Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

Howto mount drive as read-only with fstab

Writer 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 0

What 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 0

More information can be found by typing man fstab and man mount.

5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy