How can I choose which hard disk to boot from?

Asked by LEGOManiac

I am admittedly a noobie so the question might be a bit misleading. I'll try to clarify...

My requirement:
- Leave Windows Vista as untouched as possible on it's original drive in it's original bay.
- Optionally boot Ubuntu 8.10 from a second hard disk in the second bay
- Preferrably do this from either a bootable USB flash memory or a bootable CD

My problem:
- I have an HP dv9000 series laptop with a retarded BIOS
- The laptop has two hard disk bays. I can boot from each one if only one drive is in place but only from the second bay if the first bay is empty
- The BIOS does not allow me to have any control over the hard disks. That is to say; I can't disable the first drive from the BIOS
- The BIOS Boot Menu only allows you to select "hard disk" as an option but not which one. I don't get the option of booting from the second hard disk. USB and CD boot is available.

What I've done so far:

I've purchased a 250GB hard disk for Ubuntu to live on and installed it and tested it from both drive bays. It boots OK in either location.

I returned the original Vista disk to it's original bay and discovered that I can't choose between them.

I tried booting from the Ubuntu CD, hoping I'd get a chance to choose the disk I boot from but I can only select "first hard disk" which leads to Vista. If there's some optional way of getting this disk to boot the other hard drive, it would be the solution that requires the least amount of work (presumably)

QUESTION 1: Can I boot from the second hard disk using the Ubuntu Desktop CD?

I have purchased a 2GB micro-SD card and a USB dongle to connect it with. My thought was that I could install Grub to it and thereby boot Ubuntu when this dongle is plugged in. This would be my preferred route since it's very small (fits on my key chain) and wouldn't leave the Vista drive completely untouched.

QUESTION 2: How do I put GRUB on a micro-SD card in a USB port? Since I'd have to boot without the Vista disk present, would this not screw-up the drive assignments? When I re-install the Vista disk, will it still boot Ubuntu properly?

I had thought to try to figure out how to install Grub on the micro-SD card when booting from the live-CD but then I realized that it would probably point to the Kernel on the CD and not on the hard disk. I don't know how to deal with that but at least if it could be done, both hard disks would be present and drive assignments would then be correct.

QUESTION 3: Is it possible to do this with both hard disks present and Ubunto run from the Desktop CD, or am I barking up the wrong tree?

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu grub Edit question
Assignee:
No assignee Edit question
Solved by:
Joker Wild
Solved:
Last query:
Last reply:
Revision history for this message
nhasian (nhasian) said :
#1

hey you have the same HP laptop I do :) its great! i also have two 7200 rpm hard disk and my lap gets pretty hot

answer 1: leave the bios alone, just boot from the Ubuntu Desktop CD and install Ubuntu to your 2nd hard disk. It will still boot the grub bootloader on the first hard disk but thats okay, windows wont mind :)

answer 2: i dont understand why you want to take out a hard disk? you can leave them both in your system. during bootup you can choose wether to use Vista or Ubuntu in the grub menu.

answer 3: i think its the same answer as answer 2

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#2

Thanks for the help. There were a couple of points in my original question that perhaps weren't clear.

1) Ubuntu is already installed on the second hard disk. I suppose I could just install it again and do all the updates and customizations over but I was hoping I could avoid it. I had not realized when I bought the hard disk for it that the laptop used a special 90 degree SATA connector so for a few weeks I ran with only the Ubuntu disk in place until an adapter arrived by mail. Hence, the system is already set up and I'd rather not do a re-install if at all possible.

2) I would very much like to not touch the Vista installation at all until the warranty is up on the laptop. You know how tech support is. If something goes wrong, they point the blame at an "non HP" changes I made to the system, hence my intention was to install Ubuntu to a completely separate hard disk and boot from a removable device and literally not touch the original Vista disk. Yes, I could always re-install Vista if I had to send it in but then I'd have to back up all my Windows data (which I probably should do anyway, granted). Besides, if I have to re-install the Vista image for any reason, I'll be back to my current problem of a Vista installation on one drive and an Ubuntu installation on the other and no way to boot the second drive. At that point, which could be months down the road, I seriously won't want to have to re-install Ubuntu just to have Grub point to the second hard disk.

