ZFS What do you do when there is no gdisk command?

I brought a ZFS pool from an AMD64 machine over to a Raspberry PI 4 and it wouldn't import the pool, claiming some metadata was corrupted. Pool serves as a backup to my main computer, so I just recreated it and it's physically fine, but I just noticed in system messages

the primary GPT table is corrupt or invalid

Tried sudo gpart list /dev/da0, and it reports

gpart: Class 'PART' does not have an instance named '/dev/da0'.

It would seem the simplest thing to do is destroy the pool, this time zeroing out the partition tables and starting fresh, but there appears to be no gdisk command available to Raspberry PI. What can I do?
 
Gpart expects geoms and not device files. ;D Try gpart list da0 instead of gpart list /dev/da0.
Or try to recover the corrupt table with gpart recover da0.
 
If you added the whole disk to the pool the partition table gets corrupted as ZFS overwrites certain parts of it. You either don't have a partition table and add the whole disk or you create a freebsd-zfs partition and add the partition to the pool.
 
I did add the whole disk to the pool. Are you suggesting these messages are expected, and I don't need to do anything? (It was configured the same way on the previous computer.)

gpart list da0 says
gpart: Class 'PART' does not have an instance named 'da0'
 
I did add the whole disk to the pool. Are you suggesting these messages are expected, and I don't need to do anything?
Yep, they're expected then. The act of adding it to the pool corrupted the partition table. If you want to add a whole disk to a pool you should have removed the partition table beforehand, it can't get corrupted if it's not there ;)

There's no harm being done, I often forget to remove the partition table too. But you'll have to live with those corrupt partition messages when it happens. Since this is a new pool you may want to consider destroying the pool, destroying the partition table and just recreate the pool. Or create a freebsd-zfs partition (spanning the entire space) and create a pool with the partition. There is no performance penalty if you use a partition compared to using the whole disk. It only makes gpart(8) happier.
 
Back
Top