Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

It's only code: Linux Mint: Setup autofs to mount ... http://itsonlycode.blogspot.com/2015/02/linux-min...

More jaleelh9898@gmail.com Dashboard Sign Out

It's only code


Startseite Index Links Tools Articles Videos Impressum Datenschutz

SATURDAY, FEBRUARY 28, 2015 SEARCH THIS BLOG

Search
Linux Mint: Setup autofs to mount automatically NFS-shares from a Synology

OBJECTIVE ABOUT ME

I installed Linux Mint 17.1 Rebecca on a new computer and I want to access the NFS shares from my Follow 0
Synology Disk Station.
View my complete
profile
MOTIVATION

ARCHIVE
As my Synology is not always running 24/7 it would be nice just to mount the NFS shares on my client
computers on access and to avoid to integrate the shares statically in fstab. Integrating the shares in fstab ► 2018 (2)
would work, but I will always have to wait until a timeout is fullfilled while booting my computer, when the ► 2017 (1)
Synology is not running. I already set-up autofs for this "mount on demand" purpose on my laptop,
► 2016 (3)
which eves not always in the same network as my Synology.
▼ 2015 (8)

PREREQUISITES ► Jun (1)


► May (1)
► Apr (2)
Linux Mint 17.1 Rebecca
DS209+II ► Mar (2)
▼ Feb (2)
Linux Mint: Setup autofs to
SOLUTION
mount automatically NF...
Linux Mint: Move your home-
Install the autofs package directory into a separa...

Download and install the autofs package via the following command from a shell: ► 2014 (2)
► 2013 (3)
$> sudo apt-get install autofs
@CWSCHMIDT
you'll see some output like this: Tweets of @cwschmidt

Reading package lists... Done


Building dependency tree
Reading state information... Done
Recommended packages:
nfs-common
The following NEW packages will be installed:
autofs
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 281 kB of archives.
After this operation, 1.671 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ trusty-updates/main autofs amd64
5.0.7-3ubuntu3.1 [281 kB]
Fetched 281 kB in 0s (496 kB/s)
Selecting previously unselected package autofs.
(Reading database ... 158913 files and directories currently installed.)
Preparing to unpack .../autofs_5.0.7-3ubuntu3.1_amd64.deb ...
Unpacking autofs (5.0.7-3ubuntu3.1) ...
Processing triggers for ureadahead (0.100.0-16) ...
ureadahead will be reprofiled on next reboot

1 of 5 8/1/18, 10:58 AM
It's only code: Linux Mint: Setup autofs to mount ... http://itsonlycode.blogspot.com/2015/02/linux-min...

Processing triggers for man-db (2.6.7.1-1ubuntu1) ...


Setting up autofs (5.0.7-3ubuntu3.1) ...
Creating config file /etc/auto.master with new version
Creating config file /etc/auto.net with new version
Creating config file /etc/auto.misc with new version
Creating config file /etc/auto.smb with new version
Creating config file /etc/default/autofs with new version
autofs start/running, process 3481
Processing triggers for ureadahead (0.100.0-16) ...

Additionally install the nfs-common package, otherwise you won't be able to access the NFS shares.

$> sudo apt-get install nfs-common

