Page 2 of 4 FirstFirst 1234 LastLast
Results 11 to 20 of 32

Thread: How do grub/ Ubuntu/ grub.cfg interact during boot ?

  1. #11
    Join Date
    Oct 2020
    Beans
    110

    Re: How do grub/ Ubuntu/ grub.cfg interact during boot ?

    [CODE]
    if [ "${recordfail}" = 1 ] ; then
    set timeout=5 generated AFTER changes in grub implemented
    {/CODE]

    recordfail is ALWAYS set to 1 by a function in one of the "helper scripts".
    From other discussions the purpose of "recordfail" is unclear , but not important to this discussion.

    Even when bypassed by setting GRUB_RECORDFAIL_TIMEOUT=5 in " default /grub" the grub boot menu STILL times out in 30 seconds.


    The simple conclusion - it has to be modified somewhere else. Still looking for the source.

    BTW - the GRUB_DEFAULT=3 shows up in grub.cfg , however item #3 is NOT selected in grub menu - issue #2
    Last edited by helen314; 4 Weeks Ago at 06:11 PM.

  2. #12
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How do grub/ Ubuntu/ grub.cfg interact during boot ?

    Start with default grub config file and change only one line at a time.
    Some defaults are set in the scripts in /etc/grub.d, normally not edited.

    Remove entries that are not standard in new default like.
    Setting GRUB_TIMEOUT to a non-zero value when GRUB_HIDDEN_TIMEOUT is set is no longer supported.

    How are you counting? Grub starts at 0, so first entry is 0 not 1. Not Like floors in Europe.
    Last edited by oldfred; 4 Weeks Ago at 08:12 PM.
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  3. #13
    Join Date
    Mar 2011
    Location
    U.K.
    Beans
    Hidden!
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: How do grub/ Ubuntu/ grub.cfg interact during boot ?

    When I investigate such issues I often turn to ripgrep to explore various directories for file content
    First install ripgrep if not already installed

    sudo apt install rg

    Let us look for the pattern TIMEOUT=

    https://blog.burntsushi.net/ripgrep/

    TIMEOUT=

    rg -i TIMEOUT= /etc/default | grep grub

    rg -i TIMEOUT= /boot | grep grub

    I see returns such as ..

    /boot/grub/grub.cfg: set timeout=30
    /boot/grub/grub.cfg: set timeout=10
    /boot/grub/grub.cfg: set timeout=0
    /boot/grub/grub.cfg: set timeout=10

    In fact I use rEFInd ..




  4. #14
    Join Date
    Aug 2011
    Location
    51.8° N 5.8° E
    Beans
    5,532
    Distro
    Xubuntu 20.04 Focal Fossa

    Re: How do grub/ Ubuntu/ grub.cfg interact during boot ?

    The error that causes grub to switch to a 30 second default instead of the normal 5 second (or whatever you set it to be in /etc/grub/default – yes, that's the right place to set it), is an error occuring during boot, not when updating grub. Sometimes, without updating grub, I see it fall back to a 30 second timeout and the next time, still without updating grub, it's back to 3 seconds. It has become more common as my computer gets older, but otherwise it's still fine, so I keep using it. At the same time, grub doesn't set the high display resolution. I guess that on your system grub has some difficulty finding the things it needs at boot time. For possible causes I would have to read the manual and quote the relevant passages for your, but I won't do that.

  5. #15
    Join Date
    Oct 2020
    Beans
    110

    Re: How do grub/ Ubuntu/ grub.cfg interact during boot ?

    So back to my original post.

    I have learned that UEFI boot process involves
    efibootmgr


    I am still looking for connection between grub / grub.cfg and efibootmgr .

    This is how mine
    efibootmgr looks currently



    Code:
    BootCurrent: 0000
    Timeout: 1 seconds
    BootOrder: 0000,0007,0011,0006,0004,0008,0009,000A,000B,000C,000D,000E,000F,0010
    Boot0000* ubuntu    HD(2,GPT,44c98307-eb14-4cd8-ab7e-3138193729a1,0x100800,0x100800)/File(\EFI\ubuntu\shimx64.efi)
    Boot0004* USB     BBS(USB,,0x0)..GO..NO........].e.M. .B.a.y. .R.e.a.d.e.r. .1...0.0....................A...................................$..Gd-.;.A..MQ..L.9.2.0.3.1.1.1........BO..NO........e.e.M. .B.a.y. .R.e.a.d.e.r. .1...0.1....................A...........................................$..Gd-.;.A..MQ..L.9.2.0.3.1.1.1........BO..NO........e.e.M. .B.a.y. .R.e.a.d.e.r. .1...0.2....................A...........................................$..Gd-.;.A..MQ..L.9.2.0.3.1.1.1........BO..NO........i.S.e.a.g.a.t.e. .B.U.P. .U.l.t.r.a. .T.o.u.c.h. .0.0.0.4....................A.............................6..Gd-.;.A..MQ..L.0.0.0.0.0.0.0.0.N.A.B.1.3.3.H.H........BO..NO{.......Y.S.e.a.g.a.t.e....................A.............................&..Gd-.;.A..MQ..L.N.A.8.3.3.B.D.C........BO..NO........e.e.M. .B.a.y. .R.e.a.d.e.r. .1...0.3....................A...........................................$..Gd-.;.A..MQ..L.9.2.0.3.1.1.1........BO
    Boot0006* Hard Drive     BBS(HD,,0x0)..GO..NO........u.W.D.C. .W.D.5.0.0.0.A.A.K.X.-.0.0.E.R.M.A.0....................A.................................>..Gd-.;.A..MQ..L. . . . .W. .-.D.C.W.2.C.W.E.4.9.5.7.9.3........BO..NO........o.W.D.C. .W.D.5.0.0.0.B.E.V.T.-.6.0.Z.A.T.0....................A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.X.W.Y.N.8.0.C.K.5.M.9.1........BO..NO........o.W.D.C. .W.D.5.0.0.0.A.A.K.S.-.7.5.V.0.A.0....................A...........................>..Gd-.;.A..MQ..L. . . . .W. .-.D.C.W.W.A.8.F.5.3.6.8.8.8........BO..NO........u.S.T.3.3.2.0.4.1.8.A.S....................A.................................>..Gd-.;.A..MQ..L. . . . . . . . . . . . .V.6.P.M.D.L.P.Z........BO
    Boot0007* ubuntu    HD(1,GPT,db6b86b5-a4cc-4395-a80a-f2a4e652586a,0x800,0x100000)/File(\EFI\ubuntu\grubx64.efi)..BO
    Boot0008* UEFI: Seagate BUP Ultra Touch 0004    PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(3,0)/HD(1,GPT,7149cebc-a872-4fa7-bf45-e75ea1672895,0xffff,0xefff1)..BO
    Boot0009* UEFI: Seagate BUP Ultra Touch 0004    PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(3,0)/HD(10,GPT,66537b42-4255-4eef-886f-7f0d54024f1f,0x803c8000,0x39fbc000)..BO
    Boot000A* UEFI: Seagate BUP Ultra Touch 0004    PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(3,0)/HD(12,GPT,eaa6938b-2fda-41b8-a307-6eaa95e594e4,0xba384000,0x3a98000)..BO
    Boot000B* UEFI: Seagate    PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(4,0)/HD(1,MBR,0x4294967229,0x3f,0x33dccfc1)..BO
    Boot000C* UEFI: Seagate    PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(4,0)/HD(2,MBR,0x4294967229,0x3605f800,0xf5aec000)/HD(1,MBR,0x0,0x36060000,0x4e2f800)..BO
    Boot000D* UEFI: Seagate    PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(4,0)/HD(2,MBR,0x4294967229,0x3605f800,0xf5aec000)/HD(2,MBR,0x0,0x3ae90000,0x7b64000)..BO
    Boot000E* UEFI: Seagate    PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(4,0)/HD(2,MBR,0x4294967229,0x3605f800,0xf5aec000)/HD(3,MBR,0x0,0x429f4800,0xc350000)..BO
    Boot000F* UEFI: Seagate    PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(4,0)/HD(2,MBR,0x4294967229,0x3605f800,0xf5aec000)/HD(4,MBR,0x0,0x673e6800,0xd206800)..BO
    Boot0010* UEFI: Seagate    PciRoot(0x0)/Pci(0x1d,0x0)/USB(1,0)/USB(4,0)/HD(2,MBR,0x4294967229,0x3605f800,0xf5aec000)/HD(13,MBR,0x0,0xbe1a0800,0x100000)..BO
    Boot0011* ubuntu    HD(1,GPT,4f929080-5b02-4d52-a717-efffff17ed13,0x800,0x100000)/File(\EFI\ubuntu\grubx64.efi)..BO

    I do not see any "30" (seconds ) time. Actually
    Timeout: 1 seconds
    does not make much sense - if it is indeed timer to execute
    /File(\EFI\ubuntu\shimx64.efi
    The grub menu of 30 seconds timeout overrides this mystery timeout.


    shimx64.efi being yet another mystery file used during Linux UEFI boot.
    And which appears to be machine generated (binary?) file ( by
    temporary yet unknown process) and not adding much to the

    resolution of the grub menu timeout of 30 seconds
    .

    This file seems to follow "grub" menu items, in relative "inhumanly readable " format. That is about all it tells.
    But it show older OS with BIOS boot options. They will go away AFTER I resolve this "30 seconds" issue.
    Not to bother to analyze.

    CORRECTION

    efibootmgr seems to be a copy of UEFI firmware "boot sequence " setup.

    That is where "ubuntu" DEVICE (?) ( not hardware - such as USB ) is identified and there are currently THREE of them , but the sequence is wrong !

    At present I do not want to monkey with UEFI firmware , mainly because it "automatically" tries different "device"
    when it fails 3 times ( per RTFM) .



    ( Yes, there got to be a pony there somewhere under all this ....)





  6. #16
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How do grub/ Ubuntu/ grub.cfg interact during boot ?

    You seem to have three different UEFI boot entries for ubuntu using different GUIDs.
    Do you have three different installs with three different ESP - efi system partitions?
    Or did you install & reformat ESP, so it got new UUID & GUID making new entry in UEFI and obsoleting old entry. You have to manually houseclean if obsolete entry.
    You can use efibootmgr to remove old or duplicate boot entries.
    See where XXXX is the number of the entry:
    man efibootmgr
    sudo efibootmgr -b XXXX -B

    UEFI has its own timeout. Not all UEFI have same settings. Some just have fast boot or no time. One of my systems has a fast boot off, but I can set a time delay.
    That is not related to grub at all.

    The install of Ubuntu to your system creates the /EFI/ubuntu folder & all the files inside it. A major update or reinstall of grub will recreate it.
    Shimx64.efi is used for UEFI Secure Boot, but works if Secure boot is off. Grubx64.efi only works if Secure boot is off.

    You are booting entry 0000, is that your correct Ubuntu?

    If grub is still using 30 sec it, in effect is saying something is wrong in your grub. Again go back to the default and only make one change at a time.
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  7. #17
    Join Date
    Oct 2020
    Beans
    110

    Re: How do grub/ Ubuntu/ grub.cfg interact during boot ?

    Quote Originally Posted by oldfred View Post
    You seem to have three different UEFI boot entries for ubuntu using different GUIDs.
    Do you have three different installs with three different ESP - efi system partitions?
    Or did you install & reformat ESP, so it got new UUID & GUID making new entry in UEFI and obsoleting old entry. You have to manually houseclean if obsolete entry.
    You can use efibootmgr to remove old or duplicate boot entries.
    See where XXXX is the number of the entry:
    man efibootmgr
    sudo efibootmgr -b XXXX -B

    UEFI has its own timeout. Not all UEFI have same settings. Some just have fast boot or no time. One of my systems has a fast boot off, but I can set a time delay.
    That is not related to grub at all.

    The install of Ubuntu to your system creates the /EFI/ubuntu folder & all the files inside it. A major update or reinstall of grub will recreate it.
    Shimx64.efi is used for UEFI Secure Boot, but works if Secure boot is off. Grubx64.efi only works if Secure boot is off.

    You are booting entry 0000, is that your correct Ubuntu?

    If grun effect is saying something is wrong in your grubb is still using 30 sec it, i. Again go back to the default and only make one change at a time.
    If grun effect is saying something is wrong in your grubb is still using 30 sec.

    Timely reminder WHAT is the issue. Much appreciated.


    My grub configuration is a result of several years of adding hardware and only SOME of the entries are actually working OS.

    That is NOT the issue - the grub timeout is.

  8. #18
    Join Date
    Oct 2020
    Beans
    110

    Re: How do grub/ Ubuntu/ grub.cfg interact during boot ?

    Quote Originally Posted by Impavidus View Post
    The error that causes grub to switch to a 30 second default instead of the normal 5 second (or whatever you set it to be in /etc/grub/default – yes, that's the right place to set it), is an error occuring during boot, not when updating grub. Sometimes, without updating grub, I see it fall back to a 30 second timeout and the next time, still without updating grub, it's back to 3 seconds. It has become more common as my computer gets older, but otherwise it's still fine, so I keep using it. At the same time, grub doesn't set the high display resolution. I guess that on your system grub has some difficulty finding the things it needs at boot time. For possible causes I would have to read the manual and quote the relevant passages for your, but I won't do that.
    For possible causes I would have to read the manual and quote the relevant passages for your, but I won't do that.

    So basically you confirmed same issue without offering an iota of solutions .
    Much appreciated.
    I will not suggest next time do not waste your time posting, it would be rude.

  9. #19
    Join Date
    Oct 2020
    Beans
    110

    Re: How do grub/ Ubuntu/ grub.cfg interact during boot ?

    Quote Originally Posted by dragonfly41 View Post
    When I investigate such issues I often turn to ripgrep to explore various directories for file content
    First install ripgrep if not already installed

    sudo apt install rg

    Let us look for the pattern TIMEOUT=

    https://blog.burntsushi.net/ripgrep/

    TIMEOUT=

    rg -i TIMEOUT= /etc/default | grep grub

    rg -i TIMEOUT= /boot | grep grub

    I see returns such as ..

    /boot/grub/grub.cfg: set timeout=30
    /boot/grub/grub.cfg: set timeout=10
    /boot/grub/grub.cfg: set timeout=0
    /boot/grub/grub.cfg: set timeout=10

    In fact I use rEFInd ..



    Thanks for real debugging approach to the issue.
    Appreciate your post , very much.

    Here is my search
    Code:
    a@a-desktop:~$ grep "TIMEOUT" /etc/default/grub
    GRUB_HIDDEN_TIMEOUT=0
    GRUB_HIDDEN_TIMEOUT_QUIET=true
    GRUB_TIMEOUT=5
    # recordfail = 1 is causing GRUB_RECORDFAIL_TIMEOUT=30 
    GRUB_RECORDFAIL_TIMEOUT=5
    a@a-desktop:~$
    Code:
    a@a-desktop:~$ grep "set timeout=" /boot/grub/grub.cfg
      set timeout=5
        set timeout=0
        set timeout=0
      set timeout=10
    a@a-desktop:~$
    Both confirm what I already know - nether one of these sets the grub menu timeout to 30 seconds

  10. #20
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Ubuntu

    Re: How do grub/ Ubuntu/ grub.cfg interact during boot ?

    /etc/default/grub is the small settings file. You have posted it before.
    Did you try changing everything to defaults and then test?

    You full grub.cfg with all the settings is in your /boot folder.
    Again the scripts build your full grub.cfg using settings from grub.

    Code:
    fred@z170-focal-k:~$ grep "time" /boot/grub/grub.cfg        
      set timeout=30 
      if [ x$feature_timeout_style = xy ] ; then 
        set timeout_style=menu 
        set timeout=3 
      # Fallback normal timeout code in case the timeout_style feature is 
        set timeout=3
    
    
    So if your settings in /etc/default/grub are not correct it defaults to 30.
    For more info on UEFI boot install & repair - Regularly Updated :
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

Page 2 of 4 FirstFirst 1234 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
  •