Page 86 of 94 FirstFirst ... 36768485868788 ... LastLast
Results 851 to 860 of 931

Thread: Grub 2 Basics

  1. #851
    Join Date
    Jun 2009
    Location
    Alabama
    Beans
    2,231

    Exclamation Re: Grub 2 Basics

    I had a ton of grub2 confusion, this morning. Everything is sort of working, now, but I have no idea where I have ended up.

    My main installation is Ubuntu 11.10. I was controlling grub2 from it. I have secondary installations of Arch and Ubuntu 12.04. The Arch installation requires some custom configuration settings, which I modified by editing /etc/grub.d/30_os-prober

    Everything was working great until a kernel upgrade for Ubuntu 12.04 came this morning. 12.04 ran its own grub2, it didn't detect Arch, and 11.10 would boot, but the filesystems were mounted read-only. So, it wouldn't really run.

    I tried several update-grubs and grub-installs from various of my installations, but nothing was getting things right. One of them even picked up on a very old 3.0.0-12 kernel for 11.10. How, I don't know.

    So, I finally booted to a LiveCD and did grub-install from there. It did pretty well, and I could boot to a running 11.10 system which was running the correct kernel (I think). Then, from the running 11.10, I ran update-grub. It picked up both Arch and 12.04. However, it did not pick up my custom mods for Arch. And it still looks like it is a 12.04 grub menu, because 12.04 is at the top, 11.10 is on down the list, and Arch is at the bottom. Both Ubuntus boot just fine, but to boot Arch, I now have to type 'e' on its grub menu selection and add my custom parameters, manually, then Ctrx-x to boot.

    Whatever is going on? Maybe if I ran grub-install from 11.10 it would fix things back the way they were? But, I've already had so much trouble I don't feel like trying anything else, right now.

    Tim
    Cyberpower PC, Core i5 2500 3.3 gHz, 8GB DDR3, ATI 6770 1GB, Samsung BX 2440 LED 1080p, 1 TB SATA III, 2 TB SATA III, Siduction Linux 64-bit

  2. #852
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Basics

    ratcheer,

    Update-grub updates the grub menu for the (Ubuntu) OS you are currently booted into but you won't see any change if it isn't the controlling grub.

    You had the right idea: Boot into 11.10, then run "sudo grub-install /dev/sda" and your 11.10 should be controlling things again. If the drive isn't the first in the boot order, change 'sda' to the correct designation.

    The old kernel in the menu could have come from an os-prober search of your system, but sometimes Grub will also 'harvest' old Grub menus for entries. If the kernel doesn't actually exist, look for and delete any grub.cfg menus you are not actually using (I'd keep the current one for each OS in it's own /boot/grub folder). Run update-grub in each OS to ensure the main menu (within that partition) is up-to-date.
    Last edited by drs305; March 6th, 2012 at 07:36 PM.
    GRUB2

    Retired.

  3. #853
    Join Date
    Jun 2009
    Location
    Alabama
    Beans
    2,231

    Thumbs up Re: Grub 2 Basics

    Thanks very much for your reply, @drs305.

    So, since my 11.10 was the controlling owner of my prior grub2 configuration, why did the update-grub that was run when 12.04 kernel was upgraded mess up my system?

    I wish they would "ask" before doing things like that. Arch did. I was able to instruct the Arch installation to not run grub. That was great.

    Thank you,
    Tim
    Cyberpower PC, Core i5 2500 3.3 gHz, 8GB DDR3, ATI 6770 1GB, Samsung BX 2440 LED 1080p, 1 TB SATA III, 2 TB SATA III, Siduction Linux 64-bit

  4. #854
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Basics

    Quote Originally Posted by ratcheer View Post
    Thanks very much for your reply, @drs305.

    So, since my 11.10 was the controlling owner of my prior grub2 configuration, why did the update-grub that was run when 12.04 kernel was upgraded mess up my system?

    I wish they would "ask" before doing things like that. Arch did. I was able to instruct the Arch installation to not run grub. That was great.

    Thank you,
    Tim
    Most times when Grub is going to rewrite the configuration it asks for confirmation, especially in the case when the 'controlling' bootloader changes. This would be when "grub-install" is run or when certain Grub scripts are updated. When a kernel is updated 'update-grub' is run so the menu is updated but a simple kernel update shouldn't trigger 'grub-install'.

    Perhaps one of the core Grub files was changed at about the same time as the kernel, or another update on your newer OS triggered the udpate. In any case when control is transferred to another OS I agree that Grub should ask if it's OK to do so. That is the way it's designed, but as you found out sometimes it occurs when the user fails to notice the warning or it gets bypassed for some some reason.
    GRUB2

    Retired.

  5. #855
    Join Date
    Jun 2009
    Location
    Alabama
    Beans
    2,231

    Re: Grub 2 Basics

    Thank you.

    Tim
    Cyberpower PC, Core i5 2500 3.3 gHz, 8GB DDR3, ATI 6770 1GB, Samsung BX 2440 LED 1080p, 1 TB SATA III, 2 TB SATA III, Siduction Linux 64-bit

  6. #856
    Join Date
    Feb 2010
    Beans
    21

    Re: Grub 2 Basics

    Since yesterday I'm customizing my GRUB 2 configuration but I'm running in to a few problems now. This is what I want to accomplish:

    1. Change the menu entry sequence in such a way that the Windows loader will always be the first entry. The sequence of the other menu entries does not really mather.
    2. Protect two menu entries with a user+pass (this is not really a problem but I want to realize this as soon as I've solved point 1.
    3. A problem which I'm encountering now is that I've configured to hide the menu, but when I boot the splas image (without menu entries of course) isn't showing until I press a key. I found on the internet another topic with the same problem but I don't fully understand how to realize the mentioned solution.

    Splash screen not showing without pressing a key

    I'm really desperate for some help, so any answer or link to solutions would be greatly appreciated.

  7. #857
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Basics

    Quote Originally Posted by Scripting22 View Post
    Since yesterday I'm customizing my GRUB 2 configuration but I'm running in to a few problems now. This is what I want to accomplish:

    1. Change the menu entry sequence in such a way that the Windows loader will always be the first entry. The sequence of the other menu entries does not really mather.
    The easiest way to do this is with an app called Grub Customizer. It's a great tool that lets you tweak a lot of the Grub settings via a GUI interface. See the "Customizer" link in my signature line.

    The other option would be to make a custom menu and name it 09_custom, but I'd recommend Grub Customizer.

    2. Protect two menu entries with a user+pass (this is not really a problem but I want to realize this as soon as I've solved point 1.
    I wrote a guide on password protection in Grub 2. I don't know if Grub Customizer has a password capability.
    http://ubuntuforums.org/showthread.php?t=1369019


    3. A problem which I'm encountering now is that I've configured to hide the menu, but when I boot the splas image (without menu entries of course) isn't showing until I press a key. I found on the internet another topic with the same problem but I don't fully understand how to realize the mentioned solution.

    Splash screen not showing without pressing a key

    I'm really desperate for some help, so any answer or link to solutions would be greatly appreciated.
    Grub 2 really isn't set up to normally run this way since the purpose of the Grub screen is to select an OS to boot. The way Grub thinks, if you aren't going to make a selection there is no need to see the menu (and background).

    Setting up Grub so you can see a grub splash image is going to slow your boot, since nothing is going to start until you make a selection. If your desire is to show a blank screen on boot unti a selection is made, it can be accomplished but would take a bit of work.

    My main difference with the suggestion in the link you provided would be to use a menuentry with an empty title (i.e. " " ). The menuentry would still exist, but would be invisible.

    With the introduction of the submenu option in newer Grub 2 versions, I think rather than using a second grub.cfg file a submenu might be easier to manage. I'd have to experiment a bit to see how it would work. I'll put it in the "if I have some extra time I'll play with it" category.

    I realize I haven't answered your third question very well, but it will have to do for the moment.
    GRUB2

    Retired.

  8. #858
    Join Date
    Feb 2010
    Beans
    21

    Re: Grub 2 Basics

    Thnx! Your reply is really helpfull. I've changed the sequence of the menu entries with the Grub customizer app.

    Your guide on password protection seems not to difficult so I will save that for the last.

    The third answer however is (like you mentioned) for me a bit difficult to understand. First thing I don't understand is, how can there be two grub.cfg files? Which one will be (first) used at boot, or wil the both be used after each other?

    Second thing I like to ask is, where would I put the empty menu entry and what would be the effect of it? Or do you mean that this empty menu entry should be added to the second grub.cfg file?

    When I was searching on the internet yesterday for a solution I also found that the use of sub menus could be of some help. But I think that this is much more difficult to configure. Therefore I think I go for the moment for a second grub.cfg with a empty entry.

    Could you please explain a little bit more about how to create a second grub.cfg and add a empty entry to it?

  9. #859
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Grub 2 Basics

    Quote Originally Posted by Scripting22 View Post
    The third answer however is (like you mentioned) for me a bit difficult to understand. First thing I don't understand is, how can there be two grub.cfg files? Which one will be (first) used at boot, or wil the both be used after each other?
    I knew the answer was insufficient but I hadn't tried what I was about to propose.

    To answer your question, your first grub configuration file (grub.cfg) would merely point to a second one. Grub can use any valid .cfg file, so the main menu (grub.cfg) could point to another menu. When that menuentry is selected, the new .cfg menu is displayed. That is what the quoted menuentry from the other link does.

    Another way to display a second menu is via the 'submenu', which is contained within the original menu but hidden from view (except for the submenu title). This concept was introduced to limit the number of kernel versions are displayed on the main menu.

    The second set of menuentries would merely be hidden in a submenu of the grub.cfg file.

    I've now tested an idea and it works.

    First, change the default timeout to -1. This will force you to make a selection before the system boots. You can do this in Grub Customizer.

    Next, open /boot/grub/grub.cfg for editing. In the 10_linux section, find the following line (if you have it):
    submenu "Previous Linux versions" {
    Move it to the line immediately before the first menuentry in the 10_linux section. It should now look something like this:
    submenu "Previous Linux versions" {
    menuentry 'Ubuntu, with Linux 3.0.0-17-generic' --class ubuntu --class gnu-linux --class gnu --class os {
    Next, change the "Previous Linux versions" title to look like this:
    submenu " " {
    Save the file and do NOT update grub.

    If you only had one Linux OS, with MEMTEST disabled, and no Windows entries, what you should see when you boot is a screen with just the background image. If you press ENTER, your full menu will appear.

    See if this is the effect you are looking for. This method is not foolproof without some more tweaking since an update of grub will remove this edit, but it's a start.
    GRUB2

    Retired.

  10. #860
    Join Date
    Feb 2010
    Beans
    21

    Re: Grub 2 Basics

    Okay, so far I did exactly what you said but when I rebooted my laptop I ended up in de GRUB commandline instead of the menu.

    Maybe this is caused by the fact that I've made alterations to the sequence of menu entries. Maybe this has caused to change the run the scripts in a different order?

    I solved the problem by using the solution mentioned in my first post. Unfortunately the solution by using a submenu doesn't create the desired effect.

    Now I will password protect the different menu entries in the second grub.cfg so I will furthermore protect my Linux distributions.
    Last edited by Scripting22; April 10th, 2012 at 10:46 PM. Reason: New

Page 86 of 94 FirstFirst ... 36768485868788 ... 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
  •