So, in answer to question 1, are you saying that there is no way to boot the second hard disk from the Ubuntu installation CD?

Question 2 was really about how to install Grub to a removable disk from the Ubuntu Desktop CD, and if that's even possible.

I think you're right, though, about question 3. Now that I re-read it it does seem to be repetitive, although it really repeats question 1. I'm sure I meant something else but I can't recall what it was.

Revision history for this message
juancarlospaco (juancarlospaco) said :
#3

Optional: You can install Ubuntu 8.10 on a USB Pendrive if you like, leaving Window Vista Untouched,
very easy to follow process, its on System--->Administration--->create USB startup Disk

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#4

Thanks, but it's not what I was asking about. All I want is Grub installed to the MicroSD card in the USB port. Your suggestion installs the entire OS on the USB drive - all 730MB of it. I'd seen that option before and tried it but aborted when I realized what it was trying to do.

Revision history for this message
Best Joker Wild (lajjr-deactivatedaccount) said :
#5

Ok easy one insert the ubuntu boot disk, boot from it.....
make sure both driver are in....

click install to hd goto advanced choose install mbr grub etc.

click ok. by pass the install leave everything else alone make sure the boot drive for windows in the boot disk if you wanted
to follow to the end install all it will install is grub..

or open a terminal and type this <-- easiest way..

    sudo grub

    > root (hd0,0)

    > setup (hd0)

    > exit
reboot

Revision history for this message
Joker Wild (lajjr-deactivatedaccount) said :
#6

opps change it to

in a live cd session open a terminal type
sudo grub

>root (hd0,1)
>setup (hd0)
>exit

two drives..

Revision history for this message
Joker Wild (lajjr-deactivatedaccount) said :
#7

quit to end grub

also you might want to change the boot info....

type gksu gedit /boot/grub/menu.lst

in it for windows stanza

 title Windows XP/Vista # You can use any title you wish, this will appear on your grub boot menu
 rootnoverify (hd0,0) #(hd0,0) will be most common, you may need to adjust accordingly
 makeactive
 chainloader +1

in parentheses change to the drive windows is on if it didn't name it right.

Revision history for this message
Tom (tom6) said :
#8

https://help.ubuntu.com/community/WindowsDualBoot

probably too late to be helpful and i've not fully read this thread, sorry!

Regards and good luck from
Tom :)

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#9

I appreciate everyone's help, I really do, but no one seems to be reading the actual problem.

Yes, I have a Vista disk, but PRETEND IT'S 110% FULL. I don't want to use it.

My two questions were:

1) Can I use the Ubunto live session disk to boot the second hard disk. When you boot a live CD session, you get the options to enter command line parameters. Is there a way to add parameters that would force it to boot from the second hard disk and not the first? I can't see any way of doing it, so there probably isn't.

2) Given that 1 is probably not possible, my O N L Y other request is to be able to boot from a microSD card in one of the USB ports. Every single person who answered, except juancarlospaco has me putting Grub on the first hard disk. This is expressly what I am trying to avoid. How do I get it on to the microSD card in the USB port?

I tried juancarlospaco's idea of creating a USB startup disk, which puts the OS on the USB device, even though I only wanted Grub. I couldn't find another way to do it so I tried it anyway but the "create a USB startup disk" application crashes every time I run it. As an added complication, I've discovered that the network drivers on the laptop don't work so I can't simply try and update the application.

I've been doing some research on how to install Grub manually and I think I've got the jist of it.

My biggest problem is trying to figure out what device the memory card is being called. The "create a USB startup disk" application says it's /dev/sdc, so I'm assuming the device would be (sdc,0) but Grub says the device doesn't exist. Looking at /etc/fstab doesn't show anything I'd recognize. In fact, there are only two devices shown and, given that I have three (2 hard disks and a USB drive, all of which I can access) I would have expected to see three, not two.

