LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Removing lilo from the MBR (https://www.linuxquestions.org/questions/linux-newbie-8/removing-lilo-from-the-mbr-508352/)

Menno RB 12-07-2006 05:20 PM

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?

pixellany 12-07-2006 05:28 PM

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.)

Menno RB 12-07-2006 05:30 PM

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.

pixellany 12-07-2006 05:52 PM

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)

saikee 12-07-2006 06:03 PM

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.

Menno RB 12-07-2006 06:03 PM

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 :D

Menno RB 12-07-2006 06:04 PM

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.

pixellany 12-07-2006 06:07 PM

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??

saikee 12-07-2006 06:15 PM

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.

Menno RB 12-07-2006 06:25 PM

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."

Duck2006 12-07-2006 06:41 PM

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

aneeshk_k 12-08-2006 06:28 AM

By running 'fixmbr' , you can restore NTLDR. But after that how you load linux? NTLDR cant load linux...only Windows.

pixellany 12-08-2006 07:34 AM

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.

saikee 12-08-2006 08:27 AM

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.

Duck2006 12-08-2006 03:23 PM

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.


All times are GMT -5. The time now is 06:49 PM.