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