Page 1 of 5 123 ... LastLast
Results 1 to 10 of 43

Thread: need help updating GRUB -ubuntu 20.04 LTS

  1. #1
    Join Date
    Nov 2021
    Location
    TX, USA
    Beans
    35

    need help updating GRUB -ubuntu 20.04 LTS

    Hi everyone. I installed Ubuntu a couple of weeks ago (for the first time) and have spent a lot of time getting it set up and customized properly. One of the things I wanted was a LUKS encrypted filesystem. I currently have partitions for /boot, /boot/UEFI, and my home directory. The home directory's partition is LUKS encrypted. Later I wanted to reinstall Windows somewhere because I love my old photo organization tool and can't find a replacement in Linux that does what I want. I didn't really want to shrink my Ubuntu partitions at all, so I dug up an old 1TB disk that I was able to add to the computer (internally) and installed Windows 10 to it last night. Here's the issue:

    Now when I start up the machine, it goes right into Windows. I am able to use the Boot Menu in the BIOS to boot to my ubuntu partition with no issues, but I'd really like to add windows to grub.conf and just have GRUB control everything, like without having to go through the boot menu every time. After installing windows, I opened a terminal and ran sudo update-grub. That ran for a bit, but it didn't find my windows partition located on /dev/sdb. In fact, the main Win10 partition is /dev/sdb2/ but of course, windows creates a few extra partitions, probably including a boot partition.

    My problem is just that I can't add Windows to GRUB, at least not using the above command line. I did try loading Grub Customizer, but I don't know how to get it to search for other boot partitions, and those are the only ways I can think of to bring windows into GRUB by a noob like me. I was able to locate the grub.conf and edit it, at least to make sure the GRUB Customizer was looking at the right file. I can bring up the grub.conf by using the command sudo nano /boot/grub/grub.cfg but I have no idea how to add a partition, specifically a windows partition, to GRUB. I was hoping that sudo update-grub would do it, but it didn't find it. So now I'm a little stuck, and that's where you come in (hopefully). :D

    What I'd really love to make happen would be to change one of the existing options in GRUB - "elementary OS, with Linux 5.11.0-37-generic" - to instead boot Windows 10 on /sdb. In other words, the menu item in GRUB should still say the same thing - "elementary OS, with Linux 5.11.0-37-generic" - but would instead secretly load Windows. I currently have GRUB loading the default OS in 2 seconds I think it is, so if anyone else ever used my computer, they would just default to eOS and wouldn't be able to unlock the user partition, and it wouldn't boot. I know if I hit an arrow key at all on the GRUB screen it stops the timer, so that shouldn't be an issue for me to choose. Here's a screencap of nano /boot/grub/grub. Sorry it's full size. If I should shrink these in the future, say so. I just thought a full size screencap would let you clearly see everything.


    Rjcwwxa.jpg

    Wow, that's huge! I'm only at 1920*1080, but that image looks gigantic. Oh well, there it is. I guess just right click and Open image in a new tab. :D

    At any rate, thank you again in advance for your time and attention. I promise I'm keeping careful notes on everything I do to the system, and your assistance will be greatly appreciated, as well as recorded in my personal notes.
    ____________________________________________

    EDIT: Oh, look at that. The forum is smart enough to shrink my picture so it fits on the page. That's something to remember.
    Last edited by QIII; December 1st, 2021 at 06:52 PM. Reason: Corrected typo to "Windows"

  2. #2
    Join Date
    Aug 2016
    Location
    Wandering
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: need help updating GRUB -ubuntu 20.04 LTS

    Run the following on the command line (Ctrl+Alt+t):
    Code:
    sudo os-prober
    If your Windows installation was found, you can then run:
    Code:
    sudo update-grub
    If a "command not found" error is returned, use:
    Code:
    sudo apt install os-prober
    Good luck. BTW I'm not a fan of "Grub-Customizer" in the wrong hands cause more grief than necessary
    Last edited by 1fallen; November 29th, 2021 at 11:14 PM. Reason: type-o
    With realization of one's own potential and self-confidence in one's ability, one can build a better world.
    Dalai Lama>>
    Code Tags | System-info | Forum Guide lines | Arch Linux, Debian Unstable, FreeBSD

  3. #3
    Join Date
    Jun 2009
    Location
    SW Forida
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: need help updating GRUB -ubuntu 20.04 LTS

    Moved to Other OS, since elementary OS is not Ubuntu.

    Are both installed in UEFI or both in BIOS boot mode?
    How you boot install media, for both Linux & Windows is how it installs.

    Systems since 2012 are UEFI, as Microsoft has required vendors to install in UEFI boot mode to gpt partitioned drives.
    Windows only boots in UEFI mode from gpt and only in BIOS/CSM/Legacy mode from MBR.
    Only recently have some vendors made systems that are UEFI only.
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

  4. #4
    Join Date
    Aug 2016
    Location
    Wandering
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: need help updating GRUB -ubuntu 20.04 LTS

    Quote Originally Posted by oldfred View Post

    Are both installed in UEFI or both in BIOS boot mode?

    Only recently have some vendors made systems that are UEFI only.
    Thought never even occurred to me, good call oldfred.
    Due to this from OP
    I am able to use the Boot Menu in the BIOS to boot to my ubuntu partition with no issues,
    My Lenovo Legion 5 is in deed UEFI Only (2020)
    Last edited by 1fallen; November 29th, 2021 at 11:51 PM.
    With realization of one's own potential and self-confidence in one's ability, one can build a better world.
    Dalai Lama>>
    Code Tags | System-info | Forum Guide lines | Arch Linux, Debian Unstable, FreeBSD

  5. #5
    Join Date
    Nov 2021
    Location
    TX, USA
    Beans
    35

    Re: need help updating GRUB -ubuntu 20.04 LTS

    Quote Originally Posted by 1fallen View Post
    Run the following on the command line (Ctrl+Alt+t):
    Code:
    sudo os-prober
    Cool, thanks for the help! I tried this and it found Windows partition:

    Code:
    unknowable@Elite8300:~$ sudo os-prober
    [sudo] password for unknowable:
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
    /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi:Windows Boot Manager:Windows:efi
    Great! Continuing...

    Quote Originally Posted by 1fallen View Post
    If your Windows installation was found, you can then run:
    Code:
    sudo update-grub
    Hm. Did that, and it couldn't find a disk:

    Code:
    unknowable@Elite8300:~$ sudo update-grub
    Sourcing file `/etc/default/grub'
    Sourcing file `/etc/default/grub.d/init-select.cfg'
    Generating grub configuration file ...
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
    Found linux image: /boot/vmlinuz-5.11.0-41-generic
    Found initrd image: /boot/initrd.img-5.11.0-41-generic
    Found linux image: /boot/vmlinuz-5.11.0-40-generic
    Found initrd image: /boot/initrd.img-5.11.0-40-generic
    Found linux image: /boot/vmlinuz-5.11.0-37-generic
    Found initrd image: /boot/initrd.img-5.11.0-37-generic
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
    done
    Sourcing file `/etc/default/grub'
    Sourcing file `/etc/default/grub.d/init-select.cfg'
    Generating grub configuration file ...
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
    Found linux image: /boot/vmlinuz-5.11.0-41-generic
    Found initrd image: /boot/initrd.img-5.11.0-41-generic
    Found linux image: /boot/vmlinuz-5.11.0-40-generic
    Found initrd image: /boot/initrd.img-5.11.0-40-generic
    Found linux image: /boot/vmlinuz-5.11.0-37-generic
    Found initrd image: /boot/initrd.img-5.11.0-37-generic
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
      /dev/sdf: open failed: No medium found
    done
    I checked the Disks utility, and it looks like /dev/sdf is the encrypted drive mounted by LUKS, I guess:

    cDqUYRf.jpg

    Although it does say it's a USB disk of some sort. It doesn't say what size it is, so I don't have any idea which one it is. Hm. Well, no success yet, so I kept following:

    Quote Originally Posted by 1fallen View Post
    If a "command not found" error is returned, use:
    Code:
    sudo apt install os-prober
    I have to admit, I've been up for like 30 hours, and I had a total Windows user moment. I followed your instructions without looking to see what I was doing. Obviously os-prober worked when I tried it, which was the first command, but I wasn't thinking and just ran it anyway. It just said that os-prober was the latest version:

    Code:
    unknowable@Elite8300:~$ sudo apt install os-prober
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    os-prober is already the newest version (1.74ubuntu2).
    os-prober set to manually installed.
    Hm. I did try opening up that disk in Files, and also from the command line, but there wasn't anything there.

    Quote Originally Posted by 1fallen View Post
    Good luck. BTW I'm not a fan of "Grub-Customizer" in the wrong hands cause more grief than necessary
    Heh. Thank you for the note. I only used it to make some changes once, and it broke GRUB, so I had to re-image the drive from backup. Took a while, but no issue in that case. I'll be careful.

    That being said, your first command worked, it found the Windows partition right away, but sudo update-grub did not. I see someone else posted, let me see where they're taking me. Thanks for the first step though, that's a useful command to know and I have notated it in my record. Thank you.
    Last edited by QIII; December 1st, 2021 at 06:54 PM.

  6. #6
    Join Date
    Nov 2021
    Location
    TX, USA
    Beans
    35

    Re: need help updating GRUB -ubuntu 20.04 LTS

    Quote Originally Posted by oldfred View Post
    Moved to Other OS, since elementary OS is not Ubuntu.
    Sorry about the misplaced post. I thought it would be good to post there because eOS is based on Ubuntu 20.04 LTS, and everything I've Google'd for help generally works when I add "AND ubuntu" to the end of my search terms. Sorry!
    ______________________________

    EDIT: Oh, I see! You moved it to Ubuntu BASED. That makes sense, thanks.
    ______________________________

    Quote Originally Posted by oldfred View Post
    Are both installed in UEFI or both in BIOS boot mode?
    How you boot install media, for both Linux & Windows is how it installs.

    Systems since 2012 are UEFI, as Microsoft has required vendors to install in UEFI boot mode to gpt partitioned drives.
    Windows only boots in UEFI mode from gpt and only in BIOS/CSM/Legacy mode from MBR.
    Only recently have some vendors made systems that are UEFI only.
    Windows is installed in UEFI mode, but Ubuntu isn't. It's MBR, and I can't get my BIOS to boot /dev/sda because of that. This computer is just a couple of weeks old, and I still can't find where in the BIOS to allow MBR booting. I'll check again at some point looking for CSM/Legacy mode, but I haven't found it yet. What that means right now is that no matter what, I have to go into the Boot Menu when it starts up and then load Ubuntu. I did try disabling EFI booting mode on everything, and only allowing Legacy mode drives to start, but my system just hangs at boot time unless UEFI mode is enabled.
    Last edited by unknowable; November 30th, 2021 at 12:11 AM. Reason: eOS not Ubuntu? Really?

  7. #7
    Join Date
    Nov 2021
    Location
    TX, USA
    Beans
    35

    Re: need help updating GRUB -ubuntu 20.04 LTS

    Quote Originally Posted by oldfred View Post
    UEFI boot install & repair info - Regularly Updated :
    https://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to change to [Solved] when/if answered completely.

    Hmm, this is some good reading, really informative. I'll be doing a bit of reading for a while. Although to be honest, while I do see switching to UEFI will help solve my issue, the primary issue still exists: GRUB can't see Windows at all. Even if I get eOS to UEFI, that will still mean going into the Boot Menu regularly, since GRUB doesn't handle both of them. But I haven't read it yet, so I don't know anything. We'll see, and thanks for your help.
    Last edited by QIII; December 1st, 2021 at 06:54 PM.

  8. #8
    Join Date
    Aug 2016
    Location
    Wandering
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: need help updating GRUB -ubuntu 20.04 LTS

    Quote Originally Posted by unknowable View Post
    Although to be honest, while I do see switching to UEFI will help solve my issue, the primary issue still exists: GRUB can't see Windows at all.
    Even if I get eOS to UEFI, that will still mean going into the Boot Menu regularly, since GRUB doesn't handle both of them. .
    Once they are both in proper booting order "UEFI" they both will show up>>>Windows&Buntu in grub.
    I would now>> if i were you is just install eOS in UEFI mode.
    Last edited by QIII; December 1st, 2021 at 06:54 PM.
    With realization of one's own potential and self-confidence in one's ability, one can build a better world.
    Dalai Lama>>
    Code Tags | System-info | Forum Guide lines | Arch Linux, Debian Unstable, FreeBSD

  9. #9
    Join Date
    Jul 2008
    Location
    The Left Coast of the USA
    Beans
    Hidden!
    Distro
    Kubuntu

    Re: need help updating GRUB -ubuntu 20.04 LTS

    @unknowable

    Please do not insert large images into your posts. Believe it or not, there are users who still have slow connections or data limits. You may cause users to wait for a long time for the image to download. Worse, you may cost them money.

    To insert expandable thumbnails, please use the attachment facility provided by the "paperclip" button above the text entry box.
    Please read The Forum Rules and The Forum Posting Guidelines

    A thing discovered and kept to oneself must be discovered time and again by others. A thing discovered and shared with others need be discovered only the once.
    This universe is crazy. I'm going back to my own.

  10. #10
    Join Date
    Nov 2021
    Location
    TX, USA
    Beans
    35

    Re: need help updating GRUB -ubuntu 20.04 LTS

    Quote Originally Posted by QIII View Post
    @unknowable

    Please do not insert large images into your posts. Believe it or not, there are users who still have slow connections or data limits. You may cause users to wait for a long time for the image to download. Worse, you may cost them money.

    To insert expandable thumbnails, please use the attachment facility provided by the "paperclip" button above the text entry box.
    Ack, sorry! Yes, I'll do that from now on. I see the paperclip, I'll start doing that from now on. Thank you for the instruction.

Page 1 of 5 123 ... 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
  •