How to make hard drives read only?
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
How to make hard drives read only?
I have a hard drive with movies on it and want to insure it is not messed-up inadvertently. Can I make it READ-ONLY?
thanks
thanks
Re: How to make hard drives read only?
I am relatively new to Linux and very new to this forum but the following link is worth to read through:
https://www.addictivetips.com/ubuntu-li ... -on-linux/
See as well man mount and mount --help
https://www.addictivetips.com/ubuntu-li ... -on-linux/
See as well man mount and mount --help
Re: How to make hard drives read only?
As pebcak mentioned, take a look at the `mount` command.
Assuming you are mounting the drive manually, you can do something like `mount -o ro /dev/sda1 /mnt/hd0`.
If you want it automatically mounted, you will have to edit your fstab file and add in an entry for the drive. There as well you can specify the read only option.
There is an interesting caution from mount's man page; you may still get journalling and other minor writes, but I suspect no change to your data.
From https://linux.die.net/man/8/mount:
Assuming you are mounting the drive manually, you can do something like `mount -o ro /dev/sda1 /mnt/hd0`.
If you want it automatically mounted, you will have to edit your fstab file and add in an entry for the drive. There as well you can specify the read only option.
There is an interesting caution from mount's man page; you may still get journalling and other minor writes, but I suspect no change to your data.
From https://linux.die.net/man/8/mount:
Code: Select all
-r, --read-only
Mount the filesystem read-only. A synonym is -o ro.
Note that, depending on the filesystem type, state and kernel behavior, the system may still write to the device.
For example, Ext3 or ext4 will replay its journal if the filesystem is dirty.
To prevent this kind of write access, you may want to mount ext3 or ext4 filesystem with "ro,noload" mount options or set the block device to read-only mode, see command blockdev(8).
Re: How to make hard drives read only?
I have lost videos before (W-7) and am wary of doing it again. The HDD is 2-3T and backing it up is illogical for me as I have nothing blank to dump it onto. As apparently changing it to semi-permanent read-only is an 'iffy' thing guess its better to just leave it alone and be careful.
Thanks
Thanks
- kukamuumuka
- Level 16
- Posts: 6747
- Joined: Tue Sep 03, 2013 4:51 am
- Location: Finland
- Contact:
Re: How to make hard drives read only?
You might look at trying to come up with a backup solution. With modern tools based on the rsync command, but with the convenience of GUI controls, you can backup once which might be an overnight thing the first time, and then backup only those files that have been added in subsequent backups.hepme wrote: ↑Wed Jan 01, 2020 2:33 pmI have lost videos before (W-7) and am wary of doing it again. The HDD is 2-3T and backing it up is illogical for me as I have nothing blank to dump it onto. As apparently changing it to semi-permanent read-only is an 'iffy' thing guess its better to just leave it alone and be careful.
Thanks
I know what a hardware failure, as well as unintended "fat fingering", can do to irreplaceable personal data. Drives that can be temporarily mounted via USB, spinners as well as SSDs, are coming down in price and can be a great way to save your important files locally without keeping that backup drive permanently mounted.
I feel more like I do than I did when I got here.
Toshiba A135-S2386, Intel T2080, ATI Radeon® Xpress 200M Chipset, 2GB RAM, 500GB
Toshiba A135-S2386, Intel T2080, ATI Radeon® Xpress 200M Chipset, 2GB RAM, 500GB
-
- Level 6
- Posts: 1307
- Joined: Sat Sep 17, 2016 6:40 pm
- Location: England
Re: How to make hard drives read only?
If it is an external USB drive my simple solution is to stick tape over the plug. It requires a conscious effort to remove the tape to make it playable.
Cliff Coggin
-
- Level 1
- Posts: 36
- Joined: Wed Apr 10, 2019 12:40 am
Re: How to make hard drives read only?
Why not use
This will set the drive and all files to read only for everyone. If you want to do something with the drive afterwards, you'll have to run chmod again and change the permissions. A process that doesn't really happen by accident.
Code: Select all
sudo chmod -R 444 [path to drive mount point]
Re: How to make hard drives read only?
squiggles3 ; APOLOGIES for the long time lapse. Age effects concentration and I get sidelined with other priorities, sorry.
Wondering (how) I "run chmod again and change permissions"? Does running it again (same) just 'reset' HDDs to operate normally again or is there another sudo chmod to run in the process?
I like to check out the swamp before wading in you might say.. Alligators and snakes live there you know.
Thanks for the response
Wondering (how) I "run chmod again and change permissions"? Does running it again (same) just 'reset' HDDs to operate normally again or is there another sudo chmod to run in the process?
I like to check out the swamp before wading in you might say.. Alligators and snakes live there you know.
Thanks for the response
Re: How to make hard drives read only?
You don't want to do a chmod 444 anyway.
You won't be able to open up your directory to get to what is under it. Octal chmods on directories always have to be an odd number like 555. And you don't want to do it recursively or else you would make every file executable.
Since no one has asked this question yet I will. How is this partition formatted? ext4, ntfs, fat32....?
You won't be able to open up your directory to get to what is under it. Octal chmods on directories always have to be an odd number like 555. And you don't want to do it recursively or else you would make every file executable.
Since no one has asked this question yet I will. How is this partition formatted? ext4, ntfs, fat32....?
Please add a [SOLVED] at the end of your original subject header if your question has been answered and solved.
Re: How to make hard drives read only?
3.0TB- NTFS