Solved

Boot Loader

Posted on 2004-09-20
18
240 Views
Last Modified: 2010-04-20
I had Linux running on my computer, with a Windows dual boot. It was running Lilo. I reinstalled windows, and Lilo was deleted. How would I set my computer up to be able to dual boot again?
0
Comment
Question by:wertyk
  • 6
  • 3
  • 3
  • +3
18 Comments
 
LVL 6

Assisted Solution

by:knollbert
knollbert earned 100 total points
ID: 12104878
boot a rescue linux boot disk
run lilo
0
 
LVL 6

Expert Comment

by:knollbert
ID: 12104884
Windows, not working well at school?
0
 
LVL 23

Accepted Solution

by:
Mysidia earned 300 total points
ID: 12105181
Step 1.  Make a boot disk or boot CD if you don't have one...
which distribution?  Usually a Knoppix or LiveCD is sufficient for this purpose.
Most of the major distributions include a bootable CD (or disk) that is suitable.

Step 2.  Boot the system from the disk.  Follow the instructions
             you may need to type 'rescue' at a boot prompt.

             or (better yet)

             mount root=/dev/hdXX         where /dev/hdXX is where your system's root filesystem
             lives

Step 3.  If you booted in rescue mode (and not directly into your system)
             mount the root filesystem  and chroot the current shell into that filesystem
i.e.   mount /dev/hdXX /mnt
then do
chroot /mnt sh

Next make sure the lilo program and the config file from the host system is visible... if necessary
mount /usr as well (but the lilo program is usually  in the /sbin directory)

Step 4.  Run the lilo command...  if you had it setup as a bootloader, you should already have an
/etc/lilo.conf  on the host system... if not, then you need to write one first

0
 
LVL 6

Expert Comment

by:knollbert
ID: 12105317
Mysidia's comment is more thorough and should work
Unless you use scsi or SATA in which case
>mount root=/dev/hdXX
becomes
mount root=/dev/sdXX
0
 
LVL 10

Expert Comment

by:Luxana
ID: 12106894
are you sure that lilo was deleted. If the lilo was on /dev/hda2 and you reinstaled windows on /dev/hda1 and windows moved during instalation botable flag from from linux partition /dev/hda2 to /dev/hda1 bios point to /dev/hda1 partitons . In this case all you need to do is move bootable flag back to /dev/hda2 partiton.

in dos it is called active partition you can simple change with fdisk.
0
 
LVL 17

Assisted Solution

by:owensleftfoot
owensleftfoot earned 100 total points
ID: 12107037
Boot from your installation cdrom into rescue mode. When you get to a command prompt run
"chroot /mnt/sysimage" &  "lilo" (without the quotes).
0
 
LVL 23

Expert Comment

by:Mysidia
ID: 12107278
Whether active partition would be the major issue depends on whether you choose to
put lilo on the MBR or on the Linux partition

if it's on the MBR, then Windows probably overwrote the boot program
otherwise, active partition is what you need to look at (re-running lilo without resetting
the active partition number won't accomplish much in that case)

0
 
LVL 10

Expert Comment

by:Luxana
ID: 12107475
yes in my comment I assume that if you are running windows and linux on one HDD windows usually take MBR of HDD and lilo is installed on /dev/hda2 first sector. And after reinstalation windows always take bootable flag to its partition.

0
 
LVL 4

Author Comment

by:wertyk
ID: 12109621
is there no way to just put in an entry into boot.ini that will let me boot into linux? i know you can boot into multiple windows partitions this way.
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 10

Expert Comment

by:Luxana
ID: 12109898
boot.ini will not help you to boot linux, first try check which partiton is active and if linux partiton is not active make it active save and try reboot otherways you need to follow some other comments above.
0
 
LVL 20

Expert Comment

by:Gns
ID: 12110754
> is there no way to just put in an entry into boot.ini that will let me boot into linux? i know you can boot into multiple
> windows partitions this way.
As a matter of fact, there is... But the caveat is that the tool for it can only work with _partition boot records_ (/dev/hda1 /dev/hda2 in the examples above), so if you have a line "boot=/dev/hda" in /etc/lilo.conf, meaning you install to the primary boot record of the primary IDE master... which probably is your MBR (note above about SCSI/SATA/etc), then you cannot use this method.
You more or less need to know where "boot=..." points to, so the rescue mode boot is probably best anyway:-).

