Adding Linux Drive To Existing Machine?


Recommended Posts

It sounds like you installed ubuntu on a different computer. So now you wnat to add that harddrive that already has ubuntu installed to you xp computer.

Can I make the Ubuntu drive be the primary drive, and point it to the XP load as an additional OS?

does it actually need to be the primary drive, or do you just want ubuntu to boot by default, but have the option of booting XP.

Is my understanding above correct, if so i can give you some instuctions :-)

Link to post
Share on other sites
It sounds like you installed ubuntu on a different computer. So now you wnat to add that harddrive that already has ubuntu installed to you xp computer.
Can I make the Ubuntu drive be the primary drive, and point it to the XP load as an additional OS?

does it actually need to be the primary drive, or do you just want ubuntu to boot by default, but have the option of booting XP.

Is my understanding above correct, if so i can give you some instuctions :-)

<{POST_SNAPBACK}>

I built 2 identical machines, and one got Hijacked by my wife :). Now I have to merge these 2 machines for my own use. I really don't want to modify the XP load at all. I was hoping I could use the Ubuntu's bootloader to load XP on demand. Can it be done that way, or am I forced to load it into the master bootrecord on the primary drive?

BH

Link to post
Share on other sites

sure, you can do this. You can leave XP on the primary(first ide device) and ubuntu on your master(second ide device). You will have to reinstall grub on the mbr of your master(the one with xp).

I will have some instructions later, have to run an errand.

Link to post
Share on other sites

Are you sure all hardware is the samne, if it is this should be fairly simple. Install the Ubuntu drive as slave (or secondary master), leave Windows as primary. All you really need to do is install grub on mbr of windows drive and edit menu.lst and fstab. When both drives are in boot a live cd like knoppix and mount the linux drive

mkdir /mnt/hdb        
mount /dev/hdb1 /mnt/hdb  

(if your drives are SATA it may be sdb instead of hdb)

then chroot into the linux drive

chroot /mnt/hdb /bin/bash

then run grub and run these commands in grub shell

grub> root (hd1,0)          
grub> setup (hd0)          
grub> quit  

Then you need to edit /boot/grub/menu.lst and scroll down to the end of the default section and change the lines

root(hd0,0)

to

root(hd1,0)

and change

kernel  /boot/vmlinuz-2.6.10-5-386 root=/dev/hda1 ro

to

kernel  /boot/vmlinuz-2.6.10-5-386 root=/dev/hdb1 ro

if you have a seperate boot partition then this would be hdb3. Add at the end of the file

title  Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title  Microsoft Windows XP Home Edition
root  (hd0,0)
savedefault
makeactive
chainloader +1

so you can have windows as a boot choice.

Now your /etc/fstab, just change hda* to hdb keeping everythin else the same. Unless I missed something you should be ready to reboot. Hope this works for you.

Edited by naraku9333
Link to post
Share on other sites

A very nice explanation :-)

I noticed this part, that does not seem right

mkdir /mnt/hdb        
mount /dev/hdb /mnt/hdb  

you just have the generic listing of the drive, you need to specify a paritiion, assuming ubuntu is installed in the first partition, it would be like this

mkdir /mnt/hdb        
mount /dev/hdb1 /mnt/hdb

Link to post
Share on other sites
Thanks all, I will try this a little later today.

  It seems I don't have a choice, I have to put Windows on the first drive.

  Regards,

      BH

<{POST_SNAPBACK}>

you could probably but windows on the slave spot also, it may even be easier. I would have suggested doing it the same way naraku9333 did it. I mainly based this desision on old habits of windows xp needing to boot from the master.

You may get lucking placing ubunu on the master, xp on the slave, then just editing your /etc/fstab to point to xp. Then just add this to the bottom of your menu.lst file

title  Microsoft Windows XP Home Edition
root  (hd1,0)
savedefault
makeactive
chainloader +1

if this does not work, the way naraku9333 posted will work for sure :-)

Edited by shanenin
Link to post
Share on other sites

title           Windows 95/98/Me
root            (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
savedefault
makeactive
chainloader     +1

The two map lines swap the primary master and slave from the perspecive of the chainloaded OS. I don't know if it works with less primitive OSes like WinNT or GNU/Linux, never had cause to try. This may or may not prove useful to you.

Edited by Hai-Etlik
Link to post
Share on other sites

The machine is working now, primarily due to the help you guys gave me (thanks).

I do have a 'lesson learned':

1) IDE Raid cards have the option of hyjacking the primary IDE channels.

My raid card remapped the drives by default, and it confused me. The bootloader ended up on IDE5 (The XP Drive). I finally had to disconnect the raid card to get it to load properly. I will be digging into my RAID card soon to figure out how to turn off the remap.

Ubuntu works great, it recognized everything and it all works. I haven't gotten the network printer to work, but that isn't related to Linux. It didn't work under XP either.

Thanks again all for the help. You have sparked my interest in doing a self study so I can better understand the bootloader.

BH

Link to post
Share on other sites
so did you leave xp on the primary or slave drive, I think you had the option to do it either way, just curious?

so are one of your drives sata, or both of them ide?

<{POST_SNAPBACK}>

I had to put the bootloader into the MBR on the primary drive (master), with the XP load. Ubuntu is on another channel. (no slaves in my setup) Everything I see tells me XP MUST be on the first IDE drive. What is strange is how the RAID card remaps the drive during setup, and then boots from the XP drive designated IDE5. That question is going to grate on me until I figure it out, hopefully I will have time to work on it this week.

BH

Edited by Brian_Holiday
Link to post
Share on other sites
so did you leave xp on the primary or slave drive, I think you had the option to do it either way, just curious?

so are one of your drives sata, or both of them ide?

<{POST_SNAPBACK}>

I had to put the bootloader into the MBR on the primary drive (master), with the XP load. Ubuntu is on another channel. (no slaves in my setup) Everything I see tells me XP MUST be on the first IDE drive. What is strange is how the RAID card remaps the drive during setup, and then boots from the XP drive designated IDE5. That question is going to grate on me until I figure it out, hopefully I will have time to work on it this week.

BH

<{POST_SNAPBACK}>

xp must be on the primary partition not the primary drive. you can have 4 primary partitions on a single drive.

this page may seem old but the information is all good.

http://multiboot.solaris-x86.org/

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...