ALIX2 with Solidstate CF
Howto install NetBSD on a ALIX2-board with Compact-Flash (CF)
from Pascal Dornier is a ideal home server, because it is silent, small and very energie efficient. The ALIX-Board ist fast enough for most normal server usage and also interesting for appliances. Depending von the size and speed of your CF you can make it a very fast machine with enough space.
If you like to install NetBSD on a CF exactly as on a harddisk, you are finished.
But with flash memory you cannot write every block unlimited times. Modern flash has a very high limit so that it is likely that you will never reach that limit, but we like to have a perfectly optimizes NetBSD
for our CF. We will tune NetBSD
in a way that we have absolutely no write access on our CF.
Therefor we make the CF only readable and put all writeable directories (var and dev) as mfs into the RAM.
Put CF via IDE2CF
-Adapter in a normal PC and boot form a installation floppy or cdrom. Start the installation as usual
. Make one MBR
of the hole CF. Make one big root-partition ( / ) without swap or seperated tmp or whatever. In the bootblock
selection choose serial for com0 with 38400 baud. Install as usual and do not reboot!
Put the CF into the ALIX-Board and boot into singel user mode (stop the automatic boot process and type
Type following commands:
# cd /
# mount -uw /
here we mount the CF in read-write mode
mv /tmp/* /tmp/.* /var/tmp/
move eventually existing files from
ln -s var/tmp /tmp
remove the original
-directory and create a symlink
tar cvfzp var-image.tgz var
archive and compress the hole
Now we create a script that mounts a
-directory into RAM and creates all necessary files in that directory during boot process.
cat - > mount_mfs_fs
# mount_mfs_fs: mount memory file system /var and /dev
# by roby, 23 jun 2003
# PROVIDE: mount_mfs_fs
# REQUIRE: root
echo -n "Mounting memory file system: "
# /dev will automatically created during boot by the kernel
# Mount /dev fs
# mount_mfs none /dev
# build device files
# /etc/MAKEDEV all
# Mount /var fs
echo -n "/var "
# mount /var with a size of 70 MB
mount_mfs -s 70m none /var
# build dir/files in var
tar -xzpf /var-image.tgz -C /
# tar -xzpf /pkg-image.tgz -C /
This script mounts a RAM-disk and puts all necessary into it. We set the size of
to 70MB here, because we need some space to install some bigger packages later. But after installation some software you can reduce the size.
chmod 555 mount_mfs_fs
Now we need an editor (vi)
change /etc/rc.d/mountcritlocal so that
check with cd /etc/rc.d; rcorder * | less
cp -p /dev/MAKE* /etc
cp -p /dev/MAKE* /sbin
To be sure i copy
in both dirs because some scripts search in one or the other dir.
cat - >> /etc/rc.conf
Here we disable swap and give a hostname.
# cat /etc/fstab
# NetBSD /etc/fstab
# See /usr/share/examples/fstab/ for more examples.
/dev/wd0a / ffs rw,noatime 1 1
kernfs /kern kernfs rw
procfs /proc procfs rw,noauto
swap /var mfs rw 0 0
here we configure
is not needed, because the kernel setup
rm -rf /var/*
mv /dev /dev-old; mkdir /dev
Here we are ready and just have to reboot
If you like to be perfect, you can configure NetBSD to not write anything on the flash
Just change the /-entry from
and change in
umount -a >/dev/null 2>&1
mount -r /
If you lockin next time and want to modify somthing, you have to
mount -uw /
Add some packages
pkg_add -v ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD-4.0/i386/shells/standalone-tcsh-6.15.00nb1.tgz
pkg_add -v ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD-4.0/i386/lang/perl-5.10.0nb6.tgz
pkg_add -v ftp://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD-4.0/i386/sysutils/lsof-184.108.40.206nb2.tgz
You have to look for the exact file name in
because they will be updated from day to day. After installation you should tar the package-index with
tar cvfzp /pkg-image.tgz /var/db/pkg /var/db/pkg.refcount
, so that pkg_info shown all installed packages (and uncommend the appropiate line in
Some helpfull links: