Installing Linux on ZIP disk using ppa ZIP Drive Mini-Howto
John Wiggins, firstname.lastname@example.org, 26 January 1998
This document is only useful for those with the printer port version of a ZIP drive who wish to have either a portable or backup Linux system on a ZIP disk.
NOTE: I have no idea if the IDE drive works the same way as the printer port version does since I don't have one, so please don't ask me.
The Debian install portion was basically just copied with little or no editing by this author. As such, there may be some duplication of instructions.
This document assumes the following:
This document is divided into four basic sections each describing how to install a bare-bones Linux system on a 100MB ZIP disk using a printer port ZIP drive. The first section describes how to set up the ZIP disk and is common to both Red Hat and Slackware distribution installations. The second, third, and fourth sections describe how to install Red Hat 4.2, Slackware 2.2, and Debian 1.2 distributions, respectively, onto the ZIP disk.
NOTE: I realize that Red Hat 5.0 has been released now, but between classes and work, well let's just say that it may be late May before I can get around to work on it. I also, hopefully, will be testing out the other distributions.
I've finally found enough time (although I really should be studying for a sociology test...) to update this document. Thanks for all who emailed me with comments.
New to this document:
Indicates the following text are commands:
==> Indicates something noteworthy:
Indicates a screen shot/capture:
For any updates, however rare they may be, please check: http://comp.uark.edu/~jwiggins/linuxZIP/
Slackware 2.2 section courtesy of Michael Littlejohn email@example.com
Debian 1.2 section courtesy of John D. Blair firstname.lastname@example.org
(Common for both Red Hat and Slackware distributions.) Before starting, make sure that you have access to the ZIP drive; either by having ppa in the kernel or by having the ppa module loaded. One easy way to find this out is by checking dmesg:
You may have to pipe this to more as dmesg tends to be rather long. Here's a snip from mine:
If you only see something like:
then you have SCSI support but the ZIP wasn't found.
To partition the ZIP disk, run fdisk:
==> fdisk /dev/sda/
Here is a snap of the partition table I have setup:
I decided to use a swap partition since I wanted to be able to use this with any machine.
After running fdisk, format the new partition:
==> mke2fs -c /dev/sda1
Then, create the swap partition: (15360 blocks as taken from fdisk)
==> mkswap -c /dev/sda2 15360
Last, you'll need to mount the ZIP disk:
==> mount /dev/sda1 /iomega -t ext2
Since the ppa version of the ZIP drive isn't a true SCSI device, it isn't a bootable device and, therefore, requires a boot disk which has ppa included in the kernel and not as a module.
Configuring and making the kernel
First, you'll need to configure and make a kernel that has ppa support enabled and not as a loadable module. In order to get to the ppa option, select SCSI support:
SCSI support (CONFIG_SCSI) [Y/m/n/?]
Plus, SCSI disk support:
SCSI disk support (CONFIG_BLK_DEV_SD) [Y/m/n/?]
And finally, under the SCSI low-level drivers, is the ppa support:
IOMEGA Parallel Port ZIP drive SCSI support (CONFIG_SCSI_PPA) [Y/m/n/?]
Again, be sure not to include ppa as a module, but rather in the kernel. Thus far, without the use of the parport kernel patch (see 1.4), the ppa driver will not allow the passive port of the ZIP drive to be used for a printer, so you may want to say no to parallel printer support:
Parallel printer support (CONFIG_PRINTER) [N/y/m/?]
Once the kernel is configured, make the kernel:
==> make dep; make clean; make zImage
The new kernel should be found in arch/i386/boot/zImage.
Getting the kernel to a floppy
After having to have 4 separate floppies due to different kernels and needing different parameters, (plus the great email I got telling me how to do this) I have included a section on LILO as one of the means of creating a bootable floppy.
For those who have to, or for that matter just want to, have several kernels on one floppy (now adays, mine are too large) or just want to be able to pass arguments (such as single user mode) I received email on how to install LILO on a floppy.
Creating the ext2 filesystem
To create an ext2 filesystem on a floppy, just do the same command for the ZIP disk:
==> mke2fs -t /dev/fd0
Copying the essential files
Next, make sure there's a directory for a mount point, and mount the floppy (I used /mnt/floppy):
==> mount /dev/fd0 /mnt/floppy -t ext2
is to boot properly, you'll need the same files that LILO uses on your current Linux installation.
==> cp /boot/boot.b /mnt/floppy
==> cp /boot/map /mnt/floppy
==> cp /usr/src/linux/arch/i386/boot/zImage /mnt/floppy/vmlinuzDESK
Now to create the config file for LILO, now I miss the liloconfig program... (Thanks to Javier Rodriguez for this info) First, create the LILO config file, /mnt/floppy/lilo.conf, for the kernel(s) for the ZIP disk. Here's what I used so that I could have different kernels to test with:
I have two kernels, one for my 486 laptop which required the math-co emulation in the kernel and the other for my desktop. The rescue allows me to make an emergency boot to the hard drive.
Last but not least, with the floppy still mounted, run LILO to install it on the floppy with the command:
==> lilo -C /mnt/floppy/lilo.conf
Once LILO has been installed on the floppy, skip the next two steps, unless you enjoy doing this over again :)
Kernel only installation
Copy the newly made kernel to a floppy disk:
==> cp arch/i386/boot/zImage /dev/fd0
==> cat arch/i386/boot/zImage > /dev/fd0
Yes, there are many ways to copy the kernel to a floppy, but the last way, my favorite, is a little more encrypted. Try not to forget the > unless you like viewing binary files :)
Setting the root and swap on the floppy
Once the kernel is on the floppy, you need to set the root device to the ZIP disk: ==> rdev /dev/fd0 /dev/sda1 I'm not sure if the next option is needed, but I did it none the less. To set the swap:
==> rdev -s /dev/fd0 /dev/sda2
With anything computer related, something 3 months old is considered obsolete and is in need of upgrading. Since I'm not always going to have the time to update this document with every update, I'll try my best to at least update it every other version. As for the other distributions, unless the authors wish to send updates, they well remain as they are.
For my installation, I have and used:
When I first decided to attempt to install Red Hat on a ZIP disk, I figured it would be much easier to just use a Red Hat boot disk. Then I woke up. I came very close to actually getting a boot disk created, even got help from various folks at Red Hat via e-mail but ultimately I began to give up on the whole project when I discovered the --root option with rpm.
What packages to get
I found what packages to install by browsing a file I had found on one of Red Hat's mirrors. This file can be found on any mirror at:
For this installation, I wanted to include network support but due to Red Hat's X network configuration, I'm going to have to manually configure, or rather manually attempt to configure, the network setup scripts found in /etc/sysconfig/ (see section 4.3.3.)
I decided against installing any development packages as the ZIP drive, at least an unpatched kernel version, is rather slow to get anything to compile. I also choose not to install X mainly for disk space issues. Later on, I may attempt to mount my hard drive and create a symlink with /usr to see if I can get X to work.
Following is a list of what packages I installed, listed in order of installation. Those marked with a * have updates from Red Hat's errata. In parentheses is the updated package number;
And with all the above installed, I still have 32MB left!
As many, I hope, Red Hat users know, some packages may be found to have some security flaws or anything else which may cause issues to arise. For this reason, Red Hat releases updates for such packages. I have updated what packages I had which had updates and are marked in the above list. Please refer to Red Hat's web page concerning the updated packages at:
How to install packages with rpm; without glint
With rpm, use the --root option to specify the mounted directory as the root for installation. I had discovered that many packages were failing to install becuase of preinstall or postinstall scripts that weren't executing correctly due to the different root directory, thus, use the --noscripts option:
==> rpm --root /iomega -i --noscripts PACKAGE.i386.rpm
As I'm sure many will notice, you should get an error message like:
So, just create the var/lib/rpm directory :)
==> mkdir /iomega/var; mkdir /iomega/var/lib; mkdir /iomega/var/lib/rpm
Which came first, pamconfig or pam?
If anyone's tried to install pamconfig, it'll complain about a failed dependency of pam; and when you go try to install pam, pam complains about a failed dependency of pamconfig! This, being the chicken or the egg issue, puzzled me for a while, but thanks to the --nodeps flag, we can force pamconfig to install; besides pam has more failed dependencies than just pamconfig.
==> rpm --root /iomega -i --nodeps --noscripts pamconfig-0.51-2
Once everything is all nicely installed, unfortunately, the disk is not fully functionable, if that's a word. What I mean to say is, if you try to boot now with the floppy, you won't get very far. As soon as init tries to start up, you'll get two lovely errors; both of which complain about some files not being found that would have been made had the scripts been run.
The case of the missing /etc/ld.so.cache and libc.so.5
If you tried booting, you'd get two error messages, the first will be the abscence of /etc/ld.so.cache file. The second complains about a missing libc.so.5.
As mentioned by many readers, my previous instructions didn't quite work as stated. In order to get this file created, you'll have to run ldconfig while the ZIP disk is still mounted:
==> chroot /iomega /sbin/ldconfig
Thanks to Javier Rodriguez for this solution.
To solve the missing lib case, you'll have to create a symlink which would have been created by the installation scripts.
==> cd /iomega/lib; ln -s libc.so.5.3.12 libc.so.5
Thanks to Darcy Boese for this solution.
Setting root password
Just as ldconfig was ran in 184.108.40.206, you might as well change/create a root password for this new system:
==> chroot /iomega passwd root
What the install program created
While exploring my Red Had 4.2 CD-ROM, I came across something rather interesting; the source code for the install program. I found it under /misc/src/install and one thing which I found of some use was the net.c file. In this, I found what other files that would be created had the install program been run. Most of these just give network support (hince the name net.c) but even if you don't have a network card, you can still use localhost for networking (plus apache will complain about not being able to determine a hostname.) These files include:
For this document, I wanted network support for my 3Com 3c595 fast-ethernet card (which for the last several months has been used in another machine.)
First I needed a name, and since I'm running my own name server (which is another long story) I gave myself the name: dash-dot.wig.org (I just liked the sound of it.) Having a name without an IP is kind of pointless, so I used a reserved non-internet usable network of 192.168.10.0 which my name server also uses. Even though the hostname is typically stored in /etc/HOSTNAME, Red Hat checks for /etc/sysconfig/network for this name; so let's start there. Sample of my /etc/sysconfig/network:
Next, bascially duplicate the same info here for /etc/HOSTNAME, /etc/resolv.conf, and /etc/hosts:
Red Hat configures all network devices from scripts found in /etc/sysconfig/network-scripts. The configuration of any network device is usually first created via the install program so I had to create these config files manually. They all begin with ifcfg-XXX where XXX is the network interface which ifconfig brings up; e.g. ppp0, eth0, etc. For this example, I had to create a file called ifcfg-eth0 which contains the following:
And last but not least, in order to get this going right now, while in the /etc/sysconfig/network-scripts directory, just run:
==> ./ifup ifcfg-eth0 boot
This will start the script which configures the network interface if that interface was set to start at 'boot' time.
For further information, please refer to the NET-3-HOWTO document.
Okay, now comes the fun part: Figuring out what files need to be on the system disk, and what packages that you want (and can fit) on your ZIP drive.
I decided that the easiest way to get started was install Slackware directly to the ZIP drive. I decided on this approach mostly because Slackware is a smaller distribution then Red Hat, and it would be easier to trim out what I didn't want. That and the fact that I am using the Slackware distribution anyway made it an obvious choice.
Installing Slackware onto the ZIP disk is easy, as root run the setup program, and choose /iomega as the install to partition, set the install from partition to where the Slackware sources are (cdrom, hardrive, etc), select install and follow the prompts.
The hardest part is deciding what to add, and what not to add. Obviously, you'll need the 'A' series (Which is about 8 megs), the rest is up to you.
I managed to trim down the Slackware release to a respectable installation of 70 megs, which included gcc/g++, perl, X11R6 (NOT ALL OF IT!), sendmail, online docs (Minus all the development man pages, but including all the howto's), and an assortment of other goodies, while leaving about 10 megs free for user files. YMMV
(Common to both Red Hat and Slackware distributions)
The last thing that needs to be done before rebooting is to create the fstab file on the soon to be root partion. The following is what you should have as a minimum for /iomega/etc/fstab:
Save the file, and reboot with the freshly made boot floppy and enjoy!
(Special thanks to Mike for reminding me about this very important and crucial step. - John)
After spending a few hours wrestling with dpkg I decided it would be simpler to modify the Debian "Rescue" disk so that it would recognize the ppa ZIP drive. This proved to be very easy. You can then use this modified disk to procede through the normal Debian base system install. Once you've completed installing the base system you can use a boot disk to start the new base system and complete the installation using dselect. To use this technique you need to build two kernels - one with ppa and initial RAM disk support, and another without the RAM disk support.
If you want, you can skip all the steps in section 2 and let the Debian install procedure handle formatting the ZIP disk for you.
The Debian rescue disk is a SYSLINUX style boot disk, which uses a DOS formatted floppy disk and a special boot loader to avoid loading MS-DOS. These disks are very easy to modify to start your own custom boot configuration. The Debian 'boot-floppies' package contains a set of scripts to automate the process of building boot disks. However, its so simple I found it easier to do the process by hand. This deviates a bit from the Debian philosophy, but I'm over it :). There are brief instructions in the 'readme.txt' file of the Rescue floppy.
Use dd (or RAWRITE under DOS) to create a new Rescue disk.
Review the Debian install docs if you don't remember how to do this.
Build a new kernel with ZIP ppa support
Build a new kernel with ZIP ppa support (as in step 3.3.1), but also configure RAM disk and initial RAM disk support. You also need to configure the msdos, fat, minix, ext2fs, and procfs filesystems.
Also configure any modules that you would like in your final installation on the ZIP disk.
Once the kernel is configured, build with:
==> make dep; make clean
==> make bzImage
Build the modules with:
==> make modules
You will install these later.
Mount the new Rescue disk.
==> fdmount fd0
==> mount /dev/fd0 /mnt
==> whatever :)
Copy the kernel image
Copy the kernel image (on the i386 platform it will be located at arch/i386/boot/bzImage) to 'linux' on the floppy disk.
Editing the 'rdev.sh' script
Open the 'rdev.sh' script located on the Rescue floppy with your favorite editor. Change the last line: from--:
You will also have to change all occurences of /mnt/linux to the appropriate path. Since I mount my floppies under /fd0, I had to change /mnt/linux to /fd0/linux.
Run this modified 'rdev.sh' script.
Boot your modified Rescue disk. If all goes correctly you will be presented with the familiar Debian menu based install process, except that now it is aware of your ppa ZIP drive. Procede through this process as if you were installing the system on a normal hard drive, but mount /dev/sda1 as root and initialize /dev/sda2 as swap.
There is one deviation from the standard install process-- don't install and/or configure any loadable modules. You will install the modules you built in step 7.3.2 later.
You can create the boot disk just as described in steps 3.3.1 to 3.3.2, or, if you want, just use the "Create Boot Disk" option during the Debian install. I like this second option because I get another SYSLINUX boot disk, allowing me to edit the greeting message to describe the nature of my custom boot floppy and allow me to enter additional kernel arguments. You can even include help files, accessible via the functions keys. You may still wish to rebuild the kernel and modify this boot disk by hand later to remove the RAM disk support. Your call.
Insert your boot disk and choose the 'Reboot' option from the install menu.
When the system reboots you will have a slow but completely workable Debian base installation running off of your ppa ZIP drive. Proceed normally with the installation at this point. I installed all the normal UNIX utilities, along with documentation sets, make, gcc, libraries, and various useful file manipulation utilities. The result is a very powerful emergency boot system that I can use to rescue any of the systems in our department in an emergency.
If you installed make in the last step, you should be able to mount the hard drive partition containing your kernel build, cd to the proper directory and run 'make modules_install'. Here's how I did it:
==> mount /dev/hda2 /mnt
==> cd /mnt/usr/src/linux
==> make modules_install
Whew, and sigh. After amassing 31 ZIP disks and a ZIP unleashed battery pack, my next experiment is to try to get pcmcia working for my laptop.