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