Bug 743118 - Mount doesn't display BTRFS subvolume option
Summary: Mount doesn't display BTRFS subvolume option
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: util-linux
Version: 15
Hardware: x86_64
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Karel Zak
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-10-03 21:33 UTC by Xavier Krantz
Modified: 2011-10-03 22:40 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-10-03 22:40:59 UTC
Type: ---


Attachments (Terms of Use)

Description Xavier Krantz 2011-10-03 21:33:14 UTC
Description of problem:
-----------------------
* Unlike Debian's version, "mount" doesn't show the "subvolume" option used when mounting a BTRFS subvolume. 

Version-Release number of selected component (if applicable):
--------------------------------------------------------------
* mount from util-linux 2.19.1 (with libblkid and selinux support)

How reproducible:
-----------------
* When typing "mount" as a normal user or Root, I'm waiting for the list of all mounted filesystem with their options. However, the "subvol" option of a subvolume is not showed.

Steps to Reproduce:
-------------------
1. Have a BTRFS Root partition
2. Install the system, home and other in separated subvolumes
3. Assign mount point using FSTAB
3. Type "mount" to list mount point and options
  
Actual results:
------------------
[ root@Jumper ] /home/xakraz
└─> # mount | grep btrfs
/dev/sda3 on / type btrfs (rw,noatime,seclabel,ssd,space_cache,clear_cache)
/dev/sda3 on /home type btrfs (rw,relatime,seclabel,ssd,space_cache,clear_cache)
/dev/sda3 on /tmp type btrfs (rw,noatime,seclabel,ssd,space_cache,clear_cache)
/dev/sda3 on /var/tmp type btrfs (rw,noatime,seclabel,ssd,space_cache,clear_cache)
/dev/sda3 on /home type btrfs (rw,relatime,seclabel,ssd,space_cache,clear_cache)


Expected results:
-----------------
/dev/sda3 on / type btrfs (rw,subvol=@,noatime,seclabel,ssd,space_cache,clear_cache)
/dev/sda3 on /home type btrfs (rw,subvol=@home,relatime,seclabel,ssd,space_cache,clear_cache)
....


Additional info:
-----------------
┌[ root@Jumper ] /
└─> # btrfs subvolume list /
ID 256 top level 5 path @
ID 257 top level 5 path @home

/etc/fstab
UUID=aa22fa92-6502-4401-8702-5a7f56978ab8 /               btrfs   defaults,ssd,space_cache,clear_cache,noatime,subvol=@ 0       1
UUID=aa22fa92-6502-4401-8702-5a7f56978ab8 /home           btrfs   defaults,ssd,space_cache,clear_cache,subvol=@home 0       2

Comment 1 Kamil Dudka 2011-10-03 21:52:51 UTC
(In reply to comment #0)
> Version-Release number of selected component (if applicable):
> --------------------------------------------------------------
> * mount from util-linux 2.19.1 (with libblkid and selinux support)

I am switching the component to util-linux.

Comment 2 Karel Zak 2011-10-03 22:40:59 UTC
Don't forget that Fedora does not use classic /etc/mtab (we use symlink to /proc/mounts). The subvol= option is not available in the /proc/mounts file.

Anyway, the information about filesystem root directory (e.g. "/<subvolume>") is stored in the /proc/self/mountinfo file. 

You have to use findmnt(8) to see more advanced information about mountpoints:

 # mount /dev/sdb /mnt/test -o subvol=sub

 # findmnt /mnt/test
 TARGET    SOURCE         FSTYPE OPTIONS
 /mnt/test /dev/sdb[/sub] btrfs  rw,relatime,ssd
                   ^^^^^


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