annotate content/Coding/015-synology-ubuntu.rst @ 23:e4f02a31925d

New blog post for moving simulators to GitHub.
author Brian Neal <bgneal@gmail.com>
date Thu, 02 Jul 2020 15:20:39 -0500
parents 7ce6393e6d30
children
rev   line source
bgneal@4 1 Mounting a Synology DiskStation on Ubuntu 12.04
bgneal@4 2 ###############################################
bgneal@4 3
bgneal@4 4 :date: 2012-05-01 20:45
bgneal@4 5 :tags: Linux, Ubuntu, Synology
bgneal@4 6 :slug: mounting-a-synology-diskstation-on-ubuntu-12.04
bgneal@4 7 :author: Brian Neal
bgneal@4 8
bgneal@4 9 I have a Synology DiskStation that I use for a home NAS. I didn't take good
bgneal@4 10 notes when I got it to work with Ubuntu 10.04, so I had to fumble about when I
bgneal@4 11 upgraded to Ubuntu 12.04 last weekend. So for next time, here is the recipe I
bgneal@4 12 used.
bgneal@4 13
bgneal@4 14 First, you need to install the **cifs-utils** package::
bgneal@4 15
bgneal@4 16 $ sudo apt-get install cifs-utils
bgneal@4 17
bgneal@4 18 Next, I added the following text to my ``/etc/fstab`` file::
bgneal@4 19
bgneal@4 20 //192.168.1.2/shared /mnt/syn cifs noauto,iocharset=utf8,uid=1000,gid=1000,credentials=/home/brian/.cifspwd 0 0
bgneal@4 21
bgneal@4 22 Take note of the following:
bgneal@4 23
bgneal@4 24 * Replace ``//192.168.1.2/`` with the IP address or hostname of your
bgneal@4 25 DiskStation. Likewise, ``/shared`` is just the path on the DiskStation that I
bgneal@4 26 wanted to mount.
bgneal@4 27 * ``/mnt/syn`` is the mount point where the DiskStation will appear on our local
bgneal@4 28 filesystem.
bgneal@4 29 * I didn't want my laptop to mount the DiskStation on bootup, so I used the
bgneal@4 30 ``noauto`` parameter.
bgneal@4 31 * The ``uid`` and ``gid`` should match the user and group IDs of your Ubuntu
bgneal@4 32 user. You can find this by grepping your username in ``/etc/passwd``.
bgneal@4 33 * The ``credentials`` parameter should point to a file you create that contains
bgneal@4 34 the username and password of the DiskStation user you want to impersonate (see
bgneal@4 35 below).
bgneal@4 36
bgneal@4 37 Your ``.cifspwd`` file should look like the following::
bgneal@4 38
bgneal@4 39 username=username
bgneal@4 40 password=password
bgneal@4 41
bgneal@4 42 Obviously you'll want to use the real username / password pair of a user on your
bgneal@4 43 DiskStation.
bgneal@4 44
bgneal@4 45 To be paranoid, you should make the file owned by root and readable only by
bgneal@4 46 root. Do this after you get everything working::
bgneal@4 47
bgneal@4 48 $ sudo chown root:root .cifspwd
bgneal@4 49 $ sudo chmod 0600 .cifspwd
bgneal@4 50
bgneal@4 51 I created the mount point for the DiskStation with::
bgneal@4 52
bgneal@4 53 $ sudo mkdir -p /mnt/syn
bgneal@4 54
bgneal@4 55 Then, whenever I want to use the DiskStation I use::
bgneal@4 56
bgneal@4 57 $ sudo mount /mnt/syn
bgneal@4 58
bgneal@4 59 And to unmount it::
bgneal@4 60
bgneal@4 61 $ sudo umount /mnt/syn
bgneal@4 62
bgneal@4 63 You can avoid the ``mount`` and ``umount`` commands if you remove the
bgneal@4 64 ``noauto`` parameter from the ``/etc/fstab`` entry. In that case, Ubuntu will
bgneal@4 65 automatically try to mount the DiskStation at startup.