Summary: Trying to remove a missing device tells me there are no missing devices, but obviously there is one
kernel: 4.9.13
btrfs-progs: 4.9.1
Steps to reproduce:
1) Create a raid1 array:
mkfs.btrfs -f -d raid1 -m raid1 /dev/sda /dev/sdb
mkdir /mnt/volatile
mount -t btrfs /dev/sda /mnt/volatile
2) Physically remove a device or simply issue:
echo 1 > /sys/block/sdb/device/delete
3) In preparation to remove the failed device, remount and rebalance:
mount -t btrfs -o remount,degraded /dev/sda /mnt/volatile
btrfs balance start -dconvert=single -mconvert=dup /mnt/volatile
4) Obviously the array still has a missing device, check this:
btrfs fi show
Label: none uuid: 55fa0da0-26b5-4a66-ba54-e9488e47cf6e
Total devices 2 FS bytes used 320.00KiB
devid 1 size 3.74GiB used 896.00MiB path /dev/sda
*** Some devices missing
5) Try to remove missing device and see the error:
btrfs dev del missing /mnt/volatile
ERROR: error removing device 'missing': no missing devices found to remove
Step 5) failed and can be replaced by:
btrfs dev del 2 /mnt/volatile/
[ 402.828294] BTRFS info (device sdb): device deleted: id 2
btrfs fi show
Label: none uuid: 55fa0da0-26b5-4a66-ba54-e9488e47cf6e
Total devices 1 FS bytes used 320.00KiB
devid 1 size 3.74GiB used 896.00MiB path /dev/sda
Still, 'missing' should be working, and having to use the devid is a PITA for both humans and scripts (the reason why 'missing' was added in the first place).
(Probably unrelated question: In the last btrfs fi show you can see 896MB is used on a 3.74GB filesystem. The filesystem was just created however as described in the above steps, it is 100% empty with no prior use or wear. So the brand-new formatted drive seems to be 23% full, is this normal?)
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html