LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 02-04-2005, 01:34 PM   #1
Exasperated
LQ Newbie
 
Registered: Feb 2005
Posts: 16

Rep: Reputation: 0
Question Reinstalling GRUB on a copied partition


I used to have a dual boot PC with Linux on hdb and Xp on hda. Now I've moved the linux hard disc to another newer pc, but unfortunately this PC's BIOS will not pick up IDE hards discs. Windows reides on sda. I've given up on booting linux from hdb and instead I've copied the linux partitions onto sda and am using hdb as a storage disc. Now I want too dual boot linux and windows from sda. i'm using Fedora core 3.

I've repartitioned my SATA harddisc /dev/sda to contain the same partitions as my linux partitions on /dev/hdb.
/dev/sda1 is the XP ntfs partition
I've copied my /boot partition on /dev/hdb1 to /dev/sda2
I've copied my / partition on /dev/hdb2 to /dev/sda3
I copied them by logging onto the linux rescue disc and typed

# dd if=/dev/hdb1 of=/dev/sda2
# dd if=/dev/hdb2 of=/dev/sda3

OK this worked and the fedora disc even picks up /dev/sda2 as another fedora partition.
BUT.....

Firstly when I log onto the /dev/sda3 root partition,using the rescue disc, it will not mount its corressponding root partition (/dev/sda2).
Secondly, and most importantly, after I mount the boot parition and cd to /boot/grub, when I run

# grub-install /dev/sda
It gives an error
The file /boot/grub/stage2 not read correctly

This must have something to do with the fact that the files in /dev/sda2 and in /dev/sda3 must still be pointing to /dev/hdb1 and /dev/hdb2 I guess. Well hopefully someone here knows what I've done wrong, and how to fix it. Thanks in advance of course
 
Old 02-04-2005, 06:59 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Virginia, USA
Distribution: Debian 12
Posts: 8,352

Rep: Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552Reputation: 552
"Firstly when I log onto the /dev/sda3 root partition,using the rescue disc, it will not mount its corressponding root partition (/dev/sda2).
Secondly, and most importantly, after I mount the boot parition and cd to /boot/grub, when I run

# grub-install /dev/sda
It gives an error
The file /boot/grub/stage2 not read correctly"


Before you run grub-install you have to edit the grub configuration file to change all of the hard disc address in the configuration file. On SuSE the file is called /boot/grub/menu.lst. Other distributions give it a different name. If you don't know how to edit the grub config file here is the grub manual.

http://www.gnu.org/software/grub/manual/grub.html

---------------------------
Steve Stites
 
Old 02-05-2005, 04:31 PM   #3
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,213
Blog Entries: 6

Rep: Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862Reputation: 1862
http://www.rajeevnet.com/hacks_hints...s_cloning.html

Take a look at that
 
Old 02-05-2005, 05:02 PM   #4
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,236

Rep: Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150Reputation: 4150
Never been a fan of copying partitions with dd, but everyone else seems to use it.
For the grub issue, you need to be root.
If you want to install to /boot, you'll need
Code:
grub-install --root-directory=/boot /dev/sda
otherwise it'll go to root directory.
I'd probably be inclined to delete the entire grub directory, and re-install grub. But I don't know what is the accepted way of doing that on FC.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB not reinstalling jboo Linux - Software 5 10-02-2005 10:55 AM
Windows files copied to my linux partition are locked when logged in as a normal user necbrownie Slackware 8 10-15-2004 08:11 AM
WinXP can't read linux files copied to FAT32 partition gdh Linux - General 1 08-07-2004 10:31 AM
Reinstalling GRUB Petelow Linux - Newbie 1 05-24-2004 04:03 AM
I lost my NTFS partition by reinstalling GRUB yoonsangkyun Linux - General 4 01-22-2004 02:25 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:35 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