From: Goffredo Baroncelli <kreijack@inwind.it>
To: Chris Murphy <lists@colorremedies.com>
Cc: "linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>,
Stefan Behrens <sbehrens@giantdisaster.de>
Subject: Re: device delete, error removing device
Date: Wed, 24 Oct 2012 00:16:42 +0200 [thread overview]
Message-ID: <5087174A.2060405@inwind.it> (raw)
In-Reply-To: <3443D67F-6CCE-48BF-A1DB-12473BE95EE8@colorremedies.com>
Hi Chris,
I was able to reproduce (partially) your behaviour.
First I created 3 disk of 3GB. I formatted them, then I filled them with
$ dd if=/dev/zero of=/mnt/btrfs1/bigfile bs=1M count=$((7*1024))
Then I got
$ sudo /mnt/home-ghigo/btrfs/btrfs-progs/btrfs fi sh
Label: 'test1' uuid: 7ba72d6f-d226-4e8c-9a9c-92a7fd89cd99
Total devices 3 FS bytes used 7.01GB
devid 3 size 3.00GB used 3.00GB path /dev/vdd
devid 2 size 3.00GB used 2.55GB path /dev/vdc
devid 1 size 3.00GB used 3.00GB path /dev/vdb
Then I added a 12GB devices, and then I did
$ sudo btrfs device del /dev/vdb /mnt/btrfs1
After a bit of time I *succeeded* to remove the disk. Then I did:
$ sudo /mnt/home-ghigo/btrfs/btrfs-progs/btrfs fi sh
Label: 'test1' uuid: 7ba72d6f-d226-4e8c-9a9c-92a7fd89cd99
Total devices 4 FS bytes used 7.01GB
devid 4 size 12.00GB used 3.21GB path /dev/vdf
devid 3 size 3.00GB used 2.53GB path /dev/vdd
devid 2 size 3.00GB used 2.95GB path /dev/vdc
*** Some devices missing
Which is what you are reporting.
Further analysis revealed that:
1) The /dev/sdb superblock signatures is really zeroed by btrfs after
removing. In fact the disk /dev/vdb disappeared from the list above as
considered not valid.
2) The other superblocks aren't reset to the new setup after removing.
Every superblock still stores as number of disk the (old) value of 4.
3) *If I don't touch* the filesystem the situation above doesn't change.
4) If I touch the filesystem (eg creating a file or unmount the
filesystem) then the superblocks are update and the I get
$ sudo /mnt/home-ghigo/btrfs/btrfs-progs/btrfs fi show
Label: 'test1' uuid: 7ba72d6f-d226-4e8c-9a9c-92a7fd89cd99
Total devices 3 FS bytes used 7.01GB
devid 4 size 12.00GB used 3.21GB path /dev/vdf
devid 3 size 3.00GB used 2.53GB path /dev/vdd
devid 2 size 3.00GB used 2.95GB path /dev/vdc
Conclusion:
- I was not able to reproduce your problem about removing the device. I
was able to remove the device after filling the filesystem and adding a
new device.
- After removing a device, its superblock is zeroed. However the other
superblock aren't updated
- To update the other superblocks, it is needed to a) make some writing
to the filesystem [and wait the 30s timeout] or b) unmount the
filesystem. If you don't do that the superblocks still contain the old
value.
If this will be confirmed, this my be considered a bug because in case
of power supply shortage the filesystem stores an incorrect information
about the number of disks which compose the filesystem.
BR
G.Baroncelli
On 2012-10-23 22:28, Chris Murphy wrote:
>
> On Oct 23, 2012, at 1:02 PM, Goffredo Baroncelli <kreijack@inwind.it> wrote:
>
>> On 2012-10-23 20:17, Chris Murphy wrote:
>>>
>>> btrfs-progs-0.20.rc1.20121017git91d9eec-1.fc18.x86_64
>>
>> Definitely this version contains my patch.
>>
>> Are you able to reproduce this bug (the missing device warning)?
>
> Yes. 100%. It's there hours later.
>
>> If so,
>> please could you be so kindly to test the Stefan's tool [*] to dump the
>> super-blocks of the involved disks ?
>
> I would but haven't the first clue what to do with this:
> http://www.mail-archive.com/linux-btrfs@vger.kernel.org/msg19572.html
>
> This happens even with no data, so I can dd the entire missing device into a sparse file: dd to img, cp --sparse, tar with -Sj. The 80GB /dev/sdb becomes 2.5K. It's here now:
> https://dl.dropbox.com/u/3253801/devsdb_image_sparse.img.tar.bz2
>
> And by the time I've done all that, the "*** Some devices missing" message is still present with 'btrfs fi show'
>
> Or since it's a VM that I don't care about at all, I can give you login info.
>
> Chris Murphy--
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
gpg @keyserver.linux.it: Goffredo Baroncelli (kreijackATinwind.it>
Key fingerprint BBF5 1610 0B64 DAC6 5F7D 17B2 0EDA 9B37 8B82 E0B5
next prev parent reply other threads:[~2012-10-23 22:16 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-22 4:32 device delete, error removing device Chris Murphy
2012-10-22 5:04 ` dima
2012-10-22 5:30 ` Chris Murphy
2012-10-22 6:02 ` Chris Murphy
2012-10-22 9:19 ` Hugo Mills
2012-10-22 16:42 ` Chris Murphy
2012-10-22 17:04 ` Goffredo Baroncelli
2012-10-22 19:36 ` Chris Murphy
2012-10-22 19:50 ` Hugo Mills
2012-10-22 20:35 ` Goffredo Baroncelli
2012-10-22 20:46 ` Chris Murphy
2012-10-22 17:18 ` Hugo Mills
2012-10-23 7:57 ` Michael Kjörling
2012-10-23 18:10 ` Goffredo Baroncelli
2012-10-23 18:17 ` Chris Murphy
2012-10-23 19:02 ` Goffredo Baroncelli
2012-10-23 20:28 ` Chris Murphy
2012-10-23 22:16 ` Goffredo Baroncelli [this message]
2012-10-23 22:29 ` Chris Murphy
2012-10-24 18:06 ` device delete, error removing device [SOLVED] Goffredo Baroncelli
2012-10-24 19:13 ` Chris Murphy
2012-10-24 21:30 ` Goffredo Baroncelli
2012-10-24 21:43 ` Chris Murphy
2012-10-25 19:26 ` Goffredo Baroncelli
2012-10-27 18:25 ` device delete, error removing device Chris Murphy
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=5087174A.2060405@inwind.it \
--to=kreijack@inwind.it \
--cc=linux-btrfs@vger.kernel.org \
--cc=lists@colorremedies.com \
--cc=sbehrens@giantdisaster.de \
/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).