I'd still appreciate some help in putting Grub on the USB device.

Revision history for this message
Joker Wild (lajjr-deactivatedaccount) said :
#10

ok you can make usb SD card boot...but my saying install grub allows boot drivers to be on the system.....Is what you asked yes no ??

quoting from you..
" I've purchased a 250GB hard disk for Ubuntu to live on and installed it and tested it from both drive bays. It boots OK in either location.

I returned the original Vista disk to it's original bay and discovered that I can't choose between them."

I was givin you the option to boot and select either one..

I see two disks in turn you can install both use grub lilo or boot magic to have it use both why go usb if you have a purchased drive 250 gig drive for Ubuntu and one for vista original..??

Revision history for this message
Joker Wild (lajjr-deactivatedaccount) said :
#11

just one little thing if this is correct your quote

"I would very much like to not touch the Vista installation at all until the warranty is up on the laptop. You know how tech support is. If something goes wrong, they point the blame at an "non HP" changes I made to the system, hence my intention was to install Ubuntu to a completely separate hard disk and boot from a removable device and literally not touch the original Vista disk. Yes, I could always re-install Vista if I had to send it in but then I'd have to back up all my Windows data (which I probably should do anyway, granted). Besides, if I have to re-install the Vista image for any reason, I'll be back to my current problem of a Vista installation on one drive and an Ubuntu installation on the other and no way to boot the second drive. At that point, which could be months down the road, I seriously won't want to have to re-install Ubuntu just to have Grub point to the second hard disk."

As soon as you opened the computer up and disconnected the drive you voided your warranty...

Revision history for this message
Joker Wild (lajjr-deactivatedaccount) said :
#12

a usb dongle with the multimedia slot install SD card in to it

System--->Administration--->create USB startup Disk and let it go...

ro you can copy the live disk over make bootable.

Revision history for this message
Tom (tom6) said :
#13

It's all very confusing and we're all being a little unclear. Grub is a great multi-boot boot-loader, Lilo was/is too and they both make the Windows ones look a tad pathetic. Windows is built on the assumption that it will be the only OS on the system. Linux is built on the assumption that it might well not be alone.

The only thing you'd need to do to the Vista disc is change it's MBR, this is done by the installer when you tell it which disc to write it's mbr to. It's not an addition to the Vista disc it's a replacement of what's there already. The job of the new mbr would be to look for the new boot-loader on the slave-drive (the Ubuntu one) rather than on the Vista drive.

All the Grub files would be on the Ubuntu disc.

There would have to be a line in the Grub menu that would refer control back to the Vista disc to boot into Vista when the user had chosen to boot into Vista rather than Ubuntu (hopefully this would never happen)

In your setup the bios would hand control to the mbr which then hands it swiftly on to the second drive. I've a feeling this is a simplification for my brains sake.

If you want to test it out using a tiny distro such as Wolvix that might clarify the issue.
http://distrowatch.com/table.php?distribution=wolvix
Wolvix is particularly good at installing and setting up a dual-boot system. It's practically a tutorial on how to do it and teaches you a lot while making it easier than any other distro i've tried. Also it's quite quick and tends to get all the questions out of the way at the beginning so you don't have to hover over it. Added to that is that i've managed to install it to all kinds of weird setups, even ones that nothing else seemed able to cope with. Your current system would be childs play for it i'm sure.

After that replace it with Ubuntu :)

Revision history for this message
Tom (tom6) said :
#14

Hmmm, there are a few things going on here.

Each drive has its own MBR. On each of the drives you have it's MBR is telling it to look only on it's own drive for a boot-loader. Each boot-loader has only been told about the OS on it's own disc. What is needed is for one of the discs boot-loaders to be made aware of the OS on the other disc. Also the MBR on the Master Drive needs to point to that boot-loader.

The new 250Gb drive has a bootable OS on it but only when it's setup as the Master Drive.
The old drive has a bootable OS (Vista) on it but only when it's setup as the Master Drive.

