Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ Technical Support _ Finding A partition

Posted by: nzkronic Mar 13 2009, 04:46 AM

Hi, I have recently have made some space to install a xp partition, after installing xp on the free space I messed up my bootloader, I have managed to fix it so I can access the grub boot menu and boot into ubuntu.

I need to find out how to find what partition my xp is installed on so I can enter the correct entry in the /grub/menu.lst file.

eg.

title Ubuntu 8.10, kernel 2.6.27-11-generic
uuid c69aa91d-d9b9-4054-8ef5-01b3c1dc20cd
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=c69aa91d-d9b9-4054-8ef5-01b3c1dc20cd ro quiet splash
initrd /boot/initrd.img-2.6.27-11-generic
quiet

and

title Windows
map (hd0) (hd1)
map (hd1) (hd0)
root (hd1,0)
chainloader +1

is there any commands I can use so I can choose the correct "hd0, hd1" I dont really know what the map commands are as well.

Edit here is the command which may list something useful
sudo fdisk -l

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb8e74969

Device Boot Start End Blocks Id System
/dev/sda1 1 15562 125001733+ 83 Linux
/dev/sda2 * 15563 18701 25214017+ 7 HPFS/NTFS
/dev/sda3 18702 19457 6072570 5 Extended
/dev/sda5 18702 19457 6072538+ 82 Linux swap / Solaris
kieran@AstroTrain:~$





Thanks, any help is appreciated.

Posted by: michaelk Mar 13 2009, 06:52 AM

According to what you posted your windows partition is sda2 and in grub speak that is (hd0,1). grub starts at 0,0 for the first drive,partition.
Windows prefers to be installed and running from the first drive i.e. c: drive or sda, hda in linux speak. If you have multiple hard drives in your system you can install windows to the second and
the map command in a nutshell will trick windows into thinking it is on the first drive.

So:
title Windows
rootnoverify (hd0,1)
chainloader +1

Posted by: nzkronic Mar 13 2009, 08:47 PM

Thanks for that, will try it out shortly.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)