How to mount network drive on Ubuntu

To mount a network share folder, is easier using the GUI, but sometimes while using SSH terminal in to the box, is better to know the command line how to connect network share using commands.

Install CIFS packages

$ sudo apt-get install cifs-utils

Create mounting folder

$ sudo mkdir /mnt/nas_share

Mount the remote share

$ sudo mount -t cifs -o user=[username] //[server_ip]/[share_folder] /mnt/nas_share

Mount the remote share using fstab

$ sudo nano /etc/fstab

add the following line to the end

//[server]/[share_folder] /[mnt]/[mountfolder] cifs user=[username],pass=[password] 0 0

e.g.

//server/sahre /mnt/mountfolder cifs user=alex,pass=password 0 0

Reload fstab

$ sudo mount -av