Page 8 of 23 FirstFirst ... 67891018 ... LastLast
Results 71 to 80 of 227

Thread: How to have a custom Grub2 menu that is maintenance free

  1. #71
    Join Date
    Jun 2012
    Beans
    34

    Re: How to have a custom Grub2 menu that is maintenance free

    (I accidentally posted this... well, somewhere else. I received two answers: 1) Check the Mint forums (by a mod ) and 2) to use a different UUID in my grub.cfg. But now I'm copying and pasting HERE since I'm sure I'll get better answers. And this is where I meant it to go to begin with! )

    Just did a clean install of Linux Mint Nadia (based on Ubuntu 12.10) and tried setting up my Grub 2.00 menu as normal. But ran into two problems:

    1) When I run 'update-grub', I do not get the echo line from my 06_custom file. Also related to this problem is that my Grub menu items are the standard ones, and not the labels I wanted (i.e. "Windows Vista (/bootloader) on sdax" as opposed to just "Windows Vista").
    2) When I chmod -x the os_prober file and run update-grub, it only "finds" my Vista partition. Now, I only have the kernel that came installed with LM 14, but I don't remember my only having one installed kernel being an issue before; as I recall, even with just one kernel it recognized and added the appropriate entry to the Grub menu. But now, if I run ubdate-grub and reboot, I just see my Vista partition.

    Here is my 06_custom file:

    Code:
    #!/bin/sh 
    echo 1>&2 "Adding Linux Mint and Windows Vista" 
    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 "Linux Mint 14 - Nadia" {
         set root=(hd0,2)
             linux /vmlinuz root=/dev/sda2 ro quiet splash
             initrd /initrd.img 
    } 
    menuentry "Linux Mint 14 - Nadia (Recovery Mode)" {
         set root=(hd0,2)
             linux /vmlinuz root=/dev/sda2 ro single
             initrd /initrd.img 
    } 
    menuentry "Windows Vista" {
         insmod ntfs
         set root='(hd0,1)'
         search --no-floppy --fs-uuid --set 32C2B4EDC2B4B707
         chainloader +1 
    }
    Ideas?
    Last edited by ChinaJustin; January 27th, 2013 at 12:07 AM. Reason: Fixed 06_custom formatting for better readability

  2. #72
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to have a custom Grub2 menu that is maintenance free

    Grub2 2.00 it seems does not work with the old commands with echo. Actually the original post was to use a terminal's echo command to add lines to 40_custom and somehow that got picked up as part of what to post into 40_custom, so users copied & pasted it into their custom grub files. Old versions of grub tolerated various things but now it does not.

    Remove the echo line.

    first lines should just be:

    Code:
    #!/bin/sh
    exec tail -n +3 $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.
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  3. #73
    Join Date
    Jun 2012
    Beans
    34

    Re: How to have a custom Grub2 menu that is maintenance free

    oldfred,

    Thanks. So that takes care of any "echo"-ing that can be customized, but what about the issue of the "menuentry" not getting picked up on the grub update?

  4. #74
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to have a custom Grub2 menu that is maintenance free

    I used the same 40_custom thru several versions of Ubuntu/grub. But then with 1.99 it stopped working. It actually reported an error and wrote a backup grub.cfg file. It turned out I had a missing } and one stanza was always missing, but it was for something I had stopped booting and never really missed.
    So any typo now can cause issues.

    Are entries in grub.cfg?
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  5. #75
    Join Date
    Aug 2009
    Beans
    3,200
    Distro
    Ubuntu Development Release

    Re: How to have a custom Grub2 menu that is maintenance free

    Quote Originally Posted by ChinaJustin View Post
    oldfred,

    Thanks. So that takes care of any "echo"-ing that can be customized, but what about the issue of the "menuentry" not getting picked up on the grub update?
    Here is my 06_custom file on Grub 2.00 in Ubuntu Quantal Quetzel 12.10:

    Code:
    #!/bin/sh
    echo 1>&2 "Adding Ubuntu Quantal Quetzal 12.10 and Windows 7"
    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 "Quantal Quetzal 12.10" {
        set root=(hd0,6)
            linux /vmlinuz root=/dev/sda6 ro quiet splash
            initrd /initrd.img
    }
    menuentry "Quantal Quetzal 12.10 (Recovery Mode)" {
        set root=(hd0,6)
            linux /vmlinuz root=/dev/sda6 ro single
            initrd /initrd.img
    }
    menuentry "Windows 7" {
        insmod ntfs
        set root='(hd0,1)'
        search --no-floppy --fs-uuid --set 1CFC7A8DFC7A60C6
        chainloader +1
    }
    The exec tail -n +4 $0 line tells it to execute the 4th line from the top which is the 1st menuentry line.
    You will only see the echo output from line 2 when you enter sudo update-grub in terminal.
    It will list your picture and the echo line on line 2.
    The menuentry lines are only what will display on your grub menu.

    See this post by Drs305 on the old tutorial thread here.
    (this is when grub 1.99 came out)
    Check Java Version | Install Java via WEB UPD8 PPA
    Creating a Custom Maintenance Free GRUB2 Screen Community Wiki
    Ubuntu 12.04 | 14.04 | 14.10 | Mint 13 | Mint 17 | Windows 7 | All 64 bit

  6. #76
    Join Date
    Jun 2012
    Beans
    34

    Re: How to have a custom Grub2 menu that is maintenance free

    Quote Originally Posted by Cavsfan View Post
    The exec tail -n +4 $0 line tells it to execute the 4th line from the top which is the 1st menuentry line.
    You will only see the echo output from line 2 when you enter sudo update-grub in terminal.
    It will list your picture and the echo line on line 2.
    The menuentry lines are only what will display on your grub menu.
    According to oldfred, though, 2.00 doesn't do "echo" lines anymore:

    Quote Originally Posted by oldfred
    Grub2 2.00 it seems does not work with the old commands with echo.
    Are you saying it does for you, Cavsfan? Because it's not working for me, either.

    Also, let me clarify from my previous post (#71):

    When I run update-grub and then reboot my system, my menu entries on the grub menu do not reflect the changes I made in the 06_custom file as posted in post #71.

    I don't really care about the "echo" command, because that's really just something for me to see and "ooo" and "ahh" at. But I really do want the menu entries to reflect what I want them to.

    Also, why would "chmod -x"-ing the os_prober file and running update-grub only find my Vista partition and not my base LinuxMint kernels? (I only have the kernels from the clean install: no updates).

    EDIT: OK, so apparently, I forgot to chmod +x my 06_custom file. After reading oldfred's question about whether the entries were even in the grub.cfg file or not, I found that they weren't. I thought that I HAD done the chmod +x command, so either it didn't take... or I didn't do it. For the sake of my sanity and personal image, I'm saying it didn't take.
    Last edited by ChinaJustin; January 27th, 2013 at 08:36 PM. Reason: Fixed the problem

  7. #77
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: How to have a custom Grub2 menu that is maintenance free

    I do not see an error. But my 40_customs have always had +3?

    A while back there were some issues with extra spaces at an end of line or the end of the file. Impossible to visually tell if that is an issue or not anymore.

    If you have turned off os-prober then only entires you have added in your 06 or 40 custom will be added. Is you 06_custom have execute bit set?

    In /etc/default/grub I added this:
    gksudo gedit /etc/default/grub
    GRUB_DISABLE_OS_PROBER=true
    or turn off executeable bit
    sudo chmod a-x /etc/grub.d/30_os-prober

    sudo chmod 755 /etc/grub.d/06_custom
    or
    sudo chmod a+x /etc/grub.d/06_custom

    Did you check your grub.cfg to see if boot stanza are there?
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  8. #78
    Join Date
    Aug 2009
    Beans
    3,200
    Distro
    Ubuntu Development Release

    Re: How to have a custom Grub2 menu that is maintenance free

    Quote Originally Posted by ChinaJustin View Post
    OK, so apparently, I forgot to chmod +x my 06_custom file.
    That will do it every time! I thought that may be the problem. ChinaJustin if you recall you were the one asking the question about why the exec tail -n +3 $0 line did not work with the echo lines on every entry.
    That is when Drs305 stepped in and told us that when grub went to 1.99

    This is from Lucid - grub 1.98:

    Code:
    #!/bin/sh
    exec tail -n +3 $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.
    echo "Lucid Lynx 10.04" >&2 
    cat << EOF
        menuentry "Lucid Lynx 10.04" {
        set root=(hd0,2)
        linux /vmlinuz root=/dev/sda2 ro quiet splash
        initrd /initrd.img
    }
    EOF
    Which as Drs305 said changed to this in grub 1.99 and 2.00.
    Changing the 3 to 4 and adding the echo line as the 2nd line causes the first executable line to be the 4th line down (the 1st menuentry).
    Or you could leave it a 3 and leave out the echo as you stated since you are the only one to see it when you type sudo update-grub in terminal is fine too.

    Code:
    #!/bin/sh
    echo 1>&2 "Adding Ubuntu Lucid Lynx and Windows 7"
    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.
    echo "Lucid Lynx 10.04" >&2
    cat << EOF
        menuentry "Lucid Lynx 10.04" {
        set root=(hd0,2)
        linux /vmlinuz root=/dev/sda2 ro quiet splash
        initrd /initrd.img
    }
    EOF
    echo "Lucid Lynx 10.04 (Recovery Mode)" >&2
    cat << EOF
        menuentry "Lucid Lynx 10.04 (Recovery Mode)" {
        set root=(hd0,2)
        linux /vmlinuz root=/dev/sda2 ro single
        initrd /initrd.img
    }
    EOF
    echo "Windows 7 Loader" >&2
    cat << EOF
        menuentry "Windows 7" {
        insmod ntfs
        set root='(hd0,1)'
        search --no-floppy --fs-uuid --set 1cfc7a8dfc7a60c6
        chainloader +1
    }
    EOF
    Oldfred, at that time all I had installed was Lucid with grub 1.98 so I was not keeping up with the times like I should have been.
    Bogan pointed out that my tutorial was wrong and when that finally got through my thick head, I fixed it.
    So, the new wiki is a lot better as it splits it between grub 1.98, 1.99 and 2.00.
    I need to update it with the grub versions instead of the Ubuntu versions because they can change but, the grub version is what is important.
    But, come April grub 1.98 will be a thing of the past.

    The reason I say to save 40_custom as 06_custom is that even when you have 10_linux and 30_os-prober executable, the custom display will be on top and be static.
    If you save the 40_custom file, the custom entries will be on the bottom and change when the other 2 files are made executable.

    Now I have 4 Ubuntu versions installed so I can at least try to keep up.
    Check Java Version | Install Java via WEB UPD8 PPA
    Creating a Custom Maintenance Free GRUB2 Screen Community Wiki
    Ubuntu 12.04 | 14.04 | 14.10 | Mint 13 | Mint 17 | Windows 7 | All 64 bit

  9. #79
    Join Date
    Aug 2009
    Beans
    3,200
    Distro
    Ubuntu Development Release

    Re: How to have a custom Grub2 menu that is maintenance free

    I upgraded my main install Lucid Lynx 10.04 LTS to Precise Pangolin 12.04.2 LTS yesterday.
    It upgraded Grub from version 1.98 to 1.99. I didn't restore my default grub but, I did take the installers version of every file it asked about.

    When you have edited a file it asks if you want to keep your version or take the installers version.
    Of course to get the full benefits of version 1.99 I took the installers version of /etc/default/grub and /etc/grub.d/05_debian_theme.

    When it automatically did the update-grub command I seen an error on line 59 message and it would not have been bootable as it was.

    When it asked to reboot to complete the upgrade I said no (n).

    I then made my 06_custom file unexecutable: sudo chmod -x /etc/grub.d/06_custom and of course sudo update-grub and I got no errors.

    So then I knew it was safe to reboot.
    The customized 06_custom file from grub 1.98 will not work with grub version 1.99 so I had to edit it like the wiki says for grub versions 1.99 and 2.00.

    They only real operational difference I notice with grub 1.99 is when I select Windows 7 (or probably any windows os), I see an erroneous error:
    Code:
    Error: No argument specified.  
    
    Press any key to contiue...
    which means nothing and you can just wait or press enter and it will go into windows just fine.

    So, I guess the most important things are when doing an upgrade to a newer version of grub it to accept the installers versions of any file is asks about and also make 06_custom unexecutable.
    You must do this before you reboot if you see that grub has an error or it probably will boot with a grub rescue prompt.
    Check Java Version | Install Java via WEB UPD8 PPA
    Creating a Custom Maintenance Free GRUB2 Screen Community Wiki
    Ubuntu 12.04 | 14.04 | 14.10 | Mint 13 | Mint 17 | Windows 7 | All 64 bit

  10. #80
    Join Date
    Aug 2009
    Beans
    3,200
    Distro
    Ubuntu Development Release

    Re: How to have a custom Grub2 menu that is maintenance free

    Added some info in the Introduction which is underlined about what to do if you do not restore your grub files
    before upgrading from one version of Ubuntu to another if the grub files are updated to another version.
    Check Java Version | Install Java via WEB UPD8 PPA
    Creating a Custom Maintenance Free GRUB2 Screen Community Wiki
    Ubuntu 12.04 | 14.04 | 14.10 | Mint 13 | Mint 17 | Windows 7 | All 64 bit

Page 8 of 23 FirstFirst ... 67891018 ... LastLast

Tags for this Thread

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
  •