how to chroot from installation media( or my installation disk) when my slackware doesnt boot

so, you get situations where you edit your /etc/lilo.conf file and fail to run /sbin/lilo…an example is upgrading the kernel or changing to a generic kernel etc….in such a case your slackware system fails to reboot correctly….and it prompts because of a failed lilo configuration….

selfless and selfish too because i need it posted to come back again cause it recurs way too often:

upgrading kernel without running lilo for me….

Relax, you are in safe quarters if you reached here…

follow the steps here to get back up and running….

quoting from
http://docs.slackware.com/howtos:slackware_admin:how_to_chroot_from_media

In order to gain access to your system without booting directly to it, it is possible to use an installation media such as Slackware CD1 or the DVD. Once the installation media loads and starts, you can change the media’s root directory into a mounted hard-disk partition and use it as the root directory, thus running commands directly from it and affecting it.

1. so the first step is to mount your root partition….if you dont know your root partition just enter fdisk -l and check for the linux partition in it….

(let me explain for a single partition….If this is not the case, and you are using LVM/EVMS or an encrypted volume you will need to prepare the volumes before you can mount and chroot into them)

2. if its /dev/sda1, type

mount /mount/sda1 /mnt

3.   next, we need to prepare three virtual directories to be used by the environment. Those are /dev, a directory with virtual files that represent hardware devices, /proc, a directory with virtual files that represent processes and /sys which contains the kernel and other system files:

mount -o bind /dev /mnt/dev

mount -o bind /proc /mnt/proc

mount -o bind /sys /mnt/sys

4. now, since the partitions are mounted now we can chroot to it

chroot /mnt /bin/bash

quoting slackdocs again…..making my life easier…..

“The bash prompt that you see here is a bash prompt started on your system. You can now work on this environment naturally. For example editing /etc/lilo.conf and executing /sbin/lilo will happen on your system, not from the installation media.”

thats all there to it….now with the help of your installation disc you can use your underlying system when it doesnt boot up…

5. when you are done using, dont forget to run lilo again….and then there is the reboot or poweroff command which you can execute as per your needs….

*i was a bit panicky when my slackware failed to start…..but slackware it always surprises you with its tools…..and the folks at LQ…they keep your worries out….

keep slacking!!!