LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices


Reply
  Search this Thread
Old 02-13-2005, 10:40 PM   #1
makaveli0129
LQ Newbie
 
Registered: Nov 2004
Distribution: mandrake
Posts: 4

Rep: Reputation: 0
installing lilo while in windows


ok this is what is going on.

I have ubuntu installed and then i installed windows xp pro. Now i was using grub in to boot ubuntu. But i found a way to have ntldr boot lilo so that i can dual boot.

The problem is that since i re-installed windows it overwrote the mbr and now i cannot get into ubuntu.

My question is how would i install lilo so that i can boot into ubuntu without reinstalling ubuntu?

Any help would be much apprieciated. All i need to do is install lilo so that i can create an image of the boot file for linux this way i can boot up linux using ntldr. Any help is once again apprieciated. You can get a hold of me on this but aim is preferred my screenname is makaveli0129.

Thanks
 
Old 02-13-2005, 11:13 PM   #2
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
My recomendation is to use grub to boot Windows and Linux. The grub documentation will tell you how to do that (see the section on using the chainloader).

You can reinstall grub with your distro's boot CD.
 
Old 02-14-2005, 02:08 AM   #3
cyberdwarf
Member
 
Registered: Sep 2003
Location: Spokane, aka Methlehem, aka SpokVegas
Distribution: Ubuntu Edgy Eft/ OSX Panther dual boot on PPC Mac Mini.
Posts: 30

Rep: Reputation: 15
This is a relative newb, so grain of salt...

I would try the bootdisk called Ranish Partition Manager, and install their rudimentary bootloader just to get into linux. Then try installing lilo from ubuntu. Careful with Ranish. It does exactly what you tell it. Also, any rescue disk for linux should get you in. I have gotten suse to boot from the install disk without reinstalling. But the kernel image should be in your boot partition, not the mbr, if I recall correctly. Oh, and if you use ext3, there is a cool prog for use from within windows. it's called ext2ifs, and lets you read ext2 and 3 from within windows. Kinda cool. Explore2fs is by the same guy, and cool for a thubdrive cause it operates from its own folder. For what it's worth.
 
Old 02-14-2005, 07:44 AM   #4
pvs
Member
 
Registered: Jan 2005
Location: Lviv, Ukraine
Distribution: Something self-made
Posts: 69

Rep: Reputation: 16
I don't know how looks ubuntu setup, but in most distributions there is possibility to run it in rescue mode either by choosing satrtup menu item or by typing "linux rescue" at the begining of installation. NTLDR can boot any loader if first 512 bytes are saved into file visible for Windows and in boot.ini is string
X:\path\to\LILO_header.img=LILO boot to Linux
(There may be more strings with different loaders)
 
Old 02-14-2005, 08:09 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,153

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
First up, do *NOT* change to lilo.
The copying of the boot sector record to XP so it can be referenced in boot.ini works also for grub.
And you don't have to redo it every time you play with your kernel.

Ubuntu is a truly different animal.
The installer is very structured - I suspect you can't get to reinstalling grub without trashing your partitions first.
Same CD also acts as a LiveCD - you might be able to do it from there. At least it has root.

Lots of luck.
 
Old 02-14-2005, 10:19 AM   #6
AnXa
LQ Newbie
 
Registered: Jan 2005
Location: Lahti, Finland
Distribution: Gentoo x86_64, Darwin 8.0.1, Slackware 10.1
Posts: 10

Rep: Reputation: 0
Real Sollution

Well... Forget about LILO, it is not ment for beginners. This quick help will tell you how to reinstall grub without reinstalling whole system again.

Get Gentoo Live Cd or some other live cd that can access with root priviledges to your computer. Boot it and do this:

Use fdisk to find out where linux is installed. (hardrive, partition etc.) you don't need any other commands besides p(print partition table) ja q (quit fdisk) Then do this:

mount your linux partition to /mnt/gentoo, for example I use this command:
Code:
mkdir /mnt/linux
mount /dev/hda6 /mnt/linux
cd /mnt/linux
then do root change with bash exit:
Code:
chroot /mnt/linux /bin/bash
Then start grub and reinstall it to MBR with typing:
Code:
grub
root (hd0,0)
setup (hd0)
exit
root (hd0,0) this is where your boot folder is located (the folder where GNU/Linux OSs will be booted from), if you don't have boot partition then use your linux root [/] partition for this. First number tells HD and second its partition. I have boot partition at beginning of my first hard drive so it is 0,0 for me.

setup (hd0) this is where grub is going to be installed, which hard drive that is going to boot it. If you have linux in your computer first harddrive then 0 is allright. if it is located on second then it is 1 and so on.

then you can exit your live system by typing:
Code:
exit
reboot
And if you did everything right, then your grub will be starting instead of windows. You may have to do this again if it won't work at first time. Nobody can do this at first time. I know it from experience, but when you succeed in this your skills with grub will increase a lot.

this mayt sond a little bit wicked, but it works. And is the easiest sollution when comparing the time.

Last edited by AnXa; 02-14-2005 at 10:22 AM.
 
Old 02-14-2005, 08:26 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,153

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
Informative post, however makaveli0129 stated (s)he wanted to keep the ntldr MBR record.
Reinstalling grub into the MBR will only muddy the waters more I fear.
Yes, it's my preferred option as well, but isn't what was asked for.

As above except changing the setup(hd0) to (hd0,0) will install to the bootsector of the first partition of the first hard disk.
At this point you can dd the boot record and add it to boot.ini.
I presume this is as the doco you found states.
 
Old 02-16-2005, 08:43 PM   #8
marcosdumay
LQ Newbie
 
Registered: Jan 2005
Distribution: Debian, testing
Posts: 19

Rep: Reputation: 1
If you have a lilo.conf already written and really want to install lilo, you can boot the computer with a live-cd, mount your root dir anywere (let's say '/' is mounted at '/other-linux') and do:

lilo -r /other-linux

This will put lilo at mbr. I, personaly like to have a lilo.conf properly set at every system I administrate, even if it normaly uses groob, that makes much more easy to rescue the mbr if something goes wrong.
 
Old 07-13-2009, 02:52 PM   #9
svanslyck
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by pvs View Post
NTLDR can boot any loader if first 512 bytes are saved into file visible for Windows and in boot.ini is string
Clear, concise advice, and works fine for CentOS but for some reason my recent install of debian's last release is hanging on boot.

I did a
Code:
df
to confirm that I'd installed debian to /dev/sdb2 but after grabbing the bytes via
Code:
dd if=/dev/sdb2 of=whatever.ext bs=512 count=1
saving them to floppy, copying them to C:\, updating boot.ini,... when I attempted to boot debian the system just hung.

Any ideas or thots?
 
Old 07-13-2009, 06:23 PM   #10
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,153

Rep: Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125Reputation: 4125
A seriously dead thread rises again ...
That will only work if the bootloader is installed to the partition boot sector record rather than the MBR of /dev/sdb (it can be in both).
Boot debian and install the loader again to the partition - then the above should work.

There are better solutions BTW.
 
Old 07-14-2009, 10:18 AM   #11
svanslyck
LQ Newbie
 
Registered: Jul 2009
Posts: 4

Rep: Reputation: 0
Quote:
Originally Posted by syg00 View Post
A seriously dead thread rises again ...
That will only work if the bootloader is installed to the partition boot sector record rather than the MBR of /dev/sdb (it can be in both).
Boot debian and install the loader again to the partition - then the above should work.
I'm not sure which boot loader you mean, but the process I described worked perfectly with CentOS. The only difference is that the second hard drive now has debian on it, instead of CentOS, and that the file reference in boot.ini points to a file created from debian's /dev/sdb1/ instead of CentOS's.

I should have mentioned that the first hard disk has windows (and NTLDR) on it, and that linux is on the second hard disk. In each case I let the Linux install decide where to put stuff on the second hard disk and left the first hard disk alone - except for the necessary updates to boot.ini and placing the new 512 byte file where boot.ini referenced it.

I'm not unwilling to install GRUB on the first hard drive, but the only options I'm given by the debian install disk are to install it to the MBR, and it seems the revealed truth is Don't Do That.

Last edited by svanslyck; 07-14-2009 at 10:20 AM.
 
  


Reply



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
How can i restore lilo after re-installing windows? elean Linux - General 3 06-14-2004 07:29 PM
No windows in LILO ilhbutshm Linux - General 8 11-22-2003 03:13 AM
lilo and windows marek Slackware 7 08-31-2003 03:03 AM
LILO and Windows ME jbarreir Linux - Newbie 1 08-30-2003 07:13 PM
Windows ME and Lilo EvoKen Linux - Software 4 06-26-2001 09:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions

All times are GMT -5. The time now is 12:44 AM.

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
Open Source Consulting | Domain Registration