To make a drive into a Slave Drive you'll probably have to set the jumpers at the back of the drive to the settings shown on a large sticker on the drive itself or markings near the jumper-pins "MA", "SL", "CA" - CAble select doesn't usually work, nice idea but didn't work. To do all this you'll need to have the drive out of the machine and then plug it back into the machine in the slave slot. If the other disc is out of the case then the machine will hopefully refuse to boot (except by cd or something). Amazing the power those pins have.

In order to leave your Vista disk completely untouched i recommend that this is the one you make Slave. This way even it's MBR remains untouched and ignored. Make the 250Gb one the Master simply now by plugging it in to the main slot. As the boot-loader still hasn't been told about the other OS you can temporarily only get 1 OS to boot from these drives. No change.

Now putting the Ubuntu Cd into the tray and booting up into it will allow 3 main different possiblities
1. Install Grub on its own on the 250Gb drive and modify the MBR and make it's menu include both OS's
2. Install Ubuntu as a dual-boot on the 250Gb drive and let Grub modify the MBR and put Grub in the same partition as Ubuntu. Grub will then see both OS's on the 250Gb drive and also Vista
3. Install Ubuntu on the 250Gb drive wiping out everythng on the drive. Let Grub modify 'the' MBR (as in 2 the mbr on the Vista drive is effectively invisible), put Grub on the Ubuntu partition. Grub will now only see 2 oS's - Ubuntu and Vista, either of which can be set as the default to boot into.

Another thing to watch out for is that putting all the Grub files on a Usb stick will prevent you accessing either OS unless you happen to have the stick handy. Although it's a recoverable situation it would require a struggle. However, following my advice would mean that you could always just unplug the two drives, set the Vistas jumper back to MAster and boot back into it. I still recommend keeping the Grub loader on the same partition as Ubuntu as then even if the Vista disk is gone at least you can boot into Ubuntu. Usb sticks have a tendency to break or to go missing at crucial moments. But they are incredibly useful for transfering data.

Another thing i skipped over is that "dual-boot" is beginning to be replaced by "multi-boot" as its quite easy to add in another couple of OS's when you have enough drive-space but more than 2 is a bit more than required for almost anyone, perhaps someone that compares OS's often.

Anyway, good luck
Regards from
Tom :)

Revision history for this message
Tom (tom6) said :
#15

At last i've got a simple answer.

1. Plug in the Vista drive as SLave (probably it's just enough to put it in the secondary slot)
2. Plug in Ubuntu drive as MAster (ie normally & into the main slot)
3. Modify the Grub menu so that it gives a choice between Vista & Ubuntu

Job done.

No need for usb stick or reinstalling or anything :)
.
.
You can do step 3 most easily from within Ubuntu so just boot into Ubuntu as normal. Go up to the Applications menu on the top taskbar usually. Go to Accessories and select "Terminal". Into the terminal console type

sudo gedit /boot/grub/menu.lst

It should ask for your normal user pasword, not the SuperUser/Root one. In this text-editor go up to "File" and "Save As ..." change the filename to menu.020209 so that if it all goes wrong then at least we can get back to this point. Now "Save As ..." again make it menu.lst ;) Now roll through right to the end of the file and paste in this chunk of text

# This entry added by LEGOManiac for a non-linux OS on /dev/sda2
title Vista
root (hd1,0)
savedefault
chainloader +1

That's it. Now just save and reboot :)
Many regard from
Tom

PS ignore all my other posts prior to this one
PPS you can change anything in a line that has # at the start. The # 'comments out' the line so its ignored
PPPS you can also change anything in the line that has "title" at the start, these are the lines you'll see in the menu when it asks which OS to boot into. Recovery Mode is an important option to keep so don't comment it out ;)

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#16

Leo: a big thank-you

Your suggestion helped:
>click install to hd goto advanced choose install mbr grub etc.
>
>click ok. by pass the install leave everything else alone make sure the boot drive for windows in the boot disk if you wanted
>to follow to the end install all it will install is grub..
>
>or open a terminal and type this <-- easiest way..
>
> sudo grub
>
> > root (hd0,0)
>
> > setup (hd0)
>
> > exit
>reboot

