I'm giving a try to btrfs. I did some mistakes, which are good for learning!

I created several btrfs filesystems upon different devices (sdX, loop, lvm, etc). During these tests, I removed (abruptly) some or all devices which were part of a btrfs filesystem (fs were unmounted first).

But now, command btrfs show still shows filesystems UUID and list of devices. I understand that I should have done a btfrs device del BEFORE removing devices...

But where does btrfs stores its list of handled filesystems? Is there a conf file somewhere? A special command in btrfs-tools?

I didn't come with a comprehensive answer reading wiki and tutos... It is said that we can recover a dead filesystem and mounting it with mount -o recovery /dev/yourBTFSvolume /mount/point but that implies metadata/data and related devices still exist, which isn't the case here.

Here I do not attempt to recover data, I just want to clean btrfs management.

  • 1
    Just nuke the leftovers with wipefs.
    – Gabriel
    Commented Sep 28, 2013 at 18:09
  • 1
    I think wipefs won't apply in this case: it needs a device to wipe to. Here devices are no more available or are used in another fs. There's just the UUID which keep re-appearing at each boot. Commented Sep 28, 2013 at 22:33

1 Answer 1


I poked around in the code to see what was going on. When the btrfs filesystem show command is used to show all filesystems on all devices, it scans every device and partition in /proc/partitions. Each device and each partition is examined to see if there is a BTRFS "magic number" and associated valid root data structure found at 0x10040 offset from the beginning of the device or partition.

I then used hexedit on a disk that was showing up wrongly in my own situation and sure enough there was a BTRFS magic number (which is the ASCII string _BHRfS_M) there from my previous experiments.

I simply nailed that magic number by overwriting a couple of the characters of the string with "**", also using hexedit, and the wrong entries magically disappeared!


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .