Re: Can initramfs be mounted read-only?

From: Alan Jenkins
Date: Wed Aug 12 2009 - 17:24:26 EST


On 8/12/09, David Wuertele <dave+gmane@xxxxxxxxxxxx> wrote:
> I've been trying to create a system with a read-only rootfs using initramfs,
> but I'm not having any luck. I've included "ro" on my command line and when
> I cat /proc/cmdline it reports "ro" like I expect. But when I type "mount",
> I see this:
>
> rootfs on / type rootfs (rw)

Changing this could potentially break a lot of systems. At least
Debian has "ro" as a default boot option, and it uses an initramfs by
default.

> And I can create new files and write to them just fine. Is it possible to
> mount an initramfs read-only?
>
> The documentation for early userspace and initramfs does not talk about
> read/write permissions.

Have you tried running "mount / -oremount,ro" in an init script?

Regards
Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/