Results 1 to 9 of 9

Thread: How do i install Ubuntu on a USB thumb drive without sacrificing the boot loader?

  1. #1
    Join Date
    Feb 2024
    Beans
    4

    How do i install Ubuntu on a USB thumb drive without sacrificing the boot loader?

    Hi there,

    so as I already had some issues with the boot loader of Win10 I wanted to install Linux directly on my USB device. Keeping everything separated and simple.

    I saw that normal USB sticks don't perform well with the persistent mode (StackExchange Advice). So i got the fastest random r/w I was able to find (Kingston Data Travel Max with 1000mb/s read900mb/s write and 100-200mb/s random r/w) which should be more than fine for a direct install (recommendation was >20mb/s random r/w)

    Now i just picked the first version on LinusDistroWatch that i found which was Linux Mint. However I saw that it won't work as intended, as it its a copy of Ubuntu which shares a common and old installation bug of Ubunut. It doesn't mention which bug# exactly so i couldn't take a look at it:

    https://forums.linuxmint.com/viewtop...693e7771896556


    My question:

    How do I then install Ubuntu on my new USB thumb drive without touching my Windows Bootloader? The GRUB2 bootloader should go ONLY on the USB thumb drive (so i can take it anywhere i want). Like the linked post says the bug however always writes the GRUB2 on the 1st NVME killing my Win Bootloader. I am not a fan of removing my first NVME physically and i don't want to remove it with each Upgrade/Update to prevent killing my bootloader.

    Hope there is a simple fix or what I need to consider during the installation interface questions =)

    Thank you!

  2. #2
    Join Date
    May 2008
    Beans
    4,028
    Distro
    Ubuntu 24.04 Noble Numbat

    Re: How do i install Ubuntu on a USB thumb drive without sacrificing the boot loader?

    The foolproof way is to isolate or physically remove the Windows disk.
    Otherwise, during the live session but before starting the Ubuntu installer, you have to remove the boot flags from the Windows EFI partition.

    When you install to an external device, double check that the new installation will create an ESP.
    Last edited by tea for one; March 16th, 2024 at 10:34 PM.

  3. #3
    Join Date
    Feb 2024
    Beans
    4

    Re: How do i install Ubuntu on a USB thumb drive without sacrificing the boot loader?

    Thanks for the quick reply.

    > you have to remove the boot flags from the Windows EFI partition

    I am only aware of one boot flag. I think its also the "active" flag. Are there more than i need to remove?

    Do I need to change the attribute (
    Globally unique identifier https://en.wikipedia.org/wiki/GUID_Partition_Table ) as well? Like from C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI) to Windows Basic Data Partition EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 ?


    > When you install to an external device, double check that the new installation will create an ESP.

    ESP = EFI system partition?

    How do I do that during installation? I assume before installation is too early and afterwards is too late, so is there a keyword i should be looking in the installation menu?


    > The foolproof way is to isolate or physically remove the Windows disk.

    When exactly would I have to remove it? Only exactly once forever with installation or with major upgrades/updates or version changes as well?

    The idea is to use it as mobile linux, so I can use it anywhere also at friends where i might not be able to remove their harddrive.


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

    Re: How do i install Ubuntu on a USB thumb drive without sacrificing the boot loader?

    When you remove the boot and esp flags from your Windows disk, the Ubuntu installer will not interfere with your Windows Boot Manager.

    The installer will automatically create an ESP for your external USB but it will tell you the partitions being created.
    If it doesn't offer to create an ESP, then stop the installation.

    Boot into a "Try Ubuntu" live session, open Gparted and explore your Windows Efi partition.
    Last edited by tea for one; March 16th, 2024 at 11:16 PM.

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

    Re: How do i install Ubuntu on a USB thumb drive without sacrificing the boot loader?

    By the way, back up all your Windows data before embarking on this project.

  6. #6
    Join Date
    Mar 2011
    Beans
    2,005

    Re: How do i install Ubuntu on a USB thumb drive without sacrificing the boot loader?

    Launchpad Bug 1396379 - Grub installs to wrong disk, is a "feature" of the ubiquity installer used in Ubuntu 22.04. A different installer is used for 23.10, and actually installs grub to the disk you specify. With the LTS 24.04 due out next month, might be easier to use 23.10 and upgrade next month.
    Last edited by ubfan1; March 17th, 2024 at 04:36 PM.

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

    Re: How do i install Ubuntu on a USB thumb drive without sacrificing the boot loader?

    I have installed to multiple flash drives and now external SSDs.
    And have had to work around the bug. My work around is more complicated, but is in bug report.
    Posted work around to manually unmount & mount correct ESP during install #55 or( #23 & #26)
    https://bugs.launchpad.net/ubuntu/+s...y/+bug/1396379
    Remove esp flag from Windows before install to second or external drive - Tim Richardson
    https://askubuntu.com/questions/1698...p-disk-creator &

    Issue is with any official version of Ubuntu or unofficial version of Ubuntu that uses the Ubiquity installer.
    Ubuntu is converting to the Subiquity installer with does let you choose drive for ESP.
    And Lubuntu uses Calamares installer and Kubuntu will use Calamares with 24.04. Kubuntu 24.04 has a bug in a python script that causes it to crash, but workaround exists.
    Once I edited the python script, Calamares installed Kubuntu 24.04 to my sdb drive without issue.

    If using flash drive, often better to use a lightweight flavor which then uses less resources. I found Kubuntu which is not really a lightweight flavor also works well.
    https://ubuntu.com/download/flavours
    Light weight flavors:
    Lubuntu, Xubuntu, Ubuntu MATE, Budgie

    I also now highly recommend external SSD.
    I got into external SSD more by accident. Built system in 2017 that had M.2 that could use SSD or NVMe drive. NVMe drives were very expensive then so used a smaller SSD. Wanted to upgrade to larger drive, so purchased new NVMe drive as now only a bit more expensive than SSD, but faster. And then used M.2 SSD in a USB3/USB-c to M.2 adapter.
    Found external SSD worked so well I will not buy anymore flash drives, but I have a lot of flash drives already, almost all with full installs, some now obsolete & most with data.
    Last edited by oldfred; March 17th, 2024 at 04:26 AM.
    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.

  8. #8
    Join Date
    May 2024
    Beans
    1

    Re: How do i install Ubuntu on a USB thumb drive without sacrificing the boot loader?

    @OldFred
    Thank you for your info on the issue described in this thread. I'm hoping you will see this and answer my additional questions and concerns. I am posting here because it follows with the original question.

    It's been a while since I was bit by the bug that made my windows system unbootable when I tried to install Ubuntu to an external SSD. I'm getting ready to try this again, with the knowledge gained. (Last time it happened, I restored my Windows and then installed a different distro to the external drive without any issues.) This time I'm going to be installing Mint Debian. But I'm asking here since Mint is based on Ubuntu.

    I am able to selectively turn off the drives in my UEFI bios settings. Is that enough to be safe, or is removing the flags a better precaution? I could also physically remove the Windows NVMe drive from the laptop. I'm wondering if turning off the drive in BIOS, and/or turning off the partition flags is enough. Which is the preferred/best option?

    Then my concern is what happens later on, when grub gets reconfigured after an update or upgrade? Will the updater know NOT to write to the Windows EFI?


    Thanks.



    Quote Originally Posted by oldfred View Post
    I have installed to multiple flash drives and now external SSDs.
    And have had to work around the bug. My work around is more complicated, but is in bug report.
    Posted work around to manually unmount & mount correct ESP during install #55 or( #23 & #26)
    https://bugs.launchpad.net/ubuntu/+s...y/+bug/1396379
    Remove esp flag from Windows before install to second or external drive - Tim Richardson
    https://askubuntu.com/questions/1698...p-disk-creator &

    Issue is with any official version of Ubuntu or unofficial version of Ubuntu that uses the Ubiquity installer.
    Ubuntu is converting to the Subiquity installer with does let you choose drive for ESP.
    And Lubuntu uses Calamares installer and Kubuntu will use Calamares with 24.04. Kubuntu 24.04 has a bug in a python script that causes it to crash, but workaround exists.
    Once I edited the python script, Calamares installed Kubuntu 24.04 to my sdb drive without issue.

    If using flash drive, often better to use a lightweight flavor which then uses less resources. I found Kubuntu which is not really a lightweight flavor also works well.
    https://ubuntu.com/download/flavours
    Light weight flavors:
    Lubuntu, Xubuntu, Ubuntu MATE, Budgie

    I also now highly recommend external SSD.
    I got into external SSD more by accident. Built system in 2017 that had M.2 that could use SSD or NVMe drive. NVMe drives were very expensive then so used a smaller SSD. Wanted to upgrade to larger drive, so purchased new NVMe drive as now only a bit more expensive than SSD, but faster. And then used M.2 SSD in a USB3/USB-c to M.2 adapter.
    Found external SSD worked so well I will not buy anymore flash drives, but I have a lot of flash drives already, almost all with full installs, some now obsolete & most with data.

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

    Re: How do i install Ubuntu on a USB thumb drive without sacrificing the boot loader?

    Do not know Mint and what installer it now uses. If still the Ubiquity installer you have to use one of the work arounds. But gpt partitioning in advance and making sure you have an ESP on external drive is most critical as then it can be easily fixed if not correct.

    New versions of Ubuntu use the Subiquity installer that supposed has fix for where to install grub. And the Calmares installer works to let you choose drive to install grub.

    I really like a lighter weight install for external devices. Not sure if Mint is a lighter weight flavor or not.

    I do like Kubutu and the 24.04 version now has the Calamares installer that Lubuntu has used.
    I also did a test install of KDE Neon which also used the Calamares installer and looked a lot like Kubuntu even though also not an official flavor.

    Major updates to grub reinstall to the ESP you mount in fstab. As long as it is the ESP on the external drive it should be ok.

    But good backups are always required for any major system change.
    Last edited by oldfred; 1 Week Ago at 03:40 AM.
    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
  •