[klibc] [PATCH 6/8] switch_root: Fix single file mounts

Michal Suchanek michal.suchanek at ruk.cuni.cz
Fri Jul 29 01:17:41 PDT 2011


Excerpts from H. Peter Anvin's message of Thu Jul 28 22:31:04 +0200 2011:
> On 07/28/2011 12:26 AM, Michal Suchanek wrote:
> > 
> >> as you can read in the following post mikew also opted for the
> >> strict error http://www.zytor.com/pipermail/klibc/2011-July/003002.html
> >> handling as it is currently done in run-init.
> >>
> >> the util-linux switch_root is in contrary very lax, but that
> >> way dev errors can't be catched.
> > 
> > The errors in nuke_initramfs are a failure to adhere to initramfs layout
> > nuke_initramfs expects which is not documented.
> 
> The filesystem layout is very simple... all filesystem mounts are
> expected under the new root.

Where is that documented?

The switch_root man page just states that new_root should be a mount.

> 
> > Failure to remove a file
> > from a filesystem later not accessible is not necessarily a boot error.
> 
> Why shouldn't it be?  Be aware that any lack of error checking is an
> invitation to a wholesale destruction of a filesystem in the event of a
> problem.
> 
> > AFAICT nuke_initramfs cannot work if any mount is present as /some/mount
> > because it will then fail to remove /some and the system will fail to
> > boot without giving any reason.
> 
> Correct, by design.  More explicit error messages would be useful, agreed.

IIRC mountpoints under / (eg. /mount) don't cause errors which is used
for mounts that are participating in the new_root but should *not* be
seen from the booted filesystem. It is not always desirable to see
filesystems that are part of a union (aufs).

Thanks

Michal



More information about the klibc mailing list