Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Automatically Mounting NFS File Systems with /etc/fstab
- include the hostname or the IP address of the NFS server, the exported directory, and the mount point on the local machine.
- sudo nano /etc/fstab
- Add the following line to the file:
- /etc/fstab
- # <file system> <dir> <type> <options> <dump> <pass>
- 10.10.0.10:/backups /var/backups nfs defaults 0 0
- Where 10.10.0.10 the NFS server IP address, /backup is the exported directory and /var/backups is the local mount point.
- Run the mount command in one of the following forms to mount the NFS share:
- mount /var/backups
- mount 10.10.0.10:/backups
- The mount command, will read the content of the /etc/fstab and mount the share.
- Next time you reboot the system the NFS share will be mounted automatically.
- Unmounting NFS File Systems
- umount followed by either the directory where it has been mounted or remote share:
- umount 10.10.0.10:/backups
- umount /var/backups
- If the NFS mount have an entry in the fstab file, remove it.
- The umount command will fail to detach the share when the mounted volume is in use. To find out which processes are accessing the NFS share, use the fuser command:
- fuser -m MOUNT_POINT
- Once you find the processes you can stop them with the kill command and unmount the NFS share.
- If you still have problems unmounting the share use the -l (--lazy) option which allows you to unmount a busy file system as soon as it is not busy anymore.
- umount -l MOUNT_POINT
- If the remote NFS system is unreachable, use the -f (--force) option to force an unmount.
- umount -f MOUNT_POINT
- How to Mount Windows Share on Linux using CIFS
- How to use SSHFS to Mount Remote Directories over SSH
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement