Linux mount remote filesystems automatically at boot time

by on October 2, 2006 · 1 comment· Last updated October 2, 2006

Now you know how to mount a NFS or Windows/Samba remote file system. It is time to mount remote filesystems automatically at boot time using /etc/fstab (another possibility is mount local and remote file system on demand using autofs service).

Mount Remote NFS File system

The file /etc/fstab - stores static information about the filesystems. It contains descriptive information about the various file systems. fstab is only read by programs, and not written; it is the duty of the system administrator to properly create and maintain this file. Each filesystem is described on a separate line; fields on each line are separated by tabs or spaces. Lines starting with '#' are comments. Use following syntax to mount NFS fs:
{NFSServer}:{/remote/path/2/export} {/mnt/nfs} nfs {NFS-Options} 0 0

For example:
# mkdir /mnt/sales
# vi /etc/fstab

Append following line:
nfsserver.nixcraft.in:/data/sales /mnt/sales nfs defaults 0 0

Save and close the file.

Where,

  • nfsserver.nixcraft.in: Remote NFS server name (you can use IP address or FQDN)
  • /data/sales: Remote shared (exported) directory
  • /mnt/sales: Local mount point
  • nfs: File system type

You can specify comma separated list of NFS options as described in mount and fstab man pages. For example:
nfsserver.nixcraft.in:/data/sales /mnt/sales nfs nocto, rsize=32768,wsize=32768 0 0

Mount Remote Windows server /Samba (CIFS) File system

Please refer earlier article.



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 1 comment… read it below or add one }

1 Czar October 3, 2006 at 12:49 pm

In this brief blog entry I will note the steps it took for me to use the Network File System (NFS) protocol to share files between another Linux computer.

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <blockquote> <pre> <a href="" title="">
What is 12 + 4 ?
Please leave these two fields as-is:
Solve the simple math so we know that you are a human and not a bot.



Previous post:

Next post: