All of lore.kernel.org
 help / color / mirror / Atom feed
* Bug: btrfs dev del missing fails where it shouldn't
@ 2017-03-23 14:07 Károly Pados
  2017-03-24  5:48 ` Duncan
  2017-03-27 14:12 ` Karoly Pados
  0 siblings, 2 replies; 4+ messages in thread
From: Károly Pados @ 2017-03-23 14:07 UTC (permalink / raw)
  To: linux-btrfs

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?)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-27 15:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-23 14:07 Bug: btrfs dev del missing fails where it shouldn't Károly Pados
2017-03-24  5:48 ` Duncan
2017-03-27 14:12 ` Karoly Pados
2017-03-27 15:30   ` Duncan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.