The tool is called BootPart, and it will read out the bootrecord from a partition to a file and update boot.ini to make it visible... Look at http://www.winimage.com/bootpart.htm for DL etc.

-- Glenn
0
 
LVL 4

Author Comment

by:wertyk
ID: 12118789
i have no idea what i'm doing with bootpart

when i run it without any options, it gives me this:

Physical number of disk 0 : f276a3d2
 0 : C:  type=12 , size= 5253223 KB, Lba Pos=63
 1 : C:* type=7  (HPFS/NTFS), size= 20972857 KB, Lba Pos=10506510
 2 : C:  type=5  (Extended), size= 12843967 KB, Lba Pos=52452225
 3 : C:  type=83   (Linux native), size= 6136798 KB, Lba Pos=52452288
 4 : C:  type=5   (Extended), size= 506047 KB, Lba Pos=64725885
 5 : C:  type=82    (Linux swap), size= 506016 KB, Lba Pos=64725948
 6 : C:  type=5    (Extended), size= 4128705 KB, Lba Pos=65737980
 7 : C:  type=83     (Linux native), size= 4128673 KB, Lba Pos=65738043
 8 : C:  type=5     (Extended), size= 2072385 KB, Lba Pos=73995390
 9 : C:  type=b      (Win95 Fat32), size= 2072353 KB, Lba Pos=73995453


0 is the recovery partition
1 is windows
3 is linux boot (the one i want to boot from)
5 is linux swap space
7 is, um, i dont know what 7 is
9 is a fat32 partition i have so i can transfer files between windows and linux


so what do i do now?
0
 
LVL 10

Expert Comment

by:Luxana
ID: 12119990
1 : C:* type=7  (HPFS/NTFS), size= 20972857 KB, Lba Pos=10506510

* = active partition so you are booting to windows

how about try if lilo still exist on your linux partition with make this 3 : C:  type=83   (Linux native), size= 6136798 KB, Lba Pos=52452288 partition bootable.

BTW:

according number of sectors in your partitions seem like you have created extended partition for each partion starts with linux native . So your linux root partitons according this is logical partition /dev/hda5 so there can be a probleme with booting form logical partitons in some circumstancies. One extended partitons as container for rest of them is ok:-)

0
 
LVL 20

Expert Comment

by:Gns
ID: 12120820
Well wertyk, do you know that you have a bootrecord for linux installed to one of the linux partitions?
If not, then bootpart will be no use to you.

Luxana: I think the crappy display is just a bootpartism, so nothing to worry about.

-- Glenn
0
 
LVL 10

Expert Comment

by:Luxana
ID: 12121023


glenn: yes this output looks o bit ugly. According original message linux was working before reinstall windows XP so boot record for lilo should be still on first sector of linux /dev/hda5 partition.
0
 
LVL 20

Expert Comment

by:Gns
ID: 12121069
> glenn: yes this output looks o bit ugly. According original message linux was working before reinstall windows XP so boot
> record for lilo should be still on first sector of linux /dev/hda5 partition.
Only if put there.

-- Glenn
0
 
LVL 10

Expert Comment

by:Luxana
ID: 12121367
of course, but is worth to just to try :-)
0
 
LVL 4

Author Comment

by:wertyk
ID: 12367003
i just used the linux install disc to reinstall grub. thanks all.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

After running Ubuntu some time, you will be asked to download updates for fixing bugs and security updates. All the packages you download replace the previous ones, except for the kernel, also called "linux-image". This is due to the fact that w…
If you use Debian 6 Squeeze and you are tired of looking at the childish graphical GDM login screen that is used by default, here's an easy way to change it. If you've already tried to change it you've probably discovered that none of the old met…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now