Booting up Linux from a USB flash driveBuilding the USB flash drive
You can build your bootable USB flash drive on Windows, but that is a slow procedure. So I show you how to build it on Linux. Ok, let's start!
First, login as root and create a unique bootable partition by means of the 'cfdisk' command:
1) $ su root
2) # cdisk /dev/sda1
Exploring the cfdisk's menu, you will be able to find the suitable commands to partition your USB flash drive (type 'man cfdisk' to get help for the cfdisk command). After partitioning the USB flash drive you have to format it (I suggest you the FAT 16 filesystem):
# mkfs.vfat -n anyname -F 16 /dev/sda1
or even:
# mkdosfs /dev/sda1
Now download the DSL distribution's (Damn Small Linux) iso file at http://www.damnsmalllinux.org/
(choose the 'current' version). First you must create a folder to mount the iso file:
3) # mkdir tmp_iso
mount the iso file:
4) # mount -o loop dsl-0.8.3.iso tmp_iso
create another folder to mount your USB flash drive:
5) # mkdir /mnt/sda
mount the USB flash drive (sda1 should be the first USB device recognized by Linux):
6) # mount -t vfat /dev/sda1 /mnt/sda
copy the iso file to the mounted USB flash drive:
7) # cp -ra tmp_iso/* /mnt/sda/
go on with the following steps:
8) # cd /mnt/sda/boot
9) # cp vmlinuz /mnt/sda
10) # cp initrd.gz /mnt/sda
11) # cd /mnt/sda
12) # mv isolinux.bin syslinux.bin
13) # mv isolinux.cfg syslinux.cfg
now you must edit the 'syslinux.cfg' file to remove '/boot' from both '/boot/vmlinuz' and '/boot/initrd.gz' lines:
14) # pico syslinux.cfg (or even vi syslinux.cfg)
save the modified file. Now:
15) # cd..
16) # umount /mnt/sda
finally, download 'syslinux' at:
http://www.kernel.org/pub/linux/utils/boot/syslinux/
If you have problems compiling it, just install the syslinux.deb package by means of the 'apt' command. If you are not a Debian user, you can download the RPM package at:
http://www.kernel.org/pub/linux/utils/boot/syslinux/RPMS/
or visit an alternate site:
http://freshmeat.net/projects/syslinux/
After downloading/installing syslinux you must write the MBR sector on the USB flash drive. Just type:
# syslinux -s /dev/sda1
Congratulations, you have just built your Linux bootable USB flash drive! :o)
(Page 2 of 3)
<--- Index --->
DISCLAIMER:
Any named products on this website are copyright © and/or trademarks ® of their respective companies.
INFORMATION ON THIS WEB SITE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT.
The material included in this site has been compiled from a variety of sources and the site may include technical inaccuracies or typographical errors.
Information may be changed or updated without notice.
While every effort is made to ensure the correctness of the information provided here, the author can accept no responsibility for damages caused directly or indirectly from the use of such information.
The author will not be responsible for damage or loss of data. You are advised to backup data regularly!
By entering this site you are agreeing to this and also to never suing the author.
|