Flash boot of Ubuntu Casper

1. Fix Casper Script

  • log as root in Ubuntu 8.04 and mount installation CD
  • extract initrd:
mkdir casperfix
cd casperfix
gzip -dc /cdrom/casper/initrd.gz | cpio -i
  • edit scripts/casper: find the line
mount ${cowdevice} -t ${cow_fstype} -o rw,noatime,mode=755 /cow

and remove mode=755. The resulting code should look like

mount ${cowdevice} -t ${cow_fstype} -o rw,noatime /cow
      || panic "Can not mount $cowdevice on /cow"
  • save the changes, update the casper script and create the new initrd.gz file:
find . | cpio -o -H newc | gzip -9 > initrd.gz
  • Replace the old initrd.gz file on usb flash drive or or rebuild the iso

2. Create flash drive

  • install syslinux and mtools
apt-get install -y syslinux mtools
  • insert a 1GB or larger USB flash drive
  • list available drives/partitions
fdisk -l
  • unmount automatically mounted USB partition
umount /dev/sdx1
  • re-partition the flash drive
fdisk /dev/sdx
    • type p to show the existing partition and d to delete it
    • type p again to show any remaining partitions, repeat the previous step if needed
    • type n to make a new partition
    • type p for primary partition
      • type 1 to make this the first partition
      • hit enter to use the default 1st cylinder
      • type +750M to set the partition size
      • type a to make this partition active
      • type 1 to select partition 1
      • type t to change the partition filesystem
      • type 6 to select the fat16 file system
    • type n to make another new partition
    • type p for primary partition
      • type 2 to make this the second partition
      • hit enter to use the default cylinder
      • hit enter again to use the default last cylinder
      • type w to write the new partition table
  • unmount the partition
umount /dev/sdx1
  • format the first partition
mkfs.vfat -F 16 -n ubuntu8 /dev/sdx1
  • ensure the partition is unmounted
umount /dev/sdx2
  • format the second partition
mkfs.ext2 -b 4096 -L casper-rw /dev/sdx2
  • remove and re-insert your flash drive. if prompted that a new medium has been detected, select to open in a new window and click ok
  • install boot loader on the flash drive
syslinux -sf /dev/sdx1
  • copy the installation cdrom contents
cd /cdrom
cp -rfv casper dists install pics pool preseed .disk isolinux/*  /media/ubuntu8
cp -rfv md5sum.txt README.diskdefines install/mt86plus  /media/ubuntu8
  • replace /media/ubuntu8/syslinux.cfg
  • fix /media/ubuntu8/casper/initrd.gz as explained above
  • save changes and unmount the flash drive
  • reboot your computer and set your system BIOS boot priority to boot from the USB stick

3. Booting from a flash drive

This is an example of settings for the Gigabyte GA-M61PM-S2 mobo with Award BIOS:

GigabyteGaM61PmBootMenu.jpg

Attachments

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
To prevent automated spam submissions leave this field empty.