Announcement

Collapse
No announcement yet.

Backup grub?

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

    Backup grub?

    I have a dual boot system with Kubuntu as default and a Windows XP partition.
    Now I want to have a CD I can put in the drive and make it boot Windows XP as default.

    How can I backup my grub boot to a CD so it works exactly as the normal boot, but defaults to Win XP instead?

    Please help!
    Thanks!
    /Andreas

    #2
    Re: Backup grub?

    If you just want Grub to boot by default to Windows XP instead, change this line in /boot/grub/menu/lst:

    default         0

    to 2 (most likely) or whatever number it appears in your list.

    Comment


      #3
      Re: Backup grub?

      I know, but I wanted to boot from CD and make it boot Windows on the harddisk.
      I solved it yesterday, I did like it says here:
      http://www.gnu.org/software/grub/man...le-CD-ROM.html

      The only thing I did different was that the stage2 file is in another place... use locate to find it
      and then I edited my menu.lst file to point to the windows boot like:
      (in my case Windows is boot option number 6)
      Code:
      default  6
      Then I also had to edit it like this:
      Code:
      # This entry automatically added by the Debian installer for a non-linux OS
      # on /dev/hda1
      title		Microsoft Windows XP Professional
      root		(hd0,0)
      # savedefault
      makeactive
      chainloader	+1
      boot
      I added boot and put # in front of savedefault, don't know why I had to do this to make it
      work, but I didn't care either, now it works.

      Comment


        #4
        Re: Backup grub?

        oops! I kinda figured you wanted to do something more elaborate.  I kinda thought you wanted to do something similar to what I've done in the past (for a bootable grub on a mountable medium, like a floppy).

        I've never done it on CD before, but in case anyone wants to know how to put it on a floppy (like you did on a CD), I'll post that howto here as well.  This is how I've always done it...

        Insert a floppy, and format it:
        Code:
        skoal@morpheus://~ $ fdformat /dev/fd0
        Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB.
        Formatting ... done
        Verifying ... done
        drop a filesystem on it:
        Code:
        skoal@morpheus://~ $ mke2fs /dev/fd0 
        mke2fs 1.38 (30-Jun-2005)
        Filesystem label=
        OS type: Linux
        Block size=1024 (log=0)
        [...]
        Writing inode tables: done                            
        Writing superblocks and filesystem accounting information: done
        
        This filesystem will be automatically checked every 33 mounts or
        180 days, whichever comes first.  Use tune2fs -c or -i to override.
        create the Grub boot floppy:
        Code:
        skoal@morpheus://~ $ sudo mount -t ext2 /dev/fd0 /media/floppy
        Password:
        skoal@morpheus://~ $ grub-install --root-directory=/media/floppy '(fd0)'
        Probing devices to guess BIOS drives. This may take a long time.
        Due to a bug in xfs_freeze, the following command might produce a segmentation
        [...]
        Installation finished. No error reported.
        This is the contents of the device map /media/floppy/boot/grub/device.map.
        Check if this is correct or not. If any of the lines is incorrect,
        fix it and re-run the script `grub-install'.
        
        (fd0)   /dev/fd0
        skoal@morpheus://~ $ cp /boot/grub/menu.lst /media/floppy/boot/grub/
        skoal@morpheus://~ $ sudo umount /media/floppy
        It's great to have something like this around, especially if you dual boot with XP and your MBR gets blown away after an install or an apartment fire.

        Comment

        Working...
        X