Root btrfs partition listed twice?
Hi, I know btrfs complicates filesystem lists due to the use of subvolumes. However, I just noticed that the root partition itself ends up being listed twice with list-filesystems, inspect-os, inspect-get-roots, etc... I'm seeing this in version 1.26, but haven't found anything directly resolving this in newer versions. These commands all show the partition listed twice as in the following output:
<fs> inspect-get-roots /dev/sda2 btrfsvol:/dev/sda2/@
The output above complicates the existing virt-v2v process, as it prompts users to select the appropriate root filesystem. (Either one works for the conversion.) I've patched v2v to strip out the duplicate 'btrfsvol' entry if the partition itself is in both strings, but wanted to run the problem past the list before working around it at that level. Has this issue been seen before? For the record, here's the full filesystem list:
<fs> list-filesystems /dev/sda1: swap btrfsvol:/dev/sda2/@: btrfs btrfsvol:/dev/sda2/boot/grub2/i386-pc: btrfs btrfsvol:/dev/sda2/boot/grub2/x86_64-efi: btrfs btrfsvol:/dev/sda2/home: btrfs btrfsvol:/dev/sda2/opt: btrfs btrfsvol:/dev/sda2/srv: btrfs btrfsvol:/dev/sda2/tmp: btrfs btrfsvol:/dev/sda2/usr/local: btrfs btrfsvol:/dev/sda2/var/crash: btrfs btrfsvol:/dev/sda2/var/lib/mailman: btrfs btrfsvol:/dev/sda2/var/lib/named: btrfs btrfsvol:/dev/sda2/var/lib/pgqsl: btrfs btrfsvol:/dev/sda2/var/log: btrfs btrfsvol:/dev/sda2/var/opt: btrfs btrfsvol:/dev/sda2/var/spool: btrfs btrfsvol:/dev/sda2/var/tmp: btrfs btrfsvol:/dev/sda2/.snapshots: btrfs /dev/sda2: btrfs
Thanks! Mike
On Fri, Apr 25, 2014 at 01:12:08PM -0600, Mike Latimer wrote:
Hi,
I know btrfs complicates filesystem lists due to the use of subvolumes. However, I just noticed that the root partition itself ends up being listed twice with list-filesystems, inspect-os, inspect-get-roots, etc... I'm seeing this in version 1.26, but haven't found anything directly resolving this in newer versions.
I'm fairly certain this is a bug. Matt? Rich.
These commands all show the partition listed twice as in the following output:
<fs> inspect-get-roots /dev/sda2 btrfsvol:/dev/sda2/@
The output above complicates the existing virt-v2v process, as it prompts users to select the appropriate root filesystem. (Either one works for the conversion.) I've patched v2v to strip out the duplicate 'btrfsvol' entry if the partition itself is in both strings, but wanted to run the problem past the list before working around it at that level.
Has this issue been seen before?
For the record, here's the full filesystem list:
<fs> list-filesystems /dev/sda1: swap btrfsvol:/dev/sda2/@: btrfs btrfsvol:/dev/sda2/boot/grub2/i386-pc: btrfs btrfsvol:/dev/sda2/boot/grub2/x86_64-efi: btrfs btrfsvol:/dev/sda2/home: btrfs btrfsvol:/dev/sda2/opt: btrfs btrfsvol:/dev/sda2/srv: btrfs btrfsvol:/dev/sda2/tmp: btrfs btrfsvol:/dev/sda2/usr/local: btrfs btrfsvol:/dev/sda2/var/crash: btrfs btrfsvol:/dev/sda2/var/lib/mailman: btrfs btrfsvol:/dev/sda2/var/lib/named: btrfs btrfsvol:/dev/sda2/var/lib/pgqsl: btrfs btrfsvol:/dev/sda2/var/log: btrfs btrfsvol:/dev/sda2/var/opt: btrfs btrfsvol:/dev/sda2/var/spool: btrfs btrfsvol:/dev/sda2/var/tmp: btrfs btrfsvol:/dev/sda2/.snapshots: btrfs /dev/sda2: btrfs
Thanks! Mike
_______________________________________________ Libguestfs mailing list Libguestfs@redhat.com https://www.redhat.com/mailman/listinfo/libguestfs
-- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-top is 'top' for virtual machines. Tiny program with many powerful monitoring features, net stats, disk stats, logging, etc. http://people.redhat.com/~rjones/virt-top
On 25/04/14 21:03, Richard W.M. Jones wrote:
On Fri, Apr 25, 2014 at 01:12:08PM -0600, Mike Latimer wrote:
Hi,
I know btrfs complicates filesystem lists due to the use of subvolumes. However, I just noticed that the root partition itself ends up being listed twice with list-filesystems, inspect-os, inspect-get-roots, etc... I'm seeing this in version 1.26, but haven't found anything directly resolving this in newer versions.
I'm fairly certain this is a bug. Matt?
Rich.
These commands all show the partition listed twice as in the following output:
<fs> inspect-get-roots /dev/sda2 btrfsvol:/dev/sda2/@
The output above complicates the existing virt-v2v process, as it prompts users to select the appropriate root filesystem. (Either one works for the conversion.) I've patched v2v to strip out the duplicate 'btrfsvol' entry if the partition itself is in both strings, but wanted to run the problem past the list before working around it at that level.
Has this issue been seen before?
For the record, here's the full filesystem list:
<fs> list-filesystems /dev/sda1: swap btrfsvol:/dev/sda2/@: btrfs btrfsvol:/dev/sda2/boot/grub2/i386-pc: btrfs btrfsvol:/dev/sda2/boot/grub2/x86_64-efi: btrfs btrfsvol:/dev/sda2/home: btrfs btrfsvol:/dev/sda2/opt: btrfs btrfsvol:/dev/sda2/srv: btrfs btrfsvol:/dev/sda2/tmp: btrfs btrfsvol:/dev/sda2/usr/local: btrfs btrfsvol:/dev/sda2/var/crash: btrfs btrfsvol:/dev/sda2/var/lib/mailman: btrfs btrfsvol:/dev/sda2/var/lib/named: btrfs btrfsvol:/dev/sda2/var/lib/pgqsl: btrfs btrfsvol:/dev/sda2/var/log: btrfs btrfsvol:/dev/sda2/var/opt: btrfs btrfsvol:/dev/sda2/var/spool: btrfs btrfsvol:/dev/sda2/var/tmp: btrfs btrfsvol:/dev/sda2/.snapshots: btrfs /dev/sda2: btrfs
It looks like /dev/sda2 is both the root of the btrfs filesystem and a subvolume called '@'. In Fedora, at least when I wrote this, subvolumes where created underneath the btrfs root, so the btrfs root itself would never be mistaken for the root filesystem. Is '@' btrfs magic that means the root? If so, is it always listed? If /dev/sda2 and btrfsvol:/dev/sda2/@ will always mean the same filesystem, we should filter out the former if the latter exists. We need to nail down exactly what '@' means first, though. Matt -- Matthew Booth Red Hat Engineering, Virtualisation Team Phone: +442070094448 (UK) GPG ID: D33C3490 GPG FPR: 3733 612D 2D05 5458 8A8A 1600 3441 EA19 D33C 3490
On Monday, April 28, 2014 10:02:54 AM Matthew Booth wrote:
For the record, here's the full filesystem list:
<fs> list-filesystems
/dev/sda1: swap btrfsvol:/dev/sda2/@: btrfs btrfsvol:/dev/sda2/boot/grub2/i386-pc: btrfs [...] btrfsvol:/dev/sda2/.snapshots: btrfs /dev/sda2: btrfs
It looks like /dev/sda2 is both the root of the btrfs filesystem and a subvolume called '@'. In Fedora, at least when I wrote this, subvolumes where created underneath the btrfs root, so the btrfs root itself would never be mistaken for the root filesystem.
Is '@' btrfs magic that means the root? If so, is it always listed? If /dev/sda2 and btrfsvol:/dev/sda2/@ will always mean the same filesystem, we should filter out the former if the latter exists. We need to nail down exactly what '@' means first, though.
Thanks for the comments. It looks like @ is just a naming convention that we have chosen for the root of the btrfs volume. I've seen the same thing in Ubuntu (http://askubuntu.com/questions/331233/creating-btrfs-subvolume-like-or-home), and I suppose it could be in other places as well. Here's the output of `btrfs subvolume list /`: ID 257 gen 85 top level 5 path @ ID 258 gen 85 top level 257 path boot/grub2/i386-pc ID 259 gen 85 top level 257 path boot/grub2/x86_64-efi [...] ID 272 gen 85 top level 257 path var/tmp ID 278 gen 85 top level 257 path .snapshots and `btrfs subvolume show /`: Name: @ uuid: 8add32ac-4abf-af49-bdeb-bfbf1ae5ecd8 Creation time: 2014-04-23 13:23:50 Object ID: 257 Generation (Gen): 105 Gen at creation: 7 Parent: 5 Top Level: 5 Flags: - Snapshot(s): .snapshots/1/snapshot As this is more than just a SUSE thing, it seems like filtering out the non- btrfsvol device would be the right approach... -Mike
participants (3)
-
Matthew Booth -
Mike Latimer -
Richard W.M. Jones