Using Kubuntu 8.10 from a USB device (flash drive, hard drive)

Canonical has just released the new Ubuntu and Kubuntu 8.10. Like every new version, I like to see what’s new (above all because upgrades tnd to break things apart from time to time). And this time I liked to see what’s new even more, because Kubuntu 8.10 (intrepid ibex) changes KDE desktop version, and installs KDE 4.1 by default.

I’ve always thought that using a CD just for testing linux dist, and using it once, is wasting it. Everyone has an 1GB pendrive we’ve been given in some meeting, or we bought (even my father has one, I bought one for him, 8GB for 10€ the other day at MediaMarkt), and a device like that, with fast access and reusable, seems the best place where we can make our tests.

Installing Ubunto on a pendrive is very easy, there are lots of documentatios every were, for instance in PenDriveLinux, where they have an article for installing Ubuntu, with some scripts doing it all. I haven’t found the same for Kubuntu, but you just need a few modifications.

First of all we need an USB device, that can be a hard drive, a pen drive, a mobile phone… anything.

We will use the first physical partition of the device. That is, if we have just logical partitions, we must remove them and create at least one physical partition. This is that way because logical partitions have values of 5 and up (the 4 first values al reserved for physical partitions), and we need it to be the first, the one with value 1. If we have just one partition, then nothing to worry about, go ahead!

We will also need this partition to have a FAT filesystem, either FAT16 or FAT32, big enough to fit the KUbuntu CD (750MB).

Once we have the device, with the first partition prepared, we need to download KUbuntu 8.10 ISO. When we’re done downloading, we should access to the ISO filesystem. We can achieve that in windows by using 7zip for instance, and with a simple mount in linux:

mkdir /tmp/live-cd
mount -t iso9660 -o loop kubuntu-8.10-desktop-amd64.iso /tmp/live-cd

Now we should copy to the root of the unit some directories: “casper dists install pics pool preseed .disk”, also “isolinux” directory content and “md5sum.txt README.diskdefines install/mt86plus” files. From linux console, that would be:

cp -r casper dists install pics pool preseed .disk isolinux/* md5sum.txt README.diskdefines install/mt86plus /tmp/live-cd

In the graphical desktop of windows and linux, you should drag’n’drop them to the corresponding directory. We also should change the filename “isolinux.cfg” to “syslinux.cfg” and overwrite “text.cg” file with this data:
text.cfg

default persist
label persist
menu label ^Run KUbuntu Persistently saving changes back to USB
kernel /casper/vmlinuz
append file=/preseed/kubuntu.seed boot=casper persistent initrd=/casper/initrd.gz quiet splash --
label live
menu label ^Try KUbuntu without saving any changes to USB
kernel /casper/vmlinuz
append file=/preseed/kubuntu.seed boot=casper initrd=/casper/initrd.gz quiet splash --
label live-install
menu label ^Install KUbuntu
kernel /casper/vmlinuz
append file=/preseed/kubuntu.seed boot=casper only-ubiquity initrd=/casper/initrd.gz quiet splash --
label check
menu label ^Check CD for defects
kernel /casper/vmlinuz
append boot=casper integrity-check initrd=/casper/initrd.gz quiet splash --
label memtest
menu label Test ^memory
kernel /install/mt86plus
label hd
menu label ^Boot from first hard disk
localboot 0x80

Finally we need to make this drive bootable. For this we need syslinux tool, which we can find at kernel.org website in all versions (windows and linux, but a simple apt-get install syslinux will do the trick). Once we got it, we run:

syslinux -maf UNIT

Where we should change “UNIT” for /dev/sX1 in linux and “X:”in windows (and also change the X for your letter!).

And that’s it. We just need to check the computer will boot from USB devices, and done!

As it’s this easy (maybe more easy than it’s to explain it), maybe I’ll do some scripts for installing from windows and linux… but this will be other day!

Tomàs

Tomàs

I'll make something up

  • Anonymous

    Great work but I’m having some problems: when you say “copy to the root of the unit some directories” are you meaning to the flash drive? Cos the cp command example reads “/tmp/live-cd” as target.

    And I installed syslinux in my opensuse box but it doesn’t support “-maf” as valid options, only -sfr

    Thanks in advance.