linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Károly Pados" <pados@pados.hu>
To: linux-btrfs@vger.kernel.org
Subject: Bug: btrfs dev del missing fails where it shouldn't
Date: Thu, 23 Mar 2017 14:07:31 +0000	[thread overview]
Message-ID: <63b13b68a616abf8f828d6725f792be4@webmail.pados.hu> (raw)

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

             reply	other threads:[~2017-03-23 14:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-23 14:07 Károly Pados [this message]
2017-03-24  5:48 ` Bug: btrfs dev del missing fails where it shouldn't Duncan
2017-03-27 14:12 ` Karoly Pados
2017-03-27 15:30   ` Duncan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=63b13b68a616abf8f828d6725f792be4@webmail.pados.hu \
    --to=pados@pados.hu \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).