April 4th, 2003 08:54 AM
Rescue Linux Machine
I had posted the following post as an aswer to a question regarding linux installation.
But still there are a few who don't know what to do when a linux machine crashes.
Here is a tutorial on Linux Rescue
If by some means u loose ur lilo, follow these steps:
1. Boot with Redhat Cd no.1
linux rescue <enter>
3. Follow the instructions (u will have to press enter key twice)
4. After this Redhat searches for redhat installation on the disk and mounts it into /mnt/sysimage
5. u'll get a shell prompt #
7.U r ROOT here
edit ur /etc/lilo.conf
8. run lilo
(now it should work)
Suppose u don't have a Redhat Installation CD I (Which automatically detects your Redhat Installation and mounts it under /mnt/sysimage) :
But u do have the installation CD of any other popular distribution ( or a rescue CD ),then these are the steps to follow :
1. Here I'll assume that u got the rescue shell prompt
#fdisk -l or
#fdisk /dev/hda then p (to get the partition list)
3. Note down the number of all your linux partition (eg. /dev/hda5)
4. create a directory and mount your / partition (if u know) into this directory.Otherwise do trial and error.If the partition was / partition, the directory will contail etc,bin,sbin,boot etc.
#mount /dev/hda6 test
if it shows directories etc,boot,bin,sbin, etc then ok.Else try mounting other linux partitions.
Once that is done.
5. But that is not all.If u had a separate /boot partition u should mount that into boot directory.B'coz it is in this directory that your linux kernel resides (eg. vmlinuz )
6. Now make changes to /etc/lilo.conf (if necessory) and run lilo
To install GrUB type
There is no provision of uninstalling GrUB in linux (as far as I know). But if ur machine has Win98,type
But if u have Win2000 or XP
1. Boot with installation CD
2. Enter into recovery console by pressing R when asked
3. there are some more steps before u get the prompt.But i will assume here that u got the prompt
April 4th, 2003 08:45 PM
I'd add "step 0: prevention". Build a lilo floppy while your system is working fine.
April 23rd, 2003 09:17 AM
step 0: Creating boot Disk
Though there are lot of boot disk creation method, this should work on all distributions
#dd if=/boot/vmlinuz-<version no.> of=/dev/fd0
#rdev /dev/fd0 /dev/hdax
where x is the partition number of /
u can get the value of x by typing
April 23rd, 2003 10:23 AM
Great post, as a reminder for those people who've upgraded their kernel lately. You might want to re-create you boot diskette as well, so you can boot to your latest kernel.
April 23rd, 2003 04:15 PM
Another idea: people who upgraded their kernel:
Keep the old kernel around and in the lilo boot menu. It doesn't use up much space (900k mine) and it saves a lot of hassle if you build a broken one (for instance forget the IDE driver when you have IDE discs)
February 25th, 2004 07:18 AM
When grub-install fails
Sometimes grub-install fails even in the rescue mode.
The solution to this is : (change parameters according to your systems settings)
grub > install (hd0,6)/boot/grub/stage1 d (hd0) (hd0,6)/boot/grub/stage2 p (hd0,6)/boot/grub/menu.1st
this will change slightly if u have a separate boot partition.
grub > install (hd0,6)/grub/stage1 d (hd0) (hd0,6)/grub/stage2 p (hd0,6)/grub/menu.1st
ok the syntax is :
install <path to stage1> d <install device> <path to stage2> p <path to config file>