Skip to contentSkip to conversation

btrfs and mount in gentoo linux

DISCUSSION Stefan G. Weichinger 4 participants 8 messages Jul 8, 2014 – Jul 9, 2014 Btrfs file system

lore
Share & tools
lore
#0 lore raw

Hello, btrfs-mailing-list,

I already tried to contact Chris Mason via pm but so far I didn't get a reply so I taking this approach now:

I am a happy btrfs-user with gentoo linux for some time now and noticed that the command "mount" does not show me which subvolid is mounted where.

eg.

# mount | grep sda2

/dev/sda2 on /mnt/btrfs_pool1 type btrfs
(rw,noatime,compress=lzo,ssd,space_cache)

/dev/sda2 on /mnt/oopsfiles type btrfs
(rw,noatime,compress=lzo,ssd,space_cache)

/dev/sda2 on /home type btrfs (rw,noatime,compress=lzo,ssd,space_cache)

See?

I filed a bug against util-linux at bugs.gentoo.org:

https://bugs.gentoo.org/show_bug.cgi?id=510148

but as you see from Comment 5 it isn't resolved yet due to "don't know" ;-)

Can you tell me where the problem/solution might be located? Is it a known behavior in a way ... ?

Thanks for looking into it, I appreciate it ... I will then see to report things back at the gentoo bugzilla to help improving btrfs support in gentoo!

Regards, Stefan

#1 lore raw
Quoted 2 lines · Stefan G. Weichinger

I am a happy btrfs-user with gentoo linux for some time now and noticed that the command "mount" does not show me which subvolid is mounted where.

Interestingly I just found that this came up in Fedora some time ago:
https://bugzilla.redhat.com/show_bug.cgi?id=743118

findmnt seems to do the trick, so the underlying functionality in libmnt seems to work. Maybe Debian's mount does something differently?

Holger

#2 lore raw

Am 08.07.2014 22:19, schrieb Holger Hoffstätte:

Quoted 11 lines · Stefan G. Weichinger
Quoted 3 lines

I am a happy btrfs-user with gentoo linux for some time now and noticed that the command "mount" does not show me which subvolid is mounted where.

Interestingly I just found that this came up in Fedora some time ago:
https://bugzilla.redhat.com/show_bug.cgi?id=743118

findmnt seems to do the trick, so the underlying functionality in libmnt seems to work. Maybe Debian's mount does something differently?

findmnt does not fully show the subvolids or names:

# findmnt  | grep btrfs
/                                /dev/sda3[/rootfs]    btrfs
rw,noatime,compress=lzo,ssd,space_cache
├─/mnt/uncow                     /dev/sda3             btrfs
rw,noatime,compress=lzo,ssd,space_cache
└─/home/sgw                      /dev/mapper/_dev_sda4 btrfs
rw,noatime,compress=lzo,ssd,space_cache

The "[/rootfs]" is something in the right direction ...

S

#3 lore raw

-------- Original Message --------
Subject: Re: btrfs and mount in gentoo linux
From: Stefan G. Weichinger <[email protected]>
To: [email protected]
Date: 2014年07月09日 04:52

Quoted 21 lines

Am 08.07.2014 22:19, schrieb Holger Hoffstätte:

Quoted 9 lines · Stefan G. Weichinger
Quoted 3 lines

I am a happy btrfs-user with gentoo linux for some time now and noticed that the command "mount" does not show me which subvolid is mounted where.

Interestingly I just found that this came up in Fedora some time ago:
https://bugzilla.redhat.com/show_bug.cgi?id=743118

findmnt seems to do the trick, so the underlying functionality in libmnt seems to work. Maybe Debian's mount does something differently?

findmnt does not fully show the subvolids or names:

# findmnt  | grep btrfs
/                                /dev/sda3[/rootfs]    btrfs
rw,noatime,compress=lzo,ssd,space_cache
├─/mnt/uncow                     /dev/sda3             btrfs
rw,noatime,compress=lzo,ssd,space_cache
└─/home/sgw                      /dev/mapper/_dev_sda4 btrfs
rw,noatime,compress=lzo,ssd,space_cache
Quoted 1 line

The "[/rootfs]" is something in the right direction ...

The bug is that, if you don't use 'subvol=' mount option but use default subvolume or 'subvolid=' mount option, findmnt will not give the output.

Since 'subvol=' mount option differs from default subvolume mount or 'subvolid=' mount option in calling behavior, 'subvol=' uses mount_subtree() vfs call, which records subtree mount info.
On the other hand, default subvolume mount or 'subvolid=' mount does not go through the vfs subtree mount but use btrfs's implement, which does not report vfs submount.

I'll try to investigate further and find whether we can fix it to show more info.

Thanks,
Qu

Quoted 6 lines

S
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw

Am 09.07.2014 03:57, schrieb Qu Wenruo:

Quoted 4 lines
Quoted 1 line

The "[/rootfs]" is something in the right direction ...

The bug is that, if you don't use 'subvol=' mount option but use default subvolume or 'subvolid=' mount option,
findmnt will not give the output.

Yes, that sounds true as I switched to mostly using 'subvolid=' over times. I also use that in my fstab.

Quoted 6 lines

Since 'subvol=' mount option differs from default subvolume mount or 'subvolid=' mount option in calling behavior,
'subvol=' uses mount_subtree() vfs call, which records subtree mount info. On the other hand, default subvolume mount or 'subvolid=' mount does not go through the vfs subtree mount
but use btrfs's implement, which does not report vfs submount.

OK, good explanation ;-)

Quoted 2 lines

I'll try to investigate further and find whether we can fix it to show more info.

Thanks a lot, I think this would be a more expectable behavior in the end.

Stefan

#5 lore raw
In reply to Stefan G. Weichinger
Quoted 3 lines · Stefan G. Weichinger

Can you tell me where the problem/solution might be located? Is it a known behavior in a way … ?

It's known. Ubuntu has a patch so that mount shows subvolume names. This information is probably available on Gentoo with cat /proc/self/mountinfo.

Chris Murphy

#6 lore raw

Am 08.07.2014 22:20, schrieb Chris Murphy:

Quoted 8 lines · Stefan G. Weichinger
Quoted 3 lines

Can you tell me where the problem/solution might be located? Is it a known behavior in a way … ?

It's known. Ubuntu has a patch so that mount shows subvolume names. This information is probably available on Gentoo with cat /proc/self/mountinfo.

Unfortunately no.

See example from my laptop:

# grep btrfs /proc/self/mountinfo
14 0 0:14 /rootfs / rw,noatime shared:1 - btrfs /dev/sda3
rw,compress=lzo,ssd,space_cache

51 14 0:14 / /mnt/uncow rw,noatime shared:19 - btrfs /dev/sda3 rw,compress=lzo,ssd,space_cache

156 14 0:35 / /home/sgw rw,noatime shared:117 - btrfs /dev/mapper/_dev_sda4 rw,compress=lzo,ssd,space_cache

for reference: the subvols are:

# btrfs su list /
ID 256 gen 7982 top level 5 path rootfs
ID 275 gen 3972 top level 5 path __snapshots
ID 283 gen 3274 top level 275 path __snapshots/rootfs_2014_06_14
ID 288 gen 7465 top level 5 path uncow

What does the Ubuntu patch apply to? util-linux?

Thanks! Stefan

#7 lore raw
Quoted 19 lines · Stefan G. Weichinger

Am 08.07.2014 22:20, schrieb Chris Murphy:

Quoted 8 lines · Stefan G. Weichinger
Quoted 3 lines

Can you tell me where the problem/solution might be located? Is it a known behavior in a way … ?

It's known. Ubuntu has a patch so that mount shows subvolume names. This information is probably available on Gentoo with cat /proc/self/mountinfo.

Unfortunately no.

See example from my laptop:

# grep btrfs /proc/self/mountinfo
14 0 0:14 /rootfs / rw,noatime shared:1 - btrfs /dev/sda3
rw,compress=lzo,ssd,space_cache
Quoted 5 lines

51 14 0:14 / /mnt/uncow rw,noatime shared:19 - btrfs /dev/sda3 rw,compress=lzo,ssd,space_cache

156 14 0:35 / /home/sgw rw,noatime shared:117 - btrfs /dev/mapper/_dev_sda4 rw,compress=lzo,ssd,space_cache

Well it looks to me you have used mount -o subvol=rootfs for the first instance, but you've not mounted a subvolume at /mnt/uncow and /home/sgw.

What kernel version is this? And I thought the kernel was entirely responsible for the contents of /proc?

http://ur1.ca/hpk57
The fourth column lists subvol names.

Quoted 2 lines

What does the Ubuntu patch apply to? util-linux?

No idea.

Chris Murphy