Configuration NAS Mnemosyne: Difference between revisions

From miki
Jump to navigation Jump to search
 
(8 intermediate revisions by the same user not shown)
Line 4: Line 4:
* Device: '''Synology NAS DS409+'''
* Device: '''Synology NAS DS409+'''
* Name: '''Mnemosyne'''
* Name: '''Mnemosyne'''
* Disk Station Manager: '''http://mnemosyne:5000'''
* Disk Station Manager: '''http://mnemosyne:5000''', log in with admin account '''admin'''
* Admin account: '''admin''' (share same password as '''root@mnemosyne''')
* SSH: '''root@mnemosyne''' (same password as admin account)
* File location: '''<tt>/etc</tt>''', '''<tt>/usr/syno/etc/smb.conf</tt>'''
* Configuration files: '''<tt>/etc</tt>''', '''<tt>/usr/syno/etc/smb.conf</tt>'''


* uname
<source lang=bash>
uname -a
# Linux Mnemosyne 2.6.32.12 #3252 Thu Sep 4 13:54:10 CST 2014 ppc GNU/Linux
</source>


* Samba Version: '''3.0.20b'''
* Samba Version: '''3.0.20b'''
Line 17: Line 22:
* Mount requires to add '''<tt>iocharset=utf8</tt>''' on the client side
* Mount requires to add '''<tt>iocharset=utf8</tt>''' on the client side


* To access from mobile phone (SMB), use <code>guest</code> account (no password, read-only access, except in <code>public</code> folder).


* NFS version: supports version 2, 3, 4.
* NFS version: supports version 2, 3, 4.
Line 23: Line 29:
</source>
</source>


== First install ==
== Configuration ==
=== First install ===
* Mounted 4 harddrives Western Digital Caviar Green 2TB WD20EADS
* Mounted 4 harddrives Western Digital Caviar Green 2TB WD20EADS
* Plugged power & Ethernet (on home intranet), then power on.
* Plugged power & Ethernet (on home intranet), then power on.
Line 39: Line 46:
* Defined file sharing (windows,NFS)
* Defined file sharing (windows,NFS)


=== Web interface ===
== Configuration ==

