Solved How to prepare disk for ZFS

Trying to create a new ZFS dataset called archive.

1) Added new drive (ada1) and then wiped it clean with dd:

sudo dd if=/dev/zero of=/dev/ada1 bs=1G status="progress"

2) Created partition:

gpart add -t freebsd-zfs -l ARCHIVE ada0

3) Created the new dataset:

sudo zpool create archive ada1

The dataset appears to functioning as intended.
However I get the following console error:

Code:
GEOM: ada1: corrupt or invalid GPT detected
GEOM: GPT rejected -- may not be recoverable

Here is what I am seeing:

If I run geom disk list I can see ada1 listed

If I run gpart show I cannot see ada1 listed

Did I prepare disk ada1 correctly?
 
It looks like you created the partition on ada0, but you wiped and created the pool with ada1. This should be apparent as you never ran gpart create -s gpt ada1 yet your gpart add command completed.

Also if you are using partitions, you should use adaXpY when you create the pool (where X is your disk and Y the partition number). Without the 'pY' suffix you will be telling ZFS to ignore any partitioning and use the whole disk.
 
You're mixing ada0 and ada1 in your commands.

zpool create archive ada1 adds the whole disk to ZFS. Which is fine but this overwrites the partition table causing it to become 'corrupted'. If you want to do this then don't create the partition table and partitions. If you do want to use partitions add the partition to the pool, not the disk, i.e. zpool create archive ada1p1.
 
It looks like you created the partition on ada0, but you wiped and created the pool with ada1. This should be apparent as you never ran gpart create -s gpt ada1 yet your gpart add command completed.

Also if you are using partitions, you should use adaXpY when you create the pool (where X is your disk and Y the partition number). Without the 'pY' suffix you will be telling ZFS to ignore any partitioning and use the whole disk.

Please pardon my typo - I did use ada1. However I did make an amateur mistake as you pointed out. I can now see all of my drives and partitions by running gpart show. This is my second attempt to migrate from Linux to FreeBSD and I am having to change my ways a bit.

Thanks!
 
Back
Top