• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Error trying to restore GPT partition tables. Exit returned code 4

    Scheduled Pinned Locked Moved Solved
    FOG Problems
    5
    36
    8.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Matthieu JacquartM
      Matthieu Jacquart @Sebastian Roth
      last edited by

      @Sebastian-Roth said in Error trying to restore GPT partition tables. Exit returned code 4:

      lastlog --user fogproject --clear

      ok, for machine I capture image I’ll test tomorrow.

      For lastlog command it returns an error : No such file or directory

      Fog 1.5.9.138
      Debian 11
      Vmware ESXi

      1 Reply Last reply Reply Quote 0
      • S
        Sebastian Roth Moderator
        last edited by

        @Matthieu-Jacquart said in Error trying to restore GPT partition tables. Exit returned code 4:

        For lastlog command it returns an error : No such file or directory

        I cannot imagine the command lastlog is not installed. I just verified on a fresh clean minimal Debian 9.9 install. Probably try typing the command instead of copy&paste. Because sometimes characters like the dashes -- come out differently if copy&pasted.

        Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

        Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

        Matthieu JacquartM 1 Reply Last reply Reply Quote 0
        • Matthieu JacquartM
          Matthieu Jacquart @Sebastian Roth
          last edited by

          @Sebastian-Roth lastlog command is installed but doesn’t return any result for fogproject user, and same problem for fog and root account ! I just don’t understand, very strange…

          For error deploying image, I tried to uplaod image on another computer and now I’ve got this…
          IMG_20190529_123222.jpg

          Debug command parted -l /dev/sda give this
          IMG_20190529_082404.jpg

          I don’t understand but I’m leaving office now for a big week-end until monday, I’ll chek this next week !

          Thanks
          Matthieu

          Fog 1.5.9.138
          Debian 11
          Vmware ESXi

          1 Reply Last reply Reply Quote 0
          • S
            Sebastian Roth Moderator
            last edited by

            @Matthieu-Jacquart I am not sure we’ll get to anything here. There are too many strains of topics combined in one forum thread. This makes it very hard to follow and quite often we seem to mix up things here.

            For the parted -l /dev/sda output it would have been interesting to see the one with the four partitions.

            Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

            Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

            Matthieu JacquartM 2 Replies Last reply Reply Quote 0
            • Matthieu JacquartM
              Matthieu Jacquart @Sebastian Roth
              last edited by

              @Sebastian-Roth Ok I continue test, upgrading image to 1903 but still same problem.
              So these are results on PC I used to update masters, Dell Optiplex 3020 with SSD 128GB. I have no problem to upload and deploy image on this model, but all others models failed with “Error trying to restore GPT partition tables. Exit returned code 4”

              d1.partitions :
              
              label: gpt
              label-id: 24A810B8-1662-11E9-AB92-B083FE947687
              device: /dev/sda
              unit: sectors
              first-lba: 34
              last-lba: 250069646
              
              /dev/sda1 : start=        2048, size=   248742296, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=24A810B5-1662-11E9-AB92-B083FE947687
              /dev/sda2 : start=   248745984, size=     1116160, type=DE94BBA4-06D1-4D40-A16A-BFD50179D6AC, uuid=5F6E777F-5719-4379-A14B-0397E0C234B2, attrs="RequiredPartition GUID:63"
              /dev/sda3 : start=   249862656, size=      206848, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=24A810B6-1662-11E9-AB92-B083FE947687
              
              d1.minimum.partitions :
              
              label: gpt
              label-id: 24A810B8-1662-11E9-AB92-B083FE947687
              device: /dev/sda
              unit: sectors
              first-lba: 34
              last-lba: 250069646
              
              /dev/sda1 : start=        2048, size=    55035482, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=24A810B5-1662-11E9-AB92-B083FE947687
              /dev/sda2 : start=   248745984, size=     1116160, type=DE94BBA4-06D1-4D40-A16A-BFD50179D6AC, uuid=5F6E777F-5719-4379-A14B-0397E0C234B2, name="attrs=\x22RequiredPartition GUID:63"
              /dev/sda3 : start=   249862656, size=      206848, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=24A810B6-1662-11E9-AB92-B083FE947687
              
              d1.fixed_size_partitions :
              
              :3:2:2:3
              

              And for parted -l /dev/sda command :

              fog.jpg

              Thanks
              Matthieu

              Fog 1.5.9.138
              Debian 11
              Vmware ESXi

              Q 1 Reply Last reply Reply Quote 0
              • Q
                Quazz Moderator @Matthieu Jacquart
                last edited by

                @Matthieu-Jacquart Pretty weird layout, that’s not going to be pretty on devices with larger or smaller disks.

                Matthieu JacquartM 1 Reply Last reply Reply Quote 0
                • Matthieu JacquartM
                  Matthieu Jacquart @Quazz
                  last edited by Matthieu Jacquart

                  @Quazz yeah, strange layout I agree 😞
                  Any way to restore a good layout (gparted or else) ?

                  Fog 1.5.9.138
                  Debian 11
                  Vmware ESXi

                  1 Reply Last reply Reply Quote 0
                  • J
                    Joe Gill
                    last edited by

                    @phishphan Did you read this? Looks similar to what you’re experiencing.

                    1 Reply Last reply Reply Quote 0
                    • S
                      Sebastian Roth Moderator
                      last edited by

                      @Matthieu-Jacquart Well GParted might be able to shuffle around the partitions for you. It’s a GPT layout and hopefully a real EFI setup. Moving the boot partition (now sda3) might work without breaking the whole thing. But I highly recommend you take a sector by sector backup copy of that machine first before trying!

                      Make the smaller partitions first and then the larger data/windows partitions last.

                      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                      1 Reply Last reply Reply Quote 0
                      • D
                        drumnj
                        last edited by drumnj

                        I ran into the same issue. Upgraded to 1.5.6 and got this error when deploying my image. It was working on 1.5.5 before I updated, then recaptured a new image. If it helps…the 1.5.6 captured image doesn’t work, but the 1.5.5 captured image does. Used the same image that was captured on 1.5.6 on both versions, get this error. Using the 1.5.5 captured image on both versions, no error.

                        fog_error_156.jpg

                        Running:
                        Ubuntu 18.04.2 LTS
                        Hyper-V

                        1 Reply Last reply Reply Quote 0
                        • S
                          Sebastian Roth Moderator
                          last edited by

                          @drumnj Please don’t cross post those kind of partition layout issues!!! Each and every partition layout is different - peroid and therefore every one of those issues is kind of different too.

                          Please open a new topic and post at least d1.partitions, d1.minimum.partitions and d1.fixed_size_partitions of your particular image as well as the image you just uploaded. Thanks!

                          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                          D 1 Reply Last reply Reply Quote 0
                          • D
                            drumnj @Sebastian Roth
                            last edited by

                            @Sebastian-Roth Looks like it’s the same type of error. I did my tests using the same checkpoint on my image, multiple times, so nothing changed with my partitions, just the FOG version. I’m just going to stick with 1.5.5 since it works. I’ll test again when another version comes out.

                            1 Reply Last reply Reply Quote 0
                            • S
                              Sebastian Roth Moderator
                              last edited by

                              @drumnj If you don’t give us your particular partition layout details we can’t fix the issue (if there is one in 1.5.6). It’s as simple as that!!

                              Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                              Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                              1 Reply Last reply Reply Quote 0
                              • Matthieu JacquartM
                                Matthieu Jacquart @Sebastian Roth
                                last edited by Matthieu Jacquart

                                @Sebastian-Roth Ok I have same issue on another computer with standard layout, I think it coul be related to Win10 1903 update ? If I upload image before sysprep and deploy on another configuration, it’s ok. But if I sysprep and then capture image, deploy failed
                                fog.jpg

                                d1.fixed_size_partitions
                                :2:2
                                
                                d1.minimum.partitions
                                label: gpt
                                label-id: 6A1C2439-885F-11E9-BB12-1866DA164C99
                                device: /dev/sda
                                unit: sectors
                                first-lba: 34
                                last-lba: 250069646
                                
                                /dev/sda1 : start=        2048, size=       24940, type=DE94BBA4-06D1-4D40-A16A-BFD50179D6AC, uuid=6A1C2436-885F-11E9-BB12-1866DA164C99, name="attrs=\x22RequiredPartition GUID:63"
                                /dev/sda2 : start=     1979904, size=      202752, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=6A1C2437-885F-11E9-BB12-1866DA164C99, name="attrs=\x22GUID:63"
                                /dev/sda3 : start=     2182656, size=    46627670, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=6A1C2438-885F-11E9-BB12-1866DA164C99
                                
                                d1.partitions
                                label: gpt
                                label-id: 6A1C2439-885F-11E9-BB12-1866DA164C99
                                device: /dev/sda
                                unit: sectors
                                first-lba: 34
                                last-lba: 250069646
                                
                                /dev/sda1 : start=        2048, size=     1977856, type=DE94BBA4-06D1-4D40-A16A-BFD50179D6AC, uuid=6A1C2436-885F-11E9-BB12-1866DA164C99, name="attrs=\x22RequiredPartition GUID:63"
                                /dev/sda2 : start=     1979904, size=      202752, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=6A1C2437-885F-11E9-BB12-1866DA164C99, name="attrs=\x22GUID:63"
                                /dev/sda3 : start=     2182656, size=   247886848, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=6A1C2438-885F-11E9-BB12-1866DA164C99
                                

                                IMG_20190627_152742.jpg

                                I passed this script but same result

                                dism /online /cleanup-image /startcomponentcleanup
                                dism /online /cleanup-image /scanhealth
                                dism /online /cleanup-image /checkhealth
                                dism /online /cleanup-image /restorehealth
                                sfc /scannow
                                chkdsk C: /f
                                

                                Fog 1.5.9.138
                                Debian 11
                                Vmware ESXi

                                Q 1 Reply Last reply Reply Quote 0
                                • Q
                                  Quazz Moderator @Matthieu Jacquart
                                  last edited by

                                  @Matthieu-Jacquart 1903 is no problem on my end, though I must highlight I’m confused by your partition layout.

                                  On a standard W10 GPT install you’d expect 4 partitions (minimum), and on a standard MBR install you’d expect 2.

                                  What FOG version you on?

                                  Matthieu JacquartM 1 Reply Last reply Reply Quote 0
                                  • Matthieu JacquartM
                                    Matthieu Jacquart @Quazz
                                    last edited by

                                    @Quazz It’s fog 1.5.6.4 with latest kernel (4.19.36 and 4.19.48).
                                    Indeed I’ve got 2 images with 4 partitions (one is hidden 16MB, not showed on disk manager but listed with diskpart) and no problem to deploy these ones, but on 2 other images there’s just 3 partitions (OEM, system and windows) and I’ve got trouble on different configuration…
                                    So it may be related to mbr2gpt command I use to transform legacy to UEFI but I made it for my 4 images and 2 only are ok, I don’t know why and how to fix that…

                                    Fog 1.5.9.138
                                    Debian 11
                                    Vmware ESXi

                                    1 Reply Last reply Reply Quote 0
                                    • S
                                      Sebastian Roth Moderator
                                      last edited by

                                      @Matthieu-Jacquart Beside the layout being a bit weird with the three partitions it actually looks very good for being properly re-sizable! The smaller unmovable partitions are in the front (sda1 and sda2) while the big Windows partition is last.

                                      Interesting that you were not able to deploy this. Let me ask you a few questions:

                                      1. What size is the disk you captured the image from?
                                      2. What size is the disk you tried to deploy it to?
                                      3. Can you please schedule another deploy on this machine but schedule as debug this time!? Start the task as usual till you hit the error and get back to the shell. Now run the following command
                                      4. Can you please upload d1.mbr of that exact image to a fileshare and post a link here?

                                      This one you just posted reminds me on a topic that we had some weeks ago. In the end I think it turned out to be a very strange partition start number issue that was only in the d1.mbr file but not in the text-based partition layout files. I still have no idea why something like this would happen: https://forums.fogproject.org/topic/13220/error-trying-to-restore-gpt-partition-deploying-an-image-to-smaller-disk

                                      Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                      Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                                      Matthieu JacquartM 1 Reply Last reply Reply Quote 1
                                      • Matthieu JacquartM
                                        Matthieu Jacquart @Sebastian Roth
                                        last edited by

                                        @Sebastian-Roth Image was captured on 128GB SSD and failed to deploy on 120GB SSD, but I found an ugly solution that resolved my problem very well : thanks to you and @Quazz I did’nt notice that good layout contains 4 and not 3 partitions, so I just copy all files from a “good” image to a bad image folder, exept windows data partition that I renamed from d1p3.img to d1p4.img and everything works great !!!

                                        Defective image
                                        

                                        bad.JPG

                                        Fonctionnal image
                                        

                                        good.JPG

                                        New image by copy all files from fonctionnal image except d1p4.img from defective image
                                        

                                        mix.JPG

                                        So for me this problem is resolved, big thanks to Fog team 🙂
                                        Matthieu

                                        Fog 1.5.9.138
                                        Debian 11
                                        Vmware ESXi

                                        1 Reply Last reply Reply Quote 0
                                        • S
                                          Sebastian Roth Moderator
                                          last edited by Sebastian Roth

                                          @Matthieu-Jacquart Wow that’s a real nasty hack to just combine the images. If it works for you - great - go ahead!

                                          Image was captured on 128GB SSD and failed to deploy on 120GB SSD

                                          Yeah I guess this is why it fails. Not because your partition layout is not re-sizeable but because some strange thing in the d1.mbr is causing the issue I reckon.

                                          Web GUI issue? Please check apache error (debian/ubuntu: /var/log/apache2/error.log, centos/fedora/rhel: /var/log/httpd/error_log) and php-fpm log (/var/log/php*-fpm.log)

                                          Please support FOG if you like it: https://wiki.fogproject.org/wiki/index.php/Support_FOG

                                          Matthieu JacquartM 1 Reply Last reply Reply Quote 0
                                          • Matthieu JacquartM
                                            Matthieu Jacquart @Sebastian Roth
                                            last edited by

                                            @Sebastian-Roth Hi Seb, finally my trick resolve issue on some smaller disk (works now on 120GB disk with image created on 128GB disk), but some old computer with 60GB have still same error, can you take a look to d1.mbr file here ?
                                            https://send.firefox.com/download/f8a134b57bdefad8/#lyrswaozWAFfuWTEcrYrNQ
                                            Maybe some hex modification as in this topic is possible ? https://forums.fogproject.org/topic/13220/error-trying-to-restore-gpt-partition-deploying-an-image-to-smaller-disk/7

                                            Thanks
                                            Matthieu

                                            Fog 1.5.9.138
                                            Debian 11
                                            Vmware ESXi

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post

                                            187

                                            Online

                                            12.0k

                                            Users

                                            17.3k

                                            Topics

                                            155.2k

                                            Posts
                                            Copyright © 2012-2024 FOG Project