Announcement

Collapse
No announcement yet.

reinstalling GRUB

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    reinstalling GRUB

    Hi,
    I have a dual boot system with windoz on the primary hard drive and Kubuntu on the secondary hard drive and GRUB installed to the MBR. I need to reinstall windoz and this will rewrite the MBR and would like to avoid reinstalling Kubuntu and so my question is there a simple way to reinstall GRUB?

    Thanks in advance John

    #2
    Re: reinstalling GRUB

    Assuming your Windows is the same as before, and you're not going to make ANY changes to the partition table when you install it, use the following to backup the mbr:

    dd if=/dev/$WINDOWS_DISK of=mbr.backup bs=512 count=1

    $WINDOWS_DISK will most likely be hda. You want the disk NOT the partition. Keep the mbr.backup file somewhere safe.

    After installing Windows, get into a Linux system, either with a Kubuntu bootdisk, or a live system, and run the restore command.

    dd if=mbr.backup of=/dev/$WINDOWS_DISK bs=512 count=1

    If you need to change the Windows partitioning, do that in Linux with (qt)parted, before running the dd.

    Be aware that this is NOT tested by myself. Get it wrong and you could hose your partition table, which renders your data inaccessible until you fix it.

    I suggest running parted, and type "print" at the (parted) prompt to get your partition table. Note it down, on hard copy. That way you can fix your partition table if you need to.

    All commands will need to be run as root.
    I am running Ubuntu 8.10 (yes Gnome) with upgrades applied daily about 0900 UK time. Hardware is Dell Precision 420, 2x 800 MHz PIII, 512 MB RDRAM, nVidia GeForce 6800 128 MB AGP graphics, 18GB SCSI and 500GB IDE HDDs, DVD burner, Hauppage TV card.

    Comment


      #3
      Re: reinstalling GRUB

      Thanks Cantab,

      Comment

      Working...
      X