-------- Original Message --------
Subject: Re: Can't mount subvolume with ro option
From: Qu Wenruo <quwen...@cn.fujitsu.com>
To: Sébastien ROHAUT <sebastien.roh...@free.fr>, Chris Murphy <li...@colorremedies.com>
Date: 2014年06月30日 10:19

-------- Original Message --------
Subject: Re: Can't mount subvolume with ro option
From: Sébastien ROHAUT <sebastien.roh...@free.fr>
To: Chris Murphy <li...@colorremedies.com>
Date: 2014年06月28日 19:02
Le 28/06/2014 00:12, Chris Murphy a écrit :
On Jun 27, 2014, at 4:08 PM, Chris Murphy <li...@colorremedies.com> wrote:

On Jun 27, 2014, at 2:07 PM, Sébastien ROHAUT <sebastien.roh...@free.fr> wrote:

Hi,

In the wiki, it's said we can mount subvolumes with different mount options. nosuid, nodev, rw and ro are listed, as valid generic mount options.
This might require 3.15. I don't recall it working with early 3.14 kernels, but by 3.14.3 I'd moved onto testing 3.15.

[root@f20v ~]# mount /dev/sda3 /mnt
[root@f20v ~]# btrfs subvol create /mnt/test
Create subvolume '/mnt/test'
[root@f20v ~]# umount /mnt
[root@f20v ~]# mount -o ro,subvol=test /dev/sda3 /mnt
mount: /dev/sda3 is already mounted or /mnt busy
        /dev/sda3 is already mounted on /
        /dev/sda3 is already mounted on /home
        /dev/sda3 is already mounted on /var
        /dev/sda3 is already mounted on /boot
[root@f20v ~]# uname -r
3.14.6-200.fc20.x86_64


I don't know if this feature will be backported to stable kernels. If not, then probably the wiki should say it's a 3.15+ feature.
Chris Murphy


Thank you for your answer. I'm actually moving to a Fedora Rawhide (3.16 kernel).

Sebastien Rohaut
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
When testing on 3.15.2-ARCH alone with 3.16-rc2, the problem can also be reproduced.

But I can't always reproduce it, sometimes I was able to mount subvol with ro,
somtimes not.

So I think the problem needs to be investigated further.

Thanks,
Qu
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Finally find the stable method to reproduce the problem on 3.16-rc2,
the point is if we mount subvol,ro first, then you can't mount the hole device:

# mkfs.btrfs  -f /dev/sda6
# mount /dev/sda6  /mnt/btrfs/
# btrfs sub create /mnt/btrfs/subv
Create subvolume '/mnt/btrfs/subv'
# umount /mnt/btrfs
# mount -o subvol=subv,ro /dev/sda6  /mnt/other/
# LANG=C mount /dev/sda6  /mnt/btrfs/
mount: /dev/sda6 is already mounted or /mnt/btrfs busy
       /dev/sda6 is already mounted on /mnt/other

Thanks,
Qu

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

Reply via email to