Mount drive

  • Thread starter William Shakespare
  • Start date
W

William Shakespare

Guest
I have a virtual machine running on Kubuntu (Oneiric Ocelot) that I access via a Windows based pc using remote desktop connection. I need to read and write on network drives that are on a Windows server for which I have permissions. I tried to set this up via Dolphin but it did not work, I'm thinkng because I didn't see a way to issue credentials (it only prompts for name, server and folder when you try to add a network drive). It's not clear to me how to specify the path to my folders on the network. If I look at Windows explorer I see:

Computer>BB001(E:)>Docs>Reports

However, my IS folks said the path is:

\ARX\ARX1\Res\BB001

I have an ip address for the windows server as well which I also tried.

How does one determine the proper name, sever, and folder to add a network drive in Dolphin? Would it be better just to do this at the Konsole? How?

I want to mount Computer>BB001(E:)>Docs>Reports on my VM. Looks like from what I've read I have to create a mount point first.

sudo mkdir -p /mnt/sharename

That's telling the VM to create a temporary subdirectory under mnt called sharename, right?

Then I have to mount the drive.

sudo mount [IP AND/OR FOLDER ON THE WINDOWS SERVER] /mnt/sharename -o \
username=username,password=password,dmask=777,fmask=777

Is this strcuture correct? How do I determine what to specify what's in brackets?

Anyway, I looked around nin the forums here and other places on the web but didn't come up with an answer.
 


Long story short, you need to install Samba on your Linux machine before you can mount Windows shares. I haven't done a Windows->Linux share in a while (mostly do Linux->Windows) so I'm not sure what the command is exactly.

sudo mkdir -p /mnt/sharename

That's telling the VM to create a temporary subdirectory under mnt called sharename, right?

No, if you did "mkdir -p /tmp/sharename" then it would be a temporary subdirectory. Making a directory in /mnt is a permanent folder unless you delete it.
 
If I type smbtree I can see my shares but how do I know which one contains the folder I want to access?
 
Being massively undereducated in Windows/Windows sysadmin'ing I only can guide you in what it means
So,

Code:
mount -t smbfs -o username=<username>,password=<password> //<win-box>/<share> /mnt/<name-of-mountpoint>
`<win-box>' means the IP/domain the Windows box is bound to.
For `<share>', my best guess is the sharename of the folder/file/etc that was put up as a shared thing. If that doesn't work, do the full path in the form of `/a/b/c/d' (I guess cut off the C: at the beginning).
(The ip can be found out via `ipconfig' on the windows box.)

To make things a bit easier for yourself you can attach a domain to an IP by appending /etc/hosts on the linux box/vm with
`<IP> <WantedHostName>'.

Lastly (but almost unimportant), `/mnt' is usually the temporary mount directory and only used once in a blue moon. If you're going to want the windows shared mounted for most of the uptime of the linux box, create a dedicated directory in `/' and edit `/etc/fstab' to automount it during boot.

(Append fstab with: )

Code:
//servername/sharename /mountdirectory smbfs username=windowsuserename,password=windowspassword 0 0

Edit: Since /etc/fstab can be read by anyone, in your home directory,

echo username=mywindowsusername > .smbpasswd
echo password=mywindowspassword >> .smbpasswd
chmod 600 .smbpasswd

Then add this to fstab:
smbmount //servername/sharename /mountdirectory -o credentials=/home/myhomedirectory/.smbpasswd 0 0

Sources:
http://www.justlinux.com/nhf/Filesystems/Mounting_smbfs_Shares_Permanently.html
 

Staff online


Top