Installing Ubuntu Hoary from LiveCD

Note: This will not necessarily get you the installation you would have from an official installation CD! Use with caution…

I installed Hoary into a single partition, formatted as ext3 on a SCSI disk, with one other partition as swap. So I’ll be referring to /dev/sda5 and /dev/sda6 in this walk-through - you will need to use the right names for your installation.

Why did I do this?

I wanted Hoary on one of my machines. My original plan had been to install Warty and then use dist-upgrade, but for some reason, Warty hung in the installation after reboot. So since I didn’t actually want Warty, I thought about trying this approach instead.

Before you start

Make free space for new partitions on disk.

Boot from LiveCD into Hoary

You’ll do all the setup running Hoary from the LiveCD.

Create new partitions

Using fdisk, create two new partitions in the free space on disk you made earlier: “/” and swap.

Set partition IDs appropriately (0x82 and 0x83)

Make new filesystems on the partitions

I wanted to use ext3, you may prefer a different format. My new partitions were /dev/sda5 (Linux) and /dev/sda6(swap) so: mkfs.ext3 /dev/sda5 mkswap /dev/sda6 Create /mnt and mount the new Linux partition on it. `

mkdir /mnt

mount /dev/sda5 /mnt

`

Setup networking

You need this because you’ll need to install cloop-utils over the network in a minute.

Add your interface to /etc/network/interfaces and then bring it up. For example, `

vi /etc/network/interfaces

ifup eth0

` Add a known working nameserver in /etc/resolv.conf

Install cloop-utils `

apt-get update

apt-get install cloop-utils

`

Populate filesystem

Now you’ve got cloop-utils, you can create the filesystem on your new Linux partition.

We’ll take this from the LiveCD.

First, extract the compressed filesystem to the hard disk. `

extract_compressed_fs /cdrom/casper/filesystem.cloop > /mnt/extracted_fs

Second, mount this now uncompressed filesystem

mkdir /mnt/cloop

mount /mnt/extracted_fs /mnt/cloop -o loop

Finally, copy the filesystem over to the new Linux partition.

rsync -av /mnt/cloop/* /mnt/

`

Setup new Hoary system

Before you can boot your new Hoary system, you’ll need to do some of the things that the install process usually does for you, including installing the Grub bootloader.

Chroot into your new filesystem, so that all changes get made in the new partition. `

mount -t proc proc /mnt/proc

cp /etc/network/interfaces /mnt/etc/network/interfaces

chroot /mnt /bin/bash

You'll need to modify resolv.conf within the chroot-ed environment, else name resolution won't work.

vi /etc/resolv.conf

Edit /etc/fstab (it's currently empty) and set it up correctly. You need to get this right! Here's an example.

/etc/fstab: static file system information.

#

proc /proc proc defaults 0 0 /dev/sda5 / ext3 defaults 0 1 /dev/sda6 none swap sw 0 0 `

Add yourself to sudoers list

You’ll need to use visudo

Install Grub

You’ll need to know what you’re doing with Grub. If you’re not sure, especially if you’ve already got Windows installed, check what you’re doing with someone who does understand it first! `

apt-get update

apt-get install grub grub-doc

Generate a new menu.lst file

update-grub

` and edit it to suit you. If you have a dual-boot machine, then you’ll also need to add the other bootable partitions manually

Unless anyone knows how to do this automagically? please let me know

Then, copy over the stage 1 files `

cp /lib/grub/i386-pc/* /boot/grub

And now install grub

grub

grub> root (hd0,4) grub> setup (hd0) grub> quit `

Rebuild new kernel

I needed to rebuild the kernel at this point, since the default one didn’t seem to include SCSI. This might not have been necessary…

Follow instructions at http://www.ubuntulinux.org/wiki/KernelHowto

Remake initrd

Thanks to “noone cool” for this.

You should remove the current initrd file and run mkinitrd as the last step before rebooting. So any needed drivers at boot time will be available. This fixes a VFS root mount error you might get if you use ext3, sata, scsi, etc.

`

rm /boot/initrd.img-2.6.10-3-386 (—change this if needed—)

mkinitrd -o initrd.img-2.6.10-3-386 2.6.10-3-386

`

Reboot

Reboot, taking out the LiveCD. If you’ve got everything right, you’ll now have a running Hoary installation. If not, boot up the LiveCD and fix the problems.

Comments welcome! Rachel