linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Can't mount subvolume with ro option
@ 2014-06-27 20:07 Sébastien ROHAUT
  2014-06-27 22:08 ` Chris Murphy
  0 siblings, 1 reply; 7+ messages in thread
From: Sébastien ROHAUT @ 2014-06-27 20:07 UTC (permalink / raw)
  To: linux-btrfs

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.

https://btrfs.wiki.kernel.org/index.php/FAQ#Can_I_mount_subvolumes_with_different_mount_options.3F

But, when I try to mount my subvolume in read only I get an error.

# df
/dev/sdb1             5242880     352    4689856   1% /my_btrfs

# btrfs subvolume list /my_btrfs
ID 257 gen 10 top level 5 path subvol1

# LANG=C mount -t btrfs -o subvol=subvol1,ro /dev/sdb1 /my_btrfs/subvol1_mnt
mount: /dev/sdb1 is already mounted or /my_btrfs/subvol1_mnt busy
        /dev/sdb1 is already mounted on /my_btrfs

nodev and nosuid are working.

Is there an error in the wiki, or do I do something wrong ?

Thanks,

Sebastien ROHAUT

Some infos :

# cat /etc/redhat-release
Fedora release 20 (Heisenbug)

# uname -a
Linux localhost.localdomain 3.14.7-200.fc20.x86_64 #1 SMP Wed Jun 11 
22:38:05 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

# btrfs --version
Btrfs v3.14.1

# btrfs fi show
Label: none  uuid: 66e0f120-e478-4cac-b04a-82a0ffc4d6ce
     Total devices 1 FS bytes used 208.00KiB
     devid    1 size 5.00GiB used 548.00MiB path /dev/sdb1

Btrfs v3.14.1

# dmesg|grep -i btrfs
[    2.753052] Btrfs loaded
[    2.766655] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 9 /dev/sdb1
[   36.382921] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 9 /dev/sdb1
[   36.389497] BTRFS info (device sdb1): disk space caching is enabled
[   36.393462] SELinux: initialized (dev sdb1, type btrfs), uses xattr
[  860.375237] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 9 /dev/sdb1
[ 1141.451952] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 10 /dev/sdb1
[ 1379.802221] BTRFS info (device sdb1): disk space caching is enabled
[ 1513.815988] BTRFS info (device sdb1): disk space caching is enabled
[ 1529.839598] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 11 /dev/sdb1
[ 1624.310822] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 11 /dev/sdb1
[ 1650.630700] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 11 /dev/sdb1
[ 2297.318435] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 11 /dev/sdb1
[ 2305.110964] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 11 /dev/sdb1
[ 2332.863021] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 12 /dev/sdb1
[ 2344.573903] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 12 /dev/sdb1
[ 2348.597860] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 12 /dev/sdb1
[ 2580.620032] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 13 /dev/sdb1
[ 2645.162881] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 13 /dev/sdb1
[ 2706.458681] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 13 /dev/sdb1
[ 2727.745959] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 13 /dev/sdb1
[ 2797.601678] BTRFS: device fsid 66e0f120-e478-4cac-b04a-82a0ffc4d6ce 
devid 1 transid 13 /dev/sdb1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can't mount subvolume with ro option
  2014-06-27 20:07 Can't mount subvolume with ro option Sébastien ROHAUT
@ 2014-06-27 22:08 ` Chris Murphy
  2014-06-27 22:12   ` Chris Murphy
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Murphy @ 2014-06-27 22:08 UTC (permalink / raw)
  To: Sébastien ROHAUT; +Cc: linux-btrfs


On Jun 27, 2014, at 2:07 PM, Sébastien ROHAUT <sebastien.rohaut@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@rawhide ~]# mount /dev/sda3 /mnt
[root@rawhide ~]# btrfs subvol create /mnt/test
Create subvolume '/mnt/test'
[root@rawhide ~]# umount /mnt
[root@rawhide ~]# mount -o ro,subvol=test /dev/sda3 /mnt
[root@rawhide ~]# mount | grep btrfs
/dev/sda3 on / type btrfs (rw,relatime,seclabel,space_cache,autodefrag)
/dev/sda3 on /home type btrfs (rw,relatime,seclabel,space_cache,autodefrag)
/dev/sda3 on /var type btrfs (rw,relatime,seclabel,space_cache,autodefrag)
/dev/sda3 on /boot type btrfs (rw,relatime,seclabel,space_cache,autodefrag)
/dev/sda3 on /mnt type btrfs (ro,relatime,seclabel,space_cache,autodefrag)
[root@rawhide ~]# cat /proc/self/mountinfo | grep btrfs
58 0 0:33 /root / rw,relatime shared:1 - btrfs /dev/sda3 rw,seclabel,space_cache,autodefrag
72 58 0:33 /home /home rw,relatime shared:29 - btrfs /dev/sda3 rw,seclabel,space_cache,autodefrag
74 58 0:33 /var /var rw,relatime shared:30 - btrfs /dev/sda3 rw,seclabel,space_cache,autodefrag
76 58 0:33 /boot /boot rw,relatime shared:31 - btrfs /dev/sda3 rw,seclabel,space_cache,autodefrag
84 58 0:33 /test /mnt ro,relatime shared:35 - btrfs /dev/sda3 rw,seclabel,space_cache,autodefrag

So on my end it seems like it's working correctly with 3.15.


Chris Murphy

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can't mount subvolume with ro option
  2014-06-27 22:08 ` Chris Murphy
@ 2014-06-27 22:12   ` Chris Murphy
  2014-06-28 11:02     ` Sébastien ROHAUT
  0 siblings, 1 reply; 7+ messages in thread
From: Chris Murphy @ 2014-06-27 22:12 UTC (permalink / raw)
  To: Sébastien ROHAUT; +Cc: linux-btrfs


On Jun 27, 2014, at 4:08 PM, Chris Murphy <lists@colorremedies.com> wrote:

> 
> On Jun 27, 2014, at 2:07 PM, Sébastien ROHAUT <sebastien.rohaut@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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can't mount subvolume with ro option
  2014-06-27 22:12   ` Chris Murphy
@ 2014-06-28 11:02     ` Sébastien ROHAUT
  2014-06-30  2:19       ` Qu Wenruo
  0 siblings, 1 reply; 7+ messages in thread
From: Sébastien ROHAUT @ 2014-06-28 11:02 UTC (permalink / raw)
  To: Chris Murphy; +Cc: linux-btrfs

Le 28/06/2014 00:12, Chris Murphy a écrit :
> On Jun 27, 2014, at 4:08 PM, Chris Murphy <lists@colorremedies.com> wrote:
>
>> On Jun 27, 2014, at 2:07 PM, Sébastien ROHAUT <sebastien.rohaut@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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can't mount subvolume with ro option
  2014-06-28 11:02     ` Sébastien ROHAUT
@ 2014-06-30  2:19       ` Qu Wenruo
  2014-06-30  2:57         ` Qu Wenruo
  0 siblings, 1 reply; 7+ messages in thread
From: Qu Wenruo @ 2014-06-30  2:19 UTC (permalink / raw)
  To: Sébastien ROHAUT, Chris Murphy; +Cc: linux-btrfs


-------- Original Message --------
Subject: Re: Can't mount subvolume with ro option
From: Sébastien ROHAUT <sebastien.rohaut@free.fr>
To: Chris Murphy <lists@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 <lists@colorremedies.com> 
>> wrote:
>>
>>> On Jun 27, 2014, at 2:07 PM, Sébastien ROHAUT 
>>> <sebastien.rohaut@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 majordomo@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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can't mount subvolume with ro option
  2014-06-30  2:19       ` Qu Wenruo
@ 2014-06-30  2:57         ` Qu Wenruo
  2014-06-30  3:31           ` Chris Murphy
  0 siblings, 1 reply; 7+ messages in thread
From: Qu Wenruo @ 2014-06-30  2:57 UTC (permalink / raw)
  To: Sébastien ROHAUT, Chris Murphy; +Cc: linux-btrfs


-------- Original Message --------
Subject: Re: Can't mount subvolume with ro option
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: Sébastien ROHAUT <sebastien.rohaut@free.fr>, Chris Murphy 
<lists@colorremedies.com>
Date: 2014年06月30日 10:19
>
> -------- Original Message --------
> Subject: Re: Can't mount subvolume with ro option
> From: Sébastien ROHAUT <sebastien.rohaut@free.fr>
> To: Chris Murphy <lists@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 <lists@colorremedies.com> 
>>> wrote:
>>>
>>>> On Jun 27, 2014, at 2:07 PM, Sébastien ROHAUT 
>>>> <sebastien.rohaut@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 majordomo@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 majordomo@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


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Can't mount subvolume with ro option
  2014-06-30  2:57         ` Qu Wenruo
@ 2014-06-30  3:31           ` Chris Murphy
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Murphy @ 2014-06-30  3:31 UTC (permalink / raw)
  To: Qu Wenruo; +Cc: Sébastien ROHAUT, linux-btrfs


On Jun 29, 2014, at 8:57 PM, Qu Wenruo <quwenruo@cn.fujitsu.com> wrote:
>> 
> 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

Similar problem: if you mount subvol,rw and then subvol,ro it succeeds, but then mount another subvol,rw it fails.


Chris Murphy

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-06-30  3:31 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-27 20:07 Can't mount subvolume with ro option Sébastien ROHAUT
2014-06-27 22:08 ` Chris Murphy
2014-06-27 22:12   ` Chris Murphy
2014-06-28 11:02     ` Sébastien ROHAUT
2014-06-30  2:19       ` Qu Wenruo
2014-06-30  2:57         ` Qu Wenruo
2014-06-30  3:31           ` Chris Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).