From XennisWiki
Jump to: navigation, search

Before a user can access a file on a Unix-like machine, the file system that contains it needs to be mounted with the mount command. Frequently mount is used for SD card, USB storage, DVD and other removable storage devices. The mount command instructs the operating system that a file system is ready to use, and associates it with a particular point in the overall file system hierarchy (its mount point) and sets options relating to its access. Mounting makes file systems, files, directories, devices and special files available for use and available to the user. Its counterpart umount instructs the operating system that the file system should be disassociated from its mount point, making it no longer accessible and may be removed from the computer. It is important to umount a device before removing it since changes to files may have only partially been written and are completed as part of the umount. (Wikipedia)


Mount and unmount a NAS directory

Mount a NAS directory and check mounting

mount <nas-ip>:/example /media/myExample
df -h

Mount all

mount -a

Unmount /mnt/example

umount /mnt/example


List all mounted NFS shares

mount -t nfs

Mount NFS (Linux)

Mount a NFS directory

Install requirements

  • Debian apt-get nfs-common
  • Arch Linux: pacman -S nfs-utils

Create a folder, mount NAS and test it by creating a file

sudo mkdir /media
sudo mkdir /media/myExample
sudo mount <nas-ip>:/example /media/myExample
sudo touch /media/myExample/helloWorld.txt

Mount NFS directory automatically

Open the /etc/fstab file and add the line

<nas-ip>:/example /media/myExample nfs rw,hard,intr 0 0

Mount Windows NAS permanently

see How To Map A Network Drive Onto Ubuntu 14.04 Permanently

See also