I am Fedora, and so can you!
by Max Spevack
Fresh, free, and featherweight: the all-new Fedora 8 on a USB key.
I am writing this article on a Windows laptop borrowed from a friend. But fear not, dear reader, for I have not abandoned my free software principles. For while the hard disk of this laptop contains the Windows operating system, I have used a USB key as the boot device, and the laptop is currently running Fedora 8, codenamed “Werewolf.”
When I am finished, I can unplug the USB key, power off the machine, and hand the laptop back to its owner. I’ll have my entire distro in my pocket, and when the laptop’s rightful owner powers it back on, the computer will behave as always.
The following walkthrough will enable you to run Fedora 8 from a USB key.
0. Prerequisites
In order to complete this walkthrough, you need:
- a computer with Fedora 7 or Fedora 8 installed on it.
- root access on that computer.
- basic command-line knowledge.
1. Acquire a USB key
The basic desktop version of Fedora 8 will fit on a 1 GB USB key. The “developer” version of Fedora 8 will require a 2 GB USB key. Pretty much any brand of USB key should work. I use the PNY Attache ones — they work well and can be found for a relatively cheap price.
2. Acquire a Live image
The Fedora Project releases both live and installable images of the Fedora distribution. In order to run off of a USB key, you need one of the live images — this means that the entire distribution is loaded into the computer’s memory and runs without touching the hard disk at all.
Download a live image or create your own if you are particularly adventurous!
3. Install livecd-tools
On your current Fedora machine, install the livecd-tools package, either via the graphical
add/remove software application or by using yum directly on the command line. Note that this step requires you to have root access!
su -c 'yum install livecd-tools'
4. Figure out where your USB key is mounted
Plug in your USB key and the system should automatically mount it for you. All you need to do is make a note of the device name that was chosen when you plugged the USB key in. To do so, open up a terminal and run the following command:
df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VolGroup00-LogVol00
35G 6.8G 26G 21% /
/dev/sda1 99M 19M 76M 20% /boot
tmpfs 501M 12K 501M 1% /dev/shm
/dev/sdb1 2.0G 0 2.0G 0% /media/disk
In this case, the bottom line is the one that is important–you’ll want to find the line that is correct for your system, and remember the first part. /dev/sdb1 will be used for the rest of this article. You should use whatever result is displayed for your machine.
5. Copy the image onto the USB key
Now you have everything you need — the livecd-tools package is installed, the image that you want to use has been built or downloaded, and your USB key is plugged into the computer. All that is left to do is run one more command: livecd-iso-to-disk. The command’s name is pretty self-explanatory. The first argument is path to the live image, and the second command is the location of the USB key, which you discovered in the previous step. Note that this command requires root access!
su -c 'livecd-iso-to-disk /path/to/Fedora-8-Live-i686.iso /dev/sdb1' Verifying image... Fedora-8-Live-i686.iso: 17d675e98a44754d41ba0d93f485ffa3 Fragment sums: 7dba468e8adf87c776ae4a15a871426ba74dba1187adb2a6807c1e124a34 Fragment count: 20 Percent complete: 100.0% Fragment[20/20] -> OK 100.0 The media check is complete, the result is: PASS. It is OK to use this media. Copying live image to USB stick Updating boot config file Installing boot loader USB stick set up as live image!
6. Reboot
Reboot your computer, and when the BIOS starts up, make sure you tell it to boot off of the USB key and not the hard disk. Usually the screen will flash a message that says something like “press F12 to bring up boot device list”. On some machines, you have to press the DEL key instead.
That’s it. Wait for the machine to finish booting and at the login screen click on “Fedora Live” and you are automatically logged in (or just wait 60 seconds for the automatic login to trigger).
Remember!
The USB key that you have just configured only contains the operating system. It does not store any of your personal data on it. I recommend that you carry around a second USB key for saving data. Most laptops have more than one USB slot, so it is easy to plug them both in. Boot off of the first key, and then before you shut down the computer, save all of the stuff you worked on to the second key.
References:
- http://fedoraproject.org/wiki/FedoraLiveCD/USBHowTo
- http://fedoraproject.org/wiki/FedoraLiveCD/LiveCDHowTo
- http://www.redhatmagazine.com/2007/05/31/remixing-fedora-7/
About the author: Max Spevack does stuff at Red Hat.







November 7th, 2007 at 9:03 pm
It would be good if there was an easier way to set this up, like a small program that would do all the steps for you (I’m thinking something with a UI as simple as SoundJuicer). Avoiding using a shell is good for showing off
November 8th, 2007 at 1:01 am
How to make a persistent fedora live usb?
November 8th, 2007 at 3:28 am
The problem of doing it this way is that the system is read-only then. No updates, no user data (without using another usb key…but modern usb keys are big enough to have both, the OS and the user stuff on it).
I’d rather install Fedora onto the usb key (just the way you install it on your HDD).
November 8th, 2007 at 6:16 am
Fedora was copied to sdb1. Why not create another partition, sdb2, and mount it as /home ?
November 8th, 2007 at 9:43 am
Fedora can also be installed directly onto the key, which gives a full read/write environment (no need for the second key, and can be created using the regular Anaconda GUI). 4-8 GB keys are under $100 these days, and they provide plenty of room for a standard install (~2.1G in F7 IIRC, haven’t checked the size for F8 yet) as well as user data. (One gotcha: you’ll sometimes have to change the Grub boot order during installation, depending on your BIOS and disk configuration).
November 9th, 2007 at 7:54 am
While cool, this is nothing new. I’ve had RHEL4 ES booting off a 4GB keydrive for over a year now with read capability to the host NTFS Windows partition. You just have to do a new mkinitrd and make sure it obtains usb first at boot time.
November 12th, 2007 at 5:42 am
Don’t forget to turn off access time recording in fstab with the noatime option if needed. Your thumb drive will last a lot longer that way.
November 12th, 2007 at 7:26 am
I’d prefer an open/free implementation of Mandriva-Flash-like system, but the article is very useful nevertheless.
Regards,
Juan
November 16th, 2007 at 11:35 pm
[root@F8 syslinux]# date
Sa 17. Nov 06:05:25 CET 2007
[root@F8 syslinux]# su -c ‘livecd-iso-to-disk /home/user1/Downloads/Fedora-8-Live-i686.iso /dev/sdg1′
Verifying image…
/home/user1/Downloads/Fedora-8-Live-i686.iso: 17d675e98a44754d41ba0d93f485ffa3
Fragment sums: 7dba468e8adf87c776ae4a15a871426ba74dba1187adb2a6807c1e124a34
Fragment count: 20
Percent complete: 100.0% Fragment[20/20] -> OK
100.0
The media check is complete, the result is: PASS.
It is OK to use this media.
Copying live image to USB stick
Updating boot config file
Installing boot loader
USB stick set up as live image!
[root@pc1600 syslinux]# qemu -hda /dev/sdg1 -m 512 -std-vga
Could not open ‘/dev/kqemu’ – QEMU acceleration layer not activated
[root@F8 syslinux]# uname -a
Linux pc1600.netzwerk.local 2.6.23.1-49.fc8 #1 SMP Thu Nov 8 21:41:26 EST 2007 i686 i686 i386 GNU/Linux
November 22nd, 2007 at 2:08 am
The first version of Redhat I purchased was 5.0. I have tried several versions through the years and have found they are seriously lacking in apps, to, for instance, play movies, or mp3′s, or doesn’t detect my scanner or…well you all know.
On the hardware detection, as I understand it, Redhat is now the best in the world. Congratulations. I recently downloaded RH live. Kaffine doesn’t play movies out of the box. Vector Linux and Mandriva do. Putting the installation to a usb stick on a script is very nice. Thank you very much. I hacked through booting Knoppix, SLAX, DSL, and Vector on a usb stick using both syslinux and ldlinux,
I also Downloaded Fedora 8 which I am hoping will have everything Vector has. I work for the Second Largest Employer in the country. Redhat or Fedora is used on the most Expensive computer systems they have. One of my tasks involves working with those computers.(I also crawl on my belly like a reptile and replace failed bearings)The redhat based OS is the most stable, abuse absorbing OS I have ever seen, equaled only by QNX. I wish I had bought stock at the same time I bought Redhat 5.0 SALUT
November 23rd, 2007 at 3:52 am
What I was really interested in is something like this + some type of unionfs or aufs file system that will save all my updates and changes to RAM and then allow me to commit these changes to the USB drive if I want to at the end of my session (or manually). This would help to resolve some the wear out issues with USB thumb drives. but it seems that as far as I can tell, this isn’t supported. Check this post related post where no one replied – http://www.fedoraforum.org/forum/showthread.php?t=173072 Any ideas? Thanks.
January 7th, 2008 at 10:32 pm
I have gotten as far as running the command to copy the distro the the flash drive: livecd-iso-to-disk… but I get this response:
Partition isn’t marked bootable!
You can mark the partition as bootable with
# /sbin/parted /dev/sdb
(parted) toggle N boot
(parted) quit
Cleaning up to exit…
So, I go into parted and say: “toggle 1 boot”
Then I get this:
Error: The flag ‘boot’ is not available for loop disk labels.
So… I print and get:
Model: Unknown (unknown)
Disk /dev/sdb1: 8201MB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Number Start End Size File system Flags
1 0.00B 8201MB 8201MB fat32
Any ideas?
January 14th, 2008 at 11:45 pm
Is there anyway of booting the livecd from eg partition hda5 !! am too poor a a dvd burner.
January 14th, 2008 at 11:47 pm
plus my laptop is too old to boot from USB.
February 12th, 2008 at 11:54 pm
http://swik.net/knoppix/boot+knoppix+from+pen+usb+pen+drive will get your pendrive working with knoppix…
March 6th, 2008 at 5:13 pm
So Step 1 is to have fedora, and step 2 is to install fedora.
Hmmmm
March 6th, 2008 at 5:40 pm
Fear not:
http://lewk.org/blog/liveusb-creator.html
Create your Fedora USB key straight from your craptastic Windows machine. Props to Luke Macken for being a straight-up baller!
March 12th, 2008 at 7:30 am
i am a enthusiast fedora user and love the distro like anythin… i want to customise fedora 8 (which i am able to do) then make a live DVD out of my customised system so tht all my frens and college mates can use it (will contain packages which will help it in making it a more user friendly ne)… so can u help me in that.. i am a novice in this thin.. if u can help in givin me the detailed steps
April 18th, 2008 at 3:41 pm
I am a newbie trying to install fedora core 2 onto a usb hdd and i am able to install the software but i can not boot from it any help would be great. yes i can and do have the correct cmos settings.
Thanks
Scott
April 21st, 2008 at 2:19 pm
I am also a newbie using Fedora 8 for a school project. My school employs swappable drive bays for lab work. I have a matching bay at my home but the hardware profile is completely different. I would like to move this hardrive back and forth. The Live CD image would work fine, but I want to save my changes. Is there a way to force a rescan of the hardware so that it wouldn’t crash when the hardware is completely different?
Thanks for your input
Justin
May 13th, 2008 at 3:49 pm
Fedora 9 is out!
Now with new usb-thingy:
https://fedorahosted.org/liveusb-creator
Cant wait to try it out.
Something that would be great in the future would be if the usb drive could include something like a virtual machine in addition to fedora, and you would be able to start up linux on any machine instead of doing stuff with the bios-boot-settings. Then you could even go to the library and just run your usb-linux and get some work done there
May 16th, 2008 at 7:24 am
[...] Taken from here and here [...]
May 27th, 2008 at 7:59 pm
What’s with this “key” misname in Fedora/OLPC land? When someone says “acquire a key”, I think they’re talking about PKI and id_dsa. If you mean “put files on a USB flash drive”, then please say so. Wikipedia for “USB key” and see where you end up.
June 4th, 2008 at 4:05 pm
Now you can bypass all the time and effort to build your own bootable Fedora key and buy one pre-configured here http://itex.does.it, with latest Fedora 9 includes user persistence!!
June 6th, 2008 at 4:25 pm
I would have to say that the guys that did SLAX have the right idea when it comes to the modules and also having a Windows utility to write to the pen drive. If you want more people to use your product, you need to provide the people that use the more wider used OS a tool so they can convert.
Make it easy.
June 13th, 2008 at 12:20 am
Yes I do agree that free software is great. (There is always a but) But once installed it is absolutely hard to uninstall. I would want to uninstall because some windows programs don’t run in Fedora or linux. For example Dragon naturally speaking voice recognition software to mention just one.
August 12th, 2008 at 11:09 pm
To wipe the boot sector the “dd” command works nicely. You thought Windows installed fine until you tried to boot and you see “gr” or “li” and it doesn’t boot. The fixmbr and the fixboot options on the 2000 or xp install disks will correct this problem….but….if you can boot a live distro of linux…(in Knoppix you have to change the read write mode) then, from the command line, type in su return
this makes you super user or root. then, and you must be correct on your sintax….
dd if=/dev/zero of=/dev/hda bs=512 count=1 you must have the correct name of the hard drive hda, sda, hdb I have inserted hda. Hope this helps..”if” is input file and it is actually a file in your distro. “of” is for output file and it can be a device or actually a file if you wish. Yes you can copy your entire hard drive using the dd command.
August 25th, 2008 at 9:29 am
[...] También destaca extras como la opción de instalar Fedora 8 en una llave USB, y enlaza con una serie de entrevistas a los principales desarrolladores implicados en esta versión. [...]
December 2nd, 2008 at 10:56 am
Or you can run other Linux ISOs like the CentOS-based Orange JeOS appliance image. More info on the SourceForge page:
http://orangejeos.sourceforge.net/oj_core.html
December 17th, 2008 at 7:18 am
http://www.pendrivelinux.com/2008/05/17/install-fedora-9-to-a-flash-drive-using-windows/#more-402
From windows just burn the iso to the usb pen thumb or key drive. Use the above url for more info. I have not tested but it looks easy and workable.
December 17th, 2008 at 2:35 pm
Thumb drive boots are always difficult, especially based on hardware incompatibilities. I would recommend using a CD for boot in most cases.
December 20th, 2008 at 7:36 pm
[...] Instalar Fedora en lápiz USB: http://www.redhatmagazine.com/2007/11/07/i-am-fedora-and-so-can-you/ Enlaces de interés: fedoraproject.org Artículos relacionados:Liberado el Preview Release de Fedora 10Próximo fin de actualizaciones para Fedora 7Fedora 9 incluirá ext4 [...]
December 26th, 2008 at 4:39 pm
My HD on my laptop was foobar. Rather than buying a new HD I spent $24.95 on a 8gb Cruz Micro. All I had to do was set my bios to boot from the Thumb Drive. Then I installed Fedora 10 straight to the Thumb Drive. Install went really smooth and I am able to receive and install updates. First boot was a little slow but none of the above steps in this article were necessary to get Fedora working from a thumb drive.
February 23rd, 2009 at 11:42 pm
(“skierpage says:
May 27th, 2008 at 7:59 pm
What’s with this “key” misname in Fedora/OLPC land? When someone says “acquire a key”, I think they’re talking about PKI and id_dsa. If you mean “put files on a USB flash drive”, then please say so. Wikipedia for “USB key” and see where you end up.”)
For the nub’s. An “usb key” is a “A.K.A.” Thumb drive / “key fob” / “Removeable/portable storage”/ FLASH DRIVE. not a literal term.