Yellow Dog Solutions

TOPIC: Howto install on a machine with limited memory



Introduction:
Problem:
Trying to install YDL on a machine with limited memory will result in the install failing during disk partitioning due to memory exhaustion. The symptom is the following messages while formatting the disk:
Terminated
install exited abnormally
sending termination signals...done
sending kill signals...done
you may safely reboot your system
The memory exhaustion can be verified by accessing virtual terminal 4 (press Option-F4 or Command-Option-F4), where kernel messages are displayed. You should see:
Out of Memory: Killed process 14 (yi).

Scope:
This was tested using YDL 2.2 downloaded from the official ftp site on April 12 2002. However, it appears that all 2.x versions of YDL may require significant amounts of memory during install. The machine was a MAC 7200/120 with 32MB of RAM, and stock Apple hardware (1.2GB hard drive). This should be applicable to any MAC with limited memory (certainly with 32MB, I cannot determine if it is required when 48MB of RAM is installed). The MAC OS used was 7.5.3, though this document makes no mention of problems specific to that os version -- see install_oldmachine.shtml


Details
Cause:
YDL requires a 16MB RAM disk for installation. In a 32MB system, this leaves only 16MB for the kernel and all processes. The YDL installer is written in Python, and consumes the vast majority of the remaining memory. Formatting partitions (particularly large ones) requires more memory than remains available. When memory is exhausted, the kernel kills the install process, resulting in a system halt.


Workaround:
1) Begin by following the "Preparation" instructions in the Install Guide. Be sure to choose ramdisk-text.image.gz as the Linux Ramdisk in BootX.

Those who are very familiar with parted may wish to skip to step 6 and create all Linux partitions manually. However, it is a bit easier to let the installer create the partitions and only requires one extra reboot. Also, if you have less than 32MB the installer probably will not run at all. In this case, you may try skipping to step 6 and partitioning manually. Then create a device node for the swap partition with mknod and activate it with swapon before starting the installer in step 10 (I have not tested this).

2)Continue following the Install Guide. At this point I believe you can use either Default or Custom Install, though I have only tested it with Custom.

3) When creating disk partitions, remember the name of the disk(s) on which you are creating them. This will be the partition name with the last number removed -- something like "sda" for SCSI disks or "hda" for IDE.

4) After creating disk partitions and selecting "Save", you should see the "Formatting" message box and get the following error:
Terminated
install exited abnormally
sending termination signals...done
sending kill signals...done
you may safely reboot your system
5) Reboot using the power button.

6) Time to get a really big hammer and beat this thing into submission. [:)] In BootX, in the box labelled "More kernel arguments" enter
init=/bin/sh
Choose the Ramdisk just like before and boot into Linux again.

7) The installer will not start up. Instead you will get a few messages and a root prompt (# at the beginning of the line). We will now format the partitions manually.

8) First the device nodes for the disks need to be created. For SCSI disks, the following commands will do:
mknod /dev/sda b 8 0
mknod /dev/sdb b 8 16
Continue in the above pattern (adding 16 to the last number) for each actual physical hard drive you need to format (you only need /dev/sda if you only have one drive, but extras won't hurt). For ide drives use:
mknod /dev/hda b 3 0 mknod /dev/hdb b 3 64 mknod /dev/hdc b 22 0 mknod /dev/hdd b 22 64
as necessary (once again, extras don't hurt).

9) Now, enter the command:
parted /dev/sda
Replace "/dev/sda" with the name of the drive you need to format (from step 3). You will see some messages and a "(parted)" prompt. Inside parted do the following:

9a) enter the command:
print
You should see the partitions that you created in the installer. Write down the numbers of the root and swap partitions, and any additional Linux partitions that you created.

9b) Format the swap partition. Enter the command
mkfs (swap-num) linux-swap
where is the number of the swap partition. parted will issue the warning "Unable to determine if partition is mounted". Ignore this by entering "I".

9c) Format other Linux partitions. Use the command
mkfs (num) ext2
for each that represents a Linux partition. Be very careful not to format any Macintosh partitions. You will again have to ignore the warning. You should also be able to use ext3 as a filesystem type here, but I have not tested it.

9d) enter the command:
print
to see that everything looks OK. There should be an entry in the filesystem column for every Linux partition.

9e) exit parted with the command:
quit
10) Continue the normal install by entering:
init
at the command prompt (#).

11) Make sure to choose "Custom" install. The install will fail if you use "Default".

12) Follow the normal installation procedure until you get to "Drive Partitioning".

13) Select "Drive Partitioning", then immediately choose the "Done" pushbutton.

14) Continue with normal installation. Once mount points are specified, the installer will activate swap space, creating sufficient memory for the installation to proceed.


Closing
The key to this HOWTO is understanding that the init= kernel parameter specifies the first program that the kernel will run when it is done loading. Using init=/bin/sh drops you into the lowest-level, bare-bones system achievable under Linux.

This technique can be handy when all else fails, but requires a more detailed understanding of the operating system. As the old saying goes "When you want something done right, do it yourself." The machine will perform any number of tasks very well with 32MB of RAM. Examples include program development using emacs and gcc, DNS nameserver, and other low-load servers. It is even possible (and not unbearably slow) to run XWindows 3 with a lightweight window manager.

This HOWTO was written by Rob Dye



 
          Copyright ® 1999-2010. Fixstars Corporation. All rights reserved.
YDL.net Fixstars Corporation