September 2011

Don’t DHCP Your NAS

Laughing already?

I had DHCP set up for the NAS because that’s the default. This was fine until the Verizon router forgot the DNS entry for the NAS. To restore it, I rebooted the NAS, causing it to ask for an IP again. I’ve restarted the NAS before while Ubuntu had directories mounted from it and it was fine with that. This time, the IP changed and Ubuntu was very unhappy about it. I couldn’t unmount the directories either. A shut down was necessary to restore order.

Now I have the Verizon router, an Actiontec MI424-WR, set to assign it a static IP. This makes sure the IP is in the router’s DNS table without having to edit the clients’ /etc/hosts or use a naming service. To do this, log in to the router as admin and select Advanced -> IP Address Distribution -> Connection List, find the entry for the NAS and click the edit icon to the right. Make sure the NAS’s host name, IP and MAC address are correct and that Static Lease Type is checked.

Uncategorized

Comments (0)

Permalink

Running Out of Ethernet Ports

The FiOS router I have has four ports. Now that there’s a NAS in the family, I’ve got five Ethernet clients. I ordered a D-Link DGS-1008G 8-Port Gigabit Switch ($38 on Amazon). Just connect an Ethernet cable from one of its ports to one of the ports on the FiOS router and you’ve got 10 ports (4 on the FiOS and 8 on the switch, less 2 for the cable connecting them). No changes at all, it just works. And the gigabit Ethernet NICs on the HTPC and the Synology DiskStation were autodetected.

Uncategorized

Comments (0)

Permalink

Using the NAS for Home Folders

[Note: Don’t start following these directions until you’ve read this whole post. The NFS stuff was a dead end.]

I set up a user for myself on the NAS. Next, I need to connect the NAS to my home folder, so I can put the Documents, Music and Videos directories on it. The first step is to enable NFS on the client. In Ubuntu, install nfs-common with Synaptic. To automount directories, install autofs, which will install autofs5.
Synology -> Control Panel-> User, Create, then User Home and Enable User Home Service.
Synology -> Control Panel -> Shared Folder, select homes, NFS Privileges, Create. Add network segment, e.g., 192.168.1.0/24 and read/write. Note mount path at bottom.
On Ubuntu:
$ sudo mount -t nfs4 nas:/volume1/homes /mnt
mount.nfs4: mounting nas:/volume1/homes failed, reason given by server:
No such file or directory
$ sudo mount -t nfs nas:/volume1/homes /mnt
or
$ sudo mount nas:/volume1/homes /mnt

work fine, but now I’m concerned with security because NFS doesn’t validate connections by user, but by host and I don’t have common user IDs across my machines.

Synology has a forum post on linking network drives that uses CIFS. I tried this:

$ mkdir ~/nas
As root, edit /etc/fstab:
//nas/home /home/me/nas cifs user,uid=me,gid=me,rw,suid,credentials=/home/me/.naspwd 0 0

Edit ~/.naspwd:
username=nas username
password=nas password
# chmod 0600 ~/.naspwd

As me,
$ mount ~/nas
mount: wrong fs type, bad option, bad superblock on //nas/home,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount. helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so

dmesg says:
CIFS VFS: No username specified
CIFS VFS: cifs_mount failed w/return code = -22

Other instructions on the Net use Samba, so I tried that. Installed packages samba, samba-tools, smbfs, samba-doc, xsmbrowser. (You really only need smbfs.)

Now this works:
# sudo mount -t smbfs //nas/home ~/nas -o username=nas username,password=nas pwd
So does this:
# sudo mount -t smbfs //nas/home ~/nas -o credentials=/home/me/.naspwd

As root, edit /etc/fstab and change file system type from cifs to smbfs.

(When later updating another machine, I found out it was smbfs that was needed by cifs, so you can use cifs in /etc/fstab if you want instead of smbfs.)

Now, as root
# sudo mount /home/me/nas
works, but if I run it as me, I get
mount error(1): Operation not permitted
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

But this is good enough to have my home directory on the Synology DiskStation automatically mapped to ~/nas on the client. From there, I moved my common directories (e.g., Documents, Videos, and Music) to the NAS directory and made them soft links to the NAS:
$ cp -r ~/Documents ~/nas
$ mv ~/Documents ~/Documents-old
$ ln -s ~/nas/Documents ~/.

Uncategorized

Comments (0)

Permalink

Synology NAS

I bought a Synology DiskStation DS411+II and two Western Digital 2 TB Enterprise Hard Drives (WD2002FYPS). Installing the drives was easy and set up has been too, so far. It’s currently building a RAID 1 disk volume and should be done in four hours.
The only issue at this point has been that after setting the NAS’s host name, the Verizon router still had it in DNS as DiskStation (the default). After setting the host name during set up the NAS didn’t renew its DNS. Having the unit reboot fixed that.

Uncategorized

Comments (0)

Permalink