How to Map ( Mount) a Network Drive on a NAS or Windows Server
Definitions – First lets clear up a few technical terms.
Mount - Refers to making available drive space on the same or remote storage device. Typically used in the Linux world and is the equivalent of mapping a network drive in the Windows world.
Map - Refers to making available drive and resources on the same or a remove network resource such as a Windows server. Typically used in the Windows world and is the exact same as Mounting a Drive on Linux.
NAS – Is the acronym for “Network Area Storage”. As its name suggests, this is typically a dedicated network device that makes available drive space to all authorized and authntuicated network devices and users.
There will come a time in your life (sooner or later) where you will need to map (mount) a network drive to either a network device such as windows network shares or drives or a Network Area Storage (NAS)
The Scenario: Network consists of two Supermicro 1U Rackmount Dual Xeon Servers with Ubuntu 8.04 Server running absolute minimal server OS. These two server also have VMWare Server 2.0 installed on each of them. Minimal Ubuntu Install comprises of nothing more than a base installation with SSH installed for remote administration.
Both VMWare Servers host a number of appliances and virtual applications servers as follows:
Server #1
- Small Business Server 2003 with Exchange
- Windows Server 2003 Web Edition of Development and Intranet
- Windows XP Pro (Used for Application Testing)
- and Finally Windows Vista (Used for Application Testing)
Server #2
- Asterisk 2.6 VoIP PBX (Production)
- Network Monitoring
- Sugar CRM (Production)
The problem here is that over time the Virtual Machines running on the server (Virtual Server 2.0 on Ubuntu Server 8.04) will typically need more space on the actual server it self.
Side note: The above configuration grew to the point where more storage became necessary. So the logical thing to do here was to introduce a NAS on the network and reconfigure all the virtual machines to store all data on the NAS (Data implies files that contain mission critical information that needs to be access and shared frequently.
Sounds simple enough. That is until the rubber meets the road. Now I’m personally no Linux expert though there are a couple of dozen within the company. So given that the NAS is already setup and FreeNas is the flavor of the day because its Free, Stable and Quite Robust and most importantly already available on the network. I decided to create a new Share on FreeNAS dedicated to the Virtual Machines
So not being a Linux guru, I had a general idea of what is required to use and map a NAS drive on each Ubuntu Server. After a little trial and lots of errors. I finally figured it out.
On a side note: The main reason for writing this article like most of my other articles is to document the steps taken to achieve a desired result and to consolidate several hours of Googling so that our readers can benefit from our trial and errors and also to prevent wasting time in the future on similar issues.
Back to what’s required to Mount a NAS Drive / Share on Ubuntu.
Step by Step – How to Mount (Map) a NAS Drive or Network Share on Ubuntu:
- First we will need to install samba and smbfs packages on our minimalist Ubuntu 8.04 Server
- The following command from within your terminal window will do the trick
$ sudo apt-get install samba smbfs (Hit Enter)
- The following command from within your terminal window will do the trick
- Next you will need to create the mount directory by typing the following command
$ sudo mkdir /media/vmstorage (Hit Enter)
- Next we will need to mount the remote network share / drive on Ubuntu. This next step assumes that you have setup a NAS share by the name of VMStorage and that you have also created a NAS user by the name of VM with a password of VMPass for simplicity. Enter the following command from within the terminal windows to map your NAS hare on the Ubuntu Server
$ sudo smbmount //192.168.0.240/VMStorage /media/vmstorage -o username=VM,password=VMPass (Hit Enter)
- The above command assumes the following:
- Network share name on the NAS is VMStorage
- Network path to share on the NAS is //192.168.0.240/VMStorage
- Linux local path to which the Share will be mounted to is at /media/vmstorage
- NAS username is VM
- NAS password for user VM is VMPass
- Once you have completed the above steps, your Linux (Ubuntu) Server now has a network mount (mapping) to the NAS share we created earlier in the process.
- To test the map. simple navigate to the Linux mount point located at /media/vmstorage and there you should see all the files if any present on the NAS share called VMStorage.
Though the steps above appear easy…and they are for a seasoned Linux pro… For a newbie this article will prove to be a huge help as there is lots of related content online and who want to sit around searching for a simple solution.
If this article helped please provide feedback in the way of commenting. If there are any errors, please let us know.
Thank you, I’ve been looking for a way to do this. I too am a linux newbie and your tutorial worked great.
Now I need to figure out how to unmount the volume because I put it in the wrong location.
Thank you, this was exactly what I needed!
You can typically unmount a device or a mount point using the following command:
sudo umount [device]
where [device] is either the device name (e.g. /dev/sda1) or the mount point (e.g. /media/usb)