bgneal@4: Mounting a Synology DiskStation on Ubuntu 12.04 bgneal@4: ############################################### bgneal@4: bgneal@4: :date: 2012-05-01 20:45 bgneal@4: :tags: Linux, Ubuntu, Synology bgneal@4: :slug: mounting-a-synology-diskstation-on-ubuntu-12.04 bgneal@4: :author: Brian Neal bgneal@4: bgneal@4: I have a Synology DiskStation that I use for a home NAS. I didn't take good bgneal@4: notes when I got it to work with Ubuntu 10.04, so I had to fumble about when I bgneal@4: upgraded to Ubuntu 12.04 last weekend. So for next time, here is the recipe I bgneal@4: used. bgneal@4: bgneal@4: First, you need to install the **cifs-utils** package:: bgneal@4: bgneal@4: $ sudo apt-get install cifs-utils bgneal@4: bgneal@4: Next, I added the following text to my ``/etc/fstab`` file:: bgneal@4: bgneal@4: //192.168.1.2/shared /mnt/syn cifs noauto,iocharset=utf8,uid=1000,gid=1000,credentials=/home/brian/.cifspwd 0 0 bgneal@4: bgneal@4: Take note of the following: bgneal@4: bgneal@4: * Replace ``//192.168.1.2/`` with the IP address or hostname of your bgneal@4: DiskStation. Likewise, ``/shared`` is just the path on the DiskStation that I bgneal@4: wanted to mount. bgneal@4: * ``/mnt/syn`` is the mount point where the DiskStation will appear on our local bgneal@4: filesystem. bgneal@4: * I didn't want my laptop to mount the DiskStation on bootup, so I used the bgneal@4: ``noauto`` parameter. bgneal@4: * The ``uid`` and ``gid`` should match the user and group IDs of your Ubuntu bgneal@4: user. You can find this by grepping your username in ``/etc/passwd``. bgneal@4: * The ``credentials`` parameter should point to a file you create that contains bgneal@4: the username and password of the DiskStation user you want to impersonate (see bgneal@4: below). bgneal@4: bgneal@4: Your ``.cifspwd`` file should look like the following:: bgneal@4: bgneal@4: username=username bgneal@4: password=password bgneal@4: bgneal@4: Obviously you'll want to use the real username / password pair of a user on your bgneal@4: DiskStation. bgneal@4: bgneal@4: To be paranoid, you should make the file owned by root and readable only by bgneal@4: root. Do this after you get everything working:: bgneal@4: bgneal@4: $ sudo chown root:root .cifspwd bgneal@4: $ sudo chmod 0600 .cifspwd bgneal@4: bgneal@4: I created the mount point for the DiskStation with:: bgneal@4: bgneal@4: $ sudo mkdir -p /mnt/syn bgneal@4: bgneal@4: Then, whenever I want to use the DiskStation I use:: bgneal@4: bgneal@4: $ sudo mount /mnt/syn bgneal@4: bgneal@4: And to unmount it:: bgneal@4: bgneal@4: $ sudo umount /mnt/syn bgneal@4: bgneal@4: You can avoid the ``mount`` and ``umount`` commands if you remove the bgneal@4: ``noauto`` parameter from the ``/etc/fstab`` entry. In that case, Ubuntu will bgneal@4: automatically try to mount the DiskStation at startup.