Results 1 to 7 of 7

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
    3,992
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    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
    3,992
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    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
    3,992
    Distro
    Ubuntu 22.04 Jammy Jellyfish

    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
    1,994

    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.

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
  •