Ubuntu – How to mount a hard disk as read-only from the terminal

data lossfstabhard drivemountread-only

How do you mount a hard disk from the command line as read-only? I don't want or need a link to the man page, I want the exact thing I will have to type in if the following is true:

  • disk to mount is on /dev/sda
  • it is 2 TB
    -it is critical that I mount it read-only and not read-write. Very critical.
  • I'm doing it from a live Ubuntu CD so I have no business to edit the fstab or any file for that matter

Best Answer

You do not mount /dev/sda, that refers to the entire disk. You mount /dev/sda1 or whatever partition you want.

Make a mount point, call it anything you like.

sudo mkdir /media/2tb


sudo mount -o ro /dev/sda1 /media/2tb

When your done, you should unmount the disk

sudo umount /media/2tb

See man mount or https://help.ubuntu.com/community/Fstab

Related Question