Product SiteDocumentation Site

4.10. Add live OS into the usb key

On the following section we will consider that the FAT32 partition of the startup key is mounted in /media/usb.
If this is not yet the case, execute the following command to do it:
mkdir /media/usb mount /dev/sdb1 /media/usb
Add ubuntu desktop on the usb stick
Create the directory /media/usb/iso:
mkdir /media/usb/iso
Download ubuntu-12.04.1-desktop-i386.iso from http://releases.ubuntu.com/precise/ and copy it in /media/usb/iso.
Create the file /etc/grub.d/42_custom with the following content:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Ubuntu 12.04.1 - i386 - iso Live" {
     set gfxpayload=800x600x16
     set root=(hd0,msdos1)
     set isofile="/iso/ubuntu-12.04.1-desktop-i386.iso"
     search --set -f $isofile
     loopback loop $isofile
     linux (loop)/casper/vmlinuz boot=casper iso-scan/filename=$isofile noeject noprompt splash -- locale=fr_FR console-setup/layoutcode=fr 
     initrd (loop)/casper/initrd.lz
}
Upgrade grub configuration files with the following command:
update-grub
Add Unbuntu Alternate CD on the usb stick
Download ubuntu-12.04.1-alternate-i386.iso from http://releases.ubuntu.com/precise/ and copy it in /media/usb/iso.
Create the file /etc/grub.d/43_custom with the following content:
#!/bin/shexec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Ubuntu 12.04.1 - i386 - Alternate Installation" {
     set gfxpayload=800x600x16
     set root=(hd0,msdos1)
     search --set -f /iso/ubuntu-12.04.1-alternate-i386.iso
     linux /iso/vmlinuz noeject -- locale=fr_FR console-setup/layoutcode=fr
     initrd /iso/initrd.gz
}
Upgrade grub configuration files with the following command:
update-grub
Add System Rescue CD on the usb stick
Download and copy it in /media/usb/iso.
Create the file /etc/grub.d/44_custom with the following content:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "SystemRescueCD - i386 - iso Live" {
     set gfxpayload=800x600x16
     insmod ext2
     insmod loopback
     insmod iso9660
     set root=(hd0,msdos1)
     set isofile="/iso/systemrescuecd-x86-2.8.1.iso"
     search --set -f $isofile
     loopback loop $isofile
     linux (loop)/isolinux/rescuecd isoloop=$isofile setkmap=fr
     initrd (loop)/isolinux/initram.igz
}
Upgrade grub configuration files with the following command:
update-grub