Jul 02

Synology NAS

 

 

Some tips and tricks to help get the most out of your Synology NAS.

 

 

 

 

Index:

 

Accessing the root Account.

Sometimes you need to do things as the root user. To gain access to the root account is a multi-step process. Here’s what I do:

Fire up Putty and login as the admin user. The password will be the same as the admin user you setup when you initially configured your NAS. In order to get a Putty session established, you will need to ensure SSH is enabled. To do that, open up Control Panel, click Terminal & SNMP and check the Enable SSH service box.

Once you’re logged in as admin, enter this command:

admin@YOURNAS:/$ sudo su -
Password: <your admin password>
root@YOURNAS:~#

 

Adding Entries to /etc/hosts.

One thing you’ll need root access for is adding entries to the /etc/hosts file. This is useful if you want to take advantage of hostname resolution when setting up NFS client access on your NAS. You can use the IP address of NFS clients, so it’s not strictly necessary to add entries to /etc/hosts. Note, your custom entries to /etc/hosts do survive a DiskStation Manager (DSM) upgrade. You can use vi to edit /etc/hosts.

 

Setting Up NFS Access.

To conserve space on your Linux servers, it’s often a good idea to store Oracle media on an NFS drive rather than directly on the server itself. Setting up NFS access is a two stage process. Stage one is to setup NFS permissions via the DSM. Stage two is to configure an NFS share on your Linux server.

Stage One:

After creating a volume using the DSM, you’ll need to configure NFS client access to that volume.

In DSM open up Control Panel. Click on Shared Folder. Right click the relevant volume, then click Edit. Once you’re in the Edit window, click on the NFS Permissions tab. Click the Create button. This will enable you to create an NFS rule. I use these entries:

 

Field Value
Hostname or IP*: NFS client IP or hostname (from /etc/hosts)
Privilege: Read/Write
Squash: No mapping (allows file ownership changes)
Enable asynchronous Check
Allow connections from non-privileged ports Leave Unchecked
Allow users to access mounted subfolders Check

Click OK and the NAS will process your changes. That’s the NAS side of things completed.

 

Stage Two:

The second stage is to add some configuration to the Linux server.

Add a mount point directory in the root file system. Let’s call it nas (how original!):

[root@orasvr01 ~]$ cd /
[root@orasvr01 /]$ mkdir nas

 

Make the mount point directory accessible to everyone:

[root@orasvr01 ~]# chmod 777 /nas

 

Edit the /etc/fstab to include this entry:

YOURNAS:/volume1/NASNFS   /nas   nfs     rw,intr,rsize=16384,wsize=16384,timeo=10 0 0

 

where:

Value Meaning
YOURNAS Name of your NAS device
/volume1/NASNFS Name of the volume you created using DSM
/nas Name of the mount point directory
nfs Type of file system

 

Save /etc/fstab, then mount the NFS share using this command:

[root@orasvr01 ~]# mount –all

 

This will scan the /etc/fstab and mount any currently unmounted file systems.

Verify your NFS share is mounted using this command:

[root@orasvr01 ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_orasvr01-lv_root
                       31G   12G   18G  40% /
tmpfs                 3.9G   72K  3.9G   1% /dev/shm
/dev/xvdb1            477M  123M  325M  28% /boot
/dev/xvdc1             30G   23G  6.8G  78% /u01
/dev/xvdd1             30G   45M   30G   1% /u02
YOURNAS:/volume1/NASNFS
                      3.6T  1.1T  2.6T  30% /nas

There you have it! Your Linux server now has additional file system storage coming from your NAS.