Results 1 to 8 of 8

Thread: How to prevent Ubuntu adding itself to Boot Menu of EFI partition

  1. #1
    Join Date
    Dec 2017
    Beans
    5

    Question How to prevent Ubuntu adding itself to Boot Menu of EFI partition

    I have installed (full installation) Ubuntu 22.04 into external SSD and is working fine. I removed internal HDD during installation. All Ubuntu partitions (boot, EFI, root, home etc.) reside in external SSD. Post Ubuntu installation, I put the internal HDD back in its place. During normal usage, when I upgrade Ubuntu (sudo apt upgrade), it adds entry in the Boot Menu of the UEFI partition of my PC's Internal HDD. This happens specifically when there is upgradation to newer Ubuntu kernel. How can I prevent Ubuntu to modify Boot Menu of my internal HHD? I do not have BIOS option to disable HDD.

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

    Re: How to prevent Ubuntu adding itself to Boot Menu of EFI partition

    Is os-prober on?
    I thought default now was off. But I turn it off as soon as I install and only add entries I want into 40_custom. I have multiple installs & do not want some of them in boot menu.

    Change to true if now false or add line if you do not have it.
    sudoedit /etc/default/grub
    GRUB_DISABLE_OS_PROBER=true

    After any change to grub:
    sudo update-grub



    Last edited by oldfred; May 9th, 2023 at 03:24 PM.
    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.

  3. #3
    Join Date
    Dec 2017
    Beans
    5

    Re: How to prevent Ubuntu adding itself to Boot Menu of EFI partition

    Yes OS prober is already OFF. This does not help though.

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

    Re: How to prevent Ubuntu adding itself to Boot Menu of EFI partition

    With os-prober off, I do not see how it is finding other systems? Lets see details.

    Please copy & paste the pastebin link to the BootInfo summary report ( do not post report), do not run the auto fix till reviewed. Use often updated ppa version over somewhat older ISO with your USB installer or any working install.
    https://help.ubuntu.com/community/Boot-Repair &
    https://sourceforge.net/p/boot-repair/home/Home/
    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.

  5. #5
    Join Date
    May 2008
    Beans
    4,467
    Distro
    Ubuntu 24.04 Noble Numbat

    Re: How to prevent Ubuntu adding itself to Boot Menu of EFI partition

    Your internal HDD contains an operating system installed in UEFI mode.
    Therefore, there is an EFI system partition on the internal HDD.

    I imagine that the only way to prevent external Ubuntu upgrades adding an entry to your internal HDD would be to "hide" the internal ESP.
    You will have to remove the boot and esp flags on the internal ESP and then replace them.

    Which operating system is installed on the internal HDD?

  6. #6
    Join Date
    Dec 2017
    Beans
    5

    Re: How to prevent Ubuntu adding itself to Boot Menu of EFI partition

    You are correct. My internal HDD has Win11 with its own EFI partition. With regard to your suggestion to "hide" the internal ESP, I did that once in the past. But every time removing the flags and re-enabling is a hassle.
    Can I put the question bit differently. Can I completely remove Ubuntu's ability to mount any other storage device? I will never have any requirement to mount other storage (Thumb drive/ HDD) when working with Ubuntu from external SSD. Can I remove udisks2 and related services?

  7. #7
    Join Date
    May 2008
    Beans
    4,467
    Distro
    Ubuntu 24.04 Noble Numbat

    Re: How to prevent Ubuntu adding itself to Boot Menu of EFI partition

    Quote Originally Posted by panijsr View Post
    You are correct. My internal HDD has Win11 with its own EFI partition. With regard to your suggestion to "hide" the internal ESP, I did that once in the past. But every time removing the flags and re-enabling is a hassle
    If you have Gparted installed in your external Ubuntu disk, then slightly less hassle to remove and replace flags.
    Quote Originally Posted by panijsr View Post
    Can I put the question bit differently. Can I completely remove Ubuntu's ability to mount any other storage device? I will never have any requirement to mount other storage (Thumb drive/ HDD) when working with Ubuntu from external SSD. Can I remove udisks2 and related services?
    I have no idea.
    You'll have to be careful because it may affect other parts of the system.

    Suggestions
    Does your UEFI firmware allow you to de-activate your Windows 11 drive before booting into Ubuntu?
    If you upgrade Ubuntu via terminal commands (sudo apt update followed by sudo apt upgrade), you will be given the choice to abort the upgrade if a new kernel were to be installed.
    Then, you can change the flags before the upgrade?

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

    Re: How to prevent Ubuntu adding itself to Boot Menu of EFI partition

    I know that Ubuntu does not find Windows systems with bitlocker on.
    And typically fast startup/hibernation also prevents the NTFS driver from mounting NTFS partitions read/write. They can be mounted read only.
    They now do not want os-prober on by default, as it scans system and auto mounts every partition to look for operating systems to add to grub menu. That can be a security issue.

    You can in fstab mount all the NTFS partitions and set parameters to prevent mounting. May seem a bit backwards but that can work.


    # Hide mount template examples with noauto, you have to make the mount points yourself first
    sudo mkdir /mnt/SysRes
    UUID=200C11850C1156DE /mnt/SysRes ntfs defaults,noauto 0 0
    Hide windows mount with noauto: 777 is no permissions at all, UUID is better than this example with device mount
    /dev/sda2 /Windows/sda2 ntfs defaults,noauto,umask=777 0 0
    You may also what nofail as if Windows turns fast startup, then fstab entry will fail either waiting to timeout or causing other issues.
    Last edited by oldfred; May 12th, 2023 at 02:56 PM.
    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.

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
  •