lundi 5 août 2013

How to create a bootable linux flash drive

Salamu'alykom warahmatu lahi wa barakatuh :)

How to create a bootable linux flash drive :

in this tutorial i chosen SliTaz which is a light-weight distribution.
it requiring  approximately 100 MB of hard disk space
i used also in this tutorial Virtualbox as a virtual machine.

( you can download SliTaz  from here)

 I-prepare the flash disk

root@RH # mkdir usb
root@RH # fdisk /dev/sdd
   n (new)
   p (primary)
   1 (n° of partition)
   1 (starting @)
   12 (ending @)
   w (writing the modifications )

root@RH # mkfs -t ext3 /dev/sdd1
root@RH # mount /dev/sdd1 usb

II-install the grub

root@RH # grub-install roor-directory=/root/exo/usb /dev/sdd

III-copy the files from the disk into the flash drive

root@RH# cp -rf disk/* usb/
root@RH# cd usb/boot/
root@RH# mv rootfs* ../
root@RH# mv vmlinuz-2.6.37-slitaz ../linux

here i made some optional modifications : i moved the additional modules "rootfs*" files into the parent directory , and i moved also the kernel file "vmlinuz-2.6.37-slitaz" into the parent directory and i renamed it to "linux"

IV-configure the grub.conf file

root@RH# cd grub
root@RH# cp /boot/grub/grub.conf .
root@RH# ln -s grub.conf menu.lst
root@RH# vi grub.conf

   color blue/black
   title Linux_SliTaz
   root (hd3,0)
   kernel /linux rw root=/dev/null
   initrd /rootfs1.gz
   initrd /rootfs2.gz
   initrd /rootfs3.gz
   initrd /rootfs4.gz


V- reboot the with flash drive

root@RH# init 6

the login is root and password is root

enjoy :)

 i hope that tutorial allowed you to create a bootable linux flash drive with Slitaz .

thank you for reading ! :)