Is it possible to mount an entire disk device read only?
Colin Watson
cjwatson at ubuntu.com
Mon Sep 7 17:23:54 UTC 2015
On Mon, Sep 07, 2015 at 05:06:56PM +0000, Carlos Checo wrote:
> Well what I mean is that by design is most probably not possible with
> actual software. If such action would be made then you would see partitions
> as separately folders. ( I guess )
Huh? Whether device nodes are laid out as adjacent files or in
subdirectories has no relation at all to whether the read-only policy on
a disk affects the partitions it contains, or anything like that.
Device node layout is cosmetic as far as the kernel is concerned.
The kernel knows that partitions are "part of" a disk device, and it in
fact has a function to set an entire disk as read-only (set_disk_ro),
but that isn't currently exposed to userspace except for some special
purposes such as MD. A similar function, set_device_ro, operates on
individual block devices, is exposed to userspace, and is the function
ultimately called by "blockdev --setro".
--
Colin Watson [cjwatson at ubuntu.com]
More information about the ubuntu-users
mailing list