Error trying to restore GPT partition tables. Exit returned code 4 (On new PC's)



  • Hello,
    Getting the error “Error trying to restore GPT partition tables.” “Exit returned code 4” when deploying image.

    We have been using FOG for a few years and we recently updated it. We have some spare machines that were purchased maybe last year and I was able to sysprep a windows 10 image I setup from scratch. I was able to capture it using FOG. I am able to deploy this image using FOG to the spare computers. It is set to single disk resizeable which works perfect. It is a Windows 10 image.

    I am not able to deploy the image to any computers new, out of the box. We have some new computers which were sitting in the server room. I don’t recall how long we have had them. Maybe 3 months.

    Again, only with new computers it seems.

    It shows in FOG Configuration,
    You are currently running version: 1.5.9-RC2
    Latest stable version is 1.5.8.

    Running off Ubuntu on Hyper-V.

    If there is any information I can provide that may help, please let me know. I will continue to read through some Google results to see if there is anything I can try in the meantime.

    Thanks for any help you can provide.

    I forgot to mention
    New PC’s are HP ProDesk 600 G4 SFF
    Old PC’s are HP ProDesk 600 G3 SFF



  • @Sebastian-Roth Removing the 4th partition did resolve the issue. Thank you for your help. Great work with FOG.



  • @IndustrialTech87 Sorry for bombing you. I was discussing removing that partition or setting it so it resizes. I am going to deploy to a spare pc, delete the partition in disk management and recapture the image. Or use Gpart maybe. Thanks for the help.



  • This post is deleted!


  • This post is deleted!

  • Senior Developer

    @IndustrialTech87 said in Error trying to restore GPT partition tables. Exit returned code 4 (On new PC's):

    DE94BBA4-06D1-4D40-A16A-BFD50179D6AC

    You have a Windows Recovery Partition at the end of your disk (fourth partition)! That prevents FOG from shrinking down to a size smaller than ( 1952490496 (start of 4th partition) + 1034240 (size of 4th partition) ) * 512 (byte sector size) = 931.51 GB

    Do you actually need a recovery partition of you do imaging with FOG?? If you can, delete the 4th partition and resize will work as expected.



  • @Sebastian-Roth Sorry! Here they are.
    d1.partitions

    label: gpt
    label-id: 1DE8D736-288E-4F4C-AFF7-CF58B1B11E2F
    device: /dev/sda
    unit: sectors
    first-lba: 34
    last-lba: 1953525134
    sector-size: 512
    
    /dev/sda1 : start=        2048, size=      204800, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=E6C29A23-37C6-4A11-A69A-986F324550D8, name="EFI system partition", attrs="GUID:63"
    /dev/sda2 : start=      206848, size=       32768, type=E3C9E316-0B5C-4DB8-817D-F92DF00215AE, uuid=FD8A40BA-2517-4CF2-9655-29F8CB55A718, name="Microsoft reserved partition", attrs="GUID:63"
    /dev/sda3 : start=      239616, size=    96308224, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=87D213B5-9776-4A9B-8DCE-D31B74933E08, name="Basic data partition"
    /dev/sda4 : start=  1952490496, size=     1034240, type=DE94BBA4-06D1-4D40-A16A-BFD50179D6AC, uuid=F86B2D27-8384-4DBA-8BF9-06E9591D1098, name="attrs=\x22RequiredPartition GUID:63"
    

    d1.minimum.partitions

    label: gpt
    label-id: 1DE8D736-288E-4F4C-AFF7-CF58B1B11E2F
    device: /dev/sda
    unit: sectors
    first-lba: 34
    last-lba: 1953525134
    sector-size: 512
    
    /dev/sda1 : start=        2048, size=      204800, type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B, uuid=E6C29A23-37C6-4A11-A69A-986F324550D8, name="EFI system partition", attrs="GUID:63"
    /dev/sda2 : start=      206848, size=       32768, type=E3C9E316-0B5C-4DB8-817D-F92DF00215AE, uuid=FD8A40BA-2517-4CF2-9655-29F8CB55A718, name="Microsoft reserved partition", attrs="GUID:63"
    /dev/sda3 : start=      239616, size=    58477406, type=EBD0A0A2-B9E5-4433-87C0-68B6B72699C7, uuid=87D213B5-9776-4A9B-8DCE-D31B74933E08, name="Basic data partition"
    /dev/sda4 : start=  1952490496, size=      896624, type=DE94BBA4-06D1-4D40-A16A-BFD50179D6AC, uuid=F86B2D27-8384-4DBA-8BF9-06E9591D1098, name="attrs=\x22RequiredPartition GUID:63"
    

  • Senior Developer

    @IndustrialTech87 Please post the contents of the text files d1.partitions as well as d1.minimum.partitions here. Best if you copy&paste instead of sending a screenshot as I can copy values for calculations easier then instead of typing.



  • I am working to go into debug mode but wanted to mention that in the error when trying to deploy to these G4 desktops, it says
    “Args passed: /dev/nvme0n1 1 /images/images/ 9 all
    cmd tried: sgdisk -g1 /images/images/d1.mbr /dev/nvme0n1
    Exit returned code 4”



  • If I am understanding this right, it currently says 1:2 which means it wont’ resize partitions 1 and 2. That is EFI and the Microsoft reserved partition. That would be correct. Partitions 3 is the basic data partition and 4 is a required partition, I assume the extra space that was not allocated. Maybe it isn’t a partition issue…maybe its a FOG version/kernel issue…who knows. Driving me nuts!



  • @IndustrialTech87 After reading some other post with people having the same error, it seems that maybe its a partition issue, however, I am not sure. If it is, I am not sure what I should change the values to in d1.fixed_size_partitions.

    I have a screenshot of disk management once the image is deployed to one of the G3 machines.
    disk_mgmt.JPG

    I am going to grab some more information.



  • @IndustrialTech87 The new computers are 500GB but I don’t see why it would be a problem now and worked before. Isn’t that the purpose of resizing? Could it be how the image was captured and the partitions? Any possible fixes?



  • Information from image I captured.
    imagepartitions.JPG original_fstypes.JPG fixed_size_partitions.JPG

    Minimum partition - https://ibb.co/VN6WBtC

    Image Type - Resizeable
    Partition - Everything
    Compression - 6
    Image Manager - Partclone Gzip

    Confirming new PC disk size. Will let you know. I read one post and apparently his problem was with the fixed sized partitions. That had to be changed. Not sure if that is the case here.

    Thanks for any help.



  • This post is deleted!

Log in to reply
 

405
Online

7.4k
Users

14.5k
Topics

136.8k
Posts