Last active
June 11, 2016 21:26
-
-
Save sourcesimian/90798e36656810b60c818fab49d56df7 to your computer and use it in GitHub Desktop.
Read only bind mount
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Setup | |
$ sudo mkdir /mnt/pool-RO | |
$ sudo mount --bind /mnt/pool /mnt/pool-RO | |
$ sudo mount -o remount,ro /mnt/pool-RO | |
## Test | |
$ touch /mnt/pool/t1 | |
$ touch /mnt/pool-RO/t2 | |
touch: cannot touch `/mnt/pool-RO/t2': Read-only file system | |
$ rm /mnt/pool-RO/t1 | |
rm: cannot remove `/mnt/pool-RO/t1': Read-only file system | |
$ rm /mnt/pool/t1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment