Announcement

Collapse
No announcement yet.

Change GRUB boot menu (solved)

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

    Change GRUB boot menu (solved)

    Change GRUB boot menu
    =====================

    I have just installed the latest Kubuntu on a PC that has XP installed.

    Both OS's boot OK (default = Kubuntu), but there is also an XP recovery partition that appears on the boot list, plus some other stuff (memtest?) I don't want displayed.

    I want to drastically simplify this menu so that it just shows:

    - XP (default)
    - Kubuntu

    ...and I want it to stay this way throughout future Kubuntu updates (ideally!).

    As a first step I thought I would try something simpler: just change the default OS to XP.

    In a previous version of GRUB, I could simply edit the menu.lst, but this appears to be GRUB 2,
    and the boot menu appears to be generated dynamically (why?).

    After trawling through a lot of web sites I tried:

    kdesu cp /etc/default/grub /etc/default/grub.orig
    kdesu COMMAND NOT FOUND

    So I tried
    sudo cp /etc/default/grub /etc/default/grub.orig
    which worked.

    Then
    kdesu kate /etc/default/grub
    kdesu COMMAND NOT FOUND

    So I tried
    sudo kate /etc/default/grub
    which worked.

    Then edit GRUB_DEFAULT=n and save the file. OK

    Then
    kdesu grub-update
    kdesu COMMAND NOT FOUND

    So I tried
    sudo grub-update
    grub-update COMMAND NOT FOUND

    I am now totally stuck.

    I want to make a simple change to the boot menu, and it should be a simple job to do - why isn't it?



    #2
    Re: Change GRUB boot menu

    I am not sure updating grub (changing the bootloader) is supposed to be something simple or something any user would like to do. The reason it is dynamically generated is to accommodate for changes: if there is a new kernel for Ubuntu, the boot loader should point into that new kernel, but, unlike windows, you still have access to older kernels, in case something works better in the previous version.

    Some notes:
    * the command is kdesudo
    * you can hit [tab] when typing a command for autocompletion, it would have actually completed kdesudo for you
    * the command is update-grub, you typed it backwards, http://man.he.net/man8/update-grub
    * there used to be a graphical configuration for grub in kubuntu (not very good but still useful), but it hasn;t been ported to the new grub.
    * this is very lengthy but useful
    http://kubuntuforums.net/forums/inde...opic=3106368.0

    Comment


      #3
      Re: Change GRUB boot menu

      Originally posted by johniathome

      I want to drastically simplify this menu so that it just shows:

      - XP (default)
      - Kubuntu

      ...and I want it to stay this way throughout future Kubuntu updates (ideally!).
      ...

      I want to make a simple change to the boot menu, and it should be a simple job to do - why isn't it?
      I came to this decision a long time ago. I edit and make my own grub.cfg file. I control how my grub menu looks. Whenever you install or reinstall grub to the mbr it points back to the partition you installed it from.

      I keep a copy of my grub.cfg in my home folder. Whenever there system issues a update-grub I simple overwrite the grub.cfg file with my own.

      I have just as you stated, a simple menu with just the way I want it to look. None of that script messing around.

      After all, I look at grub boot menu all of 2 seconds before I make my selection.
      If I add another distro, I simple get its UUID and add it to the menu. This has worked for me.

      As far as those that think this is "dangerous" . A simple chroot and grub-install fixes it. Since grub2 came into existence I have only had to use that install when creating grub to a usb drive.

      Also, I use symbolic links to the kernel so it picks up the latest kernels automatically.
      Boot Info Script

      Comment


        #4
        Re: Change GRUB boot menu

        I was beginning to loose the will to live - thanks for both of your quick responses!

        Imilano:
        The command typos were straight from the "help" page I was looking at.
        your corrections have solved my initial problem.

        Next question:
        One of the partitions contains a Windows restore process that wipes the whole machine.
        I don't want the user to accidentally start this running for obvious reasons.

        I used the KDE partition manager to set the hidden flag on this partition (the boot flag is not set),
        then re-generated the GRUB menu.

        However, it does not ignore the partiton, and still creates a boot menu entry for it.
        How can I stop this?

        verndog:
        Thanks for you suggestion - I will try it out some time.

        Comment


          #5
          Re: Change GRUB boot menu

          I am afraid, this (blacklisting) seems to have been implemented quite recently (if implemented at all):
          http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=561626

          So, it might be available for Lucid, but not for now!

          You can also ask Qqmike, the author of the Grub help I referred to above ... best luck, and I am glad we are making progress!

          Comment


            #6
            Re: Change GRUB boot menu

            Another option would be to create a custom menu entry for your windows system based on what is in grub.cfg. You put that in /etc/grub.d/40_custom. Then change the 30_os-prober to non-executable. That way, it will update the linux listing, will not automatically list anything other than the linux system, and finally list your windows system from 40_custom. So you will have no listing from the rescue partition. There is also a "hidden" option that might work, but I am not familiar with how to use it.

            Edit: to further simplify your menu, you could set up another entry in 40_custom that points to the links /vmlinuz and /initrd.img, instead of to the specific vmlinuz-2.6.whatever. That way, it will always point to the most recent kernel installed. Then, you could make 10_linux (and 20_memtest86+, for that matter) non-executable, and the only menu entries you see will be what is in your 40_custom.

            Note, if you do this, be sure to check /boot/grub/grub.cfg before rebooting your machine, to make sure it generated the menu you expected.
            We only have to look at ourselves to see how intelligent life might develop into something we wouldn't want to meet. -- Stephen Hawking

            Comment


              #7
              Re: Change GRUB boot menu

              Originally posted by doctordruidphd
              Another option would be to create a custom menu entry for your windows system based on what is in grub.cfg. You put that in /etc/grub.d/40_custom. Then change the 30_os-prober to non-executable. That way, it will update the linux listing, will not automatically list anything other than the linux system, and finally list your windows system from 40_custom. So you will have no listing from the rescue partition. There is also a "hidden" option that might work, but I am not familiar with how to use it.

              Edit: to further simplify your menu, you could set up another entry in 40_custom that points to the links /vmlinuz and /initrd.img, instead of to the specific vmlinuz-2.6.whatever. That way, it will always point to the most recent kernel installed. Then, you could make 10_linux (and 20_memtest86+, for that matter) non-executable, and the only menu entries you see will be what is in your 40_custom.

              Note, if you do this, be sure to check /boot/grub/grub.cfg before rebooting your machine, to make sure it generated the menu you expected.
              These are all brilliant ideas! I think that's the ticket for Johni!

              Comment


                #8
                Re: Change GRUB boot menu

                Thanks to doctordruidphd. This looks like an excellent approach that will give me exactly what I want.

                I had noticed 40_custom, but did not know how to use it.

                One question: how do I make 30_os-prober non-executable (or anything else for that matter)?
                Remember - I am new to this stuff!

                (Going to bed now, so nothing more for a while).

                Comment


                  #9
                  Re: Change GRUB boot menu

                  You just do "chmod a-x /path/to/the/file/"

                  See here for more:
                  http://en.wikipedia.org/wiki/Chmod

                  Comment


                    #10
                    Re: Change GRUB boot menu

                    The Grub 2 Guide You'll find everything you need to know. Well written.
                    Using Kubuntu Linux since March 23, 2007
                    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                    Comment


                      #11
                      Re: Change GRUB boot menu

                      Thanks to all who have contributed to this.

                      I now have exactly what I want, and it's not often you get that in life!

                      Comment


                        #12
                        Re: Change GRUB boot menu



                        Welcome to KFN. Lot's of good people here. A varied range of experience.
                        Using Kubuntu Linux since March 23, 2007
                        "It is a capital mistake to theorize before one has data." - Sherlock Holmes

                        Comment


                          #13
                          Re: Change GRUB boot menu

                          Yet another solution is to have a dedicated GRUB partition!

                          This keeps my Quintuple boot system working!!!

                          Please Read Me

                          Comment


                            #14
                            Re: Change GRUB boot menu

                            @johniathome: welcome to KFN..
                            if your problem is solved please edit the subject line and append "(solved)"

                            and please tell us what did you do to get that perfect grub menu
                            asus A52N
                            Dual boot: Kubuntu 11.10 64bit, Ubuntu 11.10 64bit
                            AMD Athlon II 64 X2 | 4 GB DDR3 RAM | ATI Radeon HD 4200
                            windoze free since 2009 12 16 (Vijay din= Victory day)

                            Comment


                              #15
                              Re: Change GRUB boot menu (solved)

                              I got it to work mainly using doctordruidphd's suggestions, but thanks to everyone else who answered.

                              Comment

                              Working...
                              X