![]() |
Mount bind read-only
I have the following lines in my fstab:
/dev/sdb1 /mnt/3 reiserfs auto,user,noatime 0 0 /mnt/3 /home/ftp none bind,ro I was hoping to be able to be able to mount /dev/sdb1 for reading writing through /mnt/3 and for reading only through /home/ftp. Unfortunately, it doesn't work. After mount, I have rw access to both. After, googling, I came across some discussion that this functionality is being added to the kernel, but the discussion was a bit technical for me. Does anyone know anything about this? |
Take out the '/mnt/3 /home/ftp none bind,ro' from /etc/fstab; that will not work. Instead use:
mount --bind -r /mnt/3 /home/ftp This will allow you to mount /home/ftp as read-only. |
Quote:
Nope. I still have write access to /home/ftp. |
Look in your FTP configuration and make sure that you are not allowing write/upload/modify access - vsftp is very good with this. Look in /usr/share/doc/vsftpd/EXAMPLES for more examples.
You may also want to change permissions for the /home/ftp folder with something like: chown -R root:root /home/ftp chmod -R 0755 /home/ftp |
Quote:
In general it would be nice to be able to mount partitions with different read-write permissions depending on where they are mounted. I.e. mount --bind -r dir1 dir2 should not allow write access to dir2 no matter the mount permissions of dir1. |
As far as I can tell, the functionality you seek should be coming shortly, but is not yet in the stable kernel.
|
I thought '--bind -r' would work but you are right - it does not make it read only. I never tried it before but now that I tested this it does not mount it read only but rather it ignores the read-only parameter.
|
Does anyone know if this has been fixed yet as I really need this functionality?
|
More info: http://lwn.net/Articles/281157/
Seems like this should be in kernel 2.6.26, with some enhancements afterwards. Meanwhile, a workaround might be to export a local nfs share as read-only. |
Good idea, guess I can just mount them as read only instead.
It appears I'm not the only person who has had this problem, I have also stuck a post on the ubuntu forums about it. http://ubuntuforums.org/showthread.p...32#post5699832 |
| All times are GMT -5. The time now is 12:09 AM. |