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

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

Question

I have searched google, I’ve searched this website, I’ve searched using various terms, phrases, using quotes and without quotes and I cannot find the answer to this seemingly easy thing to do.

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

answers:

83down voteaccepted

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

Mount

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