|
|
|
|
![]() ![]() |
Nov 15 2006, 10:55 AM
Post
#1
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 21 Joined: 24-September 06 Member No.: 16,119 |
Hi guys,
Few days ago my friend ask me to reinstall Windows on his computer. The problem is he has dual OS, ubuntu linux(Dapper Drake) and Windows XP. If I reinstall the Windows the Grub loader on MBR will overwritten by Windows XP. i know after reinstalling Windows we cannot boot to Ubuntu. I'm newbie, So my question is, How we restore the Grub Loader back? I've try to boot from ubuntu using Live CD mode. But I still confuse Please help Thanks! |
|
|
|
Nov 15 2006, 11:30 AM
Post
#2
|
|
|
Way Out Of Control - You need a life :) Group: [MODERATOR] Posts: 1,980 Joined: 16-August 05 Member No.: 7,896 |
I'm not familiar with Ubuntu. I do this kind of things with Mandrake of Mandriva.
It should be the same kind of problem and the same solution on all distros, just try my way, it's not harmful as long as you do not clik "format the hard disk". With Mandrake or Mandriva, and probably with Ubuntu, you boot on the first install CD (or on the install DVD), choose "install or update", then choose "update", it verifies a lot of things and you see "installing the bootloader". Choose to put the boot loader on your first disk, and everything should go fine. Hope this helped. Yordan |
|
|
|
Nov 15 2006, 01:55 PM
Post
#3
|
|
|
Way Out Of Control - You need a life :) Group: Members Posts: 1,366 Joined: 14-September 04 From: Nottingham England Member No.: 570 |
You Have Two Options............
1) The Usual Way.... After Installing WindowsXP, Boot a Linux Rescue Disk and Re-Install Grub with the command. "grub-install" read man grub for more info. typically.... CODE mount /dev/your_boot_partiton /boot grub-install --root-directory /boot /dev/hda 2) The Easy, 733T haX0r Linux GuRu Way.... The Boot Sector is Stored on the first 512 Bytes of the physical Disk. so... Backup your boot sector to a file like so... CODE dd if=/dev/hda of=/BootSectorBackup.bin bs=512 count=1 Copy the backup file to a floppy disk / whatever. Install Windows XP. Boot a Linux Rescue Disk. then Copy your Origonal Boot Sector Over whatever Garbage WindowsXP put there with the command CODE dd if=/BootSectorBackup.bin of=/dev/hda bs=512 count=1 If at all in Doubt... Use Method 1.. If you Make a Mistake With Method 2, you can waye boodbye to your Partiton Table... File System, and look forward to a full re-partiton and re-format. Good Luck. |
|
|
|
Nov 15 2006, 03:27 PM
Post
#4
|
|
|
Newbie [ Level 2 ] Group: Members Posts: 21 Joined: 24-September 06 Member No.: 16,119 |
Hi qwijibow,
I have tried the first method but it seems the parameter is wrong because when I run $ grub-install --root-directory /boot /dev/hda the grub-install just return same as we only typed $ grub-install. When run the grub shell, I saw a few command (I think) that can be used to fix grub. Like "setup" or "install", CODE grub> help setup setup: setup [--prefix=DIR] [--stage2=STAGE2_FILE] [--force-lba] INSTALL_DEVICE [IMAGE_DEVICE] Set up the installation of GRUB automatically. This command uses the more flexible command "install" in the backend and installs GRUB into the device INSTALL_DEVICE. If IMAGE_DEVICE is specified, then find the GRUB images in the device IMAGE_DEVICE, otherwise use the current "root device", which can be set by the command "root". If you know that your BIOS should support LBA but GRUB doesn't work in LBA mode, specify the option `--force-lba'. If you install GRUB under the grub shell and you cannot unmount the partition where GRUB images reside, specify the option `--stage2' to tell GRUB the file name under your OS. grub> I'm still confuse about INSTALL_DEVICE. CODE grub> setup --prefix=/boot/grub --stage2=/boot/grub/stage2 (hd0,0) Error 12: Invalid device requested OR grub> setup --prefix=/boot/grub --stage2=/boot/grub/stage2 /dev/hda Error 11: Unrecognized device string For method 2, I'll not do it because it's to danger and can make my partition table corrupt!. So, there is another way? Thanks |
|
|
|
Nov 16 2006, 02:02 AM
Post
#5
|
|
|
Colonel Panic Group: [MODERATOR] Posts: 2,735 Joined: 25-March 05 From: Toronto, Ontario, Canada Member No.: 3,233 |
GRUB handles each partition as a number... so if I want to install it into the the MBR, usually it would be:
grub-install hd(0,0) xboxrulz |
|
|
|
Nov 17 2006, 09:18 AM
Post
#6
|
|
|
Member [ Level 1 ] Group: Members Posts: 34 Joined: 17-November 06 Member No.: 17,334 |
Hi guys, Few days ago my friend ask me to reinstall Windows on his computer. The problem is he has dual OS, ubuntu linux(Dapper Drake) and Windows XP. If I reinstall the Windows the Grub loader on MBR will overwritten by Windows XP. i know after reinstalling Windows we cannot boot to Ubuntu. I'm newbie, So my question is, How we restore the Grub Loader back? I've try to boot from ubuntu using Live CD mode. But I still confuse Please help Thanks! If you can boot from CD, simplest method is to mount linux partitions, then chroot to it, then run grub-install. TIP: fdisk -l will display all partitions at all drives. In general, for any distro, even you havn't live CD, restoring can be done in such steps: 1) Find any working linux sustem 2) Create GRUB boot floppy: # cd /usr/share/grub/i386-pc # dd if=stage1 of=/dev/fd0 bs=512 count=1 1+0 records in 1+0 records out # dd if=stage2 of=/dev/fd0 bs=512 seek=1 153+1 records in 153+1 records out 3) Boot from that floppy, then (quote from GRUB info page): Once started, GRUB will show the command-line interface (*note Command-line interface: (*note Installing GRUB natively-Footnote-1: containing the boot directory, like this: grub> root (hd0,0) If you are not sure which partition actually holds this directory, use the command `find' (*note find: grub> find /boot/grub/stage1 This will search for the file name `/boot/grub/stage1' and show the devices which contain the file. Once you've set the root device correctly, run the command `setup' (*note setup: grub> setup (hd0) For more information type info grub |
|
|
|
Feb 27 2007, 05:08 AM
Post
#7
|
|
|
Member [ Level 1 ] Group: Members Posts: 34 Joined: 13-August 06 Member No.: 15,185 |
If you can boot from CD, simplest method is to mount linux partitions, then chroot to it, then run grub-install. TIP: fdisk -l will display all partitions at all drives. In general, for any distro, even you havn't live CD, restoring can be done in such steps: 1) Find any working linux sustem 2) Create GRUB boot floppy: # cd /usr/share/grub/i386-pc # dd if=stage1 of=/dev/fd0 bs=512 count=1 1+0 records in 1+0 records out # dd if=stage2 of=/dev/fd0 bs=512 seek=1 153+1 records in 153+1 records out 3) Boot from that floppy, then (quote from GRUB info page): Once started, GRUB will show the command-line interface (*note Command-line interface: (*note Installing GRUB natively-Footnote-1: containing the boot directory, like this: grub> root (hd0,0) If you are not sure which partition actually holds this directory, use the command `find' (*note find: grub> find /boot/grub/stage1 This will search for the file name `/boot/grub/stage1' and show the devices which contain the file. Once you've set the root device correctly, run the command `setup' (*note setup: grub> setup (hd0) For more information type info grub The RHEL installer provides the GRUB boot loader, GRUB (the GRand Unified Boot-loader). /boot/grub/grub/grub.conf has a format of global options followed by boot stanzas. Here is a sample grub.conf: timeout=5 splashimage=(hd0,0) /grub/splash.xpm.gz password --md5 $1$/iX9y$Bkskfdsd4443gnff default=0 title Red Hat Enterprise Linux AS (2.6.9-648_EL) root(hd0,1) kernel /vmlinuz-2.6.9.EL ro root=/dev/VolGroup00/LogVol00 initrd /initrd-2.6.9-648.EL.img title Windows XP Pro rootnoverify (hd0,0) chainloader +1 IF ggrub-install fails for some reason try the following: 1. type the command grub and press enter 2. type root (hd0,0) 3. type setup (hd0) 4. type quit IF still problem occures, then reinstall the grub by /sbin/grub-install /dev/hda or use these three commands: Have a nice day |
|
|
|
Mar 10 2007, 10:43 AM
Post
#8
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 1 Joined: 10-March 07 Member No.: 20,803 |
1. type the command grub and press enter 2. type root (hd0,0) 3. type setup (hd0) 4. type quit root(hd0,0) means partition where kernel is stored w.m. where /boot/ directory is stored hd0 = first IDE disk, 0 means first partition on this disk - you can use tab key to show alternatives setup(hd0) means where to install grub to MBR, on which disk - so in this case in the MBR on the first IDE disk |
|
|
|
Mar 4 2008, 04:02 PM
Post
#9
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
Restoring Red Hat Enterprise Linux Boot Loader
Restoring Grub Boot Loader Hi I had dual boot system of windows xp and RHEL 3.0.After some days I have reinstalled XP.But now I want to get back RHEL 3.0 again. How Can I restore Grub boot loader again?if I can restore the grub boot loader again,will it give me the option of selecting the operating system? Please help me out... -question by ruhul |
|
|
|
Mar 13 2008, 11:52 AM
Post
#10
|
|
|
Newbie [ Level 1 ] Group: Members Posts: 0 Joined: 1-November 07 Member No.: 25,869 |
Dual Boot - Solaris 10 and Windows XP
Restoring Grub Boot Loader Hi, I installed solaris 10 first.Then I install windows xp in another partition.When I boot my system,there is no options for os choices.It directly goes to the windows xp ,how to get os choices menu. Thanks in Advance. By, Ruban demel. -reply by Ruban |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 8th September 2008 - 03:31 AM |