How-To

How to Create a Persistent Linux Installation on a Bootable Live USB or SD Card

Installing Bootable Linux Distributions to a USB Drive or SD CardRecently, we polled groovyReaders, asking you “?” One of the top concerns was uncertainty over how to safely install Ubuntu without risking damage to your main operating system. grooveDexter has already provided a few solutions that can help you get your feet wet with Ubuntu and other Linux distros without radically altering your existing Windows-based system: and . Now, I’m going to show you one other way to get into Linux risk-free.

Running Linux: Dual-boot vs. Virtualization vs. Live USB

The two methods outlined by Dex definitely have their strengths. But there are also some drawbacks. Dual-booting is the easiest method, after the initial setup, since it doesn’t require any bootable media. But due to some of the complexities of how Wubi integrates into your system disk, there are still some risks to your Windows installation in the event of a crash. The virtualization route is much safer—I’d even venture to say it’s 100% safe—but you’ll need a fairly mighty computer to run it at anything close to full speed (forget about virtualizing on your netbook or aging Windows XP PC).

So, with all that being said, here’s a third method for installing Linux: booting from a Live USB. This method has the benefit of being completely separate from your system disk, and is therefore 100% safe, like virtualization. But since you won’t be running a machine within a machine, you won’t have as much performance lag. In fact,  you shouldn’t have any.

The downside: you’ll need to use a USB stick or SD card at all times and you’ll need to make some changes to your BIOS setup.

Now, before you run for the hills after seeing the word “BIOS,” know that the tweaks are very minor and totally reversible.

Oh, also, with this version of Ubuntu, all of your hardware should work out of the box—your mouse, your wireless Internet, perhaps even your printer. And there will be absolutely no Terminal commands required. I promise.

Alright, you okay? Let’s press on.

 linux on a flash card

What You’ll Need

To begin, you’ll need the following:

  • A USB flash drive or SD card with at least 2GB capacity.
  • A PC with a BIOS that supports booting from USB. (Note: This does not include Macs. Sorry.)
  • Your favorite distribution of Linux. For these tutorials, we’ve been using Ubuntu.
  • The Universal USB Installer from PenDriveLinux.com.
  • Windows XP/Windows Vista/Windows 7

This is sort of a long tutorial, but there are only a few actionable items. Most of this is done on auto-pilot, and some of the elements of this you may already know how to do. For your convenience, here’s an outline of what we’ll cover:

Preparing Your Boot Media

The Universal USB Installer is pretty foolproof. The only fussy thing about it is that it’s not always able to format your media for you. When I first tried installing Linux with the Universal USB Installer, I kept getting the error message:

An error(1) occurred while executing syslinux. Your USB drive won’t be bootable.

To fix this, I just formatted it myself using Windows. Here’s how:

Step 1

Connect your USB drive or flash card and launch Windows Explorer.

Step 2

Right-click your drive’s icon and choose Format…

quickformat usb

Step 3

Under file system, choose FAT32. Check Quick Format and then Click Start.

formate your pendrive

Windows will warn you that it’ll erase all the contents on the drive. Make sure that you have the right drive selected and confirm. You’re done!

Installing with Universal USB Installer

Now, it’s time to turn your USB drive or flash card into a bootable drive with Linux installed. This is pretty simple.

Step 1

Download the Universal USB Installer via PenDriveLinux.com.

Step 2

Navigate to your download folder and run Universal-USB-Installer-1.8.4.5.exe.

use the universal usb installer

(For good measure, you might want to run it as an Administrator, though this shouldn’t be necessary.)

Step 3

Read the License Agreement and Click I Agree.

universal usb installer tutorial

Step 4

From the first drop-down menu, choose the exact distribution of Linux that you downloaded. If you got the latest version of Ubuntu, it should be Ubuntu 11.04. Next, Browse for the .iso file that you downloaded.

universal usb installer tutorial

TIP: If you download the .iso to the same folder as the Universal USB Installer, it will automatically detect its location.

Step 5

From the next drop-down menu, choose the drive letter of the USB drive or flash card that you formatted above.

