Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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
share|improve this question
add comment

2 Answers 2

up vote 5 down vote accepted

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

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

share|improve this answer
add comment

I am plugging a USB connected drive into Ubuntu 12.04 and the system is mounting it automatically. In Terminal, if I just say "mount" it shows me the current info. I want to remount it read-only.

Extrapolated from man mount(8):

sudo mount -o remount,ro /dev/sdb4 /media/HP_TOOLS

Seemed to work nicely. Had to do it for each automounted partition.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.