Other Help Topics :: Mounting command samba / share
I use samba.dsl to use a windows share on a other PC. Works nice but i want to automate the mounting of this share.. (put it in a script and behind a hotkey )
I tried:
mount -t smbfs -o username=administrator,password=xxxxxxx //machinename/sharename$ ~/mnt/machinename
It doesn't work... ( i made the mountpoint before i tried to mount)
error: mount: wrong fs type, bad option, bad superblock on //MN120GHOSTNEW/DSL$,
or too many mounted file systems
any tips?
Got it (thnx to Henk_1955):
smbmount //MN/DSL$ /home/dsl/mnt/MN/DSL$/ -o username=administrator%password,fmask=644,dmask=755,uid=1001,gid=50,ip=xxx.xx.xx.xx,debug=0,workgroup=workgroupname
Your original should still work, with a couple of exceptions. The mount command won't work as a regular user unless specifically allowed, e.g. in /etc/fstab. Also, I don't think the mountpoint should contain a tilde, but if I'm wrong, please correct me.
If you want to automate it, you could add the info to /etc/fstab and have it mount on boot....the password would be viewable by all users, though.
Something you might consider, since this is a script, is adding an argument test to the script, backed up by a password prompt:
if [ ! $1 ]; then
echo "enter password"
read pass
else
pass="$1"
fi
I don't know what administrator%password means, though, so this might be unnecessary.
The mount-line as you see it works fine (password has to be filled in after the: administrator% though)
By the way... The ip-part of the mount-line can be left out!
This is my executable:
mkdir ~/mnt
mkdir ~/mnt/MN120GHOSTNEW
mkdir ~/mnt/MN120GHOSTNEW/DSL$
smbmount //MN120GHOSTNEW/DSL$ /home/dsl/mnt/MN120GHOSTNEW/DSL$/ -o username=administrator%password,fmask=644,dmask=755,uid=1001,gid=50,debug=0,workgroup=WORKGROUPNAME
sudo emelfm /ramdisk/home/dsl/mnt/MN120GHOSTNEW/DSL$
Next Page...
original here.