LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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

Reply
 
Search this Thread
Old 03-20-2005, 10:12 AM   #1
chaca1983
LQ Newbie
 
Registered: Oct 2003
Distribution: Debian
Posts: 27

Rep: Reputation: 15
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

Last edited by chaca1983; 03-20-2005 at 10:13 AM.
 
Old 03-20-2005, 11:39 AM   #2
Dodgeram01
Member
 
Registered: Jun 2003
Distribution: Gentoo and Ubuntu
Posts: 95

Rep: Reputation: 15
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.
 
Old 03-20-2005, 06:41 PM   #3
chaca1983
LQ Newbie
 
Registered: Oct 2003
Distribution: Debian
Posts: 27

Original Poster
Rep: Reputation: 15
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!
 
Old 03-21-2005, 02:35 AM   #4
heema
Senior Member
 
Registered: Sep 2003
Location: Egypt
Distribution: Arch
Posts: 1,528

Rep: Reputation: 46
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
 
Old 03-21-2005, 08:13 AM   #5
chaca1983
LQ Newbie
 
Registered: Oct 2003
Distribution: Debian
Posts: 27

Original Poster
Rep: Reputation: 15
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


Last edited by chaca1983; 03-21-2005 at 08:21 AM.
 
Old 03-21-2005, 09:09 AM   #6
CrashedAgain
Member
 
Registered: Jan 2004
Posts: 307

Rep: Reputation: 32
Re: MBR deleted - I need to reinstall LILO without reinstalling Debian

Quote:
Originally posted by chaca1983


Y have my old /etc/lilo.conf in the linux patition which I can access booting from a Feather Linux CD.

as root from feather linux or knoppix or whatever you linux you can run,
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.
 
Old 03-21-2005, 02:06 PM   #7
chaca1983
LQ Newbie
 
Registered: Oct 2003
Distribution: Debian
Posts: 27

Original Poster
Rep: Reputation: 15
Great, I will try this tonight and post the outcome. Thanx CrashedAgain
 
Old 03-22-2005, 07:23 AM   #8
chaca1983
LQ Newbie
 
Registered: Oct 2003
Distribution: Debian
Posts: 27

Original Poster
Rep: Reputation: 15
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!
 
Old 03-22-2005, 08:22 AM   #9
CrashedAgain
Member
 
Registered: Jan 2004
Posts: 307

Rep: Reputation: 32
Quote:
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.


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
 
Old 03-25-2005, 11:54 PM   #10
chaca1983
LQ Newbie
 
Registered: Oct 2003
Distribution: Debian
Posts: 27

Original Poster
Rep: Reputation: 15
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!!!!
 
Old 03-26-2005, 12:21 AM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,224

Rep: Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019Reputation: 1019
Quote:
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.
 
Old 03-26-2005, 09:22 AM   #12
CrashedAgain
Member
 
Registered: Jan 2004
Posts: 307

Rep: Reputation: 32
Quote:
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.
 
Old 03-26-2005, 10:06 AM   #13
chaca1983
LQ Newbie
 
Registered: Oct 2003
Distribution: Debian
Posts: 27

Original Poster
Rep: Reputation: 15
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!!!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Reinstalling GRUB after reinstall XP nmayooran Linux - Software 1 09-10-2005 03:59 PM
reinstall GRUB to MBR w/o reinstalling Linux?? timsch75 Linux - Software 3 06-24-2004 06:36 PM
how i fixed lilo & my mbr without reinstalling bandofmercy LinuxQuestions.org Member Success Stories 1 06-07-2004 04:03 PM
reinstall grub/lilo on MBR without cdrom boot lay_Z Linux - Newbie 5 03-12-2004 05:45 AM
mbr had over write so lilo is gone how to rewrite lilo to mbr mch Linux - Software 4 10-25-2002 02:55 PM


All times are GMT -5. The time now is 06:50 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration