1
I have a RAID5 btrfs with 8 disks and a hard disk died and just disappeared from the list.
Now I tried removing it but got an error:
ERROR: error removing the device '/dev/sdb' - Inappropriate ioctl for device
After disabling auto-mounting in /etc/fstab
, I shut down the system, replaced the faulty drive and rebooted the system to reset the controller just in case it tripped from some other error, and the died disk was now absent, causing all other disks to re-enumerate, so the replacement disk became /dev/sdd
rather than sdb
.
Running btrfs fi show -d
yielded this:
Label: 'store' uuid: ...
Total devices 8 FS bytes used 5.27TiB
devid 2 size 1.36TiB used 784.63GiB path /dev/sdb
devid 3 size 1.36TiB used 784.63GiB path /dev/sdc
devid 4 size 1.36TiB used 784.63GiB path /dev/sde
devid 5 size 1.36TiB used 784.63GiB path /dev/sdf
devid 6 size 1.36TiB used 784.63GiB path /dev/sdg
devid 7 size 1.36TiB used 784.63GiB path /dev/sdh
devid 8 size 1.36TiB used 784.63GiB path /dev/sdi
*** Some devices missing
Btrfs v3.12
Now I tried btrfs device add /dev/sdd /mnt/x
, but got
ERROR: error adding the device '/dev/sdd' - Inappropriate ioctl for device
What now? How can I restore or mount the RAID?
I cannot even mount it. Tried mount [-t btrfs] -o degraded /dev/sdb /mnt/x
and mount [-t btrfs] -o degraded,device=/dev/sdb,[...] /dev/sdb /mnt/x
([...]
are the device specs, of course):
mount: wrong fs type, bad option, bad superblock on /dev/sdb,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so
This is an Ubuntu 14.04 box with kernel 3.13.0-36-generic x64.
I think newer kernels and newer btrfs tools have fixed this chicken-or-egg problem with mounting and removing devices in degraded configurations, but I haven't checked this. I just remember having read something that very much said something along those lines. Anyways. I lost my trust in btrfs as a viable alternative to ZFS. It's just YAFS XP: yet another file system and experimental for decades. – Archimedix – 2016-02-07T11:20:33.837
@Archimedix funny you should say that. During writing my answer I was going to talk about BTRFS's stability and talk about my temptation to switch to ZFS after this with the pros/cons of each, but decided to leave it out as it would probably not be found as constructive. I agree with you though; If you can use ZFS then do. – Programster – 2016-02-07T11:24:27.323