Howto mount drive as read-only with fstab
Mia Lopez
I am running Ubuntu 16.04 and everything is working perfectly.
I have a few drives that I use for archive storage, these drives are completly full now and will never be written to again.
I would like to change the mount options in /etc/fstab so that they are mounted as read-only at boot.
The drives are encrypted with LUKS and have an ext4 file system.
My current line in /etc/fstab for the drive in question looks like this:
/dev/disk/by-uuid/68271755-703c-48e6-a935-c1237de6b1a8 /mnt/HDD01 auto nosuid,nodev,nofail,x-gvfs-show 0 0What do I need to change to make it mount the drive read-only, but leaving everything else as it is?
1 Answer
You simply have to add the ro mount option, which stands for "read-only".
In /etc/fstab entries, mount options are specified in the 4th column of each entry, so you could append it to that one e.g. like this:
/dev/disk/by-uuid/68271755-703c-48e6-a935-c1237de6b1a8 /mnt/HDD01 auto ro,nosuid,nodev,nofail,x-gvfs-show 0 0More information can be found by typing man fstab and man mount.