LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to change the boot order between 2 HDD? (http://www.linuxquestions.org/questions/linux-newbie-8/how-to-change-the-boot-order-between-2-hdd-675603/)

linuxbee1 10-10-2008 10:05 PM

[Solved]How to change the boot order between 2 HDD?
 
Here is my situation:

I have debian etch installed on the machine. It is my webserver. I took a another hard drive (250GB) from another machine which has debian etch installed on it. It contains no data. I put this 250gb hardrive on my webserver machine thinking that i can use it at as a backup. when i booted the system it boots the debian from 250gb harddrive and not the other harddrive(40GB).

Here is what i want to do:

1. The machine should boot up from 40GB HDD.
2. I want to remove debian from the 250GB HDD. Format it and mount it and just use it as a backup for the 40GB HDD.

P.S Grub is installed in both the HDD

Plz advise...Thanks!

smbell100 10-10-2008 10:07 PM

Enter the BIOS at boot. You should be able to sort the boot order there.

linuxbee1 10-10-2008 10:17 PM

I did sort the boot order.

The boot order is
1.cd-rom
2. HDD

In my primary IDE master - cdrom
Primary IDE slave - 40GB
secondary IDE master - 250GB

The IDE configuration is as follows:
primary IDE master - 1st IDE
Primary IDE slave - 2nd IDE
secondary IDE master - 3rd IDE

what else do i have to change inorder to boot from 40GB HDD?

smbell100 10-10-2008 11:37 PM

An interesting setup. Personally, when originally setting up the machine I would have made the 40GB drive Primary IDE master, and the cdrom Secondary IDE master, purely for speed as the IDE interface runs at the speed of the slowest device on it, and cdroms tend to be slower than hard drives.

If your BIOS is not giving you an option to choose between the two hard drives for booting, the only option really is to change the order of the drives on the IDE interfaces. I would put the 40 Gb as Primary IDE master. However this might mean changing the grub configuration.

Hope this helps

linuxbee1 10-10-2008 11:44 PM

That means i need to physically change in the hardware and also the grub setting

smbell100 10-10-2008 11:52 PM

I am afraid so. If the BIOS won't let you choose between the hard disks, you will need to change the order the BIOS finds them in.

linuxbee1 10-10-2008 11:56 PM

Thanks for your replies.

let me try this tomm. and let you know how it goes.

smbell100 10-11-2008 12:02 AM

I won't be back until tuesday i'm afraid. Hope it goes ok

ghodkiller 10-11-2008 10:15 AM

make the hdd you want your computer to boot from, the primary one. it should do the trick

Debian

linuxbee1 10-13-2008 10:48 AM

Using the live cd I formatted the 250GB hdd.

If the set up is like:
primary IDE master - cdrom
Primary IDE slave - 40GB
secondary IDE master - 250GB

I get the grub error. Grub stage 1.5 Grub loading.....error 15

If my set up is like:
primary IDE master - cdrom
Primary IDE slave - 250GB
secondary IDE master - 40GB

The system tries to boot from 250GB hdd. When it tries to look at the /root files it just stays...since there are no files on the 250GB hdd.

Onething i noticed is that when i tried to start the machine with one hdd (40GB) connected. It gets the device name as hdc and boots without any problem. When I start the machine with 2 hdd connected. The dev name becomes hdb for 40GB and hdc for 250GB.

This is what is happenning to my system. what do i need to do if i want to boot my system from 40GB hdd? plz advice.

lugoteehalt 10-13-2008 11:55 AM

Going back to your origional post. Surely all you had to do was change /boot/grub/menu.lst so that root is on the hd you want.

So if grub thinks that the 250G thing is hd0 as it apparently did then change menu.lst on this drive so that root is hd1,whateverPartition also change the message that it sends to the kernel on the end of the kernel line is it? to: hdb or sdb or whatever.

Looking at your last post. Grub's trying to boot from the 250G? Suggest you put a small /boot partion on this drive with /boot/grub/menu.lst. Then this is the file grub'll use presumably.
If it's trying to boot from 40G then this unnecessary.

In the menu.lst file that grub is using make root apply to 40G, hd0 or hd1 I can't work it out, and at the end of the ?kernel line put the /dev for the 40G.

Grub may well have a different idea of the first hard drive than does the opperating system.

linuxbee1 10-13-2008 01:40 PM

Thanks lugoteehalt!

below is my menu.1st file:

title Debian GNU/Linux, kernel 2.6.18-6-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-6-686 root=/dev/hdc1 ro
initrd /boot/initrd.img-2.6.18-6-686
savedefault

As u mentioned in your reply I will change in the kernel line as root=/dev/hdc1 ro to root=/dev/hdb1 ro (since the 40gb is shown as hdb and 250gb is shown as hdc).

How do i find out whether 40GB is (hd0,0) or (hd1,0) or ? for the second line in root (hd0,0)

louieb 10-13-2008 07:09 PM

Quote:

Originally Posted by linuxbee1 (Post 3308915)
How do i find out whether 40GB is (hd0,0) or (hd1,0) or ? for the second line in root (hd0,0)

That would depend on where it is plugged in.
But to find out:
When you get the GRUB menu press c to get the grub> prompt
then enter
Code:

find /boot/grub/stage1
That will tell you where grub is and that is what you want to use in the root statement.

BTW: I agree with smbell100 You should plug in both hard drives to ide0 the 40 gig as master and the 250 gig as slave.
And the CD drive should be by its self in ide1.

Detailed Grub guide here with lots of examples IDBS GRUB Page

lugoteehalt 10-14-2008 11:27 AM

Quote:

Originally Posted by linuxbee1 (Post 3308915)
Thanks lugoteehalt!

below is my menu.1st file:

title Debian GNU/Linux, kernel 2.6.18-6-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-6-686 root=/dev/hdc1 ro
initrd /boot/initrd.img-2.6.18-6-686
savedefault

As u mentioned in your reply I will change in the kernel line as root=/dev/hdc1 ro to root=/dev/hdb1 ro (since the 40gb is shown as hdb and 250gb is shown as hdc).

How do i find out whether 40GB is (hd0,0) or (hd1,0) or ? for the second line in root (hd0,0)

My guess is grub think 40 is hd0 and OS think 250 is 1st hd. In which case:

title Debian GNU/Linux, kernel 2.6.18-6-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-6-686 root=/dev/hdb1 ro
initrd /boot/initrd.img-2.6.18-6-686
savedefault

But simplest thing is just trial and error. Change hd0 and /dev/hdc1 (where c come from? If two hd should be hda and hdb) till it works. 'e' to edit line in grub file when grub puts up its splash screen; b to attempt to boot.

linuxbee1 10-14-2008 03:16 PM

Thanks a lot for your replies!

My set up:
primary IDE master - cdrom
Primary IDE slave - 40GB
secondary IDE master - 250GB

When i ran:
grub> find /boot/grub/stage1
I got hd(0,0)

During bootup using e, I edited the line root= /dev/hdb1 instead of /dev/hdc1

title Debian GNU/Linux, kernel 2.6.18-6-686
root (hd0,0)
kernel /boot/vmlinuz-2.6.18-6-686 root=/dev/hdb1 ro
initrd /boot/initrd.img-2.6.18-6-686
savedefault

I got something like this during bootup:

[/sbin/fsck.ext3(1)--/var] fsck.ext3 -a -C0 /dev/hdc6
fsck.ext3:no such file or directory while trying to open /dev/hdc6
The Superblock could not be read or does not describe a correct ext2 filesystem.......
and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
fsck died with exit status 8
file system check failed
Control-D will terminate this shell and resume system boot.


All times are GMT -5. The time now is 08:34 AM.