Monday, November 29, 2010

Installing Slackware on a semi-isolated system

My ancient laptop is a never-ending fountain of joy. It's so old and battered, most forms of communication are dead, to the extent where I've had to transfer network card drivers over the sound card (as documented here). Having done that, I managed to get a working Linux system up and running. But today it was that time of year again: Upgrade time. Adding to that, the file system was getting is a bit dodgy, so I decided to wipe the system and install anew.

The obvious question is this: Just how do you install (Linux) on a system with no CD, DVD or USB capabilities. PXE is one option, and I could go to all the trouble of setting that up, but there's another option: Making a boot-partition out of the swap partition. If you can install from an USB stick, a floppy disk or a CD, there should be no reason you couldn't do the same from a regular hard drive partition, right? It turns out that this feat isn't all that difficult at all, it's just poorly documented. So I'm documenting what I did here.

This is done at your own risk. Make sure to backup your data. I'm writing this assuming you have enough of an idea how to modify the instructions to suit your system. If you are not reasonably familiar with Slackware, this guide is not for you.

I'm going to be using the swap partition, which was called /dev/hda2 on my old install. This varies from system to system. Please make sure you're very certain which partition you want to install on.

First step is to disable the swap partition.
# swapoff -a

Next step is to create a file system on this partition.
# mkfs.ext2 /dev/hda2

Mount it
# mount /dev/hda2 /mnt; cd /mnt

As I'm going for a network install, I only want to download the isolinux and kernels directories of the Slackware tree. Here I chose the slackware.no-mirror because it's one of the faster ones nearby.

# wget -nv -r ftp://ftp.slackware.no/slackware/slackware-13.1/isolinux
# wget -nv -r ftp://ftp.slackware.no/slackware/slackware-13.1/kernels



The next step is to add the install partition to lilo, by adding the following section
image = /mnt/kernels/hugesmp.s/bzImage
root=/dev/hda2
label=SlackwareInst
initrd=/mnt/isolinux/initrd.img
append="load_ramdisk=1 prompt_ramdisk=0 rw SLACKWARE_KERNEL=hugesmp.s"


Update lilo by running
#lilo -v

And reboot. Select SlackwareInst. Follow the instructions, and do a network install (I used the same FTP server as I grabbed the kernels and initrd stuff from). Easy as that.

2 comments:

  1. I've installed quite a few computers that way, on account of wanting a filesystem not well supported by a LiveCD...glad to see it's alive and well and still useful after all these years.
    You rock, Viktor.

    ReplyDelete
  2. I'm sorry about the scarcity in updates as of late, my master's thesis is eating my spare time.

    I'm considering making a partition like this a permanent fixture on my computers. They're really so tiny that wasted space is not an issue, and it's nice not have run around looking for a bootcd when you have to do emergency maintenance (you can mount the host system and edit files and whatnot).

    ReplyDelete