DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2006-11-29 17:07:49

art
Member
From: Germany
Registered: 2006-11-24
Posts: 8

Mounting NFS shares on the DSM

Hi all.

While poking around on the DSM, I noticed that /proc/filesystems reports that the kernel will support the NFS (Network file system). For those who are not familiar with it, here's a wikipedia link:
http://en.wikipedia.org/wiki/Network_File_System

For NFS to work, a portmapper is necessary. I managed to compile a tiny one (just ~30k in size), find it attached.
For security reasons, I suggest you make it bind to localhost only, e.g. add the following to your fun_plug:

Code:

# adjust the path below to match your bin directory
/mnt/HD_a2/.addons/bin/portmap -i 127.0.0.1

This should be sufficient to mount remote NFS shares on the device. You can check with ps if the portmap process is up.
It should listen on port 111 for connections. You can check this with netstat (find it attached as well):

netstat -nat should show a line

Code:

tcp        0      0 127.0.0.1:111           0.0.0.0:*               LISTEN

To mount a NFS share issue the following command on the DSM (or add it to your fun_plug if you need it always and you can make sure the remote server is up at DSM boot time):

Code:

mount -t nfs 123.45.67.89:/pub /mnt/nfs/pub

123.45.67.89 is the IP of the machine that exports the share under the path /pub.
If DNS works for your setup, you can of course also use the machines name.

In order to setup a NFS share on a linux box, check the export man page ("man export") for defails.
Basically it is as easy as starting the portmapper ("/etc/init.d/portmap start") and adding a line to /etc/exports as follows:

Code:

# export /pub for anybode (*) read only
/pub *(ro)

Finally you must start the nfs server:

Code:

/etc/init.d/nfs-kernel-server start || /etc/init.d/nfs-server start

Hope that might be useful for somebody. Unfortunately the DSMs default kernel does not support any other kind of network filesystem, e.g. smb. However, with NFS client support on the DSM, you could even access your (Win) PC's drives if you installed a NFS server on in. There's a wiki that describes how to do this with SFU (Microsoft(R) "Services for UNIX") but it's in german only:
http://wiki.tuxbox.org/NFS:SFU

Art

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB