Bug 816346 - btrfs doesn't let you delete device from filesystem and then re-add it
Summary: btrfs doesn't let you delete device from filesystem and then re-add it
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: btrfs-progs
Version: 19
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Josef Bacik
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-04-25 20:35 UTC by Richard W.M. Jones
Modified: 2014-05-14 09:41 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-05-14 09:41:55 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Richard W.M. Jones 2012-04-25 20:35:45 UTC
Description of problem:

  mkfs.btrfs /dev/vda1 /dev/vdb1
  mount /dev/vda1 /sysroot
  btrfs device add /dev/vdc1 /dev/vdd1
  btrfs device delete /dev/vda1 /dev/vdb1
  btrfs device add /dev/vda1 /dev/vdb1

The final command is OK with the Fedora 17 btrfs-progs package.

However the same sequence of commands FAILS at the last command
using the updated btrfs-progs package from Rawhide.  The error is:

  /dev/vda1 is mounted

Version-Release number of selected component (if applicable):

OK on Fedora 17:
kernel 3.3.2-1.fc17.x86_64.debug
btrfs-progs-0.19-17.fc17.x86_64

FAILS on:
same kernel
btrfs-progs-0.19-19.fc18.x86_64
(from http://koji.fedoraproject.org/koji/taskinfo?taskID=4022881)

How reproducible:

100%

Steps to Reproduce:
[see above]

Additional info:

Is the sequence of commands correct?

Comment 1 Josef Bacik 2012-04-26 14:10:28 UTC
Makes sense, the tools were updated at -18 to the latest upstream stuff which included a fix to keep you from adding devices to a btrfs volume that were already mounted.  The idea is it keeps you from say accidentally adding your root device to a new btrfs volume since it automatically "formats" the device.  I'm not sure what the right answer here is since we obviously want to keep the user from doing something bad, but in this case it's ok.  I think to err on the side of caution we just leave it like it is and if you want to re-add the original disk you will have to unmount and use a different device to mount with.

Comment 2 Fedora End Of Life 2013-04-03 15:25:37 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 3 Eric Sandeen 2013-09-18 15:52:54 UTC
A new git snapshot of btrfs-progs has been pushed to F19 testing.  If possible, please re-test these bugs & feel free to close or comment as appropriate.

Thanks,
-Eric

Comment 4 Eric Sandeen 2013-11-14 19:31:55 UTC
This is a mass update of F19 and F20 btrfs-progs bugs.

A btrfs-progs git snapshot has been built in Rawhide and submitted for F19 and F20 testing.

If your bug was reproducible, please re-test with the new build, and update this bug to let us know if it's been resolved.  If so I can add it to the Bodhi errata.

Thanks,
-Eric

Comment 5 Richard W.M. Jones 2013-11-15 08:49:20 UTC
There's a new BTRFS failure in the libguestfs test suite, just appeared
overnight.  Search for 'FAIL:' here:

http://koji.fedoraproject.org/koji/getfile?taskID=6181204&name=build.log

<<
btrfs device delete /dev/sdb1 /sysroot/
btrfs device add /dev/sdb1 /sysroot/
/dev/sdb1 appears to contain an existing filesystem (btrfs).
Use the -f option to force overwrite.
>>

This sequence of commands worked before and has now stopped
working.

Comment 6 Richard W.M. Jones 2013-11-15 08:53:14 UTC
This seems to be the result of this patch:
http://permalink.gmane.org/gmane.comp.file-systems.btrfs/28752
requiring yet another tedious workaround in libguestfs ...

Comment 7 Eric Sandeen 2014-05-13 16:39:03 UTC
btrfs-progs-3.14.1 has been pushed to Fedora 19 and 20 for testing.

I frankly have no idea if this will resolve your bug or not, but if you test it and find that it does, please take the opportunity to close this bug.  :)

Thanks,
-Eric

Comment 8 Richard W.M. Jones 2014-05-14 09:41:55 UTC
libguestfs works around all current known btrfs problems.

I updated Fedora 20 from updates-testing to ensure no new ones
have been added.  The libguestfs tests still pass which is as
far as I care about the matter.


Note You need to log in before you can comment on or make changes to this bug.