Expanding a disk with a GPT table

25,986

Solution 1

That message is normal, if your (virtual) disk magically became larger.

GPT partition table is both at the start and at the end of the disk. It's supposed to make it more resilient against failure.

When you "fix" this issue it will simply re-write the GPT backup header at the new end of your disk. This does not affect existing partitions in any way at all, provided the main GPT header at the start of the device is intact.

It would be a different story if you were to change the logical sector size. GPT unfortunately still depends on that one... in this case you have to know the partition offsets (in bytes) and recreate the partition table from scratch, or hope that one of gdisk extended modes is capable of fixing it.

Solution 2

2019 Update :::

Had a similar situation as above ( ran parted -l ) but with an additional error as shown below. Entering 'Fix' for both the issues did not cause anything detrimental to the server.

Message 1:

Error: The backup GPT table is not at the end of the disk, as it should be.
This might mean that another operating system believes the disk is smaller.
Fix, by moving the backup to the end (and removing the old backup)?

Fix/Ignore/Cancel? Fix 

Message 2:

Warning: Not all of the space available to /dev/sda appears to be used,
you can fix he GPT to use all of the space (an extra 7812939776 
blocks) or continue with the current setting? 

Fix/Ignore? Fix  

Solution 3

See this answer on Superuser. After moving the secondary GPT header to the new end of the disk, the parted warning should be gone.

# Move secondary GPT header to end of disk
sgdisk -e /dev/sda
Share:
25,986

Related videos on Youtube

István D
Author by

István D

Computer science student at Aarhus University. Likes Python.

Updated on September 18, 2022

Comments

  • István D
    István D over 1 year

    I'm running a CentOS 7 VM, where I have a second disk (sdb), which I need to expand often. After expanding the disk and I open 'parted' so that I can create a new partition, the following error message is returned:

    Error: The backup GPT table is not at the end of the disk, as it should be. This might mean that another operating system believes the disk is smaller. Fix, by moving the backup to the end (and removing the old backup)? Warning: Not all of the space available to /dev/sdb appears to be used, you can fix the GPT to use all of the space (an extra 10485760 blocks) or continue with the current setting?

    If I type in Fix, the message disappears and I'm able to create the new partition.

    Can someone advise if there is a chance of data corruption or breaking/deleting the data on the disk by using this method?

    • Admin
      Admin over 5 years
      Did you add those questions marks? They don't seem to fit with the text. :)
  • Steve O
    Steve O about 2 years
    I upvoted because this fixed my situation. I have vbox guest machines (Ubuntu 20.04) for which I occasionally want to change disk size via script. I use parted in the script to grow the partition. I could type 'fix' on the command line to make it work, however, it failed in script. This is undoubtedly what 'fix' did.