LinkStation II (en)

kernel-nfsd

Buffalo only supports samba and ftp as network protcols. For the use with a Linux computer the NFS protocol gives great advantages in performance.

The first step is the installation of the OpenLink Firmware. I use version 0.52b. After a successful installation we get ssh access to the LinkStation and can install our own software.

I loaded the required packets from a Debian Mirror, converted them with alien into tar-archives and unpacked them.

Required packages and files


portmap:
FILE                                                        PACKAGE
etc/init.d/portmap					    net/portmap
sbin/pmap_dump net/portmap
sbin/pmap_set net/portmap
sbin/portmap net/portmap
usr/share/doc/portmap/README.gz net/portmap
usr/share/doc/portmap/changelog.Debian.gz net/portmap
usr/share/doc/portmap/changelog.gz net/portmap
usr/share/doc/portmap/copyright net/portmap
usr/share/doc/portmap/portmapper.txt.gz net/portmap
usr/share/man/man8/pmap_dump.8.gz net/portmap
usr/share/man/man8/pmap_set.8.gz net/portmap
usr/share/man/man8/portmap.8.gz net/portmap


nfs-common:

FILE                                                        PACKAGE
etc/default/nfs-common					    net/nfs-common
etc/init.d/nfs-common net/nfs-common
sbin/rpc.lockd net/nfs-common
sbin/rpc.statd net/nfs-common
sbin/showmount net/nfs-common
usr/sbin/nfsstat net/nfs-common
usr/share/doc/nfs-common/README net/nfs-common
usr/share/doc/nfs-common/changelog.Debian.gz net/nfs-common
usr/share/doc/nfs-common/changelog.gz net/nfs-common
usr/share/doc/nfs-common/copyright net/nfs-common
usr/share/man/man8/lockd.8.gz net/nfs-common
usr/share/man/man8/nfsstat.8.gz net/nfs-common
usr/share/man/man8/rpc.lockd.8.gz net/nfs-common
usr/share/man/man8/rpc.statd.8.gz net/nfs-common
usr/share/man/man8/showmount.8.gz net/nfs-common
usr/share/man/man8/statd.8.gz net/nfs-common


nfs-kernel-server:


FILE PACKAGE
etc/default/nfs-kernel-server net/nfs-kernel-server
etc/exports net/nfs-kernel-server
etc/init.d/nfs-kernel-server net/nfs-kernel-server
usr/sbin/exportfs net/nfs-kernel-server
usr/sbin/rpc.mountd net/nfs-kernel-server,net/nfs-user-server
usr/sbin/rpc.nfsd net/nfs-kernel-server,net/nfs-user-server
usr/share/doc/nfs-kernel-server/NEWS.Debian.gz net/nfs-kernel-server
usr/share/doc/nfs-kernel-server/README net/nfs-kernel-server
usr/share/doc/nfs-kernel-server/changelog.Debian.gz net/nfs-kernel-server
usr/share/doc/nfs-kernel-server/changelog.gz net/nfs-kernel-server
usr/share/doc/nfs-kernel-server/copyright net/nfs-kernel-server
usr/share/man/man5/exports.5.gz net/nfs-kernel-server,net/nfs-user-server
usr/share/man/man7/nfsd.7.gz net/nfs-kernel-server
usr/share/man/man8/exportfs.8.gz net/nfs-kernel-server
usr/share/man/man8/mountd.8.gz net/nfs-kernel-server
usr/share/man/man8/nfsd.8.gz net/nfs-kernel-server
usr/share/man/man8/rpc.mountd.8.gz net/nfs-kernel-server,net/nfs-user-server
usr/share/man/man8/rpc.nfsd.8.gz net/nfs-kernel-server,net/nfs-user-server

additionally these kernel-module are needed:

lib/modules/2.4.20_mipsel_linkstation/kernel/net/sunrpc/sunrpc.o
lib/modules/2.4.20_mipsel_linkstation/kernel/fs/nfsd/nfsd.o
lib/modules/2.4.20_mipsel_linkstation/kernel/fs/lockd/lockd.o

The source kernel published from Buffalo already contains these modules and they are activated by the following lines in .config:

CONFIG_NFS_FS=m
CONFIG_NFSD=m
CONFIG_NFSD_V3=y
CONFIG_NFSD_TCP=y

Now I applied some patches from the "nfs-guru" Trond Myklebust (some have to be edited by hand, because the vanilla-sources had already been changed). For the maximum block size there exists a patch from Neil Brown, that adjusts the block size to PAGE_SIZE.

Now the kernel-modules have to be recompiled and copied into the directories listed above. After that recreate the dependencies of the modules with depmod -a .

Additionally I needed the file /etc/rpc. This file is contained in the packet netbase. I copied it from another Debian System. For the portmapper the directory /var/run has to be created.

Testing

Add nfs-shares to /etc/exports:

# /etc/exports: the access control list for filesystems which may be exported
# to NFS clients. See exports(5).
/mnt/hda/share dbox(rw,async,no_root_squash)

The directory /mnt/hda/share is exported for the host dbox without restrictions. This example can be found as /etc/exports.sample in the archive. Changes to this file are applied with the command exportfs -r. Shares are checked with showmount -e.

In the first run start the services by hand and check for errors (/var/log/messages):

/etc/init.d/portmap start
/etc/init.d/nfs-kernel-server start
/etc/init.d/nfs-common start

If you encounter problems first stop the service (etc/init.d/... stop), change config and start it again.

If all services are started without errors, then use lsmod to check whether the kernel modules were loaded.

Now mount the share from another host:

mount -t nfs -o nfsvers=3,rsize=32768,wsize=32768 nas:/mnt/hda/share /mnt 

nas has to be changed to the hostname or ip of the LinkStation. If the command returns without an error, you should test extensively. At the end the following links are needed for automatik start and stop of the services:


cd /etc/rc.d/rc2.d
ln -s ../init.d/nfs-common K79nfs-common
ln -s ../init.d/nfs-kernel-server K80nfs-kernel-server
ln -s ../init.d/portmap S32portmap
#
cd /etc/rc.d/rc2.d
ln -s ../init.d/portmap S18portmap
ln -s ../init.d/nfs-kernel-server S20nfs-kernel-server
ln -s ../init.d/nfs-common S21nfs-common
#
cd /etc/rc.d/rc6.d
ln -s ../init.d/nfs-common K79nfs-common
ln -s ../init.d/nfs-kernel-server K80nfs-kernel-server
ln -s ../init.d/portmap S32portmap

Performance

Measurement with bonnie++ of a Linux Notebook (Debian Sarge, kernel 2.6.). The LinkStation was mounted with:

mount -t nfs -o nfsvers=3,rsize=32768,wsize=32768 nas:/mnt/hda/share /mnt

Version 1.03 ------Sequential Output------ --Sequential Input- --Random-
-Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
blue 1G 7404 29 7541 1 3911 36 10213 45 10517 2 175.4 1
------Sequential Create------ --------Random Create--------
-Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP
16 155 2 388 82 508 4 156 2 1377 6 381 4

Download

Download the tar-archive here. Unpack the archive with tar zxvf Dateiname -C / auspacken, type depmod -a and continue with the chapter Testing.