[SOLVED] Booting into linux when your boot sector is gone?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
root@Microknoppix:/# mkdir /mnt/temp
root@Microknoppix:/# mount /dev/sda5 /mnt/temp
root@Microknoppix:/# chroot /mnt/temp
[root@Microknoppix /]# lilo -b /dev/sda5
Ignoring entry 'boot'
Warning: '/proc/partitions' does not exist, disk scan bypassed
Added linux-secure
Added linux
Added linux-nonfb
Added failsafe
Fatal: open /dev/hda1: No such device or address
[root@Microknoppix /]#
Does that mean installing LILO worked, and the error is just because I've removed hda1 (the IDE drive?) or did the whole thing fail.
How can I use my Knoppix CD to get into my Mandrake Desktop? thanks!
From the chroot environment, what did your /etc/fstab look like? I suspect that error is associated with that. Did you also edit the lilo.conf file before you ran lilo -b? You'll have to modify it to boot the partition now that the /dev/hda is gone.
Sorry. Old versions of linux handled SATA and IDE drives differently than today. Assuming that this is a SATA drive (which you mentioned above), my guess is that you will want to change your fstab to look like this:
I would probably from the chroot environment do a cp /etc/fstab /etc/fstab.old so you have a backup copy to mess with if you need it. Then you can modify /etc/fstab. You can either remove or comment out the /dev/hda1 line since you removed that drive.
Then make a copy of lilo.conf the same way (cp /etc/lilo.conf /etc/lilo.conf.old) and edit it to look like this:
You can comment out/delete the /dev/hda1 lines for ME again. You probably won't need the map-drive functions for Win2k since this will be the primary drive now.
You may also need to look at the file /boot/map that gets called in the beginning of lilo.conf.
Anyway, when you're done editing lilo.conf, you run the lilo -b command to install it to the / partition. Then you need to create a boot floppy or use another bootloader to chainload it. I like XOSL on floppy or CD. It's got a nice intuitive graphical interface.
That was an awesome post, thanks for the detail, it helped. Everything went well this time:
Code:
[root@Microknoppix /]# lilo -b /dev/sda5
Ignoring entry 'boot'
Warning: '/proc/partitions' does not exist, disk scan bypassed
Added linux-secure
Added linux
Added linux-nonfb
Added failsafe
Added Win2K_Server *
However, I couldn't figure out how to install XOSL to a floppy; it seems to be something you install on your hard disk.
I am wondering if it would be possible to make a GRUB boot floppy disk (I found instructions) from Knoppix, and use that to boot the LILO installed on /dev/sda5?
Yup, you could do that to. Your menu.lst file should look something like this
Code:
title Mandrake
root (hd0,4)
chainloader +1
boot
Grub counts hard disks and partitions starting from zero. So the first drive (sda) should be hd0. The first partition would be partition 0. So sda1 = (hd0,0), sda2 = (hd0,1), etc. which makes sda5 = (hd0,4).
Well, it worked!
I didn't know how to do the menu.lst so I typed in the commands at the prompt and it worked great. It got me over to lilo on my Mandrake 9.2 (!) install.
I was very happy to see my old Mandrake loading screen.
Only problem now is I'm encountering a kernel panic (no init found) so now that I'm that far I can look into how to resolve that.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.