Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
144
rated 0 times [  144] [ 0]  / answers: 1 / hits: 504296  / 2 Years ago, thu, march 3, 2022, 12:41:10

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


More From » mount

 Answers
3

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


[#31170] Friday, March 4, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ibuteking

Total Points: 35
Total Questions: 128
Total Answers: 138

Location: Indonesia
Member since Thu, Oct 1, 2020
4 Years ago
;