Tuesday, April 22, 2008

Reinstalling Without an ISO Image

One of my laptops has been incrementally upgraded every version since Ubuntu 6.06LTS, and although there was no slowdown and Canonical is really good about doing upgrades well, I wanted to wipe and do a clean install. Since /home was on a separate partition, this was a lot easier than it might have been. I didn't need to do any backups outside of what was already scheduled.

I also wanted to use the most recent RC, which I didn't have a CD of. Not to worry. If you have grub and a /home partition, you don't need to waste any bandwidth or CDs and can install directly over the net. I'll show you how. It's not difficult. I started at 4:30pm, giving myself 30 minutes before I had to go home.

First, get the hd-media kernel from http://kr.archive.ubuntu.com/ubuntu/dists/hardy/main/installer-i386/current/images/hd-media/. HD-media allows you to use an iso directly from your hard disk without burning it. We won't be doing that, though.

Second, get the netboot initrd.gz from http://kr.archive.ubuntu.com/ubuntu/dists/hardy/main/installer-i386/current/images/netboot/. We can't use the hd-media initrd.gz because it will look for installation media, which we don't have. We can't use the netboot kernel because it's designed to be placed on a server and transferred during PXE boot.

Because my school's network doesn't use a DHCP server, I needed to record my IP address, gateway, and DNS server. You may not have to do that, but it's always a good idea. I also needed to note where my home partition was. Mine was at /dev/sda3.

Next, to make things easier, I moved the kernel and initrd to /home. That's not necessary, but it saved me some typing later.

I rebooted and pressed ESC to get the Grub menu. Grub has a strong command line with help, so you can do a lot from there. Be careful to understand Grub's drive scheme. Drives use the designation (hd#,#), but the numbering starts at 0, so my /dev/sda3, being the third drive (2) on the first disk (hd0), becomes (hd0,2). I type in the following commands to set the kernel and initrd, then boot the system:

root (hd0,2)
kernel /vmlinuz vga=771
initrd /initrd.gz
boot


I added the vga=771 parameter to the kernel args because I have a widescreen monitor.

The kernel and initrd load and configure your keyboard and language, then try to autoconfigure your network to get the rest of the installer. Since there's a rogue DHCP server on my network which doesn't give correct information, I had to pull the network cable and wait for DHCP to fail, then reinsert the cable and configure the network manually.

The rest of the installer will be familiar to anyone who has installed Debian, but it's not difficult even if you've only installed Ubuntu in graphical mode before. Tab and the arrow keys are your friends there.

The only part that might give you trouble is the partitioning. Just reuse your old partitions and make sure to avoid formatting the old /home. The other partitions can be resized or anything you want, but that's not necessary and is probably asking for more trouble, so I just reformat everything the way it is, leaving /home alone.

You even get to choose one or many of the Ubuntu distributions: Ubuntu, Kubuntu, Xubuntu, Edubuntu, or various server setups. The Audio and Video editinng suites didn't want to install when I tried, but that may be fixed soon.

I answered a couple of questions, added a default user (with the same username as before, to make things easy), and left the machine overnight. When I came back to work in the morning, I only had to answer a couple of questions about time servers and the like, and I was up and running.

It's actually easier to install this way once you get used to it. It took me less than thirty minutes, starting from the download. I even left work a little early that day.

No comments:

Post a Comment

Other I' Been to Ubuntu Stories

Related Posts with Thumbnails