* mount policy for subvols if root is remount,ro
@ 2017-03-07 13:59 Goldwyn Rodrigues
2017-03-08 12:03 ` Goldwyn Rodrigues
0 siblings, 1 reply; 2+ messages in thread
From: Goldwyn Rodrigues @ 2017-03-07 13:59 UTC (permalink / raw)
To: Btrfs BTRFS
Hi,
I want to know if re-mounting the root filesystem read-only should
change subvolumes mounted as read-write to read-only as well? We do
allow mounting subvolumes RW _after_ the root filesystem is mounted RO.
# mount /dev/vdb /mnt
# mount -o ro,subvol=svro /dev/vdb /mnt/svro
# mount -o rw,subvol=svrw /dev/vdb /mnt/svrw
# mount -o remount,ro /dev/vdb /mnt
# touch /mnt/f3
touch: cannot touch '/mnt/f3': Read-only file system
Changes subvolume to read-only as well.
# touch /mnt/svrw/f3
touch: cannot touch '/mnt/svrw/f3': Read-only file system
However, remount of subvol as RW after remount,ro of root works:
# mount -o remount,rw,subvol=svrw /dev/vdb /mnt/svrw
# touch /mnt/svrw/f3
--
Goldwyn
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: mount policy for subvols if root is remount,ro
2017-03-07 13:59 mount policy for subvols if root is remount,ro Goldwyn Rodrigues
@ 2017-03-08 12:03 ` Goldwyn Rodrigues
0 siblings, 0 replies; 2+ messages in thread
From: Goldwyn Rodrigues @ 2017-03-08 12:03 UTC (permalink / raw)
To: Btrfs BTRFS
On 03/07/2017 07:59 AM, Goldwyn Rodrigues wrote:
> Hi,
>
> I want to know if re-mounting the root filesystem read-only should
> change subvolumes mounted as read-write to read-only as well? We do
> allow mounting subvolumes RW _after_ the root filesystem is mounted RO.
>
> # mount /dev/vdb /mnt
> # mount -o ro,subvol=svro /dev/vdb /mnt/svro
> # mount -o rw,subvol=svrw /dev/vdb /mnt/svrw
> # mount -o remount,ro /dev/vdb /mnt
> # touch /mnt/f3
> touch: cannot touch '/mnt/f3': Read-only file system
>
> Changes subvolume to read-only as well.
> # touch /mnt/svrw/f3
> touch: cannot touch '/mnt/svrw/f3': Read-only file system
>
> However, remount of subvol as RW after remount,ro of root works:
> # mount -o remount,rw,subvol=svrw /dev/vdb /mnt/svrw
> # touch /mnt/svrw/f3
>
Just to add, if you remount any one subvolume to read-only, all
subvolumes turn read-only.
# mount /dev/vdb /mnt
# mount -o subvol=svro /dev/vdb /mnt/svro
# mount -o subvol=svrw /dev/vdb /mnt/svrw
# mount | grep mnt
/dev/vdb on /mnt type btrfs (rw,relatime,space_cache,subvolid=5,subvol=/)
/dev/vdb on /mnt/svro type btrfs
(rw,relatime,space_cache,subvolid=257,subvol=/svro)
/dev/vdb on /mnt/svrw type btrfs
(rw,relatime,space_cache,subvolid=258,subvol=/svrw)
# mount -o remount,ro /dev/vdb /mnt/svro
# mount | grep mnt
/dev/vdb on /mnt type btrfs (ro,relatime,space_cache,subvolid=5,subvol=/)
/dev/vdb on /mnt/svro type btrfs
(ro,relatime,space_cache,subvolid=257,subvol=/svro)
/dev/vdb on /mnt/svrw type btrfs
(ro,relatime,space_cache,subvolid=258,subvol=/svrw)
--
Goldwyn
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-08 12:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-07 13:59 mount policy for subvols if root is remount,ro Goldwyn Rodrigues
2017-03-08 12:03 ` Goldwyn Rodrigues
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).