Reading package lists... Done


Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libgssglue1 libnfsidmap2 libtirpc1 rpcbind
Suggested packages:
open-iscsi watchdog
The following NEW packages will be installed:
libgssglue1 libnfsidmap2 libtirpc1 nfs-common rpcbind
0 upgraded, 5 newly installed, 0 to remove and 0 not upgraded.
Need to get 342 kB of archives.
After this operation, 1.375 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://archive.ubuntu.com/ubuntu/ trusty/main libgssglue1 amd64
0.4-2ubuntu1 [19,7 kB]
Get:2 http://archive.ubuntu.com/ubuntu/ trusty/main libnfsidmap2 amd64
0.25-5 [32,2 kB]
Get:3 http://archive.ubuntu.com/ubuntu/ trusty/main libtirpc1 amd64
0.2.2-5ubuntu2 [71,3 kB]
Get:4 http://archive.ubuntu.com/ubuntu/ trusty-updates/main rpcbind amd64
0.2.1-2ubuntu2.1 [37,0 kB]
Get:5 http://archive.ubuntu.com/ubuntu/ trusty-updates/main nfs-common amd64
1:1.2.8-6ubuntu1.1 [182 kB]
Fetched 342 kB in 1s (288 kB/s)
Selecting previously unselected package libgssglue1:amd64.
(Reading database ... 158963 files and directories currently installed.)
Preparing to unpack .../libgssglue1_0.4-2ubuntu1_amd64.deb ...
Unpacking libgssglue1:amd64 (0.4-2ubuntu1) ...
Selecting previously unselected package libnfsidmap2:amd64.
Preparing to unpack .../libnfsidmap2_0.25-5_amd64.deb ...
Unpacking libnfsidmap2:amd64 (0.25-5) ...
Selecting previously unselected package libtirpc1:amd64.
Preparing to unpack .../libtirpc1_0.2.2-5ubuntu2_amd64.deb ...
Unpacking libtirpc1:amd64 (0.2.2-5ubuntu2) ...
Selecting previously unselected package rpcbind.
Preparing to unpack .../rpcbind_0.2.1-2ubuntu2.1_amd64.deb ...
Unpacking rpcbind (0.2.1-2ubuntu2.1) ...
Selecting previously unselected package nfs-common.
Preparing to unpack .../nfs-common_1%3a1.2.8-6ubuntu1.1_amd64.deb ...
Unpacking nfs-common (1:1.2.8-6ubuntu1.1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Processing triggers for ureadahead (0.100.0-16) ...
Setting up libgssglue1:amd64 (0.4-2ubuntu1) ...
Setting up libnfsidmap2:amd64 (0.25-5) ...
Setting up libtirpc1:amd64 (0.2.2-5ubuntu2) ...
Setting up rpcbind (0.2.1-2ubuntu2.1) ...
Removing any system startup links for /etc/init.d/rpcbind ...
rpcbind start/running, process 5972
Processing triggers for ureadahead (0.100.0-16) ...

2 of 5 8/1/18, 10:58 AM
It's only code: Linux Mint: Setup autofs to mount ... http://itsonlycode.blogspot.com/2015/02/linux-min...

Setting up nfs-common (1:1.2.8-6ubuntu1.1) ...


Creating config file /etc/idmapd.conf with new version
Creating config file /etc/default/nfs-common with new version
Adding system user `statd' (UID 115) ...
Adding new user `statd' (UID 115) with group `nogroup' ...
Not creating home directory `/var/lib/nfs'.
statd start/running, process 6205
gssd stop/pre-start, process 6239
idmapd start/running, process 6286
Processing triggers for libc-bin (2.19-0ubuntu6.6) ...
Processing triggers for ureadahead (0.100.0-16) ...

Configure autofs

First create the destination directory where you want to mount the directories of your NFS server into. In
my case this is below /mnt/DiskStation

$> sudo mkdir -p /mnt/DiskStation

Now add your exported NFS-Shares root-directory from your server to the "/etc/auto.master":

/mnt/DiskStation /etc/auto.nfs

$> gksu gedit /etc/auto.master

#
# Sample auto.master file
#
# ...
#
#/misc /etc/auto.misc
#/net -hosts
#
# Include /etc/auto.master.d/*.autofs
#
+dir:/etc/auto.master.d
#
# Include central master map if it can be found using
# nsswitch sources.
#
# ...
#
+auto.master
/mnt/DiskStation /etc/auto.nfs

Create a "/etc/auto.nfs" with the following content (where "192.168.0.99" is the IP of your Synology
and "data" is the name of the exported directory):
data 192.168.0.99:/volume1/data

Finally restart autofs

$> sudo service autofs restart

autofs stop/waiting
autofs start/running, process 4084

Done. Now you should be able to access the files from your Synology at /mnt/DiskStation/data.

More information on autofs can be found here.

3 of 5 8/1/18, 10:58 AM
It's only code: Linux Mint: Setup autofs to mount ... http://itsonlycode.blogspot.com/2015/02/linux-min...

Posted by Christian Schmidt at 9:22 PM

Labels: install, Linux, Mint, NFS

No comments:

Post a Comment

Enter your comment...

Comment as: Jaleel (Google) Sign out

Publish Preview Notify me

Newer Post Home Older Post

Subscribe to: Post Comments (Atom)

Christian Schmidt, Regensburg, 2010 - 2015. Picture Window theme. Powered by Blogger.

4 of 5 8/1/18, 10:58 AM
It's only code: Linux Mint: Setup autofs to mount ... http://itsonlycode.blogspot.com/2015/02/linux-min...

5 of 5 8/1/18, 10:58 AM

You might also like