I’m not exactly sure how this happened, possibly a mistake on my part, but for some reason one of my disks in a pool is showing as whole_disk: 0 in the output for zdb – it seems that ZFS is treating it like I only added a single partition, but the disk itself was formatted by ZFS and contains no other partitions (besides EFI and GPT records).
This results in a setup that looks like the following:
zbackup:
version: 5000
name: 'zbackup'
state: 0
txg: 281069
pool_guid: 9399051620538962852
errata: 0
hostid: 2895350363
hostname: 'noname'
com.delphix:has_per_vdev_zaps
vdev_children: 1
vdev_tree:
type: 'root'
id: 0
guid: 9399051620538962852
create_txg: 4
com.klarasystems:vdev_zap_root: 129
children[0]:
type: 'raidz'
id: 0
guid: 13625876296773327015
nparity: 2
metaslab_array: 65
metaslab_shift: 34
ashift: 12
asize: 32006194855936
is_log: 0
create_txg: 4
com.delphix:vdev_zap_top: 130
children[0]:
type: 'disk'
id: 0
guid: 4843865135278549537
path: '/private/var/run/disk/by-id/media-8C6A7766-A56A-4442-B1C3-8E7639966428'
whole_disk: 1
DTL: 5984
create_txg: 4
com.delphix:vdev_zap_leaf: 131
children[1]:
type: 'disk'
id: 1
guid: 11321776112851467303
path: '/private/var/run/disk/by-id/media-1EE492E0-3C26-6B46-BD06-33BCE811B3B9'
whole_disk: 1
DTL: 5983
create_txg: 4
com.delphix:vdev_zap_leaf: 132
children[2]:
type: 'disk'
id: 2
guid: 7516016376226480799
path: '/private/var/run/disk/by-id/media-70E0A75E-9095-F04A-8D57-618A3FB99A85'
whole_disk: 0
DTL: 7762
create_txg: 4
com.delphix:vdev_zap_leaf: 7954
However the disk was moved over from another pool, so ZFS should be fine to use it as an entire disk. I’m guessing I must have used the /by-id/media- identifier to add it, rather than the overall disk number, thinking this would be fine since that’s how ZFS identifies the other disks under its control, but ZFS has treated it as me asking only for the specific partition only.
Is there any way for me to convince ZFS to treat it as a whole disk without having to re-add it somehow (can I even use the disk to replace the partition)?
The output from zdb makes it seem like ZFS only cares about the /by-id/media- reference anyway, so as far as I can tell the only difference is that the third disk has whole_disk set to 0 instead of 1, is there any way to change that without a full resilver?
NOTE: I’ve omitted the fourth entry from the list above to shorten it a bit, as it’s a file entry (used to create the pool initially in a degraded state) that is in the process of being replaced (using a whole disk ID). I’m in the process of migrating from a two disk mirror to a four disk raidz2, re-using the mirror’s disks.