Re: mount policy for subvols if root is remount,ro

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux