A two for one special! A tour of distros and how to get them running+rep
Your system on a USB Flash Drive -
TAKING IT WITH YOU ANYWHERE
I have recently tried out a technology that I have come to find really handy, the LiveUSB. For Linux users, the concept of LiveCDs should be familiar. The LiveCDs contain the whole operating system, allowing you to try it out without making any changes to your computer or existing setup whatsoever. One inserts the CD, tells the computer to boot from it, and boots from it, ending up in the OS on the CD. This is a very popular way to try out different Linux distros. Now, LiveUSBs are basically the same thing, on a USB flash drive. Your entire OS, including applications, documents and whatnot, on a flash drive. Handy. The advantage a LiveUSB has over a LiveCD is quite simple. You can't easily write to a LiveCD (and who carries CDs in their pockets?). Some operating systems allows you to store your settings, applications etc. on a hard drive, but if you insert the CD in a different computer: it is all gone. There are exceptions (OSs burning to CD-RWs), but they are rare. LiveCDs are great for trying out an OS, but if you actually want a "pocket-OS" to take with you, a LiveUSB is the way to go. So in this tutorial I will go through the steps to create such a USB drive.
If you didn't quite get the last paragraph, and/or want a bit more information about LiveUSBs before continuing, I can recommend the Wikipedia article on the subject: Live USB - Wikipedia - don't worry, it's short.
The ingredients
To make a bootable USB flash drive containing your OS, you need a few things:
* The most obvious one is perhaps a USB drive. The required size of this depends on the OS you plan on installing. A full Ubuntu install will take a lot more space than a tiny DSL install, for instance. If you have 4GB or more you should be fine in any case. And large USB drives are cheap, so just go for it. I used my 8GB SanDisk Cruzer Micro. This was originally a U3 drive. If you don't know what a U3 drive is, you could always look it up. Anyway, I uninstalled that so that I could use it for this instead. That U3 thing didn't really seem so cool to me anyway. One thing to remember is that a LiveUSB flash drive will usually wear out faster than a normal USB flash drive (unless the OS you install is running in RAM, more on this later). Yes, USB flash drives do wear out, as flash storage has a limited number of writes. Therefore, you might e.g. want to buy two drives, so that you can have a backup drive. This does not apply to USB external hard drive installs (because these do not use flash storage), but that's not what I will discuss in this tutorial anyway, as I find USB flash drives much more convenient than external hard drives. You probably won't need all that space anyway. If you do, sorry, wrong tutorial![]()
* An OS to install on the flash drive. I'll come back to this in a moment.
* CD burning software capable of writing ISOs. You will need this for creating a LiveCD. I'll come back to this too.
* You may need software to partition the USB drive and make it bootable, though some installers do this for you. Most Linux distros come with cfdisk(cfdisk - Wikipedia), or at least fdisk, which will do fine. The official GNOME partition tool GParted (GParted - Wikipedia) is a very user friendly alternative. I will go through this in more detail later.
* A computer able to boot from USB. Now, this is of course a drawback of LiveUSBs. Not all computers are able to do this, and even if they are it can be a hassle to get it to recognize yours. That being said, most - if not all - computers made within the last 5-8 years should support it, and there are tools (like the PLoP Bootmanager - see PLoP - Bootmanager) to help booting from USB even if the BIOS does not seem to allow such a thing.
* Some technical knowledge, general intelligence, patience and a full backup wouldn't hurt either...
Choosing your OS
Well, if you were thinking about a full Windows Vista install, just forget it. Heh. Of course there is the space issue, but more important is the speed issue. We're running from a USB drive, remember, and that means disk operations will be quite a lot slower than usual. If you must have Windows, you should look into Windows PE (Windows Preinstallation Environment - Wikipedia). If you are intending to use this USB drive as a system rescue tool, a version of Windows could come in handy, but I would then consider creating a multiboot USB drive. Yep, that can be done too, but it's beyond the scope of this tutorial.
If you plan on using it for a portable workstation, looking into Linux is a good idea. There are many "minimal" (and not so minimal) Linux distros that are well suited for booting from USB. I tried 4 (or actually just 3...) of them before choosing one.
The first one I tried is called Puppy Linux. Cute, eh? It is one of the minimal distributions. Actually, if the computer it is running on has more than 64MB (or up to 256MB, depending on the version) of RAM, the whole OS will run in RAM. This, of course, makes it very fast and responsive - much more than a normal hard drive install of e.g. Windows XP. The whole OS is usually less than 100MB big. The exact size varies depending on version. When I add that it is famous for its good hardware detection, easiness of installing to USB drives, and that it comes with several full-blown applications like AbiWord and Mozilla Firefox, you might understand why I wanted to try this one.
Additional info on Puppy Linux:
Home Page | Puppy Linux
Puppy Linux - Wikipedia
Screenshots:
http://maketecheasier.com/wp-content...screenshot.jpg
But, I didn't really like it. It was not my kind of OS, really. It was, however, extremely easy to use, with nice GUI tools and everything, so for the Linux newbie - this is an excellent choice! With this one, one can get a nice working system up and running in no time, allowing a newcomer to concentrate on getting familiar with the Linux way of doing things. Basically, if you are new to Linux (or have never even tried it) and want one of these LiveUSBs - go for this one!
So, moving on in the diverse forest of Linux distros I chose to try out a classic. That is, a classic in the LiveUSB world. This one is very much used for this kind of things because of its small size. It's called D*mn Small Linux - (usually just DSL). The whole system in less than 50MB. Now that's one small Linux! Like Puppy, it runs totally in RAM. The system requirements are really low, which is why this distro is often used for "reviving" old computers.
Additional info on DSL:
(heh - you will have to copy/paste links and replace the **** because of the censoring)
Screenshots:Code:http://www.****smalllinux.org/ http://en.wikipedia.org/wiki/****_Small_Linux
http://www.openaddict.com/images/200...2-20.27.12.png
http://atomicmanifesto.files.wordpre...12/dsl-42x.jpg
I played around with this one for a while. I have to say that it's a bit more my style than Puppy, but it had a few drawbacks that made me pick a different one. Like the kernel version. With so many distros availible I decided that it wouldn't hurt to try out a few more to see if I liked them better. DSL is a fairly nice distro though, and many LiveUSB users will undoubtly pick this one. It is quite user friendly, though nothing compared to Puppy. Linux newbies might benefit from looking elsewhere, depending on their patience and knowledge of computers in general.
So, after throwing away DSL for a while, I found an interesting looking distribution named SliTaz. It is the smallest one of the distributions I have mentioned so far, the ISO image being only about 25-30MB. Unlike DSL, it used the 2.6.x kernel, and included some quite impressing applications. Of course, this one also runs in RAM. It is apparently easy to set up for LiveUSB usage.
Additional info on SliTaz:
SliTaz GNU/Linux - Main page
SliTaz GNU/Linux - Wikipedia
Screenshots:
http://news.softpedia.com/images/ext...-large_006.jpg
http://3.bp.blogspot.com/_MfwRx_4ERx...itaz-linux.png
The thing is, I never got to actually try this one, as the LiveCD refused to boot... -_- Apparently this happens to some people, and there is no known way to fix it. When I get my new laptop I'll try to get it running on that one. In the meantime, I advise you to give it a try, as it looked quite promising!
Now, I moved away from the minimal distros and went for a "proper" Linux distro - Arch Linux. Arch is a build-from-scratch distro, much like Gentoo, but with binaries. And the install process is much faster...The idea is that when Arch is installed, you sit there with a base system and a command prompt, and basically have to add anything else that you want yourself. This is in other words not a suitable distro for total newbies, but should be fine for a bootable USB! Arch is optimized for i686 (and x86-64) processors, and is therefore fast on modern hardware. The drawback is that it does not support any other processor architectures. This means you need a Pentium II or higher, Athlon/Duron, etc. The AMD K6, for instance, will not work. This is not an issue for me, but you better find out whether or not it is an issue for you if you are thinking about going for this one.
Additional info on Arch:
Arch Linux - Home Page
Arch Linux - Wikipedia
Screenshots:
http://www.tuxradar.com/files/LXF118...wn.arch_01.jpg
http://upload.wikimedia.org/wikipedi...eryl-sshot.png
http://downloadsource.net/img/d85cf9...011d01dd88.jpg
http://fc09.deviantart.com/fs31/f/20...n_to_infty.jpg
http://img91.imageshack.us/img91/6970/screenshot2n.jpg
I decided to stay with Arch. It is exactly the kind of OS I like (I want control, thank you). It does not run in RAM like the others, but it is more than fast enough. The installation process is quite simple (though maybe not for a newbie), and well documented. The Wiki (ArchWiki) is a great place to start when starting out with Arch.
Now I have walked you through the distros I tried, but they are not the only options. Some other popular LiveUSB OSs include:
* Feather Linux - much like DSL, though larger, including more applications. 2.4.x kernel. Last release in 2005, now dormant.
* Xubuntu - A "lighter" Ubuntu with Xfce as window manager. Still considered a bit heavy for LiveUSBs, but runs fine on modern hardware.
* Gentoo - Very fun to install - often takes 3 or more days, at least 1, depending on experience and internet connection..Not for a linux newbie. Compile (almost) everything from scratch. Time consuming, but gives (if you do it right) a highly customized and optimized system.
The Wikipedia article on LiveUSBs I mentioned earlier lists some more distributions.
Live USB - Wikipedia
Installing the OS
Now, hopefully, you have done your research and figured out what OS to install. You have also got a USB drive ready, and your fingers are itching to combine those two into a pocket-atomic-bomb. And we will.
The install process will naturally depend on which OS you choose. I will here go through the processes of installing Puppy, DSL and Arch. Mostly Puppy, because that is the best choice for newbies (and pros won't need so much guidance). If you chose a different OS you will have to do some research on your own, but reading the below won't hurt.
Disclaimer: If you mess up your computer in any way - it's not my fault. Do backups.
Puppy Linux:
So, going for a walk with Puppy are we?This is really simple, so don't worry at all. The first thing you want to do is to get a Puppy LiveCD. How? Download the ISO from Downloads | Puppy Linux - you want the latest production version. It should be around 100MB. After you have finished downloading, burn the ISO to an empty CD. There are numerous tools for doing this. I used the extremely simple tool BurnCDCC under Windows (BurnCDCC - Download). Under Linux you could use e.g. Nero Linux. Your choice, really.
So, got a LiveCD? Reboot your computer, and get it into BIOS (or the boot menu, if you have that) to make your computer boot from the CD. When the CD boots you will have to choose a few things like keyboard layout and screen resolution. Fairly straightforward. You should soon be inside a working Puppy Linux. Feel free to look around a bit and get familiar with it.
When you decide it's time to install Puppy to your USB drive, plug it in. You should see some semi-transparent gray icons in the bottom left corner of your desktop, above the MENU button (see screenshot). These are the mountable devices. The icons can be dragged around. By clicking one, Puppy will automatically mount it. To unmount it, right click it and choose "Unmount (if mounted)" or something like that. For more information about mounting, you could read this short article: How to mount partitions and filesystems in Linux. The article also explains mounting and unmounting from a command line. You do not have to worry about that in Puppy, though.
So, you have spotted your USB drive, right? What its name is will depend on things like how many harddrives your computer has, if there are other USB drives inserted and so on. With one harddrive and no other USB drives installed, it is probably named "sdb1". If you have two hard drives installed, "sdc1". The number after the letters represent the partition. So if you have one hard drive - "sda" - with two partitions, the first partition will be called "sda1", the second "sda2". Your flash drive is probably not partitioned (yet), so it will only have one partition - "sdb1" (or "sda1", "sdc1", "sdd1" etc.) If you are normally a Windows user (and new to Linux), this can be a bit confusing. Read page 1, 2 and 3 in this article: Linux Partitions: A Primer Page 4 deals with setting up partitions, but it does not really apply to USB drives.
Before we can proceed with installing Puppy to the USB drive, we want to partition it, and make one partition (the one we will install to) bootable. Puppy includes a user friendly tool for this - GParted. Click the MENU button on your desktop (or right click on the desktop) - choose "System" - then "GParted partition manager". If you read the article above, you should know what a partition is. If you read page 4 of it, forget what you read.When we are dealing with partitioning a USB flash drive, there are a few things to consider - mainly: Do you want to be able to read it from Windows?
Windows only recognizes the first partition of a USB drive. And it does not understand the Linux filesystems (like ext2, ext3). I want to be able to use my LiveUSB drive like a normal USB drive. Therefore, I make the first partition of the USB drive about 1GB in size (I have 8GB in total), with the filesystem FAT32 (which is recognized by Windows as well as Linux). I will not have my OS installed on this partition, it will only serve as a "bridge" between Windows and Linux. Now, when I put the USB drive in - Windows thinks it's a 1GB big USB drive. The rest of the drive is not reachable through Windows by default. I can place files on that partition through Windows, like I would on any USB drive. I find that useful.
NOTE: Before continuing - 1) Make sure that you are partitioning your USB drive and not your harddrive... 2) Expect all data on your USB drive to be lost.
In order to install Puppy (or any other OS), one partition must be bootable. That is done in GParted by first partitioning the drive, then right-clicking the partition and choose "Manage flags" (or something like that). Set the bootable flag for the partition you intend to install Puppy to. I recommend setting the filesystem to "ext2" for the partition where you will install Puppy to, as "ext3" will wear out your drive faster.
You might want to have more than 2 partitions, like one separate partition for your /home directory, and/or one separate partition for backups. This is up to you. The only thing I want to mention is that creating a swap partition is usually not a good idea, as that will wear out your drive faster.
Hopefully by now you will have your flash drive properly partitioned, with one (only one) partition bootable. If you feel unsure about this, doing some research on Linux partitions and filesystems could be a good idea. A comprehensive tutorial on GParted can be found here: GParted partitioning software - Full tutorial
Now that your drive is ready, we will install Puppy to it. This is very easy through the Universal Installer, found under MENU -> "Setup" -> "Puppy universal installer". Click it.
The instructions are simple and easy to follow, so do just that. Make sure that you are installing to your flash drive, not your hard drive. Install to the partition you made bootable.
When choosing MBR, the default should do. If you are having problems booting (and the troubleshooting part of this tutorial can not help you) - try experimenting with reinstalling with a different MBR.
After the installer has finished - congratulations, you have a LiveUSB with Puppy Linux! Shut down the LiveCD (it will ask you if you want to save settings and stuff, you probably don't want that) - and reboot. Go into the BIOS (or boot menu) to boot from USB. Remove your LiveCD (so that you don't get tricked into thinking it booted from USB when it actually used your LiveCD), and go ahead. Hopefully it should boot without problems. If you do experience problems, see the troubleshooting section below.
Good luck with Puppy Linux on a stick!
D*mn Small Linux (DSL):
This section will not be as spoonfeeding as the previous one on the Puppy install, so if you are a newcomer to Linux (but wants DSL, not Puppy), you might want to read that one before reading this.
There are many ways to install DSL. If you intend to partition your drive like I suggested in the section about Puppy (the first one FAT32 for normal USB drive usage, the second ext2 bootable for the OS - possibly more partitions for /home etc.) you will want to use GRUB as your bootloader, as Syslinux accepts FAT16 or FAT32 only.
Anyway, the process is quite d*mn simpleGet the files onto the drive and install a bootloader. See this page for the details:
Note: You will have to copy/paste the links - and replace the **** because of the censoring.
The LiveCD includes a script to install DSL to USB drive which makes life easier for you. See this page:Code:http://www.****smalllinux.org/wiki/index.php/Install_to_USB_From_within_Linux
You might benefit from reading this page first, which also includes links to instructions on installing from Windows or Mac OS:Code:http://www.****smalllinux.org/wiki/index.php/Install_to_USB_From_within_DSL
You might also want to look around in the Wiki:Code:http://www.****smalllinux.org/wiki/index.php/Installing_to_a_USB_Flash_Drive
- and in particular the FAQ:Code:http://www.****smalllinux.org/wiki/index.php/Main_Page
Because these resources basically explains everything, I will not write more on this. Good luck with DSL!Code:http://www.****smalllinux.org/wiki/index.php/Frequently_Asked_Questions
Arch Linux:
If you're going for Arch, you're hopefully not a newbie, so no spoonfeeding. For advice on partitioning a USB drive, see the Puppy section.
The Arch Wiki is an invaluable resource, so if you have questions, make sure to check it out: ArchWiki
This is the document you want to read for installing Arch:
Official Arch Linux Install Guide - ArchWiki
Or - if you are new to Arch this document might be a better idea:
Beginners Guide - ArchWiki
To get Arch on a USB drive, basically just install it as you normally would (to a hard drive), but pick the USB drive as destination instead. The Arch installer will walk you through partitioning (or, more accurately, partitioning is an option in the install menu...) Auto partitioning is not a good idea. Again, see the Puppy section for details on partitioning a USB drive.
When your USB drive is partitioned and bootable, just proceed with the installation until you reach the configuration part. There are a few things there that might need some clarification.
This article should give you an idea.
Installing Arch Linux on a USB key - ArchWiki
1) If you are going to move the USB drive around (between different computers), it's best to use UUIDs in menu.lst and fstab
2) In mkinitcpio.conf - make sure to add usb to the hook list (if it's not there already)
Using the above sources, installing Arch should be easy. When installing is finished, reboot from USB and take a good look at your fresh, modern, appealing... command prompt.No fancy GUI before you've added it yourself. That's the Arch way! You might benefit from configuring your network first, by the way. A good WM for USB Arch would be Openbox, but I'm sure you would like to figure out that by yourself
Here are some tips after installing:
Post Installation Tips - ArchWiki
So, congratulations with your new Arch LiveUSB!
Troubleshooting
There are a lot of things that might go wrong, and here are some common issues you might face:
1. I can't get into this BIOS thing!
You might want to read BIOS - Wikipedia, How to Change the Boot Order in BIOS and Getting Into The BIOS
2. I'm unable to choose booting from USB drive in BIOS.
Well, first of all, make sure you have plugged the USB drive into one of the USB ports installed on your motherboard. Not in a hub, not in an extra USB card, but directly into one of the ports on the motherboard. If the BIOS still doesn't recognize it, it is possible that your computer does not support booting from USB. Try plugging it into a few different computers. If they do not recognize it either, chances are that you've done something wrong with the USB drive. Remembered to make it bootable? If they do recognize it, meaning that your computer does not support booting from USB, you might want to use something like the PLoP bootmanager I mentioned earlier in this tutorial. See PLoP - Bootmanager.
3. BIOS gives me several options from booting from USB, like USB Zip, USB FDD and USB HDD - which one should I choose?
Come on, try them all.Seriously, though, USB HDD is usually the preferred one, USB Zip might work. USB FDD is best avoided. The USB Zip option is typically used on older systems that do not support USB HDD boot. Using this boot option might require modifying the drive geometry to match how the BIOS has been hard-coded to see the device. Go figure.
4. Ok, my computer recognized the USB drive, but it won't boot my OS - just gives me errors.
You made a mistake. If you think the install is fine, make sure that the bootloader is configured properly. An example: You're using the GRUB bootloader, and get an error 15: File not found. This is quite common. The reason is probably that the GRUB configuration file (/boot/grub/menu.lst) is not set up properly. Google will help you here.
5. It boots, and seems to run fine, but my settings are not stored!
Depending on the OS installed, you might have to configure this yourself. DSL, for instance, has a file where all directories/files to be stored are listed. You will need to do some research on your own here.
7. I have a problem not listed above..
First - use Google to see if it is a common problem with a simple (or not so simple) solution. If that is not the case, you can post it in this thread or in the forum for the OS you installed (if it has one). If everything fails, go emo.
8. It works!
Good job! Cool, eh? You deserve a cookie
At last
What now? You've got a LiveUSB up and running, which basically means that you can take your system around wherever you want, plug it in, and go wild. You decide what to make of it. A system rescue tool? A hacking tool? A portable workstation? It is your choice. Anyway, I hope this tutorial was helpful to you! Have fun with your stick!![]()
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
A two for one special! A tour of distros and how to get them running+rep
CodeCall Blog | CodeCall Wiki
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog
Hehe thank you!![]()
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
I don't have time to read it whole now since we're having to live chats, but When I scanned through it I saw two word directly, "go emo". Great work marwex(I think, will read it later)
HahaYou got the essential part then!
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
Wow, that is a lot of information! Nice work! Did you find that the LiveUSB versions of Linux were very volatile? When I tried them a while back they would work for about 2-3 boot up then they would become corrupt. I attributed it to running on a FAT fs.
Anyway, +REP!

WOAH
thats a long tutorial. /* goes emo */
ill +rep you when it let me
yo homie i heard you like one-line codes so i put a one line code that evals a decrypted one line code that prints "i love one line codes"
Code:eval(base64_decode("cHJpbnQgJ2kgbG92ZSBvbmUtbGluZSBjb2Rlcyc7"));
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+(dic*) rep![]()
lol thx MathX (funny rep comment)
Hey! Check out my new Toyota keyboaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
There are currently 1 users browsing this thread. (0 members and 1 guests)