If you’re following my Twitter’s profile yet, you should have read that I’m getting rid of Ubuntu at all: right now isn’t really important “why” — I’ll explain it later on.
Just a quick note on Twitter before to get started: it’s possible that I’m not following you yet, because OpenSPF blocks some e-mail notification. Please, be patient and send me an @reply if you’d like to be answered (I get notified on non-followings replies too).
So, I need to have a fully working machine: luckily I have both an old laptop and a netbook in front of me and I can install Gentoo without data losses.
There are lots of tools to handle USB creation from CD images, but non of them worked for me: yes, it means that you must use the shell instead. But is it really a problem, moving to Gentoo?
Fortunately, the official Gentoo Wiki helps with the manual creation: of course, it fits Gentoo installations… but I successfully ported it to Ubuntu — it should work for all the other Linux distributions, with little changes.
Removing Gentoo-related steps, it successfully worked on Karmic Koala: you just need to install the syslinux package, at least (e2fsprogs should be installed yet).
$ sudo apt-get install syslinux
$ fdisk -l
First of all, identify the correct device: this is particularly important, because errors could definitively damage your existing systems. Make sure you’re going to edit the right partition table.
$ sudo fdisk /dev/sdx
Ubuntu needs to do so as sudoer, while other distributions should require root access: be careful modifying /dev/sdx with your own partition table. Then press the next sequence of buttons: [n] [enter], [p] [enter], [1] [enter], [enter] [enter], [t] [enter], [83] [enter], [a] [enter], [1] [enter], [p] [enter], [w] [enter], [q] [enter].
I know it appears a little bit confusing, so I’ll try to explain what you’re doing in details: if there’s an existing partition on the USB stick, you must delete it before (from fdisk, just press [d] before the above sequence).
With those buttons you prepared a new Ext2 bootable partition and wrote changes to the partition table: you might choose another type, but I don’t suggest you to do so.
$ sudo mkfs.ext2 /dev/sdxY
$ sudo tune2fs -i 0 /dev/sdxY
Warning: sdxY musts be replaced with the correct partition ID. Below, you’ll find some paths and mountpoints directly related to Ubuntu: they should be different in other distributions.
Before continuing, download the latest installation ISO of Gentoo, if you didn’t yet. After that:
$ sudo cat /usr/lib/syslinux/mbr.bin > /dev/sdx
$ sudo mount -t ext2 /dev/sdxY /media/usb
$ mount -t iso9660 -o loop,user /path/to/install-x86-minimal-*.iso /media/cdrom
$ cd /media/usb/
$ sudo cp -r /media/cdrom/* .
$ sudo mv isolinux extlinux
$ sudo mv extlinux/isolinux.cfg extlinux/extlinux.conf
$ sudo rm -rf extlinux/isolinux.bin
$ cd ..
$ sudo extlinux -i /media/usb/extlinux
Now you can easily unmount the USB stick, plug it on the desired device and start the installation process. I may assure that it works correctly on the EeePC — this weekly image supports the touchpad too.
For those who cares, I manage to install Funtoo: you’ll find other useful details on this blog soon. I’m actually building the Gentoo system itself.