[PATCH] mkinitrd rescue mode
Bill Rugolsky Jr.
brugolsky at telemetry-investments.com
Thu Jun 2 21:04:36 UTC 2005
Jeffrey,
This is a nice start at fulfilling a request I made more than a year ago
(that Jeremy dismissed):
http://www.redhat.com/archives/fedora-devel-list/2004-January/msg00901.html
On Thu, Jun 02, 2005 at 04:17:22PM -0400, Jeremy Katz wrote:
> > This does increase the memory profile of the initramfs by about 1.5M.
> > Isn't that memory freed after the switchroot occurs, though?
>
> The impression I've gotten is that the memory isn't freed with initramfs
> since you can't actually unmount the original rootfs.
One is expected to delete files before doing the switchroot. Unlike a ramdisk,
the ramfs pages are immediately reclaimed.
> > Both of those methods mean you'll be booting to a different kernel than
> > the one that is giving you problems. The main reason I rolled this patch
> > is to allow you to inspect (and possibly repair) the state of the system
> > when you're having problems booting. If you update to a new kernel, and
> > that kernel isn't detecting your drives correctly, then that is very
> > difficult to troubleshoot once you boot to a rescue kernel.
>
> If the kernel doesn't detect your drives correctly, then how exactly
> does this let you "repair" things? Most problems I've had are long
> before the driver is going to screw things up.
Potential uses:
o Repairing a busted root logical volume (which can happen when snapshotting
the root filesystem for example -- been there, done that).
o Shrinking filesystems, including the root filesystem.
The various resizers only allow for online growth.
Having a simple method to create an initramfs image that includes tools plus
their load dependencies (pulling in shared libraries, etc.), whatever the size,
would be a win. One could decide what is useful locally and put it in a
special initramfs image, e.g.,
/boot/initrd-$KVER-rescue.img
With a remote filesystem mount (nfs, cifs, etc.) one could have access to
a full set of tools with a simple "mount."
Booting with grub is a simple matter of including a stanza for rescue, or
editing the initrd line manually at the grub menu.
Bill Rugolsky
More information about the fedora-devel-list
mailing list