Professional Documents
Culture Documents
Install Ubuntu Di FD
Install Ubuntu Di FD
This tutorial will show how-to install Ubuntu on a usb stick. Even though this tutorial
uses Ubuntu as its base distribution, you could virtually use any type of Linux liveCD
distribution.
Being able to run Linux out of a usb bar is a great way to enjoy the live CD
experience (being able to use Linux on any computer you might get by) and the big
advantage of being easier to carry around than a CD.
1. Requirements
In order to reproduce this tutorial, you will need a few items such as:
• a ubuntu liveCD
• a usb bar of at least 1G
• a running Linux operating system
Now that you have all this, it is time to prepare you USB bar do host the Ubuntu
liveCD files.
In the first place, you need to plug your usb drive and check under which device it is
associated. To find out the device, run:
$ sudo fdisk -l
On my system, the device appears as being /dev/sdb, I will therefore use /dev/sdb
as a reference for this tutorial, please replace it accordingly to your system (might be
sda, sdc ...).
Once you found your device, you are going to create the partitions.
Using the wrong device name might destroy your system partition, please double
check
At fdisk prompt type d x where x is the partition number (you can simply type d if
you only have one partition), then:
Now we have out first partition set up, let's create the second one:
The first partition is going to be formated as a FAT filesystem of size 16 and we are
going to attribute it the label "liveusb".
The second partition is going to be of type ext2 with a blocksize of 4096 bytes and
the label casper-rw. Mind that it has to be labeled as casper-rw otherwise the
tutorial won't work!.
At this stage, our usb pendrive is ready to host the liveCD image. Now, let's copy the
files to the usb bar.
3. Installing Ubuntu on the USB stick
In the first place we need to mount our ubuntu iso. Depending if you have the .iso
file or the CD, there is 2 different ways of mounting it.
People using Ubuntu or any other user-friendly distro, might just have to insert the
cd and it will be mounted automatically. If this is not the case:
We will need to create a temporary directory, let say /tmp/ubuntu-livecd and then
mount our iso (I will be using a feisty fawn iso).
$ mkdir /tmp/ubuntu-livecd
$ sudo mount -o loop /path/to/feisty-desktop-i386.iso /tmp/ubuntu-livecd
Once the cd image is ready, it is time to mount the newly created usb bar partitions:
Same here, you might be able to get both your partition by simply replugging the
usb pendrive, partition might appears as: /media/liveusb and /media/casper-rw. If
this is not the case, then you will need to mount them manually:
$mkdir /tmp/liveusb
$ sudo mount /dev/sdb1 /tmp/liveusb
All the partitions we need are now mounted, let's copy the files.
It might complain about symbolic links not being able to create, you can ignore this.
Now let's go to the first partition of your usb disk and rename isolinux.cfg to
syslinux.cfg:
$ cd /tmp/liveusb
$ sudo mv isolinux.cfg syslinux.cfg
DEFAULT persistent
GFXBOOT bootlogo
GFXBOOT-BACKGROUND 0xB6875A
APPEND file=preseed/ubuntu.seed boot=casper initrd=initrd.gz ramdisk_size=1048576
root=/dev/ram rw quiet splash --
LABEL persistent
menu label ^Start Ubuntu in persistent mode
kernel vmlinuz
append file=preseed/ubuntu.seed boot=casper persistent initrd=initrd.gz ramdisk_size=1048576
root=/dev/ram rw quiet splash --
LABEL live
menu label ^Start or install Ubuntu
kernel vmlinuz
append file=preseed/ubuntu.seed boot=casper initrd=initrd.gz ramdisk_size=1048576
root=/dev/ram rw quiet splash --
LABEL xforcevesa
menu label Start Ubuntu in safe ^graphics mode
kernel vmlinuz
append file=preseed/ubuntu.seed boot=casper xforcevesa initrd=initrd.gz
ramdisk_size=1048576 root=/dev/ram rw quiet splash --
LABEL check
menu label ^Check CD for defects
kernel vmlinuz
append boot=casper integrity-check initrd=initrd.gz ramdisk_size=1048576 root=/dev/ram rw
quiet splash --
LABEL memtest
menu label ^Memory test
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
Woof, finally we have our usb disk almost usuable. We have a last thing to do: make
the usb bootable.
in order to make our usb disk bootable, we need to install syslinux and mtools:
$ cd
$ sudo umount /tmp/liveusb
$ sudo syslinux -f /dev/sdb1
Here we are , reboot, set your BIOS to boot from the usb bar and enjoy Ubuntu
linux from a pendrive
4. Troubleshooting
If you are having trouble booting on the usb bar, this might be due to your MBR
being corrupted. In order to fix it up, you can use lilo (I installed lilo on my box only
for thid purpose).
$ lilo -M /dev/sdb