MBR deleted - I need to reinstall LILO without reinstalling Debian
Hi guys,
This is the thing: my MBR was deleted and I had to "fdisk /mbr" my MBR. Now I have to reinstall LILO to my MBR so I can boot Debian 3.0 as well as Win 98. I was wondering if there was a way to do this without reinstalling Debian. Y have my old /etc/lilo.conf in the linux patition which I can access booting from a Feather Linux CD. This would be my questions: Where should I boot in order to install LILO: Win 98, Feather Linux or DOS (win startup disk)? I don't have the Debian Boot Disk How do I install LILO in that way? All the documents I've found describe how to install LILO already in Linux. I would really appreciate some help here as this is now the first time I have to reinstall Linux due to some MBR problem. Thanx a lot :) |
You should try to install it from feather linux or whatever distro it was that you said you could access you config from. You could probably chroot the machine and then just run lilo or one of its other scripts. You might check the Gentoo handbook as I know it deals with installing Lilo, but I don't know whether or not it would be helpful for your situation.
|
I actually tried something like that. I booted into Feathr Linux and mounted hda3 which is the partition where Debian is intalled. Then in the console I logged as root and tried to run lilo and then liloconf (or liloconfig, can't remember now). It gave me an error message, something to do with permissions if I recall correctly.
If posting the error message can be of any help please let me know and I'll post it ASAP. Thanx for such quick answer Dodgeram01! |
here is how i did it in knoppix
"Q: My other Linux install is broken and I want to reinstall LILO. A: Mount that partition and run LILO as root: * e.g. mount -o dev /mnt/hda1, if its already mounted, you'll have to clear the "nodev" flag: sudo mount -o remount,dev /mnt/hda1. * Enter that directory as root and run lilo: chroot /mnt/hda1 lilo." http://www.knoppix.net/wiki/Rescue_FAQ |
Thanx heema for your suggestion.
Here is what I did and the outcome. If you see that I'm doing anything wrong please let me know: $su #sudo mount /dev/hda3 /mnt/hda3 #chroot /mnt/hda3 lilo /dev/mapper/control: open failed: no such device Is device-mapper missing from kernel /dev/mapper/control: open failed: no such device Is device-mapper missing from kernel Incompatible libdevmapper 1.00.19-ioctl (2004-07-03)(compat) and kernel driver Warning: '/proc/partitions' does not exist, disk scan bypassed Fatal: open /vmlinuz: No such file or directory That was the console outcome. I will read the Knoppox documentation that heema suggests but if you could continue to point me to the right track I will be very thankful |
Re: MBR deleted - I need to reinstall LILO without reinstalling Debian
Quote:
mount the Debian partition then lilo -C <your-old-/etc/lilo.conf file> If this doesn't work, post back & also post your /etc/lilo.conf file. |
Great, I will try this tonight and post the outcome. Thanx CrashedAgain
|
And here's the outcome:
$su #mount -rw /dev/hda3 /mnt/hda3 #lilo -C /mnt/hda3/etc/lilo.conf Fatal: create /boot/map~: Read-only file system Maybe I made some mistake mounting the file system. I thought that -rw was for read-write. I will try some alternatives but tips are always welcomed :P See you! Thanx! |
Quote:
'man lilo' says that -r forces lilo to chroot before running so try: 'lilo -r /mnt/hda3/ -C /mnt/hda3/etc/lilo.conf' another possibility: 'lilo -m /mnt/hda3/boot/map -C /mnt/hda3/etc/lilo.conf' You may also have to edit lilo.conf so that the whole path is specified like so: (This is from my lilo.conf which is on hda8 but also boots another install on hda5. Note the full path specified for the hda5 entry. crashedagain@desktop:~$ cat /etc/lilo.conf boot=/dev/hda map=/boot/map vga=normal default="Linux(new)" prompt nowarn timeout=100 #message=/boot/message menu-scheme=wb:bw:wb:bw lba32 # Boot Kanotix on hda8 image=/boot/vmlinuz append="lang=us apm=power-off hda=scsi hdb=scsi hdc=scsi hdd=scsi hde=scsi hdf=scsi hdg=scsi hdh=scsi quiet BOOT_IMAGE=knoppix" root=/dev/hda8 label="Linux(new)" read-only # Boot Windows on hda1 other=/dev/hda1 label="Windows" table=/dev/hda # Boot Knoppix26 on hda5 image=/mnt/hda5/boot/vmlinuz-2.6.6 label="Linux(old)" root=/dev/hda5 initrd=/mnt/hda5/boot/initrd.img-2.6.6 append="lang=us apm=power-off ramdisk_size=100000 init=/etc/init nomcequiet wheelmouse" read-only |
Well I've tried that last possibilty and didn't work either. It said something about the vmlinuz file... Finally I had to reinstall Debian. But no harm done... I could backup the important data. Although I was really very interested in having this solved the other way.
I don't know if this question should really be in another post but: How can I backup and restore the MBR in Linux, Windows and DOS? It would be very useful to have an easy way to restore it in case of this incidents. Thanx again everybody for your suggestions!!!! |
Quote:
Windows and DOS have well documented ways of recovering the MBR - nothing else needed. No backup, just replacement with fixmbr or "fdisk /mbr". For grub, you can create an install floppy - this would allow a simple rebuild. Don't know about lilo. The "problem" in Linux is the proliferation of GUI based systems that hide the working of these features. Any distros recovery system should handle this with ease - if you think your distro doesn't, raise a requirement. You'll probably be pointed to an already existing solution. Gentoo users should be able to do this rebuild almost without instruction. |
Quote:
Make yourself a boot disk, at least then you will be able to get into your linux system if you lose your bootloader. Once properly running in linux lilo should reinstall easy, it's a little trickier trying to install it from a different system. Also, never put data of any importance on the same partition as an operating system, if the o/s crashes, it is GONE. For a dual boot system you should have a vfat data partition for shared data. |
I do have a vfat data partition were I keep my data, thanx for the tip anyway CrashedAgain! I was more concerned for some mldonkey temps and for the fact that this already happened to me and I wasn't able to fix it.
About reintalling lilo with the boot disk I tried that as I found my Debian boot disk but had the same problem. I guess I'm a little short on boot loaders' usage and configuration. syg00: Now I've installed Grub so I will try the install floppy. On the other hand, I couldn't figure how to recover the MBR from Debian Install CDs... I guess I'm a little short on patience too :P Thanx everyone anyhow!!! |
All times are GMT -5. The time now is 06:11 PM. |