LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (https://www.linuxquestions.org/questions/ubuntu-63/)
-   -   Ubuntu and XP on 2 separate disk? (https://www.linuxquestions.org/questions/ubuntu-63/ubuntu-and-xp-on-2-separate-disk-568922/)

kage_wing 07-12-2007 10:04 PM

Ubuntu and XP on 2 separate disk?
 
Good day,

I'm a newbie at linux. I got an UBUNTU cd from a friend. I really liked the LIVE CD, so i decided to install ubuntu. I got an old Maxtor 40GB hard disk, formatted it using my XP (which was installed on a separate disk I currently using) NTFS then restarted my computer and installed ubuntu. I installed ubuntu on the second hard disk then choose manual (in the partitioning) It went ok, successfully installed ubuntu. I get into a boot loader (GRUB) everytime and there I can choose the OS, Ubuntu and XP.

The problem was, I want to use the second hard disk on another PC, I took out the second hard disk and inserted it on another PC. When I started it, I get a blank screen... no boot loader or whatsoever just plain blank.

I returned to my first pc turned it on and GRUB gives me and Error 21. I don't get this error when my second hard disk was in placed. I know I can repair this by fixing the MBR, but what about my second hard disk? how can I let it work on the second PC, will I have to reinstall Ubuntu again? or is there a way to fix the GRUB so that it can load it from there.

I really need your help from this...

and also, I need alternative ways on how to fix the MBR. I don't have XP installer cd and a floppy on my computer.

AceofSpades19 07-13-2007 12:58 AM

when you put the harddisk back in you messed up the grub numbers and lettering of the drives
you just need to determine the placement of the harddrives according to grub

kage_wing 07-13-2007 01:30 AM

i don't have problems when I insert the second drive. What I would like to know if how can I make Ubuntu work without the first drive. I mean, how will I let it work on another pc?

blackhole54 07-13-2007 01:31 AM

Quote:

Originally Posted by kage_wing
I returned to my first pc turned it on and GRUB gives me and Error 21. I don't get this error when my second hard disk was in placed.

The reason this happened, is the MBR contains the first stage of the bootloader only. The MBR is 512 bytes (including parition table!), which does not allow much code. So the first stage in the MBR calls the second stage of the boot loader, which is (was) on your second drive. The second drive also contained the menu info (/boot/grub/menu.lst)


Quote:

I know I can repair this by fixing the MBR, but what about my second hard disk? how can I let it work on the second PC, will I have to reinstall Ubuntu again? or is there a way to fix the GRUB so that it can load it from there.
If you really haven't done any customization or have an user files, the simplest thing might be just to reinstall. However, with probably minimal work you can probably get this working w/o reinstalling. You would need to install the bootloader (MBR), edit /boot/grub/menu.lst and possibly edit /etc/fstab. Editing fstab is not necessary if all the refernces to partitions are by UUIDs, which I believe is the case. I am not sure if I am forgetting something else you would need to edit :scratch:

I am assuming in what follows that this disk is the primary hard drive (/dev/hda or /dev/sda). With the hard drive in the system, boot the system from your Ubuntu live CD, and bring up a terminal.

Type the following (what you type is in bold):

Code:

user@box~$  sudo grub
grub>  root (hd0,0)
grub>  setup (hd0)
grub>  quit
user@box~$

That should install GRUB on your MBR.

To edit the configuration files, you need to first mount your installation partition, which I am assuming is /dev/sda1:

Code:

sudo mkdir /mtn/sda1
sudo mount /dev/sda1 /mnt/sda1

You now have access to all of the files on your Ubuntu installation. All paths must have /mnt/sda1 prefixed to them. For example /boot/grub/menu.lst will now be accessed as /mnt/sda1/boot/grub/menu.lst.

You need to edit menu.lst. Type sudo followed by the name of your favorite editor followed by /mnt/sda1/grub/menu.lst and change the line that currently reads

groot=(hd1,0)

to

groot=(hd0,0)

Save your edit, exit the editor and type:

Code:

sudo chroot /mnt/sda1 update-grub
Unless I have forgotten something :-/ , you should now be able to boot into your Ubuntu instalation.


Quote:

I need alternative ways on how to fix the MBR. I don't have XP installer cd and a floppy on my computer.
There is a Linux program called install-mbr (I have not used it) that is supposed to be able to handle this. In Ubuntu, this is in the mbr package which you can install:

Code:

sudo apt-get install mbr
It also exists on the KNOPPIX live CD if you want to get a copy, or you might check to see if it exists on the Ubuntu live CD. Read its man page for instructions.

EDIT: You will probably also want to remove the lines from menu.lst which refer to the XP installation. But you can wait until you are able to boot into your regular Ubuntu installtion, if you wish.

kage_wing 07-13-2007 04:21 AM

I borrowed an xp cd from a friend so I can use its recovery console.

I read a suggestion to do fixboot on a disk with an MBR directing to UBUNTU, WILL IT affect GRUB from the second disk?

What problems may arrise if I use fixboot? fixmbr?

IS IT possible to re-install or overwrite ubuntu from my second disk from another pc by using LIVE CD?

thanks I really appreciate your help.

blackhole54 07-13-2007 06:13 AM

Quote:

Originally Posted by kage_wing
I borrowed an xp cd from a friend so I can use its recovery console.

I read a suggestion to do fixboot on a disk with an MBR directing to UBUNTU, WILL IT affect GRUB from the second disk?

What problems may arrise if I use fixboot? fixmbr?

I believe the recovery console you speak of is a Microsoft product. Are fixboot and fixmbr also Microsoft? I've never known much about Micrososft products past Win95, and I am rapidly forgetting what I used to know about that. :)

Quote:

IS IT possible to re-install or overwrite ubuntu from my second disk from another pc by using LIVE CD?
I am not sure what you are asking here. There is certainly no problem installing something over the Ubuntu installation you have already done. If you are (re)installing Ubuntu and wish to use the whole disk for it, I think you just tell it to use the whole disk. If necessary you can always go to a custom paritioning scheme. Be aware, however, I have never installed Ubuntu on a system with more than one hard drive, so I am not totally sure what options you would be presented with. Does that answer your question?

syg00 07-13-2007 07:00 AM

First things first - fix the XP machine so it runs with only one hard disk installed.
Boot the CP CD, and get into recovery console. Run fixmbr, then take the CD out and reboot.
XP should boot o.k. (but not Ubuntu).

If you have to build Ubuntu on that machine, I'd suggest you change the BIOS boot disk to be the second disk, and re-install Ubuntu completely.
Reboot to ensure it (Ubuntu) boots properly, then take the second disk out, change the BIOS boot disk back to the first disk, and check XP boots as expected.

Install (second) disk in other machine.

Simple, and no clean-up of config files needed.

kage_wing 07-13-2007 01:20 PM

Thank you very much for the help. I really appreciated it.

I solve the problem with my first disk, I inserted the XP CD, Run Recovery Console, run fixmbr. I finally got to boot windows.

One thing I noticed, when the two Disk were inserted, I inserted the XP CD, Run Recovery Console and typed fixboot. It didn't affect anything. I was afraid to use fixmbr because it gave me a warning that some partitions will be lost. So XP means the UBUNTU partitions.

Another problem arised, I deleted UBUNTU's partition using disk management from windows xp. Transfered the disk to the computer where I want it to run.

It's spec are:

Intel Celeron 1.7Ghz (S478)
Asus P4 Mobo (S478) (i forgot the model)
2x 128mb ram
80 GB Maxtor Harddisk (the second disk which I previously had Ubuntu on now formatted as NTFS by windows)
A DVD-ROM.

It was really slow, I had to click the install icon 3x before the installation window appears.

On the 4th Level of installation, I get to choose where to install ubuntu(by the way my second disk has 4 partitions)

I tried to use 1st partition to mount the "/" root and the second one was the swap.

Then suddenly when the partition manager loads up, and detects my file systems my pc justs freezes (no BOSD).

My question, does ubuntu run on Celeron?
or does it need more memory for me to install it?

I really want to try ubuntu (I'm a newbie at linux), as of now I installed a fresh xp on my PC because my lil bro will use it for his study.

Hope you could give me an idea about this. Thanks

AceofSpades19 07-13-2007 02:22 PM

Quote:

Originally Posted by kage_wing
Thank you very much for the help. I really appreciated it.

I solve the problem with my first disk, I inserted the XP CD, Run Recovery Console, run fixmbr. I finally got to boot windows.

One thing I noticed, when the two Disk were inserted, I inserted the XP CD, Run Recovery Console and typed fixboot. It didn't affect anything. I was afraid to use fixmbr because it gave me a warning that some partitions will be lost. So XP means the UBUNTU partitions.

Another problem arised, I deleted UBUNTU's partition using disk management from windows xp. Transfered the disk to the computer where I want it to run.

It's spec are:

Intel Celeron 1.7Ghz (S478)
Asus P4 Mobo (S478) (i forgot the model)
2x 128mb ram
80 GB Maxtor Harddisk (the second disk which I previously had Ubuntu on now formatted as NTFS by windows)
A DVD-ROM.

It was really slow, I had to click the install icon 3x before the installation window appears.

On the 4th Level of installation, I get to choose where to install ubuntu(by the way my second disk has 4 partitions)

I tried to use 1st partition to mount the "/" root and the second one was the swap.

Then suddenly when the partition manager loads up, and detects my file systems my pc justs freezes (no BOSD).

My question, does ubuntu run on Celeron?
or does it need more memory for me to install it?

I really want to try ubuntu (I'm a newbie at linux), as of now I installed a fresh xp on my PC because my lil bro will use it for his study.

Hope you could give me an idea about this. Thanks

First of all Linux does not BSOD only windows does
My computer which I installed ubuntu from the livecd was a p3 @ 600 mhz and 256 mb of ram so I would imagine that you oculd install it from the livecd or you could try the alternate install cd

syg00 07-13-2007 06:33 PM

Those hardware specs should be fine.
Boot the liveCD again, but don't try the install this time. From a terminal window (Applications -> Accessories -> Terminal) enter the following commands,and post all the output here
Code:

free -m
sudo fdisk -l

Edit: corrected the "free" command.


All times are GMT -5. The time now is 08:39 PM.