=== Via web interface ===
{| class=wikitable
* System
|-
** Network
| System &mdash; Network
*** Server Name: '''[http://en.wikipedia.org/wiki/Mnemosyne Mnemosyne]'''
|
*** Network config: '''manual''' (because f*cking Belgacom BBox consistently loses my DHCP settings), IP:'''172.19.100.99''', DNS:'''172.19.3.1''' (2x)
* Server Name: '''[http://en.wikipedia.org/wiki/Mnemosyne Mnemosyne]'''
** Language
* Network config: '''manual''' (because f*cking Belgacom BBox consistently loses my DHCP settings), IP:'''172.19.100.99''', DNS:'''172.19.3.1''' (2x)
*** Display: '''English'''
|-
** Time
| System &mdash; Language
*** Time zone: '''(UTC+01:00) Brussels, Copenhagen, Madrid, Paris'''
|
** Notification
*** SMTP server: '''smtp.scarlet.be'''
* Display: '''English'''
|-
*** SMTP port: '''25'''
| System &mdash; Time
*** Primary mail: '''michael.peeters@scarlet.be'''
|
*** Secondary mail: '''michael.peeters@noekeon.be'''
* Time zone: '''(UTC+01:00) Brussels, Copenhagen, Madrid, Paris'''
** Power
|-
*** Scheduled Power On: '''Weekdays''', '''17:30'''
| System &mdash; Notification
*** Scheduled Power Off: '''Daily''', '''02:00'''
|
** Firmware Update:
* SMTP server: '''smtp.scarlet.be'''
*** Version: '''DSM 2.1-0844''' on '''2009/04/21''' (file '''synology_ppc853x_409+_0844.pat''')
* SMTP port: '''25'''
* Privileges
* Primary mail: '''michael.peeters@scarlet.be'''
** Users:
* Secondary mail: '''michael.peeters@noekeon.be'''
*** '''admin''' (admin user)
|-
*** '''guest''' (enabled)
| System &mdash; Power
*** '''archives''' (Store archives)
|
*** '''backup''' (User to create backup)
* Scheduled Power On: '''Weekdays''', '''17:30'''
*** '''movies''' (store movies)
* Scheduled Power Off: '''Daily''', '''02:00'''
*** '''musics''' (store musics)
|-
*** '''photos''' (Store photos)
| System &mdash; Firmware Update:
*** '''videos''' (Store videos)
|
** Shared folder
* Version: '''DSM 2.1-0844''' on '''2009/04/21''' (file '''synology_ppc853x_409+_0844.pat''')
*** '''archives''' (Archives SW, documents...) (group ''Users'': RO - user ''archives'': RW) (NFS RO: gryphon IP / Minimoy IP)
|-
*** '''backup''' (For PC backups) (group ''Users'': RO - user ''backup'': RW) (NFS RO: gryphon IP / Minimoy IP)
| Privileges &mdash; Users:
*** '''movies''' (DVD Movies, SVCD...) (group ''Users'': RO - user ''movies'': RW) (NFS RO: gryphon IP / Minimoy IP)
|
*** '''musics''' (Audio CD, mp3, ogg...) (group ''Users'': RO - user ''musics'': RW) (NFS RO: gryphon IP / Minimoy IP)
* '''admin''' (admin user)
*** '''photos''' (Photos album) (group ''Users'': RO - user ''photos'': RW:) (NFS RO: gryphon IP / Minimoy IP)
* '''guest''' (enabled)
*** '''public''' (Public folder) (group ''Users'': RW) (NFS RW: gryphon IP / RO: Minimoy IP)
* '''archives''' (Store archives)
*** '''videos''' (Family videos...) (group ''Users'': RO - user ''videos'': RW:) (NFS RO: gryphon IP / Minimoy IP)
* '''backup''' (User to create backup)
* Storage
* '''movies''' (store movies)
** Volume
* '''musics''' (store musics)
*** Volume 1: '''4''' disk volume, '''RAID 5''', '''Complete''' consistency check
* '''photos''' (Store photos)
* File Sharing
* '''videos''' (Store videos)
** Win/Mac OS
|-
*** Enable Windows file service: '''enabled'''
| Privileges &mdash; Shared folders:
**** '''Enable Windows file service'''
|
**** Workgroup: '''HELL'''
* '''archives''' (Archives SW, documents...) (group ''Users'': RO - user ''archives'': RW) (NFS RO: gryphon IP / Minimoy IP)
**** Optimize CIFS database operations: '''disabled''' (see [http://forum.synology.com/enu/viewtopic.php?f=111&t=11934])
* '''backup''' (For PC backups) (group ''Users'': RO - user ''backup'': RW) (NFS RO: gryphon IP / Minimoy IP)
**** Enable Local Master Broser: '''disabled'''
* '''movies''' (DVD Movies, SVCD...) (group ''Users'': RO - user ''movies'': RW) (NFS RO: gryphon IP / Minimoy IP)
**** Enable CIFS Recycle Bin: '''disabled'''
* '''musics''' (Audio CD, mp3, ogg...) (group ''Users'': RO - user ''musics'': RW) (NFS RO: gryphon IP / Minimoy IP)
*** Enable AppleTalk: '''disabled'''
* '''photos''' (Photos album) (group ''Users'': RO - user ''photos'': RW:) (NFS RO: gryphon IP / Minimoy IP)
** NFS
* '''public''' (Public folder) (group ''Users'': RW) (NFS RW: gryphon IP / RO: Minimoy IP)
*** NFS Service: '''enabled'''
* '''videos''' (Family videos...) (group ''Users'': RO - user ''videos'': RW:) (NFS RO: gryphon IP / Minimoy IP)
** Network Services
|-
*** Terminal: enable '''SSH''' service
| Storage &mdash; Volume
|
* Volume 1: '''4''' disk volume, '''RAID 5''', '''Complete''' consistency check
|-
| File Sharing &mdash; Win/Mac OS
|
* Enable Windows file service: '''enabled'''
** '''Enable Windows file service'''
** Workgroup: '''HELL'''
** Optimize CIFS database operations: '''disabled''' (see [http://forum.synology.com/enu/viewtopic.php?f=111&t=11934])
** Enable Local Master Broser: '''disabled'''
** Enable CIFS Recycle Bin: '''disabled'''
* Enable AppleTalk: '''disabled'''
|-
| File Sharing &mdash; NFS
|
* NFS Service: '''enabled'''
|-
| File Sharing &mdash; Network Services
|
* Terminal: enable '''SSH''' service
|}


=== Samba server ===
=== Samba server ===
Line 104: Line 133:
</source>
</source>


'''Old solution''' &mdash; Another solution is to enforce permissions on the server side. For this, edit {{file|/usr/syno/etc/smb.conf}}, and add to <code>[global]</code> section [http://simplescientist.net/2013/10/04/handing-unix-permissions-with-a-synology-file-server/]:
;Old configuration
Another solution is to enforce permissions on the server side. For this, edit {{file|/usr/syno/etc/smb.conf}}, and add to <code>[global]</code> section [http://simplescientist.net/2013/10/04/handing-unix-permissions-with-a-synology-file-server/]:
<pre>
<pre>
create mask=644
create mask=644
Line 118: Line 146:
Note this might interfere with synology defaults [http://superuser.com/questions/659547/setting-synology-dsm-default-cifs-permissions]. We don't apply this configuration because we use unison to backup the shares on a remote server, and the easiest solution is to sync permissions and uses 777/766 permission settings.
Note this might interfere with synology defaults [http://superuser.com/questions/659547/setting-synology-dsm-default-cifs-permissions]. We don't apply this configuration because we use unison to backup the shares on a remote server, and the easiest solution is to sync permissions and uses 777/766 permission settings.


== Statistics ==
=== Upgrade firmware ===
TBC
Some statistics related to our NAS


=== Install optware ===
{| class="wikitable"
TBC
|-

!Task!!Source||Size||Time||Rate
=== Extra packages ===
|-
To install via ipkg:
|DVD to NAS||Unicorn||4,23GB||15m48s||avg 4,687kB/s, peak 7,290kB/s
<source lang=bash>
|-
ipkg install screen
|DVD to NAS||Unicorn||4,32GB||16m03s||avg 4,708kB/s, peak 7,701kB/s
ipkg install tmux
|-
</source>
|DVD to NAS||Unicorn||3,93GB||14m34s||avg 4,717kB/s, peak 7,553kB/s
|-
|DVD to HDD||Unicorn||3,65GB||4m49s||avg 13,263kB/s, peak 19,393kB/s
|-
|HDD to NAS||Unicorn||3,65GB||~7m00s||avg 8,900kB/s
|-
|DVD to NAS||Unicorn||3,65GB||11m23s||avg 5,612kB/s, peak 7,848kB/s
|}


== How-To ==
== How-To ==
=== SSH ===
=== Enable SSH ===
* Enable '''SSH''' service
* Enable '''SSH''' service
* To have root access, log in as user '''root''', and use same password as '''admin''' account.
* To have root access, log in as user '''root''', and use same password as '''admin''' account.


=== Samba ===
=== Mount NAS samba share on client ===
* Need to specify explicitly '''utf8''' as charset:
Client must explicitly specify charset '''utf8''' in the mount line:
<source lang="bash">
<source lang="bash">
mount -t cifs //mnemosyne/photos /smb/mnemosyne/photos -o noperm,iocharset=utf8
mount -t cifs //mnemosyne/photos /smb/mnemosyne/photos -o noperm,iocharset=utf8
Line 153: Line 174:
</source>
</source>


=== NFS ===
=== Enable NFS ===
(See [http://www.linuxtopia.org/online_books/network_administration_guides/NFS_tutorial/index.html HOW-TO page here])
(See [http://www.linuxtopia.org/online_books/network_administration_guides/NFS_tutorial/index.html HOW-TO page here])
<ul>
<ul>
Line 202: Line 223:
</source>
</source>


== Compile ==
=== Compile Unison ===
=== Unison ===
See [[Unison]].
Instruction from Tom Booschaert ([http://forum.synology.com/enu/viewtopic.php?f=3&t=23945&p=101901&hilit=unison#p101901]).
<source lang="bash">
# install OCaml, Gnu C Compiler en Make:
ipkg install ocaml
ipkg install gcc
ipkg install make


== Command-line reference ==
# get Unison source and unpack:
TBC
mkdir Unison_tmp
== Statistics ==
cd Unison_tmp
Some statistics on NAS file transfer
wget http://www.seas.upenn.edu/~bcpierce/unison//download/releases/stable/unison-2.32.52.tar.gz
# Other versions:
# wget http://www.seas.upenn.edu/~bcpierce/unison//download/releases/unison-2.27.57/unison-2.27.57.tar.gz
tar -xzf unison-2.32.52.tar.gz


{| class="wikitable"
# use make to compile:
|-
cd unison-2.32.52
!Task!!Source||Size||Time||Rate
make NATIVE=false UISTYLE=text
|-

|DVD to NAS||Unicorn||4,23GB||15m48s||avg 4,687kB/s, peak 7,290kB/s
# copy executable to bin folder so it can be executed anywhere:
|-
cp unison /opt/bin/
|DVD to NAS||Unicorn||4,32GB||16m03s||avg 4,708kB/s, peak 7,701kB/s
</source>
|-

|DVD to NAS||Unicorn||3,93GB||14m34s||avg 4,717kB/s, peak 7,553kB/s
;Compilation error
|-
* When building with ocaml 3.12, we get the following error:
|DVD to HDD||Unicorn||3,65GB||4m49s||avg 13,263kB/s, peak 19,393kB/s
ocamlc -I lwt -I ubase -custom -g -c /root/build/tmp/unison-2.27.57/update.ml
|-
File "/root/build/tmp/unison-2.27.57/update.ml", line 1, characters 0-1:
|HDD to NAS||Unicorn||3,65GB||~7m00s||avg 8,900kB/s
Error: The implementation /root/build/tmp/unison-2.27.57/update.ml
|-
does not match the interface update.cmi:
|DVD to NAS||Unicorn||3,65GB||11m23s||avg 5,612kB/s, peak 7,848kB/s
Modules do not match:
|}
:This is a [https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=585453 known bug]. Patch file {{file|update.mli}} as follows (see [http://http.debian.net/debian/pool/main/u/unison2.32.52/unison2.32.52_2.32.52-7.debian.tar.gz]):
<source lang=bash>
sed -ri '/^module NameMap : Map/s/Map.S/MyMap.S/' update.mli
</source>

;test Unison
<source lang=bash>
unison -version
# unison version 2.27.57
unison -selftest
# Contacting server...
# Connected [//Mnemosyne//root/test-a.tmp -> //Mnemosyne//root/test-b.tmp]
# Running internal tests...
# backups 1 (local)...
# backups 2...
# backups 2a...
# backups 3...
# backups 4...
# backups 5 (directories)...
# backups 6 (backup prefix/suffix)...
# links 1 (directories and links)...
# links 2 (symlink to nowhere)...
# Success :-)
</source>

Latest revision as of 20:47, 9 September 2018

Reference Information

  • Device: Synology NAS DS409+
  • Name: Mnemosyne
  • Disk Station Manager: http://mnemosyne:5000, log in with admin account admin
  • SSH: root@mnemosyne (same password as admin account)
  • Configuration files: /etc, /usr/syno/etc/smb.conf
  • uname
uname -a
# Linux Mnemosyne 2.6.32.12 #3252 Thu Sep 4 13:54:10 CST 2014 ppc GNU/Linux
  • Samba Version: 3.0.20b
smbd -V
# Version 3.0.20b
  • Samba Configuration file: /usr/syno/etc/smb.conf
  • Mount requires to add iocharset=utf8 on the client side
  • To access from mobile phone (SMB), use guest account (no password, read-only access, except in public folder).
  • NFS version: supports version 2, 3, 4.
nfsstat -o all -234

Configuration

First install

  • Mounted 4 harddrives Western Digital Caviar Green 2TB WD20EADS
  • Plugged power & Ethernet (on home intranet), then power on.
  • (under Linux) Launched DSAssistant.i386... Server not found
  • (reboot in Windows) Launched Synology Assistant... found!
  • Step-by-step installation (see data below)
  • Disk formatting (system partition / data partition)
  • Logged into Disk Station Manager (see data below)
    • !!! login does not work with Internet Explorer (password not accepted) !!!
  • Set up language
  • Set up e-mail notification
  • Created volume
  • Created users
  • Created shared folders
  • Defined file sharing (windows,NFS)

Web interface

System — Network
  • Server Name: Mnemosyne
  • Network config: manual (because f*cking Belgacom BBox consistently loses my DHCP settings), IP:172.19.100.99, DNS:172.19.3.1 (2x)
System — Language
  • Display: English
System — Time
  • Time zone: (UTC+01:00) Brussels, Copenhagen, Madrid, Paris
System — Notification
  • SMTP server: smtp.scarlet.be
  • SMTP port: 25
  • Primary mail: michael.peeters@scarlet.be
  • Secondary mail: michael.peeters@noekeon.be
System — Power
  • Scheduled Power On: Weekdays, 17:30
  • Scheduled Power Off: Daily, 02:00
System — Firmware Update:
  • Version: DSM 2.1-0844 on 2009/04/21 (file synology_ppc853x_409+_0844.pat)
Privileges — Users:
  • admin (admin user)
  • guest (enabled)
  • archives (Store archives)
  • backup (User to create backup)
  • movies (store movies)
  • musics (store musics)
  • photos (Store photos)
  • videos (Store videos)
Privileges — Shared folders:
  • archives (Archives SW, documents...) (group Users: RO - user archives: RW) (NFS RO: gryphon IP / Minimoy IP)
  • backup (For PC backups) (group Users: RO - user backup: RW) (NFS RO: gryphon IP / Minimoy IP)
  • movies (DVD Movies, SVCD...) (group Users: RO - user movies: RW) (NFS RO: gryphon IP / Minimoy IP)
  • musics (Audio CD, mp3, ogg...) (group Users: RO - user musics: RW) (NFS RO: gryphon IP / Minimoy IP)
  • photos (Photos album) (group Users: RO - user photos: RW:) (NFS RO: gryphon IP / Minimoy IP)
  • public (Public folder) (group Users: RW) (NFS RW: gryphon IP / RO: Minimoy IP)
  • videos (Family videos...) (group Users: RO - user videos: RW:) (NFS RO: gryphon IP / Minimoy IP)
Storage — Volume
  • Volume 1: 4 disk volume, RAID 5, Complete consistency check
File Sharing — Win/Mac OS
  • Enable Windows file service: enabled
    • Enable Windows file service
    • Workgroup: HELL
    • Optimize CIFS database operations: disabled (see [1])
    • Enable Local Master Broser: disabled
    • Enable CIFS Recycle Bin: disabled
  • Enable AppleTalk: disabled
File Sharing — NFS
  • NFS Service: enabled
File Sharing — Network Services
  • Terminal: enable SSH service

Samba server

By default, directory created on shares have permissions 777. To change this, we disable CIFS extensions [2]:

unix extensions=no

To restart samba on the synology:

/usr/syno/etc/rc.d/S80samba.sh restart

Old solution — Another solution is to enforce permissions on the server side. For this, edit /usr/syno/etc/smb.conf, and add to [global] section [3]:

	create mask=644
	security mask=644
	directory mask=755
	directory security mask=755
	force create mode=644
	force security mode=644
	force directory mode=755
	force directory security mode=755

Note this might interfere with synology defaults [4]. We don't apply this configuration because we use unison to backup the shares on a remote server, and the easiest solution is to sync permissions and uses 777/766 permission settings.

Upgrade firmware

TBC

Install optware

TBC

Extra packages

To install via ipkg:

ipkg install screen
ipkg install tmux

How-To

Enable SSH

  • Enable SSH service
  • To have root access, log in as user root, and use same password as admin account.

Mount NAS samba share on client

Client must explicitly specify charset utf8 in the mount line:

mount -t cifs //mnemosyne/photos /smb/mnemosyne/photos -o noperm,iocharset=utf8

If you get the error mount error(13): Permission denied, you need to add the option sec:

mount -t cifs //mnemosyne/photos /smb/mnemosyne/photos -o noperm,iocharset=utf8,sec=ntlm

Enable NFS

(See HOW-TO page here)

  • Enabled NFS service
  • Edited NFS privilege for share volume1/backup, allow rw, for client minimoy
  • Then from NFS client, tried
  • sudo mkdir -p /net/mnemosyne/backup
    sudo mount mnemosyne:/volume1/backup /net/mnemosyne/backup
    # mount.nfs: access denied by server while mounting mnemosyne:/volume1/backup
    
  • Looking into NAS file /var/log/messages (need to ssh as root on the NAS), there is the line:
  • ... refused mount request from HOST00245402988d.HELL for /volume1/backup (/): no export entry
    
  • So it seems that the connection is refused because the DNS name of the NFS client does not match the export line in file /etc/exports
  • /volume1/backup minimoy.HELL(rw,no_wdelay,no_root_squash,insecure_locks,anonuid=0,anongid=0)
    


Found a working recipe on this page:

  • Content of file /etc/exports
  • /volume1/backup 172.19.100.102(rw,no_wdelay,no_root_squash,insecure_locks,anonuid=0,anongid=0)
    
  • Touched file /var/lib/nfs/rmtab (because non-existent) :
  • touch /var/lib/nfs/rmtab
    cd /
    /usr/sbin/exportfs -a            # Update list of exported filesystem
    
  • On NFS client, mount the NFS share with:
  • sudo mount mnemosyne:/volume1/backup /net/mnemosyne/backup
    


Open issues:

  • How to make it to work using hostname instead of IP addess?
    Additional problem is that at each boot DNS Relay table on the ADSL router is reset to 'HOSTxxxxxxxxxxx' for wired interface on the NFS client, hence making it not recognizable for the NFS server.
  • How to deal with Access Control? I want root to be mapped to nobody, and write access only allowed for one user (which requires password to login)?
    This can be done with the following export line:
/volume1/backup minimoy.HELL(rw,no_wdelay,root_squash,insecure_locks)

Compile Unison

See Unison.

Command-line reference

TBC

Statistics

Some statistics on NAS file transfer

Task Source Size Time Rate
DVD to NAS Unicorn 4,23GB 15m48s avg 4,687kB/s, peak 7,290kB/s
DVD to NAS Unicorn 4,32GB 16m03s avg 4,708kB/s, peak 7,701kB/s
DVD to NAS Unicorn 3,93GB 14m34s avg 4,717kB/s, peak 7,553kB/s
DVD to HDD Unicorn 3,65GB 4m49s avg 13,263kB/s, peak 19,393kB/s
HDD to NAS Unicorn 3,65GB ~7m00s avg 8,900kB/s
DVD to NAS Unicorn 3,65GB 11m23s avg 5,612kB/s, peak 7,848kB/s