MBR deleted - I need to reinstall LILO without reinstalling Debian
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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.
"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."
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
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
Originally posted by chaca1983 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!
I kind of figured that might happen; I think the read-only error is because it is running from a read only system, not because hda3 is improperly mounted.
'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.
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.
Originally posted by chaca1983
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. [/B]
The only time a backup would be useful is immediately prior to updating it. After which it should probably be deleted.
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.
Originally posted by chaca1983 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!!!!
I seem to recall being able to reinstall lilo from the Debian install disks without having to reinstall the whole distro but my memory may be faulty on this.
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
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.