[SOLVED] Verify that secondary GPT header is fine?

Dunuin

Distinguished Member
Jun 30, 2020
14,793
4,630
258
Germany
Hi,

I installed PVE to a single 400GB SSD last week because that was the only one I had lying around. Its using GPT, proxmox-boot-tool and ZFS. But I only partitioned it to below 100GB because I wasn't sure if I later would move it to a 1x 100GB SSD mirror or a 2x 200GB SSD mirror.
Now I removed two 200GB SSDs from one of my servers and want to migrate that PVE from single 400GB SSD to 2x 200GB SSDs in mirror.

So I ran the following:
Code:
sgdisk <healthy bootable device> -R <new device>
sgdisk -G <new device>
zpool attach <pool> <old zfs partition> <new zfs partition>
proxmox-boot-tool format <new disk's ESP>
proxmox-boot-tool init <new disk's ESP>

But here sgdisk <healthy bootable device> -R <new device> returned
Code:
Caution! Secondary header was placed beyond the disk's limits! Moving the
header, but other problems may occur!
The operation has completed successfully.
That makes sense as the secondary header should be at the end of the disk, as far as I know and it can't clone that header to the sectors at 400GB as the new SSD only got 200GB. So I guess it wrote that header to the end of the 200GB SSD?
Does someone know a way to check if if that secondary header is fine and working and at the correct location?

Resilvering finished and next I would do a zpool detach <pool> <ZFS partition of 400GB SSD>, then remove the 400GB SSD, put in the second 200GB SSD and do the same procedure from above again to create a mirror of that single 200B SSD.

Looks all fine so far, but I really would like to verify that this secondary header doesn't cause any problems. Not hat later the primary headers corrupts and then I'm screwed because the secondary header isn't working as a backup or something like that.
 
Last edited:
Run gdisk and see if it complains and/or boot a GParted Live CD/USB and see if it complains.
Code:
gdisk /dev/sdb
GPT fdisk (gdisk) version 1.0.6

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help): v

Caution: Partition 1 doesn't begin on a 8-sector boundary. This may
result in degraded performance on some modern (2009 and later) hard disks.

Consult http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/
for information on disk alignment.

No problems found. 197783950 free sectors (94.3 GiB) available in 2
segments, the largest of which is 197781903 (94.3 GiB) in size.

Command (? for help): p
Disk /dev/sdb: 390721968 sectors, 186.3 GiB
Model: INTEL SSDSC2BA20
Sector size (logical/physical): 512/4096 bytes
Disk identifier (GUID): 77A38DB0-640D-41F2-BAAE-0A11991FF3A3
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 390721934
Partitions will be aligned on 2-sector boundaries
Total free space is 197783950 sectors (94.3 GiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              34            2047   1007.0 KiB  EF02
   2            2048         1050623   512.0 MiB   EF00
   3         1050624        67108864   31.5 GiB    BF01
   4        67110912        75499519   4.0 GiB     8300
   5        75499520       192940031   56.0 GiB    8300

So that should be fine as it didn't complained?
 
So that should be fine as it didn't complained?
I do believe so. I have seen it complain when shrinking (virtual) drives but I agree that it is a bit unconvincing that there is only the absence of complains. Maybe using the v option might give some confidence.
 
I already did:
Code:
Command (? for help): v

Caution: Partition 1 doesn't begin on a 8-sector boundary. This may
result in degraded performance on some modern (2009 and later) hard disks.

Consult http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/
for information on disk alignment.

No problems found. 197783950 free sectors (94.3 GiB) available in 2
segments, the largest of which is 197781903 (94.3 GiB) in size.
So I guess then its fine.

By the way. Why is PVE always partitioning the disks without an aligned first partition? On all my PVE servers all partitioning tools are always complaining about that.
 
The "BIOS boot" partition is sort of in the usually empty space for the actual partitions, and therefore indeed unaligned. I do believe a lot of modern Linux distribution don't create this partition when using UEFI and GRUB (but maybe GRUB puts stuff there anyway when using non-UEFI boot?). I think that the Proxmox installer creates it always for historical reasons but I'm not sure in which configurations this is actually used.

EDIT: I'm no authority on this subject and would need to dive deeper into GRUB, partitioning and its history to give more confidence to my statements.
 
Last edited:
  • Like
Reactions: Dunuin

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!