Saturday, September 5, 2009

!!! Pack 6 Linux Distros into one USB Flashdrive !!!

!!! Pack 6 Linux Distros into one USB Flashdrive !!!
----------------------------------------------------

Yes, this is now very easy to have 6 or even more Linux distros in a single pendrive.
I'm trying to explain how we can pack them in a pendrive.
But, for this your Motherboard should support booting fron flashdrives

a.I'm using Dell Inspiron
b.Intel core 2 Duo 1.83 GHz
c.Cent-OS as operating system
d.Transend JFv33 drive
((for any support or ready configuration mail me on "addi_adarsh@yahoo.co.in"))
_________________________________________________________________________
Please keep two terminals open, one is for root user and the other is for normal user.
# -> Root user
$ -> Normal user
((Be Careful with this))
We should have the ISO images of the distros ready so that we can easily mount it and get the essential files.
Here in my case the distros are :
Austrumi,Puppy Linux, Slitaz, CDLinux, DSL, GeeXbox
__________________________________________________________________________
Follow the steps:
1. $ mkdir -p work_dir/mbcd/boot
2. $ cd work_dir
Now, create 6 directories in /mnt for mounting 6 distros's ISO files
3. # mkdir /mnt/tmp{1,2,3,4,5,6}
Mount different ISO images one by one in tmp1,tmp2.....and so on and one more thing which we should keep in mind is we will use normal user's UID/GID while mounting.

4. # mount austrumi*.iso /mnt/tmp1 -o loop,uid=500,gid=500
5. # mount puppy*.iso /mnt/tmp2 -o loop,uid=500,gid=500
6. # mount slitaz*.iso /mnt/tmp3 -o loop,uid=500,gid=500
7. # mount CDlinux*.iso /mnt/tmp4 -o loop,uid=500,gid=500
8. # mount dsl*.iso /mnt/tmp5 -o loop,uid=500,gid=500
9. # mount geexbox*.iso /mnt/tmp6 -o loop,uid=500,gid=500

All the ISO images are successfully mounted and it's time to copy essential files from /mnt/tmp1... to /home//work_dir/....
_________________________________________________________________________________

1. $ cd work_dir (and all the below should be executed from here only)
Austrumi
--------
2. $ cp /mnt/tmp1/boot/austrumi.* mbcd/boot/
3. $ mkdir mbcd/boot/austrumi
4. $ cp /mnt/tmp1/isolinux/initrd.gz /mbcd/boot/austrumi
5. $ cp /mnt/tmp1/isolinux/bzImage /mbcd/boot/austrumi

Puppy Linux
-----------
6. $ mkdir mbcd/boot/puppy mbcd/Puppy
7. $ cp /mnt/tmp2/initrd.gz mbcd/boot/puppy
8. $ cp /mnt/tmp2/vmlinuz mbcd/boot/puppy
9. $ cp /mnt/tmp2/zdrv_400.sfs mbcd/Puppy

SliTz
-----
10.$ mkdir mbcd/boot/slitaz
11.$ cp /mnt/tmp3/boot/bzImage mbcd/boot/slitaz
12.$ cp /mnt/tmp3/boot/rootfs.gz mbcd/boot/slitaz
13.$ cp /mnt/tmp3/boot/vmlinu-*-slitaz mbcd/boot

Cdlinux
-------
14. $ mkdir mbcd/boot/cdlinux mbcd/Cdlinux
15. $ cp /mnt/tmp4/CDlinux/bzImage mbcd/boot/cdlinux
16. $ cp -r /mnt/tmp4/CDlinux/extra mbcd/CDlinux
17. $ cp -r /mnt/tmp4/Cdlinux/settings mbcd/CDlinux

DSL
---
18. $ mkdir mbcd/boot/dsl mbcd/dsl
19. $ cp /mnt/tmp5/boot/isolinux/linux24 mbcd/boot/dsl
20. $ cp /mnt/tmp5/boot/isolinux/minirt24.gz mbcd/boot/dsl
21. $ cp /mnt/tmp5/KNOPPIX/KNOPPIX mbcd/dsl

GeeXboX
-------
22. $ mkdir mbcd/boot/geexbox
23. $ cp /mnt/tmp6/GEEXBOX/boot/vmlinuz mbcd/boot/geexbox
24. $ cp /mnt/tmp6/GEEXBOX/boot/initrd.gz mbcd/boot/geexbox
25. $ cp /mnt/tmp6/GEEXBOX/boot/splash.png mbcd/boot/geexbox
26. $ cp -r /mnt/tmp6/GEEXBOX mbcd/
27. $ chmod -R u+w mbcd/GEEXBOX
28. $ rm -r mbcd/GEEXBOX/boot
__________________________________________________________________
Now, we will create a grub directory and copy "stage2_eltorito" file in it.

$ mkdir mbcd/boot/grub
$ rpm grub rpm -ql grub | grep stage2_eltorito
((see where this file is located and copy it in mbcd/boot/grub))
$ cp ........./stage2_eltorito mbcd/boot/grub

___________________________________________________________________
Make an image with GIMP as splash.jpg and convert it like this:

$ convert -colos 14 -depth 8 resize 640*480! splash.jpg splash.xpm.gz
$ cp splash.xpm.gz mbcd/boot/grub/
______________________________________________________________________
Now, create a grub.conf file as shown below:

$ vim mbcd/boot/grub/grub.conf

splashimage=/boot/grub/splash.xpm.gz

title Autrumi
kernel /boot/austrumi/bzImage dousb
initrd /boot/austrumi/initrd.gz

title Puppy
kernel /boot/puppy/vmlinuz pmedia=usbflash
initrd /boot/puppy/initrd.gz

title CDlinux
kernel /boot/cdlinux/bzImage quiet
initrd /boot/cdlinux/initrd

title Slitaz
kernel /boot/slitaz/bzImage rw root/dev/null vga=normal
initrd /boot/slitaz/rootfs.gz

title DSL
kernel /boot/dsl/linux24 ramdisk_size=100000 init=/etc/init
initrd /boot/dsl/minirt24.gz

title GeeXboX
kernel /boot/geexbox/vmlinuz root=/dev/ram0 rw rdinit=linuxrc boot=UUID= lang=en remote=atiusb receiver=atiusb keymap=qwerty splash=silent vga=789 video=vesafb:ywrap,mtrr hdtv quiet
initrd /boot/geexbox/initrd.gz
___________________________________________________________________
In my case pendrive is "/dev/sdb1"
Then we will copy the contents of work_dir in flashdrive:

# mount /dev/sdb1 /media/disk/
# cp -r /home/.../work_done/mbcd/* /media/disk/
___________________________________________________________________
Now, Its time for installing Grub in flash drive:

# grub-install --root-directory=/media/disk /dev/sdX
# umount /dev/sdxy
# parted /dev/sdX set y boot on
((e.g. /dev/sdb1 => X=b & y=1))
_____________________________________________________________________
Here, we are DONE
Boot from Pen drive and enjoy 6 distros, Space occupied in pendrive is approximately 350 MBs
*****************************************************************************************

1 comment: