Skip to content

Instantly share code, notes, and snippets.

@RubenKelevra
Created September 3, 2015 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RubenKelevra/77c1a3db5c4238630fee to your computer and use it in GitHub Desktop.
Save RubenKelevra/77c1a3db5c4238630fee to your computer and use it in GitHub Desktop.
ZFS lost mirror device
I'm using zfs for mirroring on my hypervisors, mitingated from lvm/mdadm-raid1.
Some days ago my zfs-mirroring stopped working, leading to a degraded state. ZFS said,
one of the mirror-devices, which should be normally named sda4, is now called
238018108320 or something like this, and on the last row of zpool status, theres an
entry like "was: /dev/sda4".
Zfs can't open the device again, I tried:
zpool offline data /dev/sda4
and
zpool dattach data /dev/sda4
than again
zpool attach data /dev/sda4
which leads to:
"zfs cannot open /dev/sda4: The device or resource is busy"
BUSY???
So I searched for the issue, and looked at /proc/mdstat...
There is /dev/sda4 listed as md2, and /dev/sda4 as spare-device
for this raid (without any active devices).
So I stopped /dev/md2 and attached /dev/sda4 again to my zfs.
Strange enouth, that mdadm can lock a device from beeing used
by zfs, the partition type of this partition was BF, means
solaris, not raid-autodetect. I think, mdadm should not do anything
with partitions which don't got the right partition type!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment