NFS server on Synology 101g+
Update
Synology now supports SSH logins and NFS services via a patch and firmware upgrade respectively. You're most probably better off using the officially provided packages and patches instead of the one described on this page.Telnet
First we need to enable telnet access to the box. There is a package that can be installed via the Synology upgrade function. Get syno-telnet-r3.zip from http://oinkzwurgl.org/diskstation and extract enabletelnet.pat. Then, from the web GUI:
Tools - Update -upload enabletelnet.pat
After that you should be able to telnet into the box:
telnet nas1 root/synopass
ipkg
Next is to install the ipkg package management system. See here for a list of available packages.
Copy ds101-bootstrap_0.1-8_powerpc.xsh to /public, then telnet into the NAS:
telnet nas1 (root / synopass)
Bootstrap the ipkg package management system:
nas1> sh ds101-bootstrap_0.1-8_powerpc.xsh
DS-101 Bootstrap extracting archive... please wait
bootstrap
bootstrap/bootstrap.ipk
bootstrap/ipkg.ipk
bootstrap/openssl.ipk
bootstrap/wget-ssl.ipk
bootstrap/bootstrap.sh
bootstrap/ipkg.sh
Creating temporary ipkg repository...
Installing DS101(g)-bootstrap package...
Unpacking bootstrap.ipk...Done.
Configuring bootstrap.ipk...
Adding /opt/lib to dynamic linker configuration...
Regenerating dynamic linker cache...
Modifying /etc/profile...
Modifying /etc/rc.local
Done.
Installing IPKG package... (Ignore missing md5sum warning)
Unpacking ipkg.ipk...Done.
Configuring ipkg.ipk..../ipkg.sh: 1170: md5sum: not found
Done.
Removing temporary ipkg repository...
Instaling OpenSSL..
Installing openssl (0.9.7d-4) to root...
Configuring openssl
Successfully terminated.
Instaling wget-SSL...
Installing wget-ssl (1.10-1) to root...
Configuring wget-ssl
Successfully terminated.
Creating /opt/etc/ipkg/cross-feed.conf...
Setup complete...BusyBox v1.00-pre2 (2006.02.14-03:44+0000) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
Update the package database
nas1> ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/Packages.gz
Updated list of available packages in /opt/var/lib/ipkg/cross
Successfully terminated.
NFS
Once ipkg is installed we can install the required NFS packages. We will need the nfsd.o Kernel module as well as the nfs-utils package. The NFS packages are here.
nas1> ipkg install kernel-modules-nfsd
Installing kernel-modules-nfsd (2.4.22-2) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/kernel-modules-nfsd_2.4.22-2_powerpc.ipk
Configuring kernel-modules-nfsd
Successfully terminated.
This installs the Kernel module into /opt/lib/modules/nfsd.o. Load it with:
insmod /opt/lib/modules/nfsd.o
Now install the nfs-utils package:
nas1> ipkg install nfs-utils
Installing nfs-utils (1.0.7-5) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/nfs-utils_1.0.7-5_powerpc.ipk
Configuring nfs-utilsTo complete the installation, you must edit /opt/etc/exports,
and then run /opt/etc/init.d/S56nfs-utils to start the nfs server.Successfully terminated.
Add your network to /etc/hosts.allow:
cat <<EOF>>/etc/hosts.allow
rtmap: 192.168.5.0/255.255.255.0
lockd: 192.168.5.0/255.255.255.0
mountd: 192.168.5.0/255.255.255.0
rquoted: 192.168.5.0/255.255.255.0
statd: 192.168.5.0/255.255.255.0
EOF
Now start portmap and the NFS server
/opt/etc/init.d/S55portmap/opt/etc/init.d/S56nfs-utils
You should now be able to mount the shared volume from any box in the 192.168.5.0/24 network.
Add the following line to /etc/fstab on a client machine:
nas1:/volume1/public /mnt/nas1/public nfs rw 0 0
Then create the mount point:
sudo mkdir -p /mnt/nas1/public
and mount the NFS share:
sudo mount /mnt/nas1/public
SSH
Enabling SSH is just as easy. Install openssh package:
ipkg install openssh
And, from a client machine:
ssh admin@nas1
Hello, its me again... The
Hello, its me again...
The whole thing worked but, as I've discovered now, there's a little problem: on my ds-106j the boottime increased from 1 to about 7 minutes! Is this supposed to happen?
Or does anyone know what to do against it?
Jup, the same for me, thanks
Jup, the same for me, thanks very much! I'm very happy with my DS106-j now!!
I'm on the edge of buying
I'm on the edge of buying the DS207 ... would this box allow the same modifications ?
For the DS207 I have a
For the DS207 I have a working solution with the kernel nfsd module detailed there: http://www.courville.org/mediawiki/index.php/Synology
I finally found that I
I finally found that I needed to install first glibc-dev in order to have all the needed source files.
Arnaud
Hello, I tried your
Hello, I tried your suggested solution for the DS207 but was unable to cross compile the kernel.
I get the following errors :
arnaud@debian:~/dev/nfs/synogpl-462/linux-2.6.15$ make ARCH=ppc menuconfig
HOSTCC scripts/basic/fixdep
scripts/basic/fixdep.c:105:23: error: sys/types.h: No such file or directory
scripts/basic/fixdep.c:106:22: error: sys/stat.h: No such file or directory
scripts/basic/fixdep.c:107:22: error: sys/mman.h: No such file or directory
scripts/basic/fixdep.c:108:20: error: unistd.h: No such file or directory
scripts/basic/fixdep.c:109:19: error: fcntl.h: No such file or directory
scripts/basic/fixdep.c:110:20: error: string.h: No such file or directory
scripts/basic/fixdep.c:111:20: error: stdlib.h: No such file or directory
scripts/basic/fixdep.c:112:19: error: stdio.h: No such file or directory
In file included from /usr/lib/gcc/i486-linux-gnu/4.1.2/include/syslimits.h:7,
from /usr/lib/gcc/i486-linux-gnu/4.1.2/include/limits.h:11,
from scripts/basic/fixdep.c:113:
/usr/lib/gcc/i486-linux-gnu/4.1.2/include/limits.h:122:61: error: limits.h: No such file or directory
scripts/basic/fixdep.c:114:19: error: ctype.h: No such file or directory
scripts/basic/fixdep.c:115:23: error: arpa/inet.h: No such file or directory
scripts/basic/fixdep.c: In function ‘usage’:
scripts/basic/fixdep.c:129: warning: implicit declaration of function ‘fprintf’
scripts/basic/fixdep.c:129: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/basic/fixdep.c:129: error: ‘stderr’ undeclared (first use in this function)
scripts/basic/fixdep.c:129: error: (Each undeclared identifier is reported only once
scripts/basic/fixdep.c:129: error: for each function it appears in.)
scripts/basic/fixdep.c:130: warning: implicit declaration of function ‘exit’
scripts/basic/fixdep.c:130: warning: incompatible implicit declaration of built-in function ‘exit’
scripts/basic/fixdep.c: In function ‘print_cmdline’:
scripts/basic/fixdep.c:135: warning: implicit declaration of function ‘printf’
scripts/basic/fixdep.c:135: warning: incompatible implicit declaration of built-in function ‘printf’
scripts/basic/fixdep.c: At top level:
scripts/basic/fixdep.c:138: error: ‘NULL’ undeclared here (not in a function)
scripts/basic/fixdep.c: In function ‘grow_config’:
scripts/basic/fixdep.c:151: warning: implicit declaration of function ‘realloc’
scripts/basic/fixdep.c:151: warning: assignment makes pointer from integer without a cast
scripts/basic/fixdep.c:153: warning: implicit declaration of function ‘perror’
scripts/basic/fixdep.c:153: warning: incompatible implicit declaration of built-in function ‘exit’
scripts/basic/fixdep.c: In function ‘is_defined_config’:
scripts/basic/fixdep.c:169: warning: implicit declaration of function ‘memcmp’
scripts/basic/fixdep.c: In function ‘define_config’:
scripts/basic/fixdep.c:182: warning: implicit declaration of function ‘memcpy’
scripts/basic/fixdep.c:182: warning: incompatible implicit declaration of built-in function ‘memcpy’
scripts/basic/fixdep.c: In function ‘use_config’:
scripts/basic/fixdep.c:201: error: ‘PATH_MAX’ undeclared (first use in this function)
scripts/basic/fixdep.c:209: warning: incompatible implicit declaration of built-in function ‘memcpy’
scripts/basic/fixdep.c:215: warning: implicit declaration of function ‘tolower’
scripts/basic/fixdep.c:217: warning: incompatible implicit declaration of built-in function ‘printf’
scripts/basic/fixdep.c:201: warning: unused variable ‘s’
scripts/basic/fixdep.c: At top level:
scripts/basic/fixdep.c:220: error: expected declaration specifiers or ‘...’ before ‘size_t’
scripts/basic/fixdep.c: In function ‘parse_config_file’:
scripts/basic/fixdep.c:222: error: ‘len’ undeclared (first use in this function)
scripts/basic/fixdep.c:228: warning: implicit declaration of function ‘ntohl’
scripts/basic/fixdep.c:239: warning: implicit declaration of function ‘isalnum’
scripts/basic/fixdep.c: In function ‘strrcmp’:
scripts/basic/fixdep.c:252: warning: implicit declaration of function ‘strlen’
scripts/basic/fixdep.c:252: warning: incompatible implicit declaration of built-in function ‘strlen’
scripts/basic/fixdep.c: In function ‘do_config_file’:
scripts/basic/fixdep.c:263: error: storage size of ‘st’ isn’t known
scripts/basic/fixdep.c:267: warning: implicit declaration of function ‘open’
scripts/basic/fixdep.c:267: error: ‘O_RDONLY’ undeclared (first use in this function)
scripts/basic/fixdep.c:269: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/basic/fixdep.c:269: error: ‘stderr’ undeclared (first use in this function)
scripts/basic/fixdep.c:271: warning: incompatible implicit declaration of built-in function ‘exit’
scripts/basic/fixdep.c:273: warning: implicit declaration of function ‘fstat’
scripts/basic/fixdep.c:275: warning: implicit declaration of function ‘close’
scripts/basic/fixdep.c:278: warning: implicit declaration of function ‘mmap’
scripts/basic/fixdep.c:278: error: ‘PROT_READ’ undeclared (first use in this function)
scripts/basic/fixdep.c:278: error: ‘MAP_PRIVATE’ undeclared (first use in this function)
scripts/basic/fixdep.c:278: warning: assignment makes pointer from integer without a cast
scripts/basic/fixdep.c:285: error: too many arguments to function ‘parse_config_file’
scripts/basic/fixdep.c:287: warning: implicit declaration of function ‘munmap’
scripts/basic/fixdep.c:263: warning: unused variable ‘st’
scripts/basic/fixdep.c: At top level:
scripts/basic/fixdep.c:292: error: expected declaration specifiers or ‘...’ before ‘size_t’
scripts/basic/fixdep.c: In function ‘parse_dep_file’:
scripts/basic/fixdep.c:295: error: ‘len’ undeclared (first use in this function)
scripts/basic/fixdep.c:297: error: ‘PATH_MAX’ undeclared (first use in this function)
scripts/basic/fixdep.c:299: warning: implicit declaration of function ‘strchr’
scripts/basic/fixdep.c:299: warning: incompatible implicit declaration of built-in function ‘strchr’
scripts/basic/fixdep.c:301: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/basic/fixdep.c:301: error: ‘stderr’ undeclared (first use in this function)
scripts/basic/fixdep.c:302: warning: incompatible implicit declaration of built-in function ‘exit’
scripts/basic/fixdep.c:304: warning: incompatible implicit declaration of built-in function ‘memcpy’
scripts/basic/fixdep.c:305: warning: incompatible implicit declaration of built-in function ‘printf’
scripts/basic/fixdep.c:297: warning: unused variable ‘s’
scripts/basic/fixdep.c: In function ‘print_deps’:
scripts/basic/fixdep.c:334: error: storage size of ‘st’ isn’t known
scripts/basic/fixdep.c:338: error: ‘O_RDONLY’ undeclared (first use in this function)
scripts/basic/fixdep.c:340: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/basic/fixdep.c:340: error: ‘stderr’ undeclared (first use in this function)
scripts/basic/fixdep.c:342: warning: incompatible implicit declaration of built-in function ‘exit’
scripts/basic/fixdep.c:346: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/basic/fixdep.c:350: error: ‘PROT_READ’ undeclared (first use in this function)
scripts/basic/fixdep.c:350: error: ‘MAP_PRIVATE’ undeclared (first use in this function)
scripts/basic/fixdep.c:350: warning: assignment makes pointer from integer without a cast
scripts/basic/fixdep.c:357: error: too many arguments to function ‘parse_dep_file’
scripts/basic/fixdep.c:334: warning: unused variable ‘st’
scripts/basic/fixdep.c: In function ‘traps’:
scripts/basic/fixdep.c:369: warning: incompatible implicit declaration of built-in function ‘fprintf’
scripts/basic/fixdep.c:369: error: ‘stderr’ undeclared (first use in this function)
scripts/basic/fixdep.c:371: warning: incompatible implicit declaration of built-in function ‘exit’
make[1]: *** [scripts/basic/fixdep] Error 1
make: *** [scripts_basic] Error 2
So I downloaded both the .ko already compiled files ans installed them in /lib/modules/ with the others, did an insmod (wich worked fine as lsmod shows both).
But I a still unable to start nfsd : the script does a segmentation fault on exportfs -r...
the only case when it doesn't is when my exports file is empty.
Have you had that problem ?
Note : my firmware is a 514 version.
NFS on 106j - problem i try
NFS on 106j - problem
i try to install NFS on my 106j but something went wrong...
by sending the commands
ipkg update
ipkg install kernel-module-nfsd
insmod /opt/lib/modules/nfsd.o
ipkg install nfs-utils
i get an undocumented error and the system won´t react any more
DiskStation> ipkg update
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/Packages.gz
Inflating http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/Packages.gz
Updated list of available packages in /opt/var/lib/ipkg/cross
Successfully terminated.
DiskStation> ipkg install kernel-module-nfsd
Installing kernel-module-nfsd (2.4.22-4) to root...
Downloading http://ipkg.nslu2-linux.org/feeds/optware/ds101g/cross/stable/kernel-module-nfsd_2.4.22-4_powerpc.ipk
Configuring nfs-utils
Cannot register service: RPC: Unable to receive; errno = Connection refused
postinst script returned status 1
ERROR: nfs-utils.postinst returned 1
An error ocurred, return value: 1.
Collected errors:
Package kernel-module-nfsd wants to install file /opt/lib/modules/nfsd.o
But that file is already provided by package kernel-modules-nfsd
DiskStation> insmod /opt/lib/modules/nfsd.o
DiskStation> ipkg install nfs-utils
Package nfs-utils (1.0.7-5) installed in root is up to date.
Configuring nfs-utils
Any suggestions - a friend of mine was able to install it on the same model without problems...! :-(
Frank












No NFSD after reboot
No NFSD after reboot
Hi,
I used the "NFS server on Synology 101g+" guide to setup a nfs server on a DS106e and ran into two problems along the way.
The first is minor: The guide doesn't mention how to configure /opt/etc/exports.
The second is more severe:The nfs server doesn't work after reboot because /opt/lib/modules/nfsd.o isn't being found/loaded.
I added the line "insmod /opt/lib/modules/nfsd.o" to /opt/etc/init.d/S56nfs-utils just above where /opt/sbin/nfsd is started, which solved the problem but isn't very elegant.
Apart from that the "NFS server on Synology 101g+" guide was execellent help in getting an NFS server running on the DS106e. Thanks.
/Richard