You are not logged in.
Hello,
I discovered a strange behavior regarding mount --bind on my system. In the past I could create read-only bind mounts using first a mount --bind /source /dest and after that mount -o remount,ro /dest. But since some kernel update (not sure which) this procedure results in the complete filesystem of the source being remounted read-only, not only the /dest mountpoint. I also saw that bind-mounts are not shown as such in the outbput of mount:
the mountpoint was created using
mount --bind /mnt/data/Backup/vserver/Daten /mnt/data/homes/vserver/Datenand results in the following output of mount:
/dev/mapper/data on /mnt/data/homes/vserver/Daten type ext4 (rw,noatime,nodiratime,user_xattr,acl,barrier=1,stripe=64,data=ordered)so its reported as if i mounted the parent fs (/dev/mapper/data on /mnt/data) to the directory.
Does anyone know what caused this behavior, and how to get read-only bind-mounts back to a working condition?
Thanks in advance,
seiichiro0185
My System: Dell XPS 13 | i7-7560U | 16GB RAM | 512GB SSD | FHD Screen | Arch Linux
My Workstation/Server: Supermicro X11SSZ-F | Xeon E3-1245 v6 | 64GB RAM | 1TB SSD Raid 1 + 6TB HDD ZFS Raid Z1 | Proxmox VE
My Stuff at Github: github
My Homepage: Seiichiros HP
Offline
You could use the "alternative" way of doing it, which is exemplified in the manual page: '
mount --bind olddir newdir
mount -o remount,ro,bind olddir newdirHere I can reproduce your problem but the "alternative" way seems to work fine.
R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K
Offline
Thanks, that seems to work.
According to the man page, there should be a "bind flag" in /etc/mtab (which is now linked to /proc/self/mounts). But it seems that this flag is missing and causes the wrong behavior.
Actually it seems from the /proc/self/mount and kernel point of view it is the right way, at least according to the information found here, so the "alternative" way actually should be the right one. But from a user perspective its kind of confusing...
My System: Dell XPS 13 | i7-7560U | 16GB RAM | 512GB SSD | FHD Screen | Arch Linux
My Workstation/Server: Supermicro X11SSZ-F | Xeon E3-1245 v6 | 64GB RAM | 1TB SSD Raid 1 + 6TB HDD ZFS Raid Z1 | Proxmox VE
My Stuff at Github: github
My Homepage: Seiichiros HP
Offline
You could use the "alternative" way of doing it, which is exemplified in the manual page: '
mount --bind olddir newdir mount -o remount,ro,bind olddir newdirHere I can reproduce your problem but the "alternative" way seems to work fine.
That's not the alternative way, that's the only way. Though, you don't need to specify both the source and dest on the remount -- just the dest.
Last edited by falconindy (2012-01-31 13:32:12)
Offline