Grub 1.99> for those multi booting

Discussion in 'all things UNIX' started by Ocky, Nov 24, 2012.

Thread Status:
Not open for further replies.
  1. Ocky

    Ocky Registered Member

    Joined:
    May 6, 2006
    Posts:
    2,713
    Location:
    George, S.Africa
    Having replaced my Lucid on sda with a remastersys backup of Kubuntu 12.04 on sdb, I discovered that the commands to be entered in /etc/grub.d/40_custom have changed somewhat. For instance the cat << EOF before the menuentry and the EOF after the } are not to be used. Also I use exec tail -n +4 $0 instead of +3. I don't know if this makes a difference but I suppose it may have something to do with the Previous versions entry.

    For my triple boot setup I have the following entries that work very nicely. (The reason why I have the menuentry Kubuntu 12.04 is that I have not yet got around to replacing that OS on sdb with some other OS - probably Kubuntu 12.10 to see what has changed)

    What is highlighted in red must be changed to suit your setup.

    Code:
    #!/bin/sh
    echo "Adding 40_custom menu entries" >&2
    exec tail -n +4 $0
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    
    
    menuentry "[COLOR="Red"]Kubuntu 12.04 Symlink Boot[/COLOR]" {
            linux /vmlinuz root=UUID=[COLOR="Red"]10b378dc-f796-429e-8d00-f54da50649d7[/COLOR] ro quiet splash $vt_handoff
         initrd /initrd.img
    }
    
    
    menuentry "[COLOR="Red"]Scientific linux 6.3 Chainload Boot[/COLOR]" {
        set root=([COLOR="Red"]hd1,5[/COLOR])
        chainloader +1    
    }
    Use sudo blkid to find the UUID as per the first entry.

    This also works well:-

    Code:
    #!/bin/sh
    echo "Adding 40_custom menu entries" >&2
    exec tail -n +4 $0
    # This file provides an easy way to add custom menu entries.  Simply type the
    # menu entries you want to add after this comment.  Be careful not to change
    # the 'exec tail' line above.
    
    
    menuentry "[COLOR="Red"]Kubuntu 12.04[/COLOR]" {
      set root=([COLOR="Red"]hd1,1[/COLOR])
         linux /vmlinuz root=/dev/[COLOR="Red"]sdb1 [/COLOR]ro quiet splash
         initrd /initrd.img
    }
    
    menuentry "[COLOR="red"]Scientific linux 6.3[/COLOR]" {
        set root=([COLOR="red"]hd1,5[/COLOR])
        chainloader +1    
    }
    
    Obviously I have added GRUB_DISABLE_OS_PROBER=true in /etc/default/grub under GRUB_CMDLINE_LINUX=""

    Note:- If you include the cat << EOF and EOF lines, you will get syntax errors when running update-grub and a grub.cfg.new file will be created. Booting the various OS will still work, but I venture to say that one will have problems when a kernel update comes along.
     
    Last edited: Nov 24, 2012
Thread Status:
Not open for further replies.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.