Tips for reducing memory usage

A NSLU2 from the front

by David Härdeman <david@hardeman.nu>

This document describes Debian etch (4.0). Some of the hints may still apply, but some may not.
  • If you do not have a serial port on your NSLU2, you can remove the getty on the serial line by commenting the corresponding line in /etc/inittab, e.g. change the line
    T0:23:respawn:/sbin/getty -L ttyS0 115200 linux
    
    to
    #T0:23:respawn:/sbin/getty -L ttyS0 115200 linux
    
    then run
    telinit q
    
    to tell init to re-read the inittab file.
  • If you are not using LVM, /etc/init.d/libdevmapper1.02 will still load the device-mapper kernel modules. Since libblkid1 depends on libdevmapper1.02 and mount depends on libblkid1, it is not possible to remove libdevmapper1.02. Instead you can prevent the script from loading the modules by inserting
    exit 0
    
    on the second line of /etc/init.d/libdevmapper1.02.
  • If you are not using IPv6, you can prevent the module from being automatically loaded by adding the line
    blacklist ipv6
    
    to /etc/modprobe.d/blacklist. The same goes for any other kernel module which is automatically loaded which you know you won't need.
  • Removing daemons that are not needed will of course also help. Starting aptitude and marking all packages as auto-installed by selecting the Installed packages line and pressing M, and thereafter checking through the list and manually marking the packages you want to keep by pressing + is usually a good start.
  • openbsd-inetd will only start if there are services activated in /etc/inetd.conf. Often the only services provided are old Unix services which are not necessary and inetd can be disabled by commenting all services in /etc/inetd.conf.

This article has been contributed by David Härdeman <david@hardeman.nu>