Is there a way to flag a partition in a disk (internal, for the case in point, although I doubt this is relevant) to be read-only?
I mean to do it from within Ubuntu (that's why I posted here). I imagine that if this is possible/not possible, it would be the same case from Windows
What I mean is to have that RO flag as something the partition table holds, so any OS accessing it (Windows, Linux) will see it as RO.
I know how to mount
a partition in Linux as RO, but that is a flag in the mount
command, not in the partition table.
I don't mean to have the setting/changing of such flag password-locked, other than perhaps accessible only to admins (Win) or sudoers (Linux).
So anyone with such access would be able to modify that flag.
For the case I am conceiving (which I am not sure it is possible), an attempt to mount the partition as RW would throw an error. The only way to mount as RW would be to set the corresponding flag in the partition table, and then mount.
If the answer depends on the partition type, I am more interested in ext4, but I am also interested in NTFS and others.
Hardware settings (e.g., jumpers) that apply to entire disks are not useful for my case, in addition to being impractical as compared to software alternatives.
Related
- Make file system/partition Read-Only for archiving purposes
- https://superuser.com/questions/236786/how-to-make-a-partition-on-external-storage-read-only-and-revert-to-normal.