LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 08-05-2007, 07:31 PM   #1
pete_bogg
Member
 
Registered: Aug 2003
Location: Kentucky
Distribution: Ubuntu 9.10
Posts: 153

Rep: Reputation: 31
U7.04 - Uninstall Grub and Install Grub


I am thinking about moving a linux-only hard drive from PC-A to PC-B. Both PC-A and PC-B have existing hard drives with WindowsXP-only installed. What I see needing to make this happen is:

1) Remove grub from the MBR of PC-A's Windows-only hard drive so that it will automatically boot up into WindowsXP. I will then remove the linux-only hard drive.

2) Install the linux-only hard drive in the PC-B. Somehow, or another, install grub on the MBR of PC-B's Windows-only hard drive, so that it will give me the choice to either boot up in Ububtu, or WindowsXP.

If this is too hard, I may have to purchase a second linux-only hard drive for PC-B.

Any thoughts?
 
Old 08-06-2007, 12:26 PM   #2
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
What you are suggesting is perfectly reasonable. To restore the Windows MBR you will need the install CD.

When installing the Linux drive in the other computer, you need some way to boot into Linux so that you can install GRUB in the MBR of drive 1. The quickest way is to boot up with a Live CD.

You can also put GRUB on the MBR of the Linux drive before moving it. In PC-B, use the BIOS settings to boot into Linux, then install GRUB to the other drive from there. Keep in mind that if you get into Linux by changing drive order, then you would be installing GRUB to drive 2, but setting GRUB's "root" to the /boot partition on drive 1. When you re-boot and restore the boot order, GRUB is now on drive 1.

Keep in mind that--during installation--GRUB always has to be pointed to its "home base"--i.e. the partition containing /boot.

I'm sure you have everything backed-up, so I won't mention that.......

Last edited by pixellany; 08-06-2007 at 12:27 PM.
 
Old 08-07-2007, 09:52 PM   #3
pete_bogg
Member
 
Registered: Aug 2003
Location: Kentucky
Distribution: Ubuntu 9.10
Posts: 153

Original Poster
Rep: Reputation: 31
Well......

I ending up moving my Ubuntu-only hard drive from PC-1 to PC-2. I had no trouble repairing the MBR on PC-1 to make it boot into WindowsXP. (Install CD-ROM -> Repair -> 'fixmbr')

However, I still cannot get grub to work using the Ubuntu CD-ROM. According to my BIOS, the WindowsXP-only drive (ntfs) is 'hard drive 0' (primary master). My Ubuntu-only hard drive (reiserfs) is 'hard drive 4' (secondary slave). The Ubuntu CD-ROM sees the drives, and I can mount them.

Here is how my drives should be arranged:

hd0,0 18GB ntfs WindowsXP (C)
hd0,1 1500MB vfat (D)
hd1,0 500MB swap
hd1,1 9GB reiserfs /
hd1,2 9GB reiserfs /usr/local
hd1,3 60GB reiserfs /home

When I try to issue the grub command 'root (<tab>', it automagically inserts 'hd0'. Grub does not see any other hard drives. When I issue the grub command 'root (list', it gives an error.

Everything on my Ubuntu-only drive is still intact. I just need to insert the boot info in the WindowsXP-only hard drive MBR.

I tried to re-install Ubuntu, but the install screen resolution does not work with my 1440x900 monitor.

Any thoughts?
 
Old 08-08-2007, 05:24 PM   #4
pete_bogg
Member
 
Registered: Aug 2003
Location: Kentucky
Distribution: Ubuntu 9.10
Posts: 153

Original Poster
Rep: Reputation: 31
Never mind....

I was able to get grub installed on the MBR of the WindowsXP-only hard drive.

My drives are: /dev/sda and /dev/sdb.


I did the following from a liveCD terminal:
Code:
$ sudo -i
# mkdir /mnt/work
# mount /dev/sdb2 /mnt/work
# mount -o bind /dev /mnt/work/dev
# mount -o bind /proc /mount/work/proc
# cp /proc/mounts /mnt/work/etc/mtab
# chroot /mnt/work/ /bin/bash
# grub
grub> root (hd1,1)
grub> setup (hd0)
grub> quit
#
I don't know if the stuff at the beginning was needed, but at least I got grub working correctly.

Now if I can get X working correctly (different video card).
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM
Need to (re)install GRUB: fedora c4 rescue cd (and GRUB) unable to see the harddisk whencat Fedora 4 03-05-2006 02:01 PM
Grub 0.97 issues on slackware - grub-install is very slow, & updating menu.lst fails dieyouspammer Linux - Software 1 02-27-2006 01:06 PM
Need to uninstall grub and install in root superblock ganja_guru Linux - Software 2 06-26-2005 09:06 PM
how to uninstall lilo & install grub without using gui & linuxconf? prav_284 Red Hat 1 11-28-2003 05:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:15 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration