Damned Flash Drive
The advent of the flash drive has given rise to interesting possibilities. You can store your personal data and transport it on your key chain if you’d like without worrying too much about damage. It is impervious to scratches, dust, impacts, being dropped, crushed or even having had a swim in the pool of that last wild party. What’s more is that these devices are quite dense in capacity meaning that at times you could even transfer the software that reads and writes your personal data. Modern operating systems like Windows XP and Linux can recognize and use many of these devices with no manual configuration. Thanks to its USB connector these drives can become bootable too; meaning that, if your computer supports it, instead of loading your operating system from your hard drive it will load bootable software from your flash drive and so allow you to do diagnostics on your dying hard drive if the need arises. The interesting possibility this suggests is that you can boot a complete operating system from your flash drive limited only by its capacity.
Did you know that, when worn as a necklace, another name for a flash drive is Nerd Bling? Respect.
Damn Small Linux (DSL), a Linux distribution, is only 50mb in size and can run live of a bootable business card sized CD. It features a graphical user interface, networking, web browser, e-mail client, word processor, media player, instant messaging client, PDF viewer and much more. It can also be installed to, and run from hard disk, USB flash drive, CompactFlash card, Microsoft Windows or Linux emulated host environments via Qemu, and ZIP drive. This gives you a great range of freedom to use the same familiar interface in a plethora of environments as DSL automatically detects the hardware of the system it is booting on. If installed to a flash drive you can take your desktop almost anywhere and have a common entry point for your personal data.
The only downfall with flash drives is that the storage medium used is flash memory which has a “wear” cost caused by write/erase cycles. Write operations will gradually slow down as the device ages until it eventually fails. Depending on the product quality of the device and thanks to the built-in USB mass storage controller it could last millions of cycles before failure. Operating systems like DSL are typically optimized for size and set up so as to place temporary or intermediate files in memory rather than non-volatile storage (to avoid excessive writing to the flash memory in the flash drive).
Installing DSL to a flash drive can have different approaches, but I wanted to be able to use it within my current environment AND be able to boot it natively from my flash drive. Now this is where things get really technical and if it isn’t your cup of tea you might want to stop reading here. If not, the procedure is very easy although documentation on the net might not be so forthcoming. I used a Kingston DataTraveler Elite 256MB USB Flash Drive as my medium, but a 128MB flash drive will also do and tested it on an IBM ThinkPad T42.
There are a few things you should be aware of:
Firstly, I am not responsible for any loss or damage to any hardware, software, data or virginity that you might experience following this tip and in such provide ABSOLUTELY NO WARRANTY, to the extend permitted by applicable law.
Secondly, older versions of BIOS on certain systems do not support booting from a USB device. Ensure that the target system supports this to avoid disappointment or impending doom. The Windows guide assumes that the primary (usually only) partition on the flash drive is set as ACTIVE (bootable). If it isn’t the drive can be repartitioned and made active with “fdisk” or “cfdisk” in DOS or on the DSL Live CD. You could also try to do this in Disk Managment (right click on the partition and click on “Mark Partion as Active”) or the command-line utility DISKPART within Windows XP, but the functionality might be severely crippled on removable media. If this tip does not work for you, you might have better success with the guides linked to at the end of the article.
Thirdly, if you are a system administrator, here is another reason why you must password-lock your network’s machines’ BIOS’s and disable all other bootable devices that you can’t control. Imagine someone walking in on your premises with a LiveCD full of hacking, cracking, cooking, breaking, snooping and all-other-kinds-of-nastiness software. You could be 0wn3d within minutes.
Finally, ALWAYS BACKUP your personal and sensitive data. Especially in this case because one of the steps requires you to format your flash drive
What we are doing:
AFTER backing up all our data, we are going to format the flash drive to ensure it has a FAT (not FAT32) primary partition. Thereafter we will strap on a Linux bootloader that works with FAT partitions. Finally we extract DSL onto the flash drive and test it.
What you’ll need:
- Computer with capable of booting from USB keydrive (select USB-HDD)
- A USB flash drive greater than or equal to 128MB USB keydrive that can boot as USB-HDD device. Make sure you read the product specification, only some USB flash sticks support this feature. (or see this 4/05 review on Ars Technica http://arstechnica.com/reviews/hardware/flash2005.ars . Only 3 of 10 reviewed sticks are bootable.)
- SYSLINUX
- Damn Small Linux -> dsl-embedded.zip
The procedure in Windows or DOS:
- Insert USB Flash drive and make sure it is detected by the host.
- BACK UP any sensitive data.
- Format you’re your flash drive with FAT or FAT16 file system.
- Right click on the drive in “My Computer” -> Click on “Format…” -> Choose “FAT” under “File System” -> Click on “Start”
- Alternatively, in the command prompt enter “format flash_drive_letter: /FS:FAT”
- Extract SYSLINUX to any directory that you can easily access from the command prompt.
- From the command prompt within the directory where you extracted SYSLINUX change to the WIN32 subdirectory (Windows NT/XP/2000/2003) or DOS subdirectory (MS-DOS, DR-DOS, PC-DOS, FreeDOS…) and enter “syslinux –s flash_drive_letter:” [Note the colon “:” at the end] to alter the boot sector on the flash drive and copy a file named LDLINUX.SYS into its root directory.
- Extract the contents of dsl-embedded.zip to the root of the drive ensure that the paths are intact.
- Double click on “dsl-windows.bat” to test emulation within Windows.
- Reboot and ensure in BIOS that your boot sequence has USB listed before any hard drives.
- Enjoy!
Optional
- Hide ALL your visible (excluding ldlinux.sys) files except for “dsl-windows.bat” so that only this file will be visible on foreign computers by novice users (Unless “Show all hidden files and folders” has been set) [Select files -> Right Click -> Properties -> Hidden -> OK]
- If you are running Windows NT/2000/XP rename the “dsl-windows.bat” to “dsl-windows.cmd” or whatever blows your hair back as long as the extension is .CMD [Select files -> Right Click -> Properties -> Hidden -> OK]
- Make you’re your newly renamed file read-only
The procedure in Linux:
- Insert USB Flash drive and make sure it is detected by the host. Any subsequent reference to “/dev/sda” should be replaced by your relevant device link.
- BACK UP any sensitive data.
- Set up a bootable FAT partition sda1 by using cfdisk e.g. “cfdisk /dev/sda”
- Make sure the partition is set to ACTIVE (bootable)
- Apply syslinux to the flash drive with syslinux e.g. “syslinux -s /dev/sda1”
- Extract the contents of dsl-embedded.zip to the root of the drive ensure that the paths are intact.
- Run “dsl-linux.sh” to test emulation within Linux.
- Reboot and ensure in BIOS that your boot sequence has USB listed before any hard drives.
- Enjoy!
Other guides:
Imprinting Bootable [DSL] Images to USB Devices (Windows)
Boot linux with a usb memory stick
Setting the Proper Geometry on your USB Pendrive
WeetHet - Boot from USB Flash drive
Create Bootable USB Flash Drive (Windows 98)
Boot KNOPPIX from an USB Memory Stick
Tip: Boot from USB Key Addendum
Beginners Guides: USB Memory Drive Projects
Windows-based Format Utility for HP Drive Key or DiskOnKey USB Device (Works on many non HP-keys)
Other bootable Linux distro’s:
SLAX
Puppy Linux
Flash Linux
LAMPPIX











January 29th, 2006 at 10:12 am
I tried this and it works great!! Thanks for all the help!! The only issue I picked up was with my flash drive (1GB SanDisk), could be a little big. After some re-partitioning and a Chuck Norris format or two it worked like a bomb!
however DSL got a lot further.
Interesting waste of information…I tried to boot up from CD with Kubuntu first and then DSL on a dinosaur Pentium-S PC and they both don’t work
January 29th, 2006 at 4:59 pm
Nothing like a good old Chuck Norris format to sort out those pesky partitioning problems eh? I wouldn’t give up on DSL yet as its minimum hardware requirements are lower than that, maybe you should try some of the cheat codes.
You might also have a few other options available to you in terms of Linux distributions. If Linux can run on my iPod I’m sure there is a version that will run on your machine. Here are some suggestions:
Slackware
http://www.slackware.com
http://en.wikipedia.org/wiki/Slackware
http://distrowatch.com/table.php?distribution=slackware
“Slackware Linux doesn’t require an extremely powerful system to run (though having one is quite nice
. It will run on systems as far back as the 486. Below is a list of minimum system requirements needed to install and run Slackware.”
http://www.slackware.com/install/sysreq.php
Debian
http://www.debian.org
http://en.wikipedia.org/wiki/Debian
http://distrowatch.com/table.php?distribution=debian
“The current release includes over fifteen thousand software packages for eleven computer architectures”
Gentoo Linux
http://www.gentoo.org/
http://en.wikipedia.org/wiki/Gentoo_Linux
http://distrowatch.com/table.php?distribution=gentoo
A powerful distribution, but the installation is not for the squeamish and might take you several weeks to install as you compile everything from source code on the machine. This of course will give you great performance, flexibility and allow you to install only what you need. It is brilliantly documentated with a handbook that will guide you step-by-step through the entire process and so allow you to learn a lot about Linux. An automated installer program is under development and available for testing.
I also recommend that you search the web with that machine spec in mind as there are plenty of different Linux distributions that you could use.