About nixCraft

Topics

Linux mount remote filesystems automatically at boot time

Posted by Vivek Gite [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,

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.

Tell us how we're doing: Please answer a few questions about your experience to help us improve nixCraft.

You may also be interested in other helpful articles:

Discussion on This Article:

  1. Czar Says:

    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.

Leave a Reply

We encourage your comments, and suggestions. But please stay on topic, be polite, and avoid spam. Thank you very much for stopping by our site!

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Copyright © 2004-2008 nixCraft. All rights reserved - TOS/Disclaimer - Privacy policy - Sitemap - Powered by Open source software.