If you have user shares set up on your Vault, you may run into trouble getting them mounted on your Ubuntu box. So, you’ll need to know:
– the NetBIOS name of your vault (or its IP)
– the names of the share or shares to mount
– your username on the MediaVault and your password
Create a file in your home directory to store your username & password. I like vi, so:
Once vi opens, press i then type
Of course, replace yourusername and yourpassword with appropriate strings. Both your username and password are case sensitive. When finished, press Esc once then type:
Press Enter and vi will write the results.
Now, change the permissions and owner on the new file — you don’t want just anyone reading it:
chmod 700 ~/.smbpassword
chown root ~/.smbpassword
You’ll need to install smbfs, so type this:
apt-get install smbfs
We’ll need a place to mount our shares. I have two shares set up on my vault: binaries and backups.
With Unix, we need to have an empty directory set up to serve as a placeholder for our share. The mnt directory is a safe place to create them, so type the following:
Replace sharename with the name of your share. For example:
Repeat as needed for each share you intend to create:
Now, we need to edit fstab so it knows where to get the share info, where to mount it, and whose credentials to use. Best to do this as root.
sudo vi /etc/fstab
Go to the bottom of the file. Press Esc once then hit
then press Enter. Note that the commands in vi are case-sensitive. When you hit those keys, the cursor will drop to the last line of the file (G), go to the end of that line ($) then enter Append mode (a). When you press Enter, the keystroke is added to the end of the file; it adds a new line.
Now, we’ll need to add the mount entry. To do this, type
//mediaVaultName/shareName /mnt/shareName cifs credentials=/home/ubuntuUsername/.smbpassword,iocharset=utf8,file_mode=0777,dir_mode=0777 0 0
– Replace MediaVaultName with either the actual name or the IP address of your Vault. Tip: best to use only its IP address if you haven’t set up a DNS server.
– Replace shareName with the actual name of your share.
– Replace ubuntuUsername with the username that you use to log in to Ubuntu.
Add lines for each share you want to mount on Ubuntu.
When done typing, press Esc once then type:
By the way, the colon enters command mode, it then writes the file (w) then quits (q).
From the prompt, type
sudo mount -a
Enter your root password if prompted.
After a second or two, you should be returned to a prompt. Check in /mnt/shareName to see if anything appears. If nothing’s there, check the system log to see if anything unusual appeared. To do this, type the following
dmesg | tail
This will display the last ten lines of the system log. Look for anything that contains “cifs” as the possible reason for the failure.
The entire process may be possible on other Network Attached Storage units (NAS) from other manufacturers, but I’ve not had a chance to work with them. Fortunately, CIFS and SMB are standardized protocols that computers use to share information — so the process should be very similar.