universal usb installer tutorial

Step 6

Lastly, there’s a slider bar at the bottom that lets you designate some space for persistent storage. If your USB drive is big enough, I highly recommend this. Normally, a Live USB like the one we are creating would be static. That is, any programs you installed, documents you created or settings you tweaked would be undone each time you rebooted. But by setting a persistent file size on our USB drive, we are setting aside space to save these changes.

universal usb installer tutorial

Step 7

Click Create.

set the location and iso

Sit back and relax and wait for the Universal USB Installer to do its thing. Note: If you chose a Persistent file size, then there will be a point in the installation when it appears to hang. Don’t fret—this is normal. It could take 10+ minutes, so just be patient.

installation complete

The installer will let you know when the installation is complete. Once it is, you are free to Click Close.

Note: In this screenshot, I am installing a different distro of Linux—DSL 4.4.—but the successful installation screen will look the same regardless of which distro you are setting up.

Now, your Live USB is ready-to-go.

Setting Up Your BIOS to Boot Linux from a Live USB

Booting from a USB drive varies from computer-to-computer, as does the procedure for changing the boot device order. I’ll show you how to do it on my computer—an ASUS EEEPC 1005HAB—but it’s probably  best to Google the specific step-by-step instructions for your specific make and model.

Just in case you decide not to do that (for whatever reason), let me explain our goal.

By default, your computer probably tries to boot from the main internal hard disk drive (where Windows is installed). If it doesn’t find an operating system there, it’ll then try another drive—perhaps the CD-ROM or USB. What we want to do is to get your computer to check the USB drive for an operating system before it goes to your Windows system disk.

To do that we need to enter into the BIOS setup page. This is accomplished by pressing a certain key during boot up but before the Windows logo appears.

Usually, your computer will display it’s manufacturer’s logo before the Windows logo. The key to enter the BIOS setup will usually  be indicated along the bottom. For me, it’s F2. For you, it may be F10, F12 or Esc or something completely different. Again, Google is your friend here.

If you were using my ASUS EEEPC, you’d do the following:

Step 1

Insert your Linux Live USB or flash card. In my case, I’m inserting an SD card into my laptop’s card reader.

Step 2

Reboot your computer.

Step 3

Begin pressing the key to enter setup as soon as the computer begins booting up. Press it repeatedly if you have to. For me, I’m pressing F2 as soon as I see the ASUS logo.

asus eee pc bios setup

If all goes well, you’ll find yourself in the BIOS setup utility. Your BIOS setup screen may look different from mine, but no matter what computer you have, it’ll be ugly.

the bios sure is ugly

Step 4

Look for an option that’s something along the lines of “Boot” or “Startup Disks” or “Boot Devices.” If you don’t see anything like that, look for a menu that has an option that’s similar to “Boot Device Priority.”

boot device priority list in the bios

Step 5

In the Boot Device Priority settings, make the device that your Live USB or flash card is connected to the first priority.

usb flash priority on boot device

Step 6

Save Your Changes and Exit. There’s usually a hotkey for this. For me, it’s F10.

save and exit bios

Step 7

All done. You’ll only have to do these steps once. After this, your computer will automatically boot from your USB device whenever it’s plugged in. When it’s not, then Windows will load.

Setting Up Ubuntu with Persistence

When you boot into your LiveUSB Linux device, you’ll be greeted with a setup screen with a few options. For this tutorial, I’m assuming that you don’t want to install Ubuntu on your main hard disk. So, we’ll be booting a live version of Ubuntu. Usually, this is just a “test drive” version of Ubuntu that lets you tour the OS and make sure everything works. But because we chose to create a persistent version of Ubuntu, we can actually make changes to the OS, install new programs and save documents, just like we had it installed permanently.

For most Linux systems installed using the above instructions, the persistence will work out of the box. But if you reboot your Linux device and the changes still aren’t saved, then you may need to create another user.

Here’s how:

Step 1

Insert your LiveUSB and boot your computer.

Step 2

When the Ubuntu Installer Boot Menu appears, choose the first option: Run Ubuntu from this USB.