This was basically what I'm trying to do, except I want Grub to setup (sdc) which Grub keeps saying doesn't exist.

I haven't been brave enough to try to re-install to the laptop but, in desparation, I did drag out another PC and tried your suggestion of having the installation program write Grub to a USB device that way. I doubted it would work since the Ubuntu partition is (hd1,0) on the laptop and (hd0,0) on the spare PC, but, after a slew of error messages, the USB device was able to boot the laptop into Ubuntu. Curiously, I did not get those error messages on the second attempt. I can now do what my end-objective was to do: insert the USB memory to boot to Ubuntu, leave the USB memory out to boot to Vista and not touch a single byte on the Vista hard disk.

Unfortunately the USB memory I used was not the one on my key chain as I was afraid of forgetting my keys behind a little-used computer [:-)] so I'd still like to know how to install Grub directly to the USB device from within Ubuntu but at least I've got a system that works more-or-less the way I want it to.

If anyone can fill me in on how to tell grub to use the USB device, I'd be grateful.

Tom: You gave me one of those Doh! moments. Yes, in hindsight, I could have just put Vista in the second drive bay and installed Ubuntu to the first one without touching anything on the Vista drive.
Oh well, it's basically done now.

I still need to know how to write Grub to a USB device, though.

Revision history for this message
Tom (tom6) said :
#17

I don't think you have done anything to prevent being able to implement my idea which might be better in the longer run too. However you're just asking to change the MBR to point at sdc and to put a Grub boot-loader on /boot/grub on there.

If someone shows how to change the MBR make sure it's on the Ubuntu disc rather than the Vista one!! Although it's quite easy to 'repair' the Vista mbr from inside Vista. - but if you were having to return it under warentee then presumably the problem would be that Vista had become stroppy.

I think i found a way to change the drive the 2nd stage looks at but not the mbr, so not much use - sorry. Perhaps the grub people could help? and i found a post that might help but you'd have to logical though it - remember grub starts counting at 0 (like a good machine would) so sdc1 would be (hd2,0)
http://www.gnu.org/software/grub/
http://ubuntuforums.org/showpost.php?s=13d1bee1f57d4a05a372380e2de33563&p=117829&postcount=2
Personnaly i would approach this usb thing by just installing a tiny distro on the stick/card and let it worry about sorting all the grub stuff out. I find Wolvix is the easiest & fastest to install but Puppy is prettier to use even though it's grub install is very confusing. Here's my fav 3 but DistroWatch may be worth exploring ...
http://distrowatch.com/table.php?distribution=wolvix
http://distrowatch.com/table.php?distribution=slitaz
http://linux.softpedia.com/get/System/Operating-Systems/Linux-Distributions/Puppy-Linux-1996.shtml

Good luck with this and happy hunting :)
Regards from
Tom :)

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#18

Tom:
When you suggested installing a mini-linux distro in order to get Grub installed I had visualized installing it to the Ubuntu hard disk. I hadn't thought of installing it to the USB device. Good point. However, I haven't given all the details. The USB device that I carry around on my keychain is there for a reason. I use it to transfer other files and I really need it to be as close to 2GB as possible. I can't use a larger one (4GB) because the device it is primarily intended for (a surveilence camera) won't take a card over 2GB and video sucks up space fairly quickly so I'm trying to keep the installation on the USB device to a minimum.

At any rate, it's working now the way I wanted it: Grub is now installed on the keychain; I haven't touched my Vista disk; Ubuntu boots properly on the laptop (with the keychain plugged in) so there's no real need to fiddle any further.

As an interesting related note, KGRUBEditor (under applications->system tools) sees the USB device but throws an error if I try to install Grub to it.

I'm going to close this thread and open a new one specific to installing Grub to a USB device.

Thanks to everyone for their help.

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#19

Thanks Leo Albert Jackson Jr, that solved my question.

Revision history for this message
Tom (tom6) said :
#20

You're welcome. Glad we got an answer that worked out of all that :)

Regards from
Tom