cannot create zfs volume: one of the devices is part of an active md or lvm device

During the migration of a RAID1 mdadm on Ubuntu server to a ZFS mirror, I got stuck at the initial zfs volume creation with the following error:

cannot create 'tank': one or more vdevs refer to the same device, or one of the devices is part of an active md or lvm device

Obviously I’ve removed the device from the old mdadm array with:

sudo mdadm /dev/md3 --set-faulty /dev/sdb3
sudo mdadm /dev/md3 --remove /dev/sdb3

However, the zpool utility doesn’t actually look if the device is currently used or not, but simply look at the metadata at the beginning of the disk that is still there.

To wipe the mdadm metadata you need to use:

sudo mdadm --zero-superblock /dev/sdb3

But the good old dd will do the job too:

sudo dd if=/dev/zero of=/dev/sdb3 count=64 bs=1024

🇬🇧 🇺🇸 If you found value in my content, consider supporting me by treating me to a coffee, beer, or pizza. Your contributions help fuel more quality content creation.

🇮🇹 Se hai trovato valore nei miei contenuti, considera di supportarmi offrendomi un caffè, una birra o una pizza. I tuoi contributi aiutano a creare contenuti di qualità.

🇬🇧 🇺🇸 If you have found inaccuracies or wish to improve this article, please use the comments section below (after clicking on Load Comments).

🇮🇹 Se hai trovato imprecisioni o vuoi migliorare questo articolo, utilizza la sezione commenti qui sotto (dopo aver cliccato Load Comments)

Comments