Yes, it is ZFS mirror, created during installation. No hardware raid controller.How is the mirror set up? ZFS? Hardware RAID controller? gmirror(8)? Am I to assume the label on the thread (ZFS) means this is a ZFS mirror?
In that case, just zpool-detach(8) it.
What more do you think needs to be done? You might want to remove the partition table, or completely wipe the drive.What are the steps after the zpool-detach(8)?
I suppose follow comands would make the deleted hard drive, say ada1, part of existing filesystem:What more do you think needs to be done? You might want to remove the partition table, or completely wipe the drive.
Good point. It would be safer if the op were to create a completely new pool on the drive being added and then mount the filesystem from that pool on a suitable mountpoint in the original filesystem, e.g. something like this after creating the new partitions on ada1Just keep in mind that if one of the drives of the striped set fails the entire pool will be gone.
zpool create newpool ada1
zfs create -o mountpoint=/usr/data newpool/data
I suppose follow comands would make the deleted hard drive, say ada1, part of existing filesystem:
gpart destroy ada1
gpart create -s gpt ada1
gpart add -t freebsd-zfs ada1
zpool add zroot ada1
zfs create zroot/data
zfs create -o mountpoint=/usr/data zroot/data
# zpool status
pool: zroot
state: ONLINE
config:
NAME STATE READ WRITE CKSUM
zroot ONLINE 0 0 0
ada0p3 ONLINE 0 0 0
ada1 ONLINE 0 0 0
errors: No known data errors
# gpart show
=> 40 976773088 ada0 GPT (466G)
40 1024 1 freebsd-boot (512K)
1064 984 - free - (492K)
2048 4194304 2 freebsd-swap (2.0G)
4196352 972576768 3 freebsd-zfs (464G)
976773120 8 - free - (4.0K)
GEOM: ada1: the primary GPT table is corrupt or invalid.
GEOM: ada1: using the secondary instead -- recovery strongly advised.
What am I doing wrong?# gpart recover ada1
gpart: arg0 'ada1': Invalid argument
Thanks for the warning.Good point. It would be safer if the op were to create a completely new pool on the drive being added and then mount the filesystem from that pool on a suitable mountpoint in the original filesystem, e.g. something like this after creating the new partitions on ada1
Code:zpool create newpool ada1 zfs create -o mountpoint=/usr/data newpool/data
You added the disk to the pool instead of the partition on that disk,What am I doing wrong?
zpool add zroot ada1
vs. zpool add zroot ada1p1
. So now the primary partition table got overwritten with ZFS metadata.Now gpart is not seeing ada1, how do I use its storage then?You added the disk to the pool instead of the partition on that disk,zpool add zroot ada1
vs.zpool add zroot ada1p1
. So now the primary partition table got overwritten with ZFS metadata.
Ignore the "error" about the primary partition table being corrupt. Do NOT try to restore it, that will overwrite the ZFS metadata.
It became part of the zroot pool.Now gpart is not seeing ada1, how do I use its storage then?
I see. Available size info from zfs list or zpool list shows I can already use ada1's storage.It became part of the zroot pool.