Re: changing default os in grub

From: john gennard (joney_at_clara.co.uk)
Date: 12/02/04

  • Next message: CW Harris: "Re: Woody and kernel 2.6"
    Date: Thu, 02 Dec 2004 20:34:13 +0000
    To: debian-user@lists.debian.org
    
    

    Clive Menzies wrote:

    >> [snip]

    > Hi John
    >
    > You need to edit /boot/grub/menu.lst with a text editor. I have a
    > rather complex grub set-up (which was an interesting learning
    > experience) on a spare windows machine in our office which has two
    > drives /dev/hda and /dev/hdb; hda has windows 98 and hdb has a vfat
    > partition for the windows system and 4 Debian based systems on different
    > partitions but share common swap space.
    >
    > Here's an extract from my menu.lst:
    >
    > # This entry is for the windows OS and appears first as the default
    > # system on /dev/hda1
    > title Windows 98SE
    > root (hd0,0)
    > savedefault
    > makeactive
    > chainloader +1
    >
    >
    > # Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST
    > # The automagic kernels list includes all the d-i sarge kernels which
    > # update automatically. Note that the groot (grub root) is on the
    > # second disk
    > ### BEGIN AUTOMAGIC KERNELS LIST
    > ## lines between the AUTOMAGIC KERNELS LIST markers will be modified
    > ## by the debian update-grub script except for the default optons below
    >
    > ## DO NOT UNCOMMENT THEM, Just edit them to your needs
    >
    > ## ## Start Default Options ##
    > ## default kernel options
    > ## default kernel options for automagic boot options
    > ## If you want special options for specifiv kernels use kopt_x_y_z
    > ## where x.y.z is kernel version. Minor versions can be omitted.
    > ## e.g. kopt=root=/dev/hda1 ro
    > # kopt=root=/dev/hdb2 ro
    >
    > ## default grub root device
    > ## e.g. groot=(hd0,0)
    > # groot=(hd1,1)
    >
    > ## should update-grub create alternative automagic boot options
    > ## e.g. alternative=true
    > ## alternative=false
    > # alternative=true
    >
    > ## should update-grub lock alternative automagic boot options
    > ## e.g. lockalternative=true
    > ## lockalternative=false
    > # lockalternative=false
    >
    > ## altoption boot targets option
    > ## multiple altoptions lines are allowed
    > ## e.g. altoptions=(extra menu suffix) extra boot options
    > ## altoptions=(recovery mode) single
    > # altoptions=(recovery mode) single
    >
    > ## controls how many kernels should be put into the menu.lst
    > ## only counts the first occurence of a kernel, not the
    > ## alternative kernel options
    > ## e.g. howmany=all
    > ## howmany=7
    > # howmany=all
    >
    > ## ## End Default Options ##
    >
    > title Debian GNU/Linux, kernel 2.6.8-1-686
    > root (hd1,1)
    > kernel /boot/vmlinuz-2.6.8-1-686 root=/dev/hdb2 ro
    > initrd /boot/initrd.img-2.6.8-1-686
    > savedefault
    > boot
    >
    > title Debian GNU/Linux, kernel 2.6.8-1-686 (recovery mode)
    > root (hd1,1)
    > kernel /boot/vmlinuz-2.6.8-1-686 root=/dev/hdb2 ro single
    > initrd /boot/initrd.img-2.6.8-1-686
    > savedefault
    > boot
    >
    > title Debian GNU/Linux, kernel 2.4.27-1-386
    > root (hd1,1)
    > kernel /boot/vmlinuz-2.4.27-1-386 root=/dev/hdb2 ro
    > initrd /boot/initrd.img-2.4.27-1-386
    > savedefault
    > boot
    >
    > title Debian GNU/Linux, kernel 2.4.27-1-386 (recovery mode)
    > root (hd1,1)
    > kernel /boot/vmlinuz-2.4.27-1-386 root=/dev/hdb2 ro single
    > initrd /boot/initrd.img-2.4.27-1-386
    > savedefault
    > boot
    >
    > ### END DEBIAN AUTOMAGIC KERNELS LIST
    >
    > # This is a divider, added to separate the menu items below from the
    > # Debian sarge ones. Here I've manually inserted the details of Ubuntu,
    > # and MEPIS. Note that Xandros uses LILO by default and offers
    > # no easy way to install grub. I can only boot into Xandros from a boot
    > # floppy. My advice is don't mix Xandros with grub ;)
    > title Other operating systems:
    > root
    >
    >
    > # This entry automatically added by the Debian installer for an existing
    > # linux installation on /dev/hdb9.
    > title Ubuntu, kernel 2.6.8.1-3-386 (on /dev/hdb9)
    > root (hd1,8)
    > kernel /boot/vmlinuz-2.6.8.1-3-386 root=/dev/hdb9 ro quiet
    > splash
    > initrd /boot/initrd.img-2.6.8.1-3-386
    > savedefault
    > boot
    >
    >
    > # This entry automatically added by the Debian installer for an existing
    > # linux installation on /dev/hdb9.
    > title Ubuntu, kernel 2.6.8.1-3-386 (recovery mode) (on
    > /dev/hdb9)
    > root (hd1,8)
    > kernel /boot/vmlinuz-2.6.8.1-3-386 root=/dev/hdb9 ro single
    > initrd /boot/initrd.img-2.6.8.1-3-386
    > savedefault
    > boot
    >
    >
    > # This entry automatically added by the Debian installer for an existing
    > # linux installation on /dev/hdb11.
    > title MEPIS, kernel 2.4.26 (on /dev/hdb11)
    > root (hd1,10)
    > kernel /boot/vmlinuz-2.4.26 root=/dev/hdb11 ro
    > savedefault
    > boot
    >
    >
    > # This entry automatically added by the Debian installer for an existing
    > # linux installation on /dev/hdb11.
    > title MEPIS, kernel 2.4.26 (recovery mode) (on /dev/hdb11)
    > root (hd1,10)
    > kernel /boot/vmlinuz-2.4.26 root=/dev/hdb11 ro single
    > savedefault
    > boot
    >
    >
    > # This entry automatically added by the Debian installer for an existing
    > # linux installation on /dev/hdb11.
    > title Run MEMTEST to test system memory (on /dev/hdb11)
    > root (hd1,10)
    > kernel /boot/memtest86.bin root=/dev/hdb11
    > savedefault
    > boot
    >
    > Once you've edited your menu.lst run update-grub but make sure you have
    > also made a grub floppy to get you out of trouble, if necessary. Look
    > at the GRUB in Debian HOWTO:
    >
    > http://www.linuxorbit.com/modules.php?op=modload&name=Sections&file=index&req=viewarticle&artid=539
    >
    > HTH
    >
    > Clive
    >

    Many thanks, Clive. In fact your set up is very similar to
    mine except that I have Knoppix 3.1 and Sid and no Mepis.

    I have a small W2000 install, but don't want it as the default.
    For default, I want Sarge, but it seems I may only be able to
    select one kernel.

    I'll create a GRUB boot floppy and then experiment.

    Until recently, I used boot floppies for all my installed
    systems and found that convenient for my purposes. However,
    the much larger kernels mean this is no longer an option.

    Slightly off this topic: My Bios boot sequence is now set
    to Cdrom (I never leave a CD in the drive), then Harddrive.
    This allows me to boot into Knoppix later issues and similar
    distros without keep going into the Bios. I've been wondering
    if anyone has tried putting Lilo or Grub onto a Cdrom (or Dvd).

    Regards, John.

    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: CW Harris: "Re: Woody and kernel 2.6"

    Relevant Pages

    • Re: Naming harddisks (Linux)
      ... But I also see that for an USB drive it uses /dev/sdas the ... Does GRUB recognize SCSI drives? ... The first step in understanding the boot process is to ... The bootloader's job is to load the OSs kernel. ...
      (comp.os.linux.misc)
    • Re: Weird partition arrangements and broken GRUB
      ... partition type 0x7' message. ... I have read somewhere else that Windows could only boot from a primary ... # This entry automatically added by the Debian installer for a non-linux OS ...
      (Debian-User)
    • Re: remove partaion
      ... The most interesting hurdle will be what the Master Boot Record ... thus kill GRUB. ... I would copy your MBR and first 63 sectors (see the MBR Copy Appendix ... GUI or command line commands to accomplish that. ...
      (Fedora)
    • Re: How do I make a boot disk so I can restore Grub?
      ... I read that Windows will overwrite the MBR. ... > need to make a boot disk so I can restore MBR after Windows ... How do I make a boot disk and be able to restore Grub on ... with the designation for wherever your boot partition is. ...
      (comp.os.linux.setup)
    • grub ignoring root=/dev/hda3 kernel option - where should I report the bug?
      ... I am using grub, installed on the MBR of /dev/hda (and I installed it ... If I try to boot into Debian testing or Windows, ... kernel command line. ...
      (Debian-User)