Page 1 of 6 123 ... LastLast
Results 1 to 10 of 56

Thread: HOW-TO restoring XP and Vista Bootloader & Restoring GRUB

  1. #1
    Join Date
    Apr 2007
    Location
    Munich, Germany
    Beans
    1,578
    Distro
    Ubuntu

    HOW-TO restoring XP and Vista Bootloader & Restoring GRUB

    I've noticed a lot of people asking about restoring Vista/XP bootloaders, and so i decided to write a how-to for this. Also, i will include a quick how-to on restoring GRUB as well.

    For Vista:
    Boot to your recovery cd/partition (if you don't have one, or lost yours, you can get a recovery CD from here note: the CD is ONLY recovery options, so no cheap way of getting Vista
    This download is available to customers running genuine Microsoft Windows. Please click the Continue button to begin Windows validation. As described in our privacy statement, Microsoft will not use the information collected during validation to identify or contact you.
    part of the disclaimer for the multi-gigabyte download for the actual program used to create that disk. If you don't agree with it or don't have a genuine windows system, do not use this download.)
    After booting to the CD, get to the Recovery Console (it differs for each recovery program, but generally is easily enough found). Once there type
    Code:
    bootrec /fixmbr
    bootrec /fixboot
    which will restore the Vista bootloader.

    For XP:
    boot to an XP CD (sorry, no links available ) and, once the menu loads, hit "R" to enter a command prompt. Once there, choose which partition you want, and enter an admin password (if you have one set).
    then type
    Code:
    fixmbr
    fixboot
    and the XP bootloader should be restored.

    For GRUB restore to MBR:
    boot to the LiveCD (this is the easiest way IMHO) and then start a terminal (applications-->accessories-->terminal)and type
    Code:
    sudo grub
    find /boot/grub/stage1
    root (hd?,?)
    setup (hd?)
    quit
    where the (hd?,?) and (hd?) corresponds to the output of find /boot/grub/stage1 (first time round the (hd?,?) stands for the drive (hd?) and the partition (,?) at which Ubuntu (or any Linux) is located, and then the second time round (hd?) just stands for the drive, for the MBR).
    If you would like a more detailed explanation catlett did a good job with his how-to here and also offers troubleshooting ideas.

    How to restore GRUB to a partition:
    **DISCLAIMER** This is untested, as I haven't had time to do so yet, but it should work. Any feedback would be great, either by PM or to have a reply posted here.
    Code:
    sudo grub
    find /boot/grub/stage1
    root (hd?,?)
    setup (hd?,?)
    quit
    (for an explanation of the above code, see the info on restoring GRUB to the MBR, apart from the code marked in bold).
    There is only one small variation for this (marked in bold) but it's a significant one. That "?" marked in bold should be the same one you used for your "root" command in the line above. It will then install GRUB to that partition.

    Now, you may ask, why is this on a Linux forum? Well this is for those people who either decide Ubuntu (or Linux in general) isn't for them, and wish to get back to Vista or XP, or else for those people (like me) who have set up a triple boot system. To set up a triple boot, i found, it works best if you install the XP bootloader (for XP), then the Vista Bootloader (on top) and then lastly, the GRUB which then allows the booting of all 3 systems. The problem i ran into was that i had Vista and Ubuntu installed, so i installed XP, then GRUB, and realized XP bootloader files (which are in the Partition and called the ntldr files) could not boot Vista. I ended up removing Vista then, but that's another story.

    Hope this helps,
    Lswest

    *EDIT* As thegizmoguy point out, restoring a vista bootloader in a tripleboot setup (Linux-->Vista-->XP) will also allow access to the XP partition again
    Last edited by lswest; January 4th, 2009 at 08:02 PM. Reason: added the info on restoring GRUB to a partition

  2. #2
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: HOW-TO restoring XP and Vista Bootloader & Restoring GRUB

    Very cool thread.

    If I may , this is how to restore the WINDOWS boot loader FROM LINUX

    From the Ubuntu Live CD:

    1. Boot live CD, open a terminal.

    2. Enable The Universe repositories (System->Administation->Software Sources : tic "Community maintained Open Source software (universe)"

    3. Install ms-sys
      Code:
      sudo apt-get update && sudo apt-get install ms-sys
    4. Restore MBR

      • Set up your windows partition :
        Code:
        ms-sys -p /dev/sda1
        Note: change /dev/sda1 and /dev/sda to your windows partition and MBR

        Code:
        ms-sys -p /dev/<drive>
        <drive> = your windows hard partition (/dev/hda1 or /dev/sda1)
      • Write to MBR :

        • 2000/XP/2003 :

          Code:
          ms-sys -m /dev/sda
        • DOS/Windows 98/NT :

          Code:
          ms-sys -w /dev/sda


        ms-sys -p = write to windows partition

        ms-sys -w = write Microsoft DOS/Windows NT to MBR
        ms-sys -m = write Microsoft 2000/XP/2003 to MBR



    How to : http://ms-sys.sourceforge.net/
    man page : http://linux.die.net/man/1/ms-sys

    ----------

    From Knoppix :

    boot Knoppix, open a terminal and enter :

    sudo install-mbr /dev/hda

    I know the Ubuntu method works with every version of windows EXCEPT VISTA (it may work with Vista, I have not tested it), I have not tried Knoppix

    bodhi.zazen
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  3. #3
    Join Date
    Apr 2007
    Location
    Munich, Germany
    Beans
    1,578
    Distro
    Ubuntu

    Re: HOW-TO restoring XP and Vista Bootloader & Restoring GRUB

    Thanks for the compliment ^^ and nice, i didn't know you could install an XP bootloader from linux, ties in nicely though ^^, i'll have to try it sometime.

  4. #4
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: HOW-TO restoring XP and Vista Bootloader & Restoring GRUB

    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

  5. #5
    Join Date
    Apr 2008
    Beans
    14

    Re: HOW-TO restoring XP and Vista Bootloader & Restoring GRUB

    hi, after running this from my windows sys restore prompt
    ----
    fixmbr
    fixboot
    ----

    my windows XP wont load anymore. i get the message 'Failed to load operating system'

    so i loaded up ubuntu to try restore the windows boot loader

    i get to step three and i get the message from terminal,
    ----
    E: couldnt find package ms-sys

    if this is trying to find my windows install on the my E drive, it wont find it. My windows install is on my C: drive, ubuntu is on E:. they are two seperate hard drives. How can i get it look on the C: drive?

  6. #6
    Join Date
    Sep 2007
    Beans
    268

    Re: HOW-TO restoring XP and Vista Bootloader & Restoring GRUB

    Thanks guys, excellent resources. I have used it countless times!

  7. #7
    Join Date
    Apr 2007
    Location
    Munich, Germany
    Beans
    1,578
    Distro
    Ubuntu

    Re: HOW-TO restoring XP and Vista Bootloader & Restoring GRUB

    Quote Originally Posted by jvittetoe View Post
    hi, after running this from my windows sys restore prompt
    ----
    fixmbr
    fixboot
    ----

    my windows XP wont load anymore. i get the message 'Failed to load operating system'

    so i loaded up ubuntu to try restore the windows boot loader

    i get to step three and i get the message from terminal,
    ----
    E: couldnt find package ms-sys

    if this is trying to find my windows install on the my E drive, it wont find it. My windows install is on my C: drive, ubuntu is on E:. they are two seperate hard drives. How can i get it look on the C: drive?
    looks like you'll have to install it from source (there's a link on this page) and then to make it look on your second hdd, sda=first hard drive, sdb=second hard drive. Run a
    Code:
    sudo fdisk -l
    to find out which one is the one you need (pick the one that has an NTFS partition)

    @ iSplicer: thanks ^^ glad it helped you out.

  8. #8
    Join Date
    Apr 2008
    Beans
    3,317
    Distro
    Kubuntu 9.10 Karmic Koala

    Re: HOW-TO restoring XP and Vista Bootloader & Restoring GRUB

    looks like you'll have to install it from source
    ms-sys is not in the Hardy Repos, but there is a debian package:

    http://packages.debian.org/etch/ms-sys


    A few more options to fix the MBR:

    1)

    Code:
    sudo apt-get install lilo
    sudo lilo -M /dev/sda mbr
    (If you are using Ubuntu 8.10 or Ubuntu 8.10 Live CD, lilo is already installed, and the first line is unnecessary)

    2) SuperGrub also has ability to fix the MBR.
    Last edited by meierfra.; January 4th, 2009 at 09:25 PM. Reason: Added lilo

  9. #9
    Join Date
    Jan 2008
    Beans
    Hidden!
    Distro
    Ubuntu 10.04 Lucid Lynx

    Red face Re: HOW-TO restoring XP and Vista Bootloader & Restoring GRUB

    just read this post and am amazed! great stuff... everyday i get surprised with linux in general and ubuntu specially...

    great post

  10. #10
    Join Date
    Apr 2006
    Location
    Montana
    Beans
    Hidden!
    Distro
    Kubuntu Development Release

    Re: HOW-TO restoring XP and Vista Bootloader & Restoring GRUB

    Quote Originally Posted by meierfra. View Post
    ms-sys is not in the Hardy Repos, but there is a debian package:

    http://packages.debian.org/etch/ms-sys
    Or install the 7.10 package ...

    http://packages.ubuntu.com/gutsy/i386/ms-sys/download

    http://packages.ubuntu.com/gutsy/amd64/ms-sys/download
    There are two mistakes one can make along the road to truth...not going all the way, and not starting.
    --Prince Gautama Siddharta

    #ubuntuforums web interface

Page 1 of 6 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •