Small Linux Notes By Levi Waldron

Small Linux | RecentChanges | Preferences

My Small Linux experience

By: Levi Waldron

My computer: A 386 Twinhead laptop with 4MB RAM, 81MB hard drive

My purpose was to set up this laptop with a minimal Linux system to save the majority of the hard drive with a database of song lyrics with guitar chords, known on the net as the OLGA database. It takes up about a 100MB of disk space, even after gzipping everything, so the tinier my linux system the fewer songs I have to leave out. I used PLIP and NCFTP to connect the laptop to my desktop computer to transfer the database, and I am now stuck at the point of finding a Lynx binary for Small Linux to browse the songs and automatically view the gzipped text files. But here is my story...

Just for fun, I started by trying to make a dual-boot DOS/Linux system. This didn't work, so I'll just mention what I did briefly. Following the Debian guide at debian.org, I defragged the hard drive, used FIPS to do a lossless partition from DOS, then booted up SL (Small Linux), used fdisk to define a Linux native and swap partition, used mkfs.ext2 and mkswap to format them, then discovered that the LILO that comes with SL does not do dual boot, so I started over.

Here's what I did to make a single-boot SL system:

1) From my desktop, used

dd if=root of=/dev/fd0 dd if=boot of=/dev/fd0

to make floppy disk images of the root and boot disks.

2) Turned on the laptop with the boot disk in place. At first I tried the default boot by just pressing at the boot prompt, but I got all sorts of weird strange errors. I realized that this was due to insufficient memory, so booted again using the command:

linux root=/dev/fd0 load_ramdisk=0

and everything went fine. Don't switch to root disk til prompted to do so.

3) fdisk

Note: 1 cylinder = 82.65 kB

       12 cylinders = 1 MB

l to list possible partition types p to print partition table d to delete partitions t to change a partition's system id (82=swap, 83=native) n to add a new partition a to make the Linux native partition bootable v to check for unused cylinders w to write partition to disk and exit

I made a 4MB swap partition in the last 48 cylinders of the disk and used the rest for the Linux native. Thus, /dev/hda1 is my Linux native bootable partition and /dev/hda2 is my swap partition.

Now reboot with

shutdown -r now

then boot up as in step 2.

4) Format new partitions.

mkfs.ext2 /dev/hda1 (since my Linux native is hda1)

mkswap /dev/hda2 (and my swap is hda2)

5) Copy root filesystem to Linux native root directory. As mentioned in the other SL writeups, this process gets hung up at the proc directory. That's because of a file /proc/kcore which is 4,198,400 MB, which it wouldn't let me delete. As a workaround, I moved /proc to /yproc so it at least wouldn't get hung up until all the other copying was done:

mv /proc /yproc

Also the copy process runs into recursive problems when it tries to copy /mnt onto itself, so I made a directory called zmnt

mkdir /zmnt

mount /dev/hda1 /zmnt

Now commence the copying:

cp -a /* /zmnt/ (note: use the exact same /'s as I used here or beware)

When it gets hung up I used ctrl-c to stop it, then

mv /zmnt/yproc /zmnt/proc

Then I copied the rest of the files from /proc which got skipped by stopping the copy (probably not necessary):

cd /yproc

cp loadavg meminfo misc uptime /zmnt/proc

Finally,

umount /zmnt

6) Reboot: shutdown -r now

Leave the boot disk in but at the boot prompt type:

linux root=/dev/hda1 load_ramdisk=0

7) Copy the kernel from boot disk to HDD. With boot floppy still in drive, type:

mount /dev/fd0 /mnt

cp /mnt/linux /

umount /mnt

8)Edit lilo.conf. NOTE!!! If you type vi lilo.conf, SL actually runs a tiny editor called e3. It doesn't actually identify itself as such, so I could not figure out why standard vi commands like :wq would not exit me, and I couldn't figure out how to get help. I ended up shutting off the computer to get out which was a pain because SL doesn't have fsck to fix up the hard drive after doing this. Upon rebooting, I check the symbolic links and found that vi actually started e3, then found an instruction manual for e3. e3 is easy to use, if you just type e3 without a filename the first time and write down a few of its key commands, for example ctrl-k-x to save and exit or ctrl-k-q to abort and exit.

Anyways, with this figured out I edited lilo.conf so that the only uncommented lines were:

boot = /dev/hda

timeout = 1

vga = normal

image = /linux

  root = /dev/hda1

  label = linux

  read-only

8.1) Run: lilo.

8) To make mounting the floppy easier, I made a directory /floppy then added the following line to /etc/fstab:

/dev/fd0 /floppy auto defaults 0 0

9) Reboot the system without a floppy in the drive!

shutdown -r now

============================================================================== Now for setting up plip. See note about vi/e3 in step 7 of the SL setup above.

My desktop (big) computer is cedar.forestry.utoronto.ca. It has an ethernet connection all the time and is 128.100.163.19. If you're not connected to the net you can just make a number up (use mine if you want to).

I bought a "Laplink" cable which has male pins on both sides and plugs into the parallel printer ports of each computer. Cost 8 Canadian dollars.

My laptop (baby) computer I named baby.forestry.utoronto.ca. I used ping from my big computer to determine that 128.100.163.20 was not being used by any other computer, so this is what I called baby.

I figured out how to do this from PLIP-install-HOWTO. It's very well written and easy to follow, and will help you if this doesn't work. http://www.linuxdoc.org/HOWTO/PLIP-Install-HOWTO.html

1) I'm sure not everything I did was necessary, but it worked so here it is.

On big computer, add to /etc/hosts: 127.100.163.20 baby.forestry.utoronto.ca

on baby, add to /etc/hosts: 127.100.163.20 localhost

                             127.100.163.19 cedar.forestry.utoronto.ca cedar

			     127.100.163.20 baby.forestry.utoronto.ca baby

2) Your big computer must NOT have lp compiled into the kernel. It's probably not, but you can test by typing

cat /proc/devices. You should see an entry with "6 lp" in it. Then if you type as root:

/sbin/rmmod lp

Then cat /proc/devices will no longer show the "6 lp" entry.

If this doesn't remove the lp module, then you'll have to recompile with lp loaded as a module or use a serial port and SLIP instead, but the cable is more expensive and it's a much slower way to transfer data.

3) On the desktop (big) computer, you must have plip as a loadable module. To do this I went to my kernel compiling directory and typed:

make menuconfig

to choose plip as a loadable module. Then I exited and typed

make modules

to compile the new plip module.

Then I didn't actually write this part down, but I think I typed

cp /home/lwaldron/linux/modules/plip.o /lib/modules/2.2.18/net/

   (2.2.18 is the version of my kernel)

to get plip.o in the right place. This might not be necessary, but if you still can't load plip with the command '/sbin/insmod plip' as root, maybe this will help.

With this done, I was able to follow the rest of the instructions in PLIP-install-HOWTO and get plip running easily. I put the commands I used into a script /usr/local/bin/plip-on.sh Here it is: (Connect the laplink cable to both computers first)

/usr/local/bin/plip-on.sh

  1. !/bin/sh

/sbin/rmmod lp

/bin/echo 7 > /proc/parport/0/irq

/sbin/insmod plip

/sbin/ifconfig lo netmask 255.255.255.255 up

/sbin/ifconfig plip0 cedar pointopoint baby netmask 255.255.255.255 up

You can test whether this worked by typing:

ping cedar --> should give 0% packet loss

ping baby --> should give 100% packet loss

4) On baby, copy needed files to baby from net/modules floppy: Put it in baby drive then type:

mount /floppy (see my step 8 from SL setup to make this command work)

cp /floppy/2.0.0/* /bin/

rm /bin/System?.map (I can't remember why I did this but it's in my no!tes - I think just to save space)

mkdir /lib/modules

cp /floppy/net/plip.o /lib/modules/

Now I run the script /bin/plip-on.sh:

  1. !/bin/sh

/sbin/insmod /lib/modules/plip.o

/sbin/ifconfig plip1 128.100.163.20 pointopoint 128.100.163.19 netmask 255.255.255.255 up

/sbin/route add -host 128.100.163.19 dev plip1

Now you should be able to

ping 128.100.163.20 --> 0% packet loss

ping 128.100.163.19 --> 0% packet loss

PLIP is up and running! (hopefully). The Small Linux side should work because yours will be the same as mine, but if the part on the big computer doesn't, take a look at PLIP-install-HOWTO. It takes you through it step by step and will tell you where your setup differs.

telnet and ftp will now work, although I had trouble finding binaries with the necessary libraries for Small Linux. For me, it involved downloading binaries for RedHat? 5.2 onto my big computer, putting them onto a floppy, then copying them onto the baby. The I ran them and got missing library errors. Then I went and found that library with my big computer, transferred it over on a floppy, got a new missing library error, found and copied that library over, etc. etc. until I finally got it to work. I actually used ncftp because it does recursive ftp of entire directory trees. I tried this again for lynx however, but the binary won't even run - not sure why. So I still can't browse this lovely OLGA database I've ftp'd onto this little laptop.

5) When I'm done with plip, I run the shell /usr/local/bin/plip-off.sh on my big computer to get rid of plip and reload lp:

  1. !/bin/sh

/sbin/rmmod plip

/sbin/insmod lp

See Levi's files that have been uploaded: Programs For Small Linux

/Talk

-- back to Experiences Installing Small Linux


Small Linux | RecentChanges | Preferences
This page is read-only | View other revisions
Last edited September 20, 2004 7:34 am (diff)
Search: