[Libguestfs] Root btrfs partition listed twice?

Matthew Booth mbooth at redhat.com
Mon Apr 28 09:02:54 UTC 2014


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




More information about the Libguestfs mailing list