Lilo in a Chroot

18:22 Mon, 13 Jun 2011

A note for myself on using lilo in a chroot environment.

If you need to run lilo in a chroot (say, after booting from a rescue disk), don't forget to mount /proc and /dev in the chroot environment.

For example, if the partition of your normal root is /dev/sda1 then

mount -t ext3 /dev/sda1 /mnt mount --bind /proc /mnt/proc mount --bind /dev /mnt/dev chroot /mnt # fix the problem...then lilo -v

If you don't do this for the /dev directory, lilo won't fix the correct MBR. Lilo also needs the /proc dummy filesystem otherwise it spits out some warning messages that you can probably do without; it probably uses /proc/devices.

(The reason for this post will be explained in the next couple of days when I follow up with details of a long tedious two days spent fixing up my Slackware upgrade, where I forgot to create an initrd before rebooting with a new kernel.)

Categories: unix

Leave a comment

Your email address will not be published. Required fields are marked *

Plain text only please, any < or > are removed.