create a persistent linux installation on a sd card

16
groovypost.com http://www.groovypost.com/howto/howto/really-run-linux-from-a-memory-card/ How to Create a Persistent Linux Installation on a Bootable Live USB or SD Card Recently, we polled groovyReaders, asking you “What’s stopping you from trying Ubuntu ?” 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: dual- booting Windows/Ubuntu with Wubi and virtualizing Ubuntu within Windows . 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.

Upload: bobapatatas

Post on 16-May-2017

247 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: Create a Persistent Linux Installation on a SD Card

groovypost.com http://www.groovypost.com/howto/howto/really-run-linux-from-a-memory-card/

How to Create a Persistent Linux Installation on a BootableLive USB or SD CardRecently, we polled groovyReaders, asking you “What’s stopping youfrom trying Ubuntu?” One of the top concerns was uncertainty overhow to safely install Ubuntu without risking damage to your mainoperating system. grooveDexter has already provided a few solutionsthat can help you get your feet wet with Ubuntu and other Linux distroswithout radically altering your existing Windows-based system: dual-booting Windows/Ubuntu with Wubi and virtualizing Ubuntu withinWindows. Now, I’m going to show you one other way to get into Linuxrisk-free.

Running Linux: Dual-boot vs. Virtualization vs. Live USBThe 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 tosome of the complexities of how Wubi integrates into your system disk, there are still some risks to yourWindows installation in the event of a crash. The virtualization route is much safer—I’d even venture to sayit’s 100% safe—but you’ll need a fairly mighty computer to run it at anything close to full speed (forget aboutvirtualizing 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. Thismethod has the benefit of being completely separate from your system disk, and is therefore 100% safe, likevirtualization. But since you won’t be running a machine within a machine, you won’t have as muchperformance 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 changesto your BIOS setup.

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

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

Alright, you okay? Let’s press on.

Page 2: Create a Persistent Linux Installation on a SD Card

What You’ll NeedTo 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, andsome of the elements of this you may already know how to do. For your convenience, here’s an outline ofwhat we’ll cover:

Preparing Your Boot Media

Installing with Universal USB Installer

Setting Up Your BIOS to Boot Linux from a Live USB

Setting Up Ubuntu with Persistence (optional)

Preparing Your Boot MediaThe Universal USB Installer is pretty foolproof. The only fussy thing about it is that it’s not always able toformat your media for you. When I first tried installing Linux with the Universal USB Installer, I kept getting theerror 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 1Connect your USB drive or flash card and launch Windows Explorer.

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

Page 3: Create a Persistent Linux Installation on a SD Card

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

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 InstallerNow, it’s time to turn your USB drive or flash card into a bootable drive with Linux installed. This is prettysimple.

Page 4: Create a Persistent Linux Installation on a SD Card

Step 1Download the Universal USB Installer via PenDriveLinux.com.

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

(For good measure, you mightwant to run it as anAdministrator, though thisshouldn’t be necessary.)

Step 3Read the License Agreement and Click I Agree .

Page 5: Create a Persistent Linux Installation on a SD Card

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

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

Step 5

Page 6: Create a Persistent Linux Installation on a SD Card

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

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

Page 7: Create a Persistent Linux Installation on a SD Card

Step 7Click Create .

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

The installer will let youknow when the installation

Page 8: Create a Persistent Linux Installation on a SD Card

is complete. Once it is, youare free to Click Close .

Note: In this screenshot, Iam installing a differentdistro of Linux—DSL 4.4.—but the successfulinstallation screen will lookthe same regardless ofwhich distro you are settingup.

Now, your Live USB isready-to-go.

Setting Up Your BIOS to Boot Linux from a Live USBBooting from a USB drive varies from computer-to-computer, as does the procedure for changing the bootdevice order. I’ll show you how to do it on my computer—an ASUS EEEPC 1005HAB—but it’s probably bestto 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 isinstalled). If it doesn’t find an operating system there, it’ll then try another drive—perhaps the CD-ROM orUSB. What we want to do is to get your computer to check the USB drive for an operating system before itgoes to your Windows system disk.

To do that we need to enter into the BIOS setup page. This is accomplished by pressing a certain keyduring 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 theBIOS setup will usually be indicated along the bottom. For me, it’s F2. For you, it may be F10, F12 or Esc orsomething completely different. Again, Google is your friend here.

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

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

Step 2Reboot your computer.

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

Page 9: Create a Persistent Linux Installation on a SD Card

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

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

Page 10: Create a Persistent Linux Installation on a SD Card

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

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

Step 7

All done. You’ll only have to do these steps once.After this, your computer will automatically boot from

Page 11: Create a Persistent Linux Installation on a SD Card

your USB device whenever it’s plugged in. When it’snot, then Windows will load.

Setting Up Ubuntu with PersistenceWhen you boot into your LiveUSB Linux device, you’ll be greeted with a setup screen with a few options. Forthis tutorial, I’m assuming that you don’t want to install Ubuntu on your main hard disk. So, we’ll be booting alive version of Ubuntu. Usually, this is just a “test drive” version of Ubuntu that lets you tour the OS and makesure everything works. But because we chose to create a persistent version of Ubuntu, we can actually makechanges 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 ifyou reboot your Linux device and the changes still aren’t saved, then you may need to create another user.

Here’s how:

Step 1Insert your LiveUSB and boot your computer.

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

Page 12: Create a Persistent Linux Installation on a SD Card

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

Step 4Click Add.

Page 13: Create a Persistent Linux Installation on a SD Card

Step 5Give yourself a username and Click OK.

Step 6Give yourself a good password and Click OK.

Page 14: Create a Persistent Linux Installation on a SD Card

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

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

Note: If you don’t do this, when you try toinstall new programs or do otheradministrator-only tasks, it’ll ask you fora password for "Ubuntu” over and overand fail to authenticate.

Page 15: Create a Persistent Linux Installation on a SD Card

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

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

Step 10Choose the user you just created.

You’ll be logged into a newdesktop. Now, you can go aboutyour business, adding programs,changing settings and creatingdocuments and they’ll all bethere when you come back.

Note: I can’t really explain whysome users have to add a newuser in order to get an UbuntuLive USB to stay persistent. Thefirst time I tried it, it didn’t work itall—I made changes to the livesession user and when Irebooted, poof, they were gone.I then added a new user and thechanges were saved for thatuser. But then, when I re-did thisentire process for the tutorial, Inoticed that items I was saving tothe desktop for the live userstayed persistent after I added

Page 16: Create a Persistent Linux Installation on a SD Card

another user.

I know this isn’t a very expertsounding piece of advice, but ifyou encounter any quirks alongthe process, I recommend tryingagain from the beginning. That means re-downloading all the ISOs and programs, re-formatting your flashdrive, 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 Iattempted a persistent install, I used a small persistent set-aside of 1 GB. The first time, when it didn’t workas well, I had a persistent file size of 2 GB. If you give this tutorial a shot, I’d love to hear how things turnedout for you.

ConclusionI call this method of installing Ubuntu the best of both worlds—with portability! You’re not fudging around withyour 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 fromthere with all of my stuff already there. This is actually what savvy tech support crews and data recoveryspecialists do. They just load up their toolkit and operating system onto a thumb drive and fire it up on theclient’s machine, even if it’s not bootable due to a virus attack, hard drive failure, etc. I’m sure you can thinkof 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.

About the authorBased in Pittsburgh, Jack Busch is a groovyPost senior writer. News or geek tip? Email Jack [email protected].

| |