Ubuntu Alternate Installation from USB-disk


Writing the Alternate Installation Disk of Xubuntu 8.04 Hardy Heron to an USB-disk is not as straightforward as doing it with the desktop version.

You would follow the same procedure as with the desktop version, but when you boot the computer from the usb-disk you run into an error:
No common CD-drive detected

… and there it stops. You might find some forums suggesting to toggle into the console and do some “creating folders” and “links” and “mounting” them. Do not read them. It does not work.

It is a bug. You have to change a file named cdrom-detect.postinst. Pretty obvious name. There is a patch from Hans Deragon.

I assume it would be more elegant to download and run the patch
patch YourFile2BePatched
… anyway I did not bother, opened a text editor and pasted the addition instead. The part of the code is quite at the beginning of cdrom-detect.postinst.

Nice try, but FIRST you have to FIND the file to change:

cdrom-detect.postinst is located inside an archive inside a compressed folder called initrd.gz. The initrd.gz file is actually a compressed archive containing all of the executables, libraries, and configuration files needed during boot.

SO DO THIS:

Open a terminal and create a folder extract in your home directory, change into this folder and extract initrd.gz into it:
mkdir extract
cd extract
zcat /media/USBdisk/install/initrd.gz | cpio -i

Note that in this example the installation USB-disk is found at /media/USBdisk. Change it according to your situation.

Now it is time to find /var/lib/dpkg/info/cdrom-detect.postinst and exchange the lines

do
mounted=0

devices="$(list-devices cd; list-devices maybe-usb-floppy)"
for device in $devices; do
if mount -t iso9660 -o ro,exec $device /cdrom; then
log "CD-ROM mount succeeded: device=$device"
mounted=1
db_set cdrom-detect/cdrom_device $device

with

do
mounted=0

devices="$(list-devices cd; list-devices partition; list-devices maybe-usb-floppy)"
for device in $devices; do
if mount -t iso9660 -o ro,exec $device /cdrom || \
mount -t vfat -o ro,exec $device /cdrom ; then
log "CD-ROM mount succeeded: device=$device"
mounted=1
db_set cdrom-detect/cdrom_device $device

Repackage the initrd.gz file and put it on the USB drive:


find . | cpio -o --format='newc' | gzip -9 > /media/USBdisk/install/initrd.gz

Now you can remove your temporary extraction folder:
cd ..
rm -R extract

and restart use the Alternate Install USB-disk.

Whew!

Advertisement

2 thoughts on “Ubuntu Alternate Installation from USB-disk

  1. Update: I just found out, that this does not apply to Ubuntu 9.04 Jaunty. The forum stated, that the bug is fixed for Jaunty and that it should be ok just to create the alternate USB-image and then boot into it. In my case it did not. A first glance at the cdrom-detect.postinst reveals that the script indeed looks for a usb-partition, but then tries to mount it as vfat. USB-creator formated with fat32 so this might be the problem.

  2. Update: Yes, the bug is fixed with Jaunty. You only have to make shure that the USB-disk is formated as fat16! Otherwise the installer fails with the above error message.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s