Is it viable to run Ubuntu from a USB (long-term)

9,302

Hello fellow USB booter :3

I am excited to say that, I, like you have had the need to the solution to this exact problem; though, I did it more for portability than anything else.

I actually tried many things before like using the live-boot with/without persistence and any other similar live boot setups but they never really worked for me. Adding to the fact that persistence wasn't going to happen the same as with a normal pc or laptop due to having to create a specific filesystem or something like this for the persistence file and the wear and tear the USB would have to take I ended up with the following.

So... if you've already tried USB persistence and found it lacking this is what I followed.

The method is pretty straightforward:

Required tools:

  1. Vbox with Ubuntu image
  2. USB 3.0 min storage suggested from personal observation 128GB

(I purchased a Samsung USB 128GB as it seemed it would handle all the OS installation and probably have an OK speed for read/write operations. I also have used other Samsung SSD's so I was pretty confident in it's performance)

Overview of method:

  1. Somewhere in the Vbox settings of the image you'll need to select 'Use as live bootable disc' or something similar maybe 'Live/Boot' could also be the option

  2. Depending on your setup you might need to install USB 3.0 support on Vbox if your connecting your USB device to a 3.0 port as it might not recognize it otherwise

  3. Start your Live Ubuntu Vbox and go through the process until you're selecting the installation disk.

  4. You'll need to format the USB with ext4 I believe. I think some have suggested ext2 or ext3 but I used ext4 and selected '/' as an option somewhere in those settings as well.

  5. Once you've configured it proceed with the installation and wait until the installation process is done.

5.1. Try booting from the USB

  1. Depending on your BIOS settings you might need to enable UEFI support(I always have to research how the MBR,GPT,ext4,UEFI and Legacy all work together to boot an OS because I always forget, so I'm sure google has the answers if you run into an issue with any of these settings).

If all happened correctly then you should now have ended up with the following:

USB 3.0 126GB with a full-fledged Ubuntu installation on it. This USB 3.0 device can now boot up from any computer that supports USB booting and possible will need UEFI enabled to.

Longevity:

I haven't met anyone who has run a full-fledged operating system from a USB as their main driver. On that note I've been using mine for well over 10 months now and it's still going good.

Use Performance:

After using it for many months and not even turning off the pc most of the time I don't think I've notices any sluggishness. I'll sometimes be editing short videos and images as well as working with programming and browsing a lot on a dual monitor screen and it handles well. Not as fast as my SSD but much faster than many HDDs. The good thing here is that USB 3.0 is pretty fast now and it's almost in every place now. If you use USB 2.0 port you'll definitely see the difference in speeds when programs open or files move.

Always bear in mind that it's a USB installation and that sometimes these things fail all at once or over time as well.

I've used my USB Ubuntu installation on many computers now and it's been flawless, except with macs as their booting has different requirements)

Also, I remember doing something about installing EFI on it so that the computer could detect it was an OS and add it to the boot order so if another computer doesn't support UEFI you might need to try another method or try changing this one somehow.

You might also want to create a swap file for some performance improvement but this is only what I've seen recommended on forum's about server performance so I'm not sure how much it would help here and it would also be costing you storage space in case you're on a lower than 128GB USB.

In any case I hope this sends you in the right path. I know it took me a while to figure it out but now I'm able to write this post from my own USB installation ;)

Share:
9,302

Related videos on Youtube

Alex Eagle
Author by

Alex Eagle

Stuff

Updated on September 18, 2022

Comments

  • Alex Eagle
    Alex Eagle almost 2 years

    I'm aware that similar (if not identical) questions have been asked before, but I'd like to explain my particular circumstances and see if you'll still give the same advice.

    I currently am saving up for new PC parts. I'm stuck on a second hand, 8 year old (or more) hunk of scrap. I'm trying my best to work with it (editing videos, web design, gaming, etc.) but it's awful. I also need to get myself a fresh copy of Windows 10 because I'm still using the beta/dev version.

    Given that I'm demanding a fair amount, do you think that installing Ubuntu on a USB and using that for a few months would do better than W10 from my SSD? My SSD isn't anything fancy, though.

    I've used Ubuntu before. For several years, in fact. However, recent attempts at installing it have appeared to have trashed a few of my old HDDs and they now won't boot. I don't want the same to happen to my shiny new SSD because it's all I've got.

    As far as I can see my options are: Stick with Windows on an internal SSD because it would be faster, switch to Ubuntu on a stick because that would be faster or make sure that Ubuntu doesn't screw up my SSD if I install it on that.

    Remember, I'm talking about using a USB like a hard drive for several months, maybe even a year, and I'd be expecting a fair amount of performance from a USB.

    Many thanks, Alex.

    • JonasCz
      JonasCz over 7 years
      An ordinary USB flash stick definitely won't work for months, as they wear out fairly quickly, and all of them are slow (unless you have a USB SSD made especially for this purpose, or a USB hard drive). Anything on an internal SSD (Ubuntu or Windows) will be faster. However, I've never had Linux or Ubuntu make a HDD go bad - yes, screwed up software, OS, or bootloader happens - you can just reinstall.
    • sudodus
      sudodus over 7 years
      I would mostly agree with @JonasCz. I have installed Ubuntu and Ubuntu family operating systems (Kubuntu, Lubuntu ... Xubuntu) into HDD, SSD, USB, SD-card drives and I have never managed to destroy the drive by doing that. Either you had extreme bad luck, or you have 'only' destroyed the partition table or file system. If I were you, I would [try to] wipe the first megabyte and create a new partition table (if you still have those damaged HDDs. You can use mkusb for that purpose, if you install Ubuntu into a USB pendrive and install mkusb into that live Ubuntu system.
    • sudodus
      sudodus over 7 years
      An alternative that will cause less write operations (and wear) of a USB pendrive, is a persistent live system. You can install Ubuntu into one small cheap USB pendrive and install mkusb into that live Ubuntu system. Then mkusb can install a persistent live Ubuntu system into another USB pendrive, which should be a fast USB 3 pendrive, for example Sandisk Extreme. See this link and links from it, help.ubuntu.com/community/mkusb . Take frequent backups of the casper-rw partition for persistence. mkusb provides a tool for that, help.ubuntu.com/community/mkusb/persistent
    • Alex Eagle
      Alex Eagle over 7 years
      The problem with the drives is that they wouldn't boot. No OS showing up at all. I'm yet to plug them in and boot to a working drive and check their status through that. I don't honestly think that it destroyed the drive's ability to store data. I think that it's probably just that the boot was corrupted or something...
    • Meninx - メネンックス
      Meninx - メネンックス over 7 years
      I have tried running a Persistent flash drive long term but have had problems with corrupting partitions, especially NTFS ones. I have used a Full install USB flash drive for over four years, (8.04 to 12.04, upgrading regularly), without problems. It had a FAT32 partition. In ten years never had a flash drive die from over use, only from removing unsafely and botched formats.
    • karel
      karel almost 7 years
    • ubfan1
      ubfan1 over 3 years
      Search this site for optimize USB for several suggestions to prolong life noatime on root mount, move to ram /tmp and log files, use guest session which is all in ram, ... etc.
  • Pooya Estakhri
    Pooya Estakhri over 2 years
    I guess the efi thing that you are referring to is partitioning the usb to two parts one for efi and the other for os itself, i cant say the minimum required size but my system was happy with 300Mb although i guess it needed far less. in order to achieve this the user needs to remove existing partition. create another with ext4 format using / as root and with the size maybe 100Mb less than the default offered value, then to create another partition for the remaining 100 with EFI something as the format instead of ext4