run ubuntu form this usb

Step 3

Ubuntu will boot into a Live session. From here, you should be able to use Ubuntu like normal. However, any files you create or change won’t be saved for the next time you boot. You’ll need to create a new user in Ubuntu in order for your changes to be saved. To do this, Click System > Administration > Users and Groups.

add users and groups in ubuntu

Step 4

Click Add.

live session user ubuntu

Step 5

Give yourself a username and Click OK.

persistent changes on ubuntu live usb

Step 6

Give yourself a good password and Click OK.

persistent changes on ubuntu live usb

Step 7

Select the user you just created and Click Advanced Settings. This is important. Otherwise, your user won’t be able to install new software or access the Internet.

adding persistent user ubuntu live usb

Step 8

Under the User Privileges tab, go ahead and Check everything. Click OK.

connect to wireless and ethernet

Note: If you don’t do this, when you try to install new programs or do other administrator-only tasks, it’ll ask you for a password for “Ubuntu” over and over and fail to authenticate.

Step 9

Click  the Power Button icon in the top-right and choose Switch from Ubuntu…

switch form ubuntu

FYI “Ubuntu” is the name of your live session user. I know, it’s kind of confusing.

Step 10

Choose the user you just created.

choose the new ubuntu user

You’ll be logged into a new desktop. Now, you can go about your business, adding programs, changing settings and creating documents and they’ll all be there when you come back.

Note: I can’t really explain why some users have to add a new user in order to get an Ubuntu Live USB to stay persistent. The first time I tried it, it didn’t work it all—I made changes to the live session user and when I rebooted, poof, they were gone. I then added a new user and the changes were saved for that user. But then, when I re-did this entire process for the tutorial, I noticed that items I was saving to the desktop for the live user stayed persistent after I added another user.

I know this isn’t a very expert sounding piece of advice, but if you encounter any quirks along the process, I recommend trying again from the beginning. That means re-downloading all the ISOs and programs, re-formatting your flash drive, etc. Sometimes things get funny with the download or the install that are unexplainable.

The only difference I can think of that may have had an effect on my success is that the second time I attempted a persistent install, I used a small persistent set-aside of 1 GB. The first time, when it didn’t work as well, I had a persistent file size of 2 GB. If you give this tutorial a shot, I’d love to hear how things turned out for you.

Conclusion

I call this method of installing Ubuntu the best of both worlds—with portability! You’re not fudging around with your main system disk, but you also don’t have to virtualize anything, meaning that this solution is 100% suitable for lower-powered machines (like my netbook). But best of all, because the installation is persistent, I can pop out my SD card, slip it into my pocket and then load it up on another computer and boot it from there with all of my stuff already there. This is actually what savvy tech support crews and data recovery specialists do. They just load up their toolkit and operating system onto a thumb drive and fire it up on the client’s machine, even if it’s not bootable due to a virus attack, hard drive failure, etc. I’m sure you can think of plenty of other groovy uses for a complete portable OS, though.

Now go out and enjoy Ubuntu—or whichever Linux distro you chose!

Tux logo used in featured image by Larry Ewing.

24 Comments

