USB boot

Prepare USB Flash Drive :

usbDevice=c dd if=/dev/zero of=/dev/sd${usbDevice} count=1 bs=512

fdisk /dev/sd${usbDevice} <<EOF n p 1 a 1 w EOF

umount /dev/sd${usbDevice}1 mkfs.vfat -F 32 -n MULTIBOOT /dev/sd${usbDevice}1 mkdir /media/MULTIBOOT mount /dev/sd${usbDevice}1 /media/MULTIBOOT grub-install --force --no-floppy --root-directory=/media/MULTIBOOT /dev/sd${usbDevice} cd /media/MULTIBOOT/boot/grub wget

Transformer Ubuntu CDROM Live en Ubuntu USB Live

copier le contenu du CDROM

export usb="/home/patrick/ubuntu_usb" mkdir $usb mkdir /mnt/iso mount -o loop xubuntu-8.04-desktop-i386.iso /mnt/iso rsync -av /mnt/iso $usb/

Modifier isolinux

cd $usb cp isolinux/* . mv isolinux.cfg syslinux.cfg nano syslinux.cfg

<verbatim> DEFAULT usblive GFXBOOT bootlogo APPEND file=/preseed/ubuntu.seed boot=casper initrd=initrd.gz quiet splash -- LABEL usblive menu label ^Start Ubuntu and save changes to USB kernel vmlinuz append file=/preseed/ubuntu.seed boot=casper persistent initrd=initrd.gz quiet splash -- LABEL live menu label ^Try Ubuntu without any change to your computer kernel vmlinuz append file=/preseed/ubuntu.seed boot=casper initrd=initrd.gz quiet splash -- LABEL live-install menu label ^Install Ubuntu kernel vmlinuz append file=/preseed/ubuntu.seed boot=casper only-ubiquity initrd=initrd.gz quiet splash -- LABEL memtest menu label Test ^memory kernel mt86plus append - LABEL hd menu label ^Boot from first hard disk localboot 0x80 append - DISPLAY isolinux.txt TIMEOUT 300 PROMPT 1 F1 f1.txt F2 f2.txt F3 f3.txt F4 f4.txt F5 f5.txt F6 f6.txt F7 f7.txt F8 f8.txt F9 f9.txt F0 f10.txt Step Four- Time to fix the initrd filesystem There is a simple error with the casper script in the initrd filesystem. We will need to extract, edit the casper script and re-pack the initrd.gz. </verbatim> ---++ Patch initrd

cd $usb/casper mkdir old cd old gunzip < ../initrd.gz | cpio -i --make-directories cd scriptsretirer ,mode=755 de la ligne :

nano casper Now, search for "mount ${cowdevice} -t ${cow_fstype} -o rw,noatime,mode=755 /cow". Remove "mode=755".

cd .. find ./ | cpio -H newc -o > ../initrd cd .. rm initrd.gz gzip initrd

rendre bootable la clef USB

dd if=/dev/zero of=/dev/sdn count=1 bs=512fdisk /dev/sdnn < create new partition p < create a primary partition 1 < partition number of 1 enter < start at first cylinder +770M < make it 770MB in size a < make partition bootable 1 < specify partition t < change partition type 6 < to FAT16 n < new partition p < primary 2 < partition #2 enter < accept default enter < use all remain space p < review the partition changes w < write changes q < quit

Formater les 2 partitions

mkfs.vfat -F 16 -n UbuntuLive /dev/sdn1 mkfs.ext2 -b 4096 -L casper-rw /dev/sdn2

Copier les fichiers sur la clef

mkdir /media/usb mount /dev/sdn1 /media/usb rsync -av $usb/ /media/usb/ umount /media/usb

Installer syslinux

sudo syslinux -f /dev/sdn1