Niet alle computers hebben een cdrom speler. Gelukkig ondersteunen steeds meer computer booten vanaf USB sticks. De stappen hierbeneden zorgen er voor dat je een USB stick kunt maken om Ubuntu te installeren.
Note: Deze methode werkt mogelijk ook met andere ISO bestanden, maar dat is niet gegarandeerd.
Plaats de USB stick in je computer en bepaal welk device die is (bijv /dev/sdb). Deze gegevens heb je nodig om het script aan te passen.
Het script moet de volgende aanpassingen krijgen:
Vervang /dev/sdx met /dev/[usb device]
Verander de ISOIMAGE variabele naar het pad van de Ubuntu Server iso
Het script kan nu uitgevoerd worden om een USB stick installer te maken. Boot de computer van USB en installeer Ubuntu net alsof je het van een cdrom doet.
Opmerkingen:
Note: The first screen after the language prompt has several options. Only the first option works (Install to disk)
If on booting the USB drive you get a blank screen with the cryptic message MBR FA:, press the “a” key. The message will change to MBR 1234F. Now press “1” and the boot will proceed as normal.
Depending on the speed of your drive, the “Loading Linux Kernel” window may show 100% for a minute or more. It hasn't locked up. Just be patient!
#!/bin/bash
# If unsure which device is your flash drive then
# run "sudo dmesg | less" in order to identify it.
ISOIMAGE="/home/hulk/mini.iso"
if [ ! -r $ISOIMAGE ]; then
echo "specify the proper path to the iso image"
exit 1;
fi
echo "Installing the tools necessary to create a bootdisk (syslinux, mtools, mbr)"
sudo apt-get install syslinux mtools mbr
FOUNDDISK=0
while [ $FOUNDDISK -eq 0 ]; do
echo -e "Enter the device name to use. Be aware that the disk will be completely erased. (ie: /dev/sdc) $DEV"
read DEV
if [ -b $DEV ]; then
echo "Found disk!"
FOUNDDISK=1
fi
done
echo "Use fdisk to manually create a 1GB bootable FAT16 partition."
read -p "Press [Enter] to start the fdisk program..."
sudo fdisk $DEV
sudo mkfs -t vfat ${DEV}1
sudo mkdir -p /mnt/flash
sudo mount -t vfat ${DEV}1 /mnt/flash
sudo syslinux -s ${DEV}1
sudo mkdir -p /mnt/iso
sudo mount -o loop $ISOIMAGE /mnt/iso
sudo cp -R /mnt/iso/isolinux/* /mnt/flash
sudo mv /mnt/flash/isolinux.cfg /mnt/flash/syslinux.cfg
sudo mkdir -p /mnt/flash/install
sudo cp vmlinuz /mnt/flash/install
sudo cp initrd.gz /mnt/flash/install
sudo cp $ISOIMAGE /mnt/flash
sudo install-mbr $DEV
sudo umount /mnt/flash
sudo umount /mnt/iso
sudo sync
wiki/linux/ubuntu_usb_stick_installer.txt · Last modified: 2008/11/16 23:53 by plange