24 Comments

  1. James

    May 4, 2011 at 6:52 am

    Excellent post dude!

    Very helpfull and fullfiled in details. I’ve been struggling with Live Session for several months, but you explained all with accuracy.

    Thank you!

  2. daniel

    September 24, 2011 at 7:49 pm

    this worked on my dell mini 9 using USB, but not using the SD card.. i went to bios and made sure USB & external device was enabled for boot but dell still can’t find SD at boot. any one know if this is a Dell thing?

    • Alex

      September 27, 2011 at 12:07 pm

      Well.. it is also a HP Laptop issue. Worked like a charm on my little eeePC (Asus), but no way with HP :(

  3. Patrick

    October 12, 2011 at 5:45 am

    Man you ROCK! This is cool, just formatted my 16GB drive and booted into Ubuntu. Tried the other tool as well the one where you can install various distros to boot from… absolutely class tools!
    Thanks a lot.

  4. Patrick

    October 12, 2011 at 7:41 am

    ok I can’t get to the part where you switch user. What do I do there? When I click on the power button there is no “switch from Ubuntu” I’m using version 64bit 11.04

  5. vishu

    December 13, 2011 at 7:23 pm

    thanks a lot

  6. sniper

    April 20, 2012 at 8:30 pm

    I astonished to see that i experienced the 2 Gig and 1 Gig issue, for the secod time around my USB install worked better with the 1 Gig persistence; but I still would like to know the root of that problem. I am using Linux Mint 12.
    thanks

  7. Gustavo

    May 11, 2012 at 7:37 am

    Im using a Kingston 8Gb pendrive and the 12.04 Ubuntu works perfect with writing settings and documents functions without having to create new user.

  8. Tarique Baig

    August 13, 2012 at 4:12 am

    hey !!! please help ! i have made a botable Usb drive but i am confused
    about the BIOS set up. ur Netbook shows Really Understandable options
    …Mine is very Difficult. i have taken the images of the BIOS options .
    By loking at them Please help me what changes should i do to them ?

  9. Tarique Baig

    August 13, 2012 at 4:14 am

    this is the 2nd image. your tutorial was really good :) please tell me what alterations should i do and where in BIOS. thanks

  10. Tarique Baig

    August 13, 2012 at 3:21 am

    help

  11. Vephar

    August 16, 2012 at 1:24 am

    “Boot USB devices first”, on the bottom. Set it to Enable.

  12. Jon Cole

    August 25, 2012 at 1:01 pm

    I really want to do this on my 8gig memory stick, but would like to know if and how I could undo it and turn my memory stick back into just a memory stick.

    • Kates_Reason

      September 9, 2012 at 12:18 am

      you use the app gparted to format the flash drive, choose FAT32. after, you can label it.

  13. Smoris

    January 21, 2013 at 2:57 am

    I figured this out on my own – wish I had found the tutorial before ! One problem: can’t get the VPN to work. The Network Manager refuses to store my password. Any suggestions anyone ?

  14. http://parsiantools.com/count.html

    February 14, 2013 at 5:19 pm

    Striving for better body in just over 100
    milligrams of sodium, which promotes a healthy and balanced coffee extract regime.

  15. anti aging products

    March 27, 2013 at 11:42 am

    Wonderful beat ! I would like to apprentice while you amend your
    web site, how can i subscribe for a blog web site?
    The account helped me a applicable deal. I have been a little bit familiar of this your broadcast provided vibrant clear concept

  16. Edil

    July 26, 2013 at 8:21 am

    Thanks dude!!!!!!!! For about 2 months, i’m searching for this!!!!!

    • Steve Krause

      July 26, 2013 at 9:09 am

      Wow Edil! I’m disappointed you didn’t know groovyPost was supposed to be the first place you check for these things!!! :)

  17. Edil

    July 29, 2013 at 7:29 am

    Will it work on Ubuntu 13.04?

  18. Francisco

    October 4, 2014 at 2:45 pm

    Hi!

    I’ve been using the “Universal USB Installer” for a long time and it’s great to test Linux distros from my dear 4GB USB drive. However I have a doubt for the persistent option: how big can I do it?I make this question as I think it has to be as big as we can, but we have to let room for the distro files to be inside the USB drive.
    The ISO size for any distro is like a 4GB DVD but I’m sure usually it’s not that big. So, how big can be the persistent file anyway? Is there any way to have a clue of what to choose before installation?

    Thanks!

  19. Mayur

    February 25, 2015 at 6:44 am

    Can I use same method for Redhat also?

  20. Mihail

    April 23, 2016 at 1:50 pm

    Hi, just tried this with Ubuntu 16.04 on Mac with SD card and it didn’t work.

    • No Name

      October 25, 2016 at 8:17 am

      Read the whole article, or at least the requirements:

      “A PC with a BIOS that supports booting from USB. (Note: This does not include Macs. Sorry.)”

Leave a Reply

Your email address will not be published. Required fields are marked *

 

To Top