Score:2

Make file system/partition Read-Only for archiving purposes

cn flag

I have found a couple of questions relating to file systems which are in Read-Only mode after failure and how to make them writable again. I want to achieve the exact opposite.

I have 3.5" Hard disks formatted in ext4 with archive files on them.
The HardDisks are internal drives, on them is plain data, no operating system. (Like a data backup)

I want to make the file System read-only as opposed to read-only mounting or changing permissions on the files.

Is this possible and if so, how?

Score:4
in flag

One way to do this would be via the e2fsprogs package. When installed, you can set an Ext4 partition as read-only like this:

sudo tune2fs -O read-only /dev/sdXY

Note: Setting partition attributes is done via tune2fs with packages provided by e2fsprogs as per the documentation for Ext4.

In the event you change your mind later about having the partition set as read only, you can remove the setting like this:

sudo tune2fs -O ^read-only /dev/sdXY

Note: The ^ acts as “unset”.

julian bechtold avatar
cn flag
thank you for the nice sugestion. I will try it. I hope, I can still access the data from other machines, which do not have tune2fs installed?
julian bechtold avatar
cn flag
works great. at least my on ubuntu server 20.04 lts, `tune2fs` came preinstalled.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.