Remove non-user write permissions from the root_fs file:
chmod og-w root_fs
And run the uml instance from a different user account than the owner of the root_fs file.
In fact, if you are always using the same root filesystem, I would be tempted to place it here:
and make it a root owned file with rw-r--r-- permissions. Then as long as you run your uml instance as a normal, non-root user, you will be blocked from modifying it accidently.
--- On Thu, 3/6/08, Robert P. J. Day <rpjday@...> wrote:
> From: Robert P. J. Day <rpjday@...>
> Subject: [uml-user] how to ensure a root filesystem is always "read-only"?
> To: "UML user mailing list" <user-mode-linux-user@...>
> Date: Thursday, March 6, 2008, 6:37 AM
> currently, i'm reading the chapter on sharing
> filesystems here:
> and i have a few (again, fairly basic) questions about
> running UML
> using COW to protect the root filesystem from modification.
> first, is there any way to truly protect the root
> filesystem from
> modification if i accidentally fire up a UML session
> against that root
> filesystem and forget to use COW? as i read it, nothing
> stops me from
> doing that and, if i absent-mindedly make changes to the
> filesystem at that time, i invalidate all my other
> COW-based UML
> sessions based on that root FS, correct? so is there any
> way to stop
> me from making that kind of mistake?
> actually, that's my only question for now, more
> Robert P. J. Day
> Linux Consulting, Training and Annoying Kernel Pedantry:
> Have classroom, will lecture.
> http://crashcourse.ca Waterloo,
> Ontario, CANADA
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> User-mode-linux-user mailing list