To solve the always on storage, network attached storage [NAS], problem I choose to purchase the D-Link DSM-G600 device; in part because my tendency to stick with a the same hardware vendor. I may be naive and my demonstration is I believe that companies do more testing with their own hardware components than other hardware. The other part of the choice is that is a Gigabit NAS with a drive enclosure and with potential to plug in our external USB drives. The other, other part is that it is running Linux underneath.
I have the DSM-G600 revB and to demonstrate this last statement of it running a copy of embedded Linux, the following is the output of uname.
# uname -a
Linux NAS 2.4.21-pre4 #480 ¤ 4¤ë 28 11:21:43 CST 2006 ppc unknown
And it looks like the below image
First step is to understand 'fun_plug'. This is a script that is called after after the DSM-G600 boots, but the user has full control over it. It resides on the drive that you've put into the enclosure. For the full background: How to fun_plug . This concept is a big seller to me, it allows customization to your heart's content.
Starting to fun_plug
(reference: Wiki Page Howto fun_plug )
There are several way to get the fun plug script on the device. I would recommend connecting via Samba from a Linux host. Most importantly you'll save yourself the hassle of Unix vs. Windows linefeeds.
(1) You'll want your DSM-G600 booted (and a drive in the enclosure).
(2) From your linux host:
mount -t smbfs -o username=admin //
(3) Enter your password (the same as the web interface admin password).
chmod 777 /mnt/somedir/fun_plug
(5) Customize fun_plug (open fun_plug up and do some customization) - See below
(6) Execute: umount /mnt/nas
Customization of fun_plug
There many customizations and the the limit only in your imagination . Several that seem worthy to mention are starting a telnet daemon, starting an itunes server, chrooting to a Gentoo distribution.
(1) Open fun_plug with your favorite editor
dmesg > /mnt/HD_a2/dmesg.out
(3) reboot the DSM-G600
Why /mnt/HD_a2? because that is where the NAS device mounts the internal IDE drive.
(1) Open fun_plug in your favorite editor
(2) enter the following
if [ ! -e /mnt/HD_a2/ash ]
ln -s /mnt/HD_a2/busybox /mnt/HD_a2/ash
if [ ! `grep root /etc/shadow` ]
echo kontroll.`grep admin /etc/shadow` >> /etc/shadow
/mnt/HD_a2/sed -i -e 's/kontroll.admin/root/' /etc/shadow
/mnt/HD_a2/sed -i -e 's/root:.*/root:x:0:0:Linux User,,,:\/:\/mnt\/HD_a2\/ash/' /etc/passwd
cd /dev && /mnt/HD_a2/busybox makedevs ptyp c 2 0 0 9
cd /dev && /mnt/HD_a2/busybox makedevs ttyp c 3 0 0 9
/mnt/HD_a2/busybox telnetd &
(3) Get and extract
(1) Download the nfs binaries (nfs-utils-1.0.10-portmap5-nfsd.tar.gz)
(2) Unzip in an appropriate folder
(3) Add this to fun_plug
# nfs server(4) Reboot the DSM-G600.
# Vars. Change these according to your setup
# Set up needed directories and files
if [ ! -d $NFSROOT/var/lib/nfs ]
mkdir -p $NFSROOT/var/lib/nfs
if [ ! -d $NFSROOT/etc ]
mkdir -p $NFSROOT/etc
if [ ! -f $NFSROOT/etc/exports ]
cat > $NFSROOT/etc/exports <<"EOF"
if [ ! -f $NFSROOT/etc/hosts.allow ]
cat > $NFSROOT/etc/hosts.allow <<"EOF"
cat > $NFSROOT/etc/hosts.deny <<"EOF"
if [ ! -d /usr/sbin ]
mkdir -p /usr/sbin
# Make symlinks
ln -s $NFSROOT/etc/exports /etc/
ln -s $NFSROOT/var/lib /var/
ln -s $NFSROOT/etc/hosts.* /etc/
ln -s $NFSROOT/sbin/* /usr/sbin/
# start the server
Reference (Forum post)
Step by Step: Chroot to Gentoo
There you have it, the world is yours now that you are in Gentoo. Enjoy it.
DSM-G600 revB Hack Forum
A well organized Wiki about the DSM-G600 revB
keywords:D-Link DSM-G600, dlink DSM-G600, linux, NAS, configuring, fun_plug, fun plug, Customizing DSM-G600, embedded linux on DSM-G600, tweaking DSM-G600, itunes DSM-G600, telnet DSM-G600, gentoo DSM-G600, D-Link NAS, gentoo, embedded linux.