Fix grub after windows xp install - pclinuxos
by me13th
Jun
2008
You installed PCLinuxOS, because windows was giving you major headaches. Everything is perfectly setup in PCLinuxOS, all your setting for thunderbird, favorites, LAMP, all the different browsers, bookmarks and what not. Now your itching!! Computers shouldn’t work this good, I need to dual boot windows xp and PCLinuxOS. Break up the monotony of one operating system. Plus You have to get your fix of Rome: Total War.
Problem: Windows XP installation Master Boot Record (MBR) masks your PCLinuxOS GRand Unified Bootloader (GRUB).
Solution: rebuild grub and then add Windows XP to the boot menu.lst.
Here is how I did it.
NOTE: this is based on a 40 gb hard drive, with a swap as the first partition followed by root, /home, windows. see pic below. sloppy pic I know.
First we fix grub so we can boot into PCLOS.
You will need your original PCLinuxOS live-cd I used the 2007 version of PCLinuxOS.
After you have booted windows xp, did all your updates and windows xp is working properly. Pop in the PCLinuxOS cd and restart your computer, of course making sure your BIOS has a cd-rom as the first boot device.
I logged in as guest and used the terminal program- super user mode under System -> Terminals, but I am sure you can log in as root. First you have to enter grub find the partition your PCLinuxOS grub is on.
code:
grub
find /boot/grub/stage1
it should spit out (hd0,*) with * being the partition number your grub is on, mine is (hd0,4).
so after you get that information and you are still in the grub prompt.
code:
root (hd0,4)
setup (hd0)
quit
now restart computer taking the PCLinuxOS disk out of your cd-rom drive and pressing <enter>. Your computer should boot the familiar PCLinuxOS boot menu.
Now go into File Manager - Super User Mode, That would be under System->File Tools. Go Into your root Folder and then into boot, then grub, and open the menu.lst file with an editor..
at the end of the file press <enter> twice. All boot menu items must be seperated by a newline. Here is my menu.lst for example.
code:
timeout 10
color black/cyan yellow/cyan
gfxmenu (hd0,4)/usr/share/gfxboot/themes/pclinuxos/boot/message
default 0
title linux
kernel (hd0,4)/boot/vmlinuz
BOOT_IMAGE=linux root=/dev/hda5 acpi=on splash=verbose vga=788
initrd (hd0,4)/boot/initrd.img
title linux-nonfb
kernel (hd0,4)/boot/vmlinuz
BOOT_IMAGE=linux-nonfb root=/dev/hda5 acpi=on splash=verbose
initrd (hd0,4)/boot/initrd.img
title failsafe
kernel (hd0,4)/boot/vmlinuz
BOOT_IMAGE=failsafe root=/dev/hda5 failsafe acpi=on
initrd (hd0,4)/boot/initrd.img
title Windows XP
rootnoverify (hd0,2)
makeactive
chainloader +1
as windows is located on the (hd0,2) partition. you can find this by opening a terminal and typing in
code:
fdisk -l
It’s the partition with the file system NTFS or FAT32 depending on the filesystem you chose when you installed windows xp.
Hard drives are like multi-dimensional arrays with (hd0,1) being hda2, with hda equaling hd0 and 1 being the partition labeled /dev/hda2, if it where (hd1,2) hd1 would be hdb and 2 would be the third partition and so on, So my (hd0,2) is actually the partition labeled /dev/hda3.
Well I hope this helps some people from banging their heads againt the electronic filing system (computer).

