Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Read-only mounts

If you want to mount a Path read-only on Linux (>2.6.26 kernels), you have to call two function calls:

mount(src_path, target_path, "", MS_BIND, NULL);
mount(src_path, target_path, "", MS_REMOUNT|MS_RDONLY|MS_BIND, NULL);

That is first bind the two paths and the remount the target path with the read-only flag. Some might find that not so obvious.



This post first appeared on Tail -f /dev/random, please read the originial post: here

Share the post

Read-only mounts

×

Subscribe to Tail -f /dev/random

Get updates delivered right to your inbox!

Thank you for your subscription

×