LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-07-2006, 05:20 PM   #1
Menno RB
LQ Newbie
 
Registered: Dec 2006
Posts: 16

Rep: Reputation: 0
Removing lilo from the MBR


I'm trying to let NTLDR handle the bootloading and therefore I need to remove the lilo-code from the master bood record, or atleast that's what I've read. Now it tells me to do this with the following code:

lilo -u <device>

I have one harddisk (hda) so therefore I tried "lilo -u hda" but it says "fatal: open hda: no such file or directory". Does this mean lilo is not installed on my MBR? In that case, howcome when I boot up it shows lilo?

Thanks in advance,

Menno

EDIT:

I'm sorry, tonns of threads on this topic. How do I delete a thread I've made by the way?

Last edited by Menno RB; 12-07-2006 at 05:23 PM.
 
Old 12-07-2006, 05:28 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Maybe you need to say /dev/hda??
But, why not just overwrite lilo with whatever you want in the mbr (which I assume is the Windows loader.)
 
Old 12-07-2006, 05:30 PM   #3
Menno RB
LQ Newbie
 
Registered: Dec 2006
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany
Maybe you need to say /dev/hda??
But, why not just overwrite lilo with whatever you want in the mbr (which I assume is the Windows loader.)
Yes, that would make more sense to me too. But in the tutorial I'm following to get to a dualboot system it says that removing Lilo will have your system booting with NTLDR again, the way I read it.

By the way you were right, I had to use /dev/hda, which I found in other threads as well. I should search before posting, haha.
 
Old 12-07-2006, 05:52 PM   #4
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by Menno RB
Yes, that would make more sense to me too. But in the tutorial I'm following to get to a dualboot system it says that removing Lilo will have your system booting with NTLDR again, the way I read it.

By the way you were right, I had to use /dev/hda, which I found in other threads as well. I should search before posting, haha.
There has to be **something** in the mbr of the HD that the bios believes is #1. Nothing in the mbr--no boot from the HD.
the windows boot code actually sends the system to NTLDR, which is in the **boot partition** of the Windows partition. (eg, when you chain-load from grub, you are sending the system to NTLDR)
 
Old 12-07-2006, 06:03 PM   #5
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
To remove Lilo in the MBR is to replace it with MS's MBR.

Task B1 & B2 of the last link of my signature refer.

Lilo cannot put NTLDR into MBR. It is always MS MBR, which is common for all Dos and Windows system, occupying the MBR. Therefore putting Dos's MBR will do the same job.

NTLDR resides in the root partition of Win2k or XP and that is "c" drive in MS term.

MS's MBR has one main function ----> to boot whatever partition that has the active flag switched on. That is why a MS system must be active before it can be booted.

Last edited by saikee; 12-07-2006 at 06:08 PM.
 
Old 12-07-2006, 06:03 PM   #6
Menno RB
LQ Newbie
 
Registered: Dec 2006
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by pixellany
There has to be **something** in the mbr of the HD that the bios believes is #1. Nothing in the mbr--no boot from the HD.
the windows boot code actually sends the system to NTLDR, which is in the **boot partition** of the Windows partition. (eg, when you chain-load from grub, you are sending the system to NTLDR)
Yeah but in the tutorials I've read they don't mention "restoring" the MBR, the way I've read it it seems that when you remove the lilocode from the MBR then the MBR will contain the NTLDR code again. Now that I've read up on it a bit more it seems that linux keeps a file that contains the previous MBR-code (preinstallation perhaps?) which is restored when removing Lilo I guess? I'm taking some random guesses there but that's my interpretation.

Anyway, using lilo -u /dev/hda didn't work for me, when I rebooted it still showed Lilo. So I used my Windows XP recovery cd and restored the MBR and now NTLDR is loaded when booting and I can choose to login to Linux, so I'm happy right now
 
Old 12-07-2006, 06:04 PM   #7
Menno RB
LQ Newbie
 
Registered: Dec 2006
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by saikee
To remove Lilo in the MBR is to replace it with MS's MBR.

Task B1 & B2 of the last link of my signature refer.
Hehe, I ended up doing B2.
 
Old 12-07-2006, 06:07 PM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by Menno RB
Yeah but in the tutorials I've read they don't mention "restoring" the MBR, the way I've read it it seems that when you remove the lilocode from the MBR then the MBR will contain the NTLDR code again. Now that I've read up on it a bit more it seems that linux keeps a file that contains the previous MBR-code (preinstallation perhaps?) which is restored when removing Lilo I guess? I'm taking some random guesses there but that's my interpretation.
My guess is that this is not how it works--at least not with grub. Do you have docs that say that lilo does this??
 
Old 12-07-2006, 06:15 PM   #9
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
I could be wrong but if Lilo can restore MS's MBR it may require the image saved previously before Lilo takes over the MBR. Some older write-ups do make such a suggestion.

Nowadays it is a lot easier to use a Dos floppy, or download Freedos or get a Win2k or XP installation disk to restore MS's MBR.
 
