Skip to content

Instantly share code, notes, and snippets.

@sourcesimian
Last active June 11, 2016 21:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sourcesimian/90798e36656810b60c818fab49d56df7 to your computer and use it in GitHub Desktop.
Save sourcesimian/90798e36656810b60c818fab49d56df7 to your computer and use it in GitHub Desktop.
Read only bind mount
## 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