document updated 16 years ago, on Nov 6, 2008
Debugging initrd/initramfs images when they don't work correctly.
First of all, you can usually extract the files on a functioning OS.
- initrd — mount loopback, or if in Windows, use Explore2FS.
- initramfs — ungzip, and extract with cpio (gzip -dc initrd.gz | cpio -i)
linux/Documentation/initrd.txt, see "noinitrd". (though how exactly is this used for debugging?)
Some initrd scripts can have special triggers built in to them:
- For things built with mkinitramfs, you can specify "debug=vc" as a boot parameter, this outputs stuff to /tmp/initramfs.debug.
- (Knoppix) Boot parameter of "BOOT_IMAGE=debug" will open a prompt during initrd.
- (Puppy Linux) Boot parameter of "LOGLEVEL=7" will output a bunch of stuff to /tmp/bootkernel.log, /initrd/tmp/bootinit.log, /tmp/sysinit.log, /tmp/xerrs.log, and /var/log/messages.
A nice cpio+qemu script can be created that allows you to rapidly make changes and then test them.
To recreate/update the initrd with your new files:
- initrd (cpio)
- initramfs (loop)
(background) Tools that create initrd filesystems:
(background) Useful /proc/ stuff.
- /proc/cmdline — the boot parameters
- /proc/partitions — complete list of disk devices (eg. /dev/sda1 /dev/sda2 ...)
==External links==
- man pages
- magazine articles