# How to make second HD (linux) bootable?[solved]

## calicoman

Not sure this should be here on on the installation section, but here goes.

I had winXP on drive C and Gentoo on drive D. My C drive just failed and what I want to do is to change my BIOS and boot directly into the Gentoo drive. I am thinking that there is more to that than just using my install disk and changing hdb1 to be bootable with cfdisk. Also, I think that the boot map needs to be copied to hdb1.

I hope that I can do this without using grub as I have already lost one windows drive because I misconfigured it. I used lilo to dual boot until todays crash. Is the bootloader actually installed on the first drive or is it on the Gentoo drive and referenced by the mbr on the winXP drive. How about the partition table also.

Since I have always dual booted I have had to learn this stuff.

EDIT: SEE MY LAST POST FOR A CLEARER PICTURE OF WHAT I WANTLast edited by calicoman on Sat Mar 01, 2008 2:59 pm; edited 2 times in total

----------

## flybynite

More info is needed to make sure you are trying to do the right thing.

Can you boot into gentoo by selecting inside the lilo menu or does the menu not show now?

Are you planning on removing the C: drive?  Is the drive itself the problem or is just windows messed up?

Can you show your current /etc/lilo.conf?  You might be able to use a live cd to do this.

There are a couple of choices you made when installing lilo that we need to know to be sure.

If you just want to temporarily boot linux you can make a grub boot floppy or use a live cd.

----------

## cyrillic

One easy way to check which harddrive the bootloader is installed on is to just unplug the Windows harddrive, and then see if the machine is able to boot Gentoo directly.

BTW, the "bootable" flag that you can see with fdisk / cfdisk is purely a figment of Microsoft's imagination, and has no effect on your ability to boot Linux.

----------

## calicoman

I have already replaced C: with an old 144MB drive I had kept laying around just for emergency purposes, booted with my install CD and rewrote the partition table and reinstalled lilo. So I am actually using D: drive.

Lilo.conf is:

lba32

# MBR to install LILO to:

boot = /dev/hda

map = /boot/.map

default=Gentoo

menu-scheme=Wb

prompt

# If you always want to see the prompt with a 15 second timeout:

#timeout=200

delay = 50

# Normal VGA console

vga = normal

# End LILO global section

# Linux bootable partition config begins

#

image = /boot/linux-2.6.23-gentoo-r8

	root = /dev/hdb3

	label = Gentoo

	read-only # read-only for checking

#

# Linux bootable partition config ends

#

#

# DOS bootable partition config begins

#

other = /dev/hda1

	label = WindowsXP

	table = /dev/hda

#

# DOS bootable partition config ends  

#

I guess I have already answered the question of where lilo resides and that can be readily changed. Does the table refer to the partition table for both hda and hdb ?

The reason I want to make this drive bootable is that I would just as soon have both drives bootable (when I replace C: drive) and make my choice from the BIOS.

What really makes me mad is that it was the newest drive I have in all my 4 computers and now I will probably have to spend another $100 for another version of XP (other 3 use winME)as well as the cost of a new drive. Oh well it will make Billy glad.

Anyway, I appreciate the response.

----------

## robdd

Hi calicoman, I'm glad that you're back in business, even though you have lost your Windoze disc   :Sad: 

I'm sorry to hear that you have had problems with grub - I haven't had any trouble so far. One very useful tool is a grub floppy and/or a grub CD which you can boot off. Then, even if you're primary drive is toast, you can use grub to boot off the second hard drive very easily.

There *is* a "gotcha" if you try to move an IDE drive from slave to master and then boot into Linux - the entries in fstab change from hdbX to hdaX, so you have to edit the fstab entries before you can boot. Same holds true for SCSI or SATA discs.

 *Quote:*   

> 
> 
> BTW, the "bootable" flag that you can see with fdisk / cfdisk is purely a figment of Microsoft's imagination, and has no effect on your ability to boot Linux.
> 
> 

 

cyrillic is almost right here - I was caught by my new Intel motherboard, which is sooooooooo smart that it won't boot off a primary partition that doesn't have the bootable flag set. It really had me going for a while. Gee I hate software (and now firmware) that tries to help me - and then gets it wrong !

Regards, Rob D.

----------

## calicoman

Thanks for the replies guys.

I guess I didn't explain myself adequately. I can boot and get to Gentoo without problems.

What I want to do is change the boot order in my BIOS and boot directly to my second drive (Gentoo). In the process of setting up to do this I don't want to screw up this drive. Can I change the line in lilo.conf to:

 boot=/dev/hdb

and accomplish this. It would seem to me that it would work if my drive hdb partition table is written to hdb and not hda. Would I also have to do something to the: 

table=/dev/hda 

section? 

Frank

Edit 2/28/08

----------

## calicoman

EDITED BUMP

----------

## Jaglover

 *Quote:*   

>  boot=/dev/hdb 

 

Did you ever think how a PC boots? After POST is finished BIOS executes the code on the MBR of first HDD. You change boot order in the BIOS - another disk becomes first - and is new hda. Obviously you need to fix your fstab before you re-run lilo.

----------

## pappy_mcfae

 *calicoman wrote:*   

> Thanks for the replies guys.
> 
> I guess I didn't explain myself adequately. I can boot and get to Gentoo without problems.
> 
> What I want to do is change the boot order in my BIOS and boot directly to my second drive (Gentoo). In the process of setting up to do this I don't want to screw up this drive. Can I change the line in lilo.conf to:
> ...

 

I don't see why you don't do it the easy way:

Physically reconfigure the drive. If the drive has jumpers, set it to master instead of slave or cable select. If the drive actually configures itself with cable select, just swap the master cable to the drive. If you do this, your Gentoo drive will become /dev/hda. 

You will then have to edit /etc/lilo.conf, and replace all instances of /dev/hdbx with /dev/hdax. You will also have to edit /etc/fstab. This is a very important step. An incorrect /etc/fstab can prevent booting. I found that out the hard way.

You will also have to set the bootable flag via fdisk or cfdisk. This goes without saying, but I said it nonetheless.

The final step is to run lilo. If it works the first time, smile and breathe a sigh of relief. If not, tweak /etc/lilo.conf if need be. Reboot and you're done.

What you want to do 's a very doable thing. You just have to make absolutely sure you are looking at your fstab and lilo.conf the way your computer does. If you do, things will go smoothly. If not, then you'll get experience in debugging.

Good luck.

Blessed be!

Pappy

----------

