Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Help! Windows Re-ordered My Partitions!
shaggy999
post Feb 11 2004, 01:37 AM
Post #1


Grub-er
**

Group: Members
Posts: 27
Joined: 18-January 04
Member No.: 2,170



I had Windows and Red Hat Linux set to dual boot just fine. But I had some extra space that I created a FAT32 partition on in Windows so that I could share files between the OSs. But after I added them the partitions have gotten switched around! What I mean is, they're still there, but now my /boot partition, which used to be /dev/hda2 is now /dev/hda1! And my Windows boot drive went from /dev/hda1 to /dev/hda2. I think my other partitions got changed around too. What do I do? sad.gif

I can mount the file systems just fine when I boot off the linux CD and go into rescue mode, but I can't figure out how to fix this sad.gif
Go to the top of the page
 
+Quote Post
shaggy999
post Feb 11 2004, 01:58 AM
Post #2


Grub-er
**

Group: Members
Posts: 27
Joined: 18-January 04
Member No.: 2,170



A little more info... it also screwed up XP because XP was set to boot off of partition(1) and it was now located on partition(2). I was able to change the boot.ini file on the drive to refer to partition(2) now and so I now have XP back. So now I just need to figure out how to tell Linux where all my partitions are again. blink.gif

Can anybody help me with that?
Go to the top of the page
 
+Quote Post
hughesjr
post Feb 11 2004, 02:00 AM
Post #3


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



OK .... first you need to figure out which partitions are which ....

Boot off the rescue disk:

linux resuce

then exit to the console prompt ... create a mount point:

mkdir /mnt/rh

Figure out what partition is where use the command:

fdisk -l /dev/hda

You need to know what partition is root, and boot, and swap, and windows boot.

Then mount the / (that is the root) partiton into /mnt/rh (i'll assume boot is hda1, windows boot is hda2, swap is hda3 and root is hda5 ... change the instructions below based on what you actually find....)

mount /dev/hda5 /mnt/rh

now mount your boot partiton into the linux root partition ...

mount /dev/hda1 /mnt/rh/boot

if everything is mounted, chroot into the linux install so we can fix grub...

chroot /mnt/rh /bin/bash

now go to /boot/grub

cd /boot/grub

and edit menu.lst

vi menu.lst (or another console text editor of you choice)

change all the drives to the correct values in menu.lst ... for grub purposes ... hda1 is (hd0,0), hda2 is (hd0,1), hda3 is (hd0,2), hdb1 is (hd1,0), hdb2 is (hd1,1), etc.

Once that is set properly, run grub and reset everything up...

grub

now you are at the grub prompt ....

root (hd0,0)
(note: this is if your boot partiton is hda1)

setup (hd0)
(this would be to set the MBR to boot from grub)

quit

If all the paths are correct in /boot/grub/menu.lst and the grub commands completed without error, you should be able to exit the the chroot and reboot the PC...


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post
shaggy999
post Feb 11 2004, 02:27 AM
Post #4


Grub-er
**

Group: Members
Posts: 27
Joined: 18-January 04
Member No.: 2,170



Thanks for the help! I'm going to try this now. However, I don't want to install GRUB into the MBR. The way I set it up before is I installed it into the first sector of the /boot partition and then used dd to dump the first sector of the HD to a floppy disk. Then booted into windows, but the binary file on my C: drive and added C:linux.bin="Linux" to my list of OS's. So I'm assuming instead of setup(hd0) I do setup(hd0,0)?
Go to the top of the page
 
+Quote Post
shaggy999
post Feb 11 2004, 02:34 AM
Post #5


Grub-er
**

Group: Members
Posts: 27
Joined: 18-January 04
Member No.: 2,170



Well, everything has worked so far, except for setup. I don't want to put it into the MBR. So how do I install it to the first sector of the boot partition?
Go to the top of the page
 
+Quote Post
shaggy999
post Feb 11 2004, 02:54 AM
Post #6


Grub-er
**

Group: Members
Posts: 27
Joined: 18-January 04
Member No.: 2,170



I'm posting this from Linux! Woooo! cool.gif biggrin.gif

Thanks for the help!

I figured out how to install grub into the partition (grub-install /dev/hda1) and then I just re-did the dd process and copying the sector over to Windows. Thanks again!

Talk about a crash course in grub. blink.gif
Go to the top of the page
 
+Quote Post
hughesjr
post Feb 11 2004, 06:46 AM
Post #7


Its GNU/Linuxhelp.net
*******

Group: Admin
Posts: 3,433
Joined: 25-July 03
From: Corpus Chrsiti, TX, USA
Member No.: 1,151



The setup (hd0,0) would have worked for the setup (grub-install /dev/hda1 does the same thing)... you still would have have needed to either copy the sector over to the windows drive ... OR use bootpart (instructions).


--------------------
Johnny Hughes
hughesjr@linuxhelp.net
Enterprise Alternatives: CentOS, WhiteBoxEL
Favorite Workstation Distros (in order): CentOS, Gentoo, Debian Sarge, Ubuntu, Mandrake, FedoraCore, Slackware, SUSE
Favorite Server Distros (in order): CentOS, WhiteBoxEL, Debian Sarge, Slackware, Mandrake, FedoraCore, Gentoo, SUSE
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 18th October 2017 - 10:50 PM