Tuesday, 7 June 2011

Configure systems to mount ext4, LUKS-encrypted and network file systems automatically

The first part of this objective, Configure systems to mount ext4 file systems automatically  has been already discussed in previous posts, here, here.The second part, Configure systems to mount  LUKS-encrypted  file systems automatically, has been covered here.

The last part of the objective Configure systems to mount network file systems automatically is related to this objective, Mount and unmount cifs and nfs network file systems, all we need to do is make the mount permanent by adding to the /etc/fstab file.

NFS
 
Add the following line to your /etc/fstab file:
10:168.20.225:/inst  /distro                 nfs     defaults 0 0
This will mount the nfs share /inst on 10.168.20.225 to a directory called /distro, with default options.

CIFS

Add the following line to your /etc/fstab file:
\\10.168.20.112\c$ /test cifs cred=/cred.cifs 0 0
This will mount the c drive of 10.168.20.112 to /test. The cred.cifs file contains the credentials needed to mount the share. This file needs to have the following format:
username=value
password=value
domain=value
Of course, you could simply pass the credentials as options instead of a credentials file. Ensure that the file  /cred.cifs is only readable by the appropriate user(s).

No comments:

Post a Comment