Old 12-07-2006, 06:25 PM   #10
Menno RB
LQ Newbie
 
Registered: Dec 2006
Posts: 16

Original Poster
Rep: Reputation: 0
Yes I just managed to find the docs I read again:

http://www.unixguide.net/linux/faq/04.12.shtml

Important part:

"lilo -u /dev/hda

This rewrites the original, pre-LILO master boot record back to the
first hard drive, from the boot record saved in /boot/boot.0300."
 
Old 12-07-2006, 06:41 PM   #11
Duck2006
Member
 
Registered: Sep 2006
Distribution: Ubuntu 8.04 Hardy Heron LST
Posts: 346

Rep: Reputation: 33
From the install disk for XP you can recover your MBR on your XP drive by booting the install disk then pressing r for recover and at the command promp type fixmbr
 
Old 12-08-2006, 06:28 AM   #12
aneeshk_k
LQ Newbie
 
Registered: Oct 2004
Posts: 17

Rep: Reputation: 1
Thumbs up

By running 'fixmbr' , you can restore NTLDR. But after that how you load linux? NTLDR cant load linux...only Windows.
 
Old 12-08-2006, 07:34 AM   #13
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738Reputation: 738
Quote:
Originally Posted by aneeshk_k
By running 'fixmbr' , you can restore NTLDR. But after that how you load linux? NTLDR cant load linux...only Windows.
Au contraire---the procedure for this has been posted here quite often. I am not the expert on this, but it involves creating a copy of GRUB stage1, moving it to the Windows partition and pointing NTLDR to it with the boot.ini file.
Search here at LQ for the details.
 
Old 12-08-2006, 08:27 AM   #14
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Restoring MS MBR permit Windows boots itself again, as Lilo was occupying the MBR before.

NT versions of Windows like Win2k, XP and possibly Vista uses NTLDR boot loader which can multi boot up to 10 systems. Thus if Windows boots again a user can amend its NTLDR configuration file to boot other systems. NTLDR doesn't reside in the MBR. It hides itself as a hidden file inside the root partition or the "C" drive and is controlled by another hidden file boot.ini.

A user generally needs to do 10 times more work to ask NTLDR to multi boot than using any of the Linux boot loader Grub or Lilo to boot Windows. The explanation is simple. Windows doesn't support Linux and wouldn't (possibly not willing) to read files in a Linux partition. This implies even if you point a gun at the head of Windows it will still not go out to a Linux partition to fetch a file. To beg a NTLDR to boot a Linux a Windows user must first install the Linux, have it in running order and then copy the first 512bytes of its boot loader into the root partition of Windows (so that the lazy bugger doesn't have to come out to get it itself!).

When a Windows user has done the above and selects in NTLDR menu to boot a Linux NTLRD just loads the available 512 bytes of that Linux boot loader for passing the control over to Linux, a process known as "chain loading". (the first 512 bytes is portion of that boot loader to occupy the MBR if it were given the chance)

Some difficulties (when comaring with Linux) of Windows NTLDR multi-booting are

(1) System file boot.ini must be unhide first, edited outside the desktop (as it hates you touching its system files) and have it hidden again on completion.

(2) The Linux must be installed and has its boot loader in working order and inside its root partition. (come on if you are there would you not let Linux to boot Windows?)

(3) Any alteration to the Linux boot loader requires the entire process to be repeated again.

(4) The maximum number of systems NTLDR can handle is 10. Lilo eats 27 images for breakfast and Grub doesn't even brink if you throw 100 systems at it.

(5) It is a favour to ask NTLDR to boot another non-MS system. In Linux you need to point a gun in Linux to stop it from booting Windows because every Linux installer will try to set up the dual boot automatically without the user lifting a finger (That means no or very little work from the user in using Linux to multi boot).

If people like to go from A to B and then from B to C that is fine with me, as long as I have shown them the route going directly from A to C. I went through the scenic route of from A to B and to C myself so why can't they.

Last edited by saikee; 12-08-2006 at 08:30 AM.
 
Old 12-08-2006, 03:23 PM   #15
Duck2006
Member
 
Registered: Sep 2006
Distribution: Ubuntu 8.04 Hardy Heron LST
Posts: 346

Rep: Reputation: 33
Quote:
every Linux installer will try to set up the dual boot automatically without the user lifting a finger (That means no or very little work from the user in using Linux to multi boot).
Linux setup may try to set up a dual boot loader, when it installs, but unfortunaly it some time failes for one reason or another (human or hardware or even software). So you have to find another way of getting it done.
 
  


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
Removing Linux/Lilo from MBR hsimah Slackware 6 09-01-2006 07:21 PM
removing GRUB from MBR gomez6211 Linux - Newbie 1 07-25-2005 10:09 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
Removing RH from MBR esael Slackware 2 09-15-2002 05:26 PM
removing LILO from the MBR keegan1 Linux - General 10 06-12-2001 04:10 AM


All times are GMT -5. The time now is 02:18 PM.

Main Menu
Advertisement
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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration