PDA

View Full Version : Mount samba shares with utf8 encoding using cifs


Pages : 1 2 3 4 [5] 6

dmizer
July 12th, 2009, 12:51 AM
Try adding this line to your /etc/fstab file:
//pmde1505/receive /mnt/pmde1505/receive cifs username=*****,password=*****,iocharset=utf8,uid=1 000,gid=1000,nounix,file_mode=0555,dir_mode=0555

and see if that improves things.

exsysprog
July 12th, 2009, 08:34 PM
Try adding this line to your /etc/fstab file:
//pmde1505/receive /mnt/pmde1505/receive cifs username=*****,password=*****,iocharset=utf8,uid=1 000,gid=1000,nounix,file_mode=0555,dir_mode=0555

and see if that improves things.

Jammed schedule - may take up to a couple days for me to get this done.

Will update when completed. Thanks a bunch for your assistance.

dippietheham
July 14th, 2009, 04:08 AM
Hi,

I followed all the instructions on the first 2 pages, and I COULD get vim to edit the necessary files on the mounted share. However, and this was frustrating, I could not get Kate or Komodo Editor to edit and save the files - the error was along the lines of no such file or directory.

I finally found a workaround/solution:
https://bugs.launchpad.net/ubuntu/+source/samba/+bug/286828/comments/50

I was using a Linux box to access a Smb connection on a linux box. I could have used nfsmount, but I have certain restrictions and using CIFS was the fastest and best solution. Once I turned off DFS on the samba server, all was well.

Not sure if this has already been noted somewhere in this long post, but I hope it helps someone.

exsysprog
July 15th, 2009, 11:08 AM
Jammed schedule - may take up to a couple days for me to get this done.

Will update when completed. Thanks a bunch for your assistance.

Experiment results :

did umount.cifs to unmount the share
did mount to get list of mounts and confirm that share was unmounted
modified fstab as described
did sudo mount -a to reload fstab
did mount and ls -l /mnt/pmde1505 ... to confirm share was remounted
all files and directories had read and execute permissions and were owned by me as before, mount shows the share as
//pmde1505/receive on /mnt/pmde1505/receive type cifs (rw,mand)

tried to cp an exe file and got same result as before - could not open the file for reading Permission denied.

This is kinda curious. I feel like I read somewhere about a bug having these properties but I'm not sure and I can't find a reference - I'll keep looking.

dmizer
July 15th, 2009, 06:59 PM
Just for testing, try changing the file_mode and dir_mode to 777.

exsysprog
July 15th, 2009, 08:32 PM
Just for testing, try changing the file_mode and dir_mode to 777.


Test complete. Results unchanged. There must be something simple I'm overlooking.

CasaDelGato
July 15th, 2009, 08:45 PM
I'm yet another person having similar problems.
I just went through the whole set of instructions, and am now stuck with the "mount error(13): Permission denied" problem.
I'm trying to mount a share from a Buffalo Terastation.

It (of course) works just fine in the GUI File Browser, but I really need to be able to access it from some command line programs.

dmizer
July 15th, 2009, 08:47 PM
Test complete. Results unchanged. There must be something simple I'm overlooking.
The only thing left I can think of then is server side. Perhaps a firewall or anti-virus is interfering?

Otherwise, you may want to open a bug.

I'm yet another person having similar problems.
I just went through the whole set of instructions, and am now stuck with the "mount error(13): Permission denied" problem.
I'm trying to mount a share from a Buffalo Terastation.

It (of course) works just fine in the GUI File Browser, but I really need to be able to access it from some command line programs.

There is a fix for this problem listed in the troubleshooting section.

CasaDelGato
July 15th, 2009, 08:52 PM
Already tried adding the "nounix" option.
Didn't help.

Couldn't find any mention of the permission denied problem in the referenced thread either.

dmizer
July 15th, 2009, 09:13 PM
Already tried adding the "nounix" option.
Didn't help.

Couldn't find any mention of the permission denied problem in the referenced thread either.

Sorry, the reference thread was in the wrong section. I just moved it.

Try the fix for "Files owned by root."

CasaDelGato
July 15th, 2009, 09:29 PM
added gid= ...
no change.

Now, one thing I am wondering about.
The GUI File Browser created an icon for this volume on my Desktop.
When I right click on that icon, one of the choices is "unmount".
But apparently the GUI mounts things in a GUI specific manner so that only GUI apps can access them?

dmizer
July 15th, 2009, 09:51 PM
The GUI does not mount. Only Nautilus aware apps will be able to access the files.

However, if you are still mounted via GUI, you should unmount that and make sure that it does not automatically reboot.

Also, double check to make sure you have smbfs installed. The GUI will mount even without the smbfs package installed.

exsysprog
July 16th, 2009, 08:22 AM
The only thing left I can think of then is server side. Perhaps a firewall or anti-virus is interfering?

Otherwise, you may want to open a bug.



There is a fix for this problem listed in the troubleshooting section.

Thank you very much for all of your help.

I just created a share on another machine in my environment. It's running the same Windows version. I was able to connect and copy files, including exe's, without difficulty. Gotta run right now but my plan is to continue experimenting to see if I can isolate what is causing this strange behavior on the one machine. I will report back here when I have made progress.

dmizer
July 16th, 2009, 09:09 AM
Thank you very much for all of your help.

I just created a share on another machine in my environment. It's running the same Windows version. I was able to connect and copy files, including exe's, without difficulty. Gotta run right now but my plan is to continue experimenting to see if I can isolate what is causing this strange behavior on the one machine. I will report back here when I have made progress.

With that information, I can say with a great deal of certainty, that the problem is the Windows server rather than your Ubuntu client. I suggest concentrating your experimenting there.

CasaDelGato
July 17th, 2009, 12:46 AM
I've removed the GUI mount just to be sure. (also rebooted the system.)
How can I tell if smbfs is installed? I followed all the instructions in the other post, and received no errors - other than the final mount doesn't work. (Still getting that pesky 13 error.)

I can connect to the TeraStation from my MS WinXP machine just fine using the same name.
Just the Ubuntu machine won't connect.

CasaDelGato
July 17th, 2009, 01:01 AM
Okay, just went through the 2 Samba things from your sig.
Apparently Samba wasn't installed.
Didn't help though.

Still getting the error(13)

dmizer
July 17th, 2009, 03:34 AM
Okay, just went through the 2 Samba things from your sig.
Apparently Samba wasn't installed.
Didn't help though.

Still getting the error(13)

Okay, please post your current /etc/fstab line, plus the output of this:
smbtree

CasaDelGato
July 17th, 2009, 11:45 AM
Wow, this is a pain in 640x480 video...
fstab line is:
//TERA1/Perforce /media/Perforce cifs credentials=/root/.smbcredentials,iocharset=utf8,gid=1000,uid=1000,n ounix,file_mode=0777,dir_mode=0777 0 0

smbtree

CATHOUSE
\\UBUNTU Ubuntu server (Samba, Ubuntu)
\\UBUNTU\IPC$ IPC Service (Ubuntu server (Samba, Ubuntu))
\\UBUNTU\print$ Printer Drivers
\\TERA1 TeraStation
\\TERA1\ADMIN$ IPC Service (TeraStation)
\\TERA1\IPC$ IPC Service (TeraStation)
\\TERA1\Perforce Perforce Repository
\\TERA1\Backup System Backups
\\TERA1\Priscilla Moms System Backups
\\TERA1\John Johns System Backups
\\TERA1\share TeraStation folder
\\TERA1\usbdisk3 USB Disk3
\\TERA1\info TeraStation utilities
\\SHOP Out in the Shop Office
\\SHOP\ShopHP5L HP LaserJet 5L
\\SHOP\BACKUP01
\\SHOP\print$ Printer Drivers
\\SHOP\IPC$ Remote IPC
\\SHOP\Shop (C)
\\EIGER John's Desktop
\\EIGER\J$ Default share
\\EIGER\C$ Default share
\\EIGER\ADMIN$ Remote Admin
\\EIGER\Mental (D)
\\EIGER\Physical (C)
\\EIGER\MultiMedia
\\EIGER\I$ Default share
\\EIGER\D$ Default share
\\EIGER\IPC$ Remote IPC

Which does seem to include everything on my local network, including the item I'm trying to mount.

CasaDelGato
July 17th, 2009, 01:34 PM
Interesting.
Just for the heck of it, I went to the TeraStation and created a brand new user on it.
Then changed the smbcredentials file to use this new userid.

Now the mount works.

The old userid works fine from other systems, including multiple simultaneous connections from different systems.

exsysprog
July 21st, 2009, 05:45 PM
With that information, I can say with a great deal of certainty, that the problem is the Windows server rather than your Ubuntu client. I suggest concentrating your experimenting there.

Windows indeed!

I did a little more experimenting, and I did some research on the Windows side of things. The bottom line turns out to be that apparently XP sometimes drops the ball in managing it's ACL's.

Reference the following if you're having a similar problem:

http://networking.nitecruzr.net/2005/09/server-access-authorisation.html

http://ss64.com/nt/cacls.html

In my case the Windows sharing and security properties (both) on all involved directories and files showed clearly that the "everyone" group had read permissions on the .exe files that could not be copied. It also showed clearly that the specific userid that I used to authenticate to the share had at least read permissions. But no ... as described before.

The solution, which seems to be working thus far, was to use the CACLS windows utility on the XP box to manually re-grant read permission to the "everyone" group for the effected share. Redundant - yes, but it worked. MSFT MVP's have reported cases of NTFS ACL's getting corrupted and causing the symptoms I reported earlier in this thread. Maybe I need to surface scan my HD again!

Thanks again for your help. I'll update this if there turns out to be other relevant information.

BDNiner
July 26th, 2009, 12:00 PM
Thank you, this worked perfectly and on the first try. Great tutorial

jwillar
July 26th, 2009, 05:28 PM
I've been using this tutorial for a few years now w/o fail, it just works. It's that good. However, in the last few weeks I've found my NAS drive is not mounting after rebooting Ubuntu 9.04. It mounts fine when using "sudo mount -a" from a terminal. This has not been a problem with U9.04 before, just recently. Have you any thoughts on a fix?

dmizer
July 26th, 2009, 09:10 PM
I've been using this tutorial for a few years now w/o fail, it just works. It's that good. However, in the last few weeks I've found my NAS drive is not mounting after rebooting Ubuntu 9.04. It mounts fine when using "sudo mount -a" from a terminal. This has not been a problem with U9.04 before, just recently. Have you any thoughts on a fix?

I've run into this problem since Jaunty started depending on network-manager for 100% of network connections. It doesn't mesh well with the CLI tools like /etc/network/interfaces and /etc/fstab.

Try editing /etc/rc.local and add "mount -a" to the file like so:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.

mount -a
exit 0

adonet
July 27th, 2009, 05:35 PM
Dear DMIZER thank you for your exellent tutorial. It's great.

However, I ran into one problem. I use this way of connecting to my freecom networkdrive. I can make the connection. I can read files, I can write files but I cannot replace files with another (newer) version and I cannot delete directories when these directories have files still in it.
This is very annoying when using backup software like Synkron.
Of course a windows xp machine will do the trick flawlessly, but I want my ubuntu machine to do the job!

The FSTAB line I used is:
#//192.168.2.11/public /media/netwerkdrive cifs guest,rw,nounix,uid=1000,iocharset=utf8,codepage=8 50 0 0
The suggested lines in your tutorial would read:
//192.168.2.11/public /media/netwerkdrive cifs guest,rw,nounix,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0
But I have to add the nounix word to prevent an errormessage.
In both cases the same happens. I can read, write and cannot overwrite or multi delete.

The share is not password protected. That's something I deal with when this is working.

Do you have any suggestions for this problem?

thanks

jwillar
July 27th, 2009, 07:48 PM
I've tried adding "mount -a" to /etc/rc.local as you suggested, rebooted and still no NAS drive. By the way, here is the line I've used in my 'fstab' file.

//192.168.0.9/Volume_1 /media/NAS-Shared cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

I have two other systems on my home network and the NAS drive mounts correctly (also running the latest updates for Ubuntu 9.04).

I've begun looking for other solutions and believe 'GvFS' looks promising. Thanks for your quick response and help with this. From what I understand from research, others are having this problem as well.

dmizer
July 27th, 2009, 10:34 PM
Do you have any suggestions for this problem?

thanks

Try this /etc/fstab line:
//192.168.2.11/public /media/netwerkdrive cifs guest,rw,nounix,uid=1000,gid=1000,iocharset=utf8,f ile_mode=0777,dir_mode=0777 0 0

If that doesn't work, what error do you get if you don't use the "nounix" option?

I've tried adding "mount -a" to /etc/rc.local as you suggested, rebooted and still no NAS drive. By the way, here is the line I've used in my 'fstab' file.

//192.168.0.9/Volume_1 /media/NAS-Shared cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

I have two other systems on my home network and the NAS drive mounts correctly (also running the latest updates for Ubuntu 9.04).

I've begun looking for other solutions and believe 'GvFS' looks promising. Thanks for your quick response and help with this. From what I understand from research, others are having this problem as well.

There is an open bug report on this: https://bugs.launchpad.net/ubuntu/+source/sysvinit/+bug/275451

There are several potential workarounds listed, but the one that fixes the problem most of the time involves /etc/network/interfaces. Please post the contents of this file.

jwillar
July 28th, 2009, 10:08 PM
Success! I took your advise and read the BUG report. It mentioned more than once that the Network Manager could be affecting this problem. Hmm could it be that simple? I switched back to 'NetworkManager' from to 'Wicd', re-booted and now my NAs drive mounts automatically! Thanks for your help in resolving this problem, your 'Linux-Foo' is strong.

adonet
July 29th, 2009, 06:02 PM
Try this /etc/fstab line:
//192.168.2.11/public /media/netwerkdrive cifs guest,rw,nounix,uid=1000,gid=1000,iocharset=utf8,f ile_mode=0777,dir_mode=0777 0 0

If that doesn't work, what error do you get if you don't use the "nounix" option?



When I don't use the "nounix" option I get this error message:

mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

If I use the fstab line that you suggested, I get the same problem, not being able to overwrite an excisting file with another version of it, nor
being able to delete a directory with something in it from nautilus or thunar. (these programs sometimes don't respond anymore)

dmizer
July 29th, 2009, 07:13 PM
When I don't use the "nounix" option I get this error message:

mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

If I use the fstab line that you suggested, I get the same problem, not being able to overwrite an excisting file with another version of it, nor
being able to delete a directory with something in it from nautilus or thunar. (these programs sometimes don't respond anymore)

Since you're having this problem both with GVFS and CIFS, I highly suggest that you take a very close look at permissions on your NAS. Possibly look for firmware updates as well.

What is the output of:
ls -la /media/netwerkdrive

adonet
July 30th, 2009, 03:00 PM
Since you're having this problem both with GVFS and CIFS, I highly suggest that you take a very close look at permissions on your NAS. Possibly look for firmware updates as well.

What is the output of:
ls -la /media/netwerkdrive

The output is:

totaal 4
drwxrwxrwx 1 mint7 mint7 0 2009-05-09 04:23 .
drwxr-xr-x 8 root root 4096 2009-07-30 20:56 ..
drwxrwxrwx 1 mint7 mint7 0 2009-05-30 01:19 Afbeeldingen
drwxrwxrwx 1 mint7 mint7 0 2009-05-08 18:44 Documenten
drwxrwxrwx 1 mint7 mint7 0 2009-05-08 19:39 Download
drwxrwxrwx 1 mint7 mint7 0 2009-05-08 18:50 Foto
drwxrwxrwx 1 mint7 mint7 0 2009-05-08 20:11 Telefoon
drwxrwxrwx 1 mint7 mint7 0 2009-07-30 00:59 test
drwxrwxrwx 1 mint7 mint7 0 2009-07-27 23:11 .Trash-0
drwxrwxrwx 1 mint7 mint7 0 2009-07-06 12:50 .Trash-1000
drwxrwxrwx 1 mint7 mint7 0 2009-05-31 00:16 video-onderzoek

richardh9936
July 30th, 2009, 05:45 PM
Many thanks to you for creating this howto. Can we promote it to a STICKY, please?

dmizer
August 1st, 2009, 05:14 AM
The output is:

That all looks good. What are the permissions of the sub folders?
ls -la /media/netwerkdrive/Foto

dmizer
August 1st, 2009, 05:16 AM
Many thanks to you for creating this howto. Can we promote it to a STICKY, please?

If we stickied all the tutorials which deserve it, there would be several pages of stickies, and that would defeat the purpose.

Thanks for the vote of confidence though :)

jpkotta
August 1st, 2009, 01:55 PM
CIFS VFS: Server not responding error needs a bit different fix [in Jaunty].

Why is that? It doesn't seem right to do it in the GDM shutdown. Just because GDM quits doesn't mean I'm rebooting the machine. Also, it won't work if I'm using KDM or another DM. Wouldn't the same effect be achieved if you put the rc symlink before the gdm/kdm one? Finally, the correct way to edit those symlinks is through update-rc.d.


sudo update-rc.d -f umountnfs.sh remove
sudo update-rc.d umountnfs.sh start 15 0 6 .

Sorry if this has already been addressed, but I'm not reading >100 pages in this thread.

adonet
August 1st, 2009, 04:31 PM
That all looks good. What are the permissions of the sub folders?
ls -la /media/netwerkdrive/Foto

The permissions of subfolder Foto is this:

ls -la /media/netwerkdrive/Foto
totaal 4754
drwxrwxrwx 1 mint7 mint7 0 2009-05-09 03:19 .
drwxrwxrwx 1 mint7 mint7 0 2009-05-09 03:31 ..
drwxrwxrwx 1 mint7 mint7 0 2009-05-08 18:28 afdrukken
-rwxrwxrwx 1 mint7 mint7 5 2008-04-12 22:41 .conduit.conf
drwxrwxrwx 1 mint7 mint7 0 2009-05-08 18:49 Download
drwxrwxrwx 1 mint7 mint7 0 2009-05-08 18:43 Foto-familie
drwxrwxrwx 1 mint7 mint7 0 2009-05-08 18:31 Foto's
drwxrwxrwx 1 mint7 mint7 0 2009-05-08 18:50 Foto-vrienden
drwxrwxrwx 1 mint7 mint7 0 2009-05-08 18:50 Negatieven
drwxrwxrwx 1 mint7 mint7 0 2009-05-08 18:50 _SYNCAPP
-rwxrwxrwx 1 mint7 mint7 4860042 2009-07-26 17:28 .synkron.syncdb
drwxrwxrwx 1 mint7 mint7 0 2009-07-27 22:44 test
-rwxrwxrwx 1 mint7 mint7 7168 2008-03-28 23:23 Thumbs.db

dmizer
August 1st, 2009, 05:46 PM
Why is that? It doesn't seem right to do it in the GDM shutdown. Just because GDM quits doesn't mean I'm rebooting the machine. Also, it won't work if I'm using KDM or another DM. Wouldn't the same effect be achieved if you put the rc symlink before the gdm/kdm one? Finally, the correct way to edit those symlinks is through update-rc.d.


sudo update-rc.d -f umountnfs.sh remove
sudo update-rc.d umountnfs.sh start 15 0 6 .

Sorry if this has already been addressed, but I'm not reading >100 pages in this thread.

Because Jaunty's network is managed by "network-manager" which only works in userspace, not in the system. That means you only have a network connection when you are logged in, so if you are logging off you are terminating your network connection (and therefore your connection to your shares as well). Because of that, the system links don't work as shown multiple (http://ubuntuforums.org/showpost.php?p=7676798&postcount=154) times (http://ubuntuforums.org/showpost.php?p=7148956&postcount=122) in this thread: http://ubuntuforums.org/showthread.php?t=293513

Here is a debian bug report that mentions this problem: http://www.nabble.com/CIFS-VFS:-server-not-responding-during-shutdown-td23443702.html
Do you have network-manager installed? If you have it could cause the
problem. Init script for shutting down network-manager has higher
priority than umountnfs.sh script that unmounts network filesystems like
nfs/cifs. Solution is to not use network-manager (tested) or modify
network-manager script to require umount network filesystems before it
shuts down (not tested)

KDE fix is mentioned here: http://ubuntuforums.org/showpost.php?p=7365942&postcount=934. I admit that it's buried. I'll update the main post with a link to that.

If you're using another DM, then you're probably not using network-manager to manage your network, and the first fix will work fine.

Why is

sudo update-rc.d -f umountnfs.sh remove
sudo update-rc.d umountnfs.sh start 15 0 6 .
more correct than
ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K15umountnfs.sh
ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K15umountnfs.sh

dmizer
August 1st, 2009, 06:10 PM
The permissions of subfolder Foto is this:

Assuming that your Ubuntu user name is mint7, then all your permissions look correct. You should take a close look at how the shares are set up on the NAS, especially considering you're having the same problem with GVFS: http://ubuntuforums.org/showpost.php?p=7688745&postcount=33

adonet
August 2nd, 2009, 07:41 AM
Assuming that your Ubuntu user name is mint7, then all your permissions look correct. You should take a close look at how the shares are set up on the NAS, especially considering you're having the same problem with GVFS: http://ubuntuforums.org/showpost.php?p=7688745&postcount=33

My login name is mint7 indeed.
Using GVFS gives me the same troubles.

In my NAS setup I find this:

Host Name FND
Group Name VLAS
Administrator admin
Date/Time 2009/08/02 13:38:24 GMT1
Language
Firmware Version NAS2891-009B2 LOADER 3.2
Status - Network Information
IP Address 192.168.2.11
DHCP Server OFF


The SMB doesn't require any login or password for one shared Map on this drive.

And when I try to access this share from a winXP machine it all works OK.

jpkotta
August 2nd, 2009, 12:51 PM
Because Jaunty's network is managed by "network-manager" which only works in userspace, not in the system. That means you only have a network connection when you are logged in, so if you are logging off you are terminating your network connection (and therefore your connection to your shares as well).

Fair enough. I use wicd. IMHO, network should be independent of the GUI, but if that's how they did it, then that's how they did it.


Why is

sudo update-rc.d -f umountnfs.sh remove
sudo update-rc.d umountnfs.sh start 15 0 6 .
more correct than
ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K15umountnfs.sh
ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K15umountnfs.sh

http://www.debian.org/doc/debian-policy/ch-opersys.html#s-/etc/init.d

rturner
August 3rd, 2009, 08:19 AM
Another Me Too on thanks for the tutorial. I have Windows 7 running on an extra machine on my home office LAN and the Ubuntu machine has been the only one which couldn't see the Win7 shares. I've now got it permanently mounted with no errors. I've got your tutorial bookmarked.

dmizer
August 3rd, 2009, 10:42 AM
Fair enough. I use wicd. IMHO, network should be independent of the GUI, but if that's how they did it, then that's how they did it.
Actually, since I have a lot of server side experience, I agree that network should be independent of the GUI. However, I can see the security advantage for an end user desktop focused distribution like Ubuntu and it's easy enough to remove network-manager and install gnome-network-admin instead.

In either case, with Gnome becoming reliant on network-manager, I think that my howto will become fairly useless over the next release or two so I've been playing with autofs just in case.

http://www.debian.org/doc/debian-policy/ch-opersys.html#s-/etc/init.d

Looks like I have some reading to do. Thank you.

corkscrew
August 4th, 2009, 04:20 PM
My network is comprised of the following components...

Desktop - jaunty
Desktop -vista 64
Laptop - Hardy heron
Laptop - XP pro
NAS storage x 2 (FAT32)
Netgear DGNB2100 router (wired & wireless)

My aim is to mount the 2 NAS drives permanently when booting the desktop with Jaunty on.

The situation is, at the moment I can browse to both NAS drives from all machines except the jaunty one through network places on hardy laptop and from both windows machines.If I try this from the jaunty machine I get the following error

Unable to mount location Failed to retrieve share list from server
however if I type the path into the nautilus window
smb://lan-disk1/store1/
It goes there straight away (i had the same result with hardy on the same machine)

I have tried both of your tutorials the one "Mount samba shares with utf8 encoding using cifs" and the one "Howto: Fix Windows share browsing issues" both very comprehensive but I'm still no further forward.

The error message I get when I try mounting using cifs is
mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

Being a windows convert where network browsing was so easy I find this infuriating, please can you help?

dmizer
August 4th, 2009, 07:21 PM
corkscrew,

Please post the output of:
sudo iptables -L

corkscrew
August 5th, 2009, 02:52 AM
corkscrew,

Please post the output of:
sudo iptables -L
Here you go
cem@m3n78:/media$ sudo iptables -L
[sudo] password for cem:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

dmizer
August 5th, 2009, 04:10 AM
Ok, that looks good. Do you have any firewalls enabled on the Windows machines? If so, are the results different if you disable the Windows firewall?]

Also, please post your current /etc/fstab line.

corkscrew
August 5th, 2009, 09:24 AM
Ok, that looks good. Do you have any firewalls enabled on the Windows machines? If so, are the results different if you disable the Windows firewall?]

Also, please post your current /etc/fstab line.

here's my fstab

proc /proc proc defaults 0 0
# / was on /dev/sda5 during installation
UUID=e092cfc2-fb77-47b0-9756-da91ede67294 / ext3 relatime,errors=remount-ro 0 1
# /home was on /dev/sda6 during installation
UUID=2f84e334-9ad2-46d3-a098-b7f32fca4b38 /home ext3 relatime 0 2
# swap was on /dev/sda8 during installation
UUID=6ffbcd91-988f-4549-97e1-8bad61e73b35 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
#/dev/sda7
UUID=05ab0423-09f8-468c-9503-2fdb65697046 /data ext3 relatime 0 2
/dev/sdb1 /media/SATA2-data ntfs defaults 0 0


I do have zonealarm on one laptop but i have no problem browsing to the shares on that machine from the jaunty desktop. Its only the 2 NAS drives which i cant get to properly.
thanks for your help by the way

dannyboy79
August 6th, 2009, 09:43 AM
i seem to have a weird problem. i have all these windows ntfs smb shares that I have ensured I have gone into sharing/security and set them to full control (rwx by everyone, as well as my username (daniel) as well as the administrator account). next I go into ubuntu and have the following lines in /etc/fstab

http://img401.imageshack.us/img401/7268/mypicssecurity.png (http://img401.imageshack.us/my.php?image=mypicssecurity.png)

you can see that windows firewall is allowing the share to be written to. i don't actually even use a software firewall on windows or ubuntu because I have a hardware firewall built into the router connected to my broadband modem.

//192.168.0.4/My\040Pictures /var/lib/mythtv/pictures cifs auto,noexec,users,nounix,uid=12345,gid=12345,crede ntials=/etc/samba/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

(NOTE: i noticed that after I finish the post, there's a space in the word credentials in the fstab entry but when I try to edit the post, there is no space. not to mention i checked the real fstab and there is no space there either.)

uid 12345 and ghid 12345 are mythtv:mythtv and I am in that group. see here:

daniel@dell:~$ groups
daniel adm dialout cdrom video plugdev lpadmin sambashare admin mythtv

the /var/lib/mythtv/pictures/ folder prior to mounting is owned by mythtv:mythtv and rwx by all. after I mount the share, it's still owned by mythtv:mythtv but the permissions are shown below:

dr-xr-xr-x 1 mythtv mythtv 0 2009-08-01 15:54 pictures

the mount command shows this:

//192.168.0.4/My Pictures on /var/lib/mythtv/pictures type cifs (rw,mand,noexec,nosuid,nodev)

it says it's rw?

when I try to write to it, i get this:

daniel@dell:~$ touch /var/lib/mythtv/pictures/test.txt
touch: cannot touch `/var/lib/mythtv/pictures/test.txt': Permission denied

i thought dir_mode=0777,file_mode=0777 would allow the mythtv user and actually all to rwx on it? any help please? i can't seem to write to it?

dannyboy79
August 7th, 2009, 08:50 AM
here's my fstab

proc /proc proc defaults 0 0
# / was on /dev/sda5 during installation
UUID=e092cfc2-fb77-47b0-9756-da91ede67294 / ext3 relatime,errors=remount-ro 0 1
# /home was on /dev/sda6 during installation
UUID=2f84e334-9ad2-46d3-a098-b7f32fca4b38 /home ext3 relatime 0 2
# swap was on /dev/sda8 during installation
UUID=6ffbcd91-988f-4549-97e1-8bad61e73b35 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
#/dev/sda7
UUID=05ab0423-09f8-468c-9503-2fdb65697046 /data ext3 relatime 0 2
/dev/sdb1 /media/SATA2-data ntfs defaults 0 0


I do have zonealarm on one laptop but i have no problem browsing to the shares on that machine from the jaunty desktop. Its only the 2 NAS drives which i cant get to properly.
thanks for your help by the way

this forum post topic is about mounting samba shares. i don't even see anything about cifs in your /etc/fstab. can you please re-read the post. you should be able to straighten things out if you follow the directions. if you merely asking about a mounting a usb drive then there are other forum post that help with that also. ah heck, i guess I'll post what you need to fix.

i am assuming your line that reads

/dev/sdb1 /media/SATA2-data ntfs defaults 0 0

is the one that is suppose to be mounting the NAS box. for your specifying it be mounted as ntfs filesystem. linux can't work with ntfs directly, there a module that is used I believe which is called ntfs-3g but you don't want to do that because you said NAS box. NETWORK attached storage. SO you needs to use smbfs but that's deprecated so you need to use cifs as the guide says. your line would be something like this:

//servernamehere/sharenamehere /media/SATA2-data cifs guest,uid=1000,iocharset=utf8,codepage=unicode,uni code 0 0

where uid and gid are the username id and groupid for the user that will be mounting the share. normally in ubuntu 1000, is the first user. keep in mind that this all matters whether the NAS box is being shared with a password or not. I am showing you an example of non-password protected share, if it's protected as i said before, you need to actually read the first page. or you can see this wiki: https://wiki.ubuntu.com/MountWindowsSharesPermanently

good luck

dannyboy79
August 7th, 2009, 08:51 AM
canyone help with post #1049. it's a very strange problem and I am not sure what I am doing wrong. I have followed all wiki's and forum post's regarding this subject but it still won't mount writable. i actually have another share like this as well tyhat I hope to fix soon

dmizer
August 7th, 2009, 09:00 AM
here's my fstab

proc /proc proc defaults 0 0
# / was on /dev/sda5 during installation
UUID=e092cfc2-fb77-47b0-9756-da91ede67294 / ext3 relatime,errors=remount-ro 0 1
# /home was on /dev/sda6 during installation
UUID=2f84e334-9ad2-46d3-a098-b7f32fca4b38 /home ext3 relatime 0 2
# swap was on /dev/sda8 during installation
UUID=6ffbcd91-988f-4549-97e1-8bad61e73b35 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
#/dev/sda7
UUID=05ab0423-09f8-468c-9503-2fdb65697046 /data ext3 relatime 0 2
/dev/sdb1 /media/SATA2-data ntfs defaults 0 0


I do have zonealarm on one laptop but i have no problem browsing to the shares on that machine from the jaunty desktop. Its only the 2 NAS drives which i cant get to properly.
thanks for your help by the way
What is the exact command you're using to mount the share?

canyone help with post #1049. it's a very strange problem and I am not sure what I am doing wrong. I have followed all wiki's and forum post's regarding this subject but it still won't mount writable. i actually have another share like this as well tyhat I hope to fix soon

Sorry, I've been out on a business trip and have only had sporadic internet connections.

I think you should probably mount the share as danny's numeric uid (if you want to use it as danny) and gid 12345. I think that will give you the results you're after.

Edit:
Also, regarding the space in the mount line, you should always use [code] bbc markup because the code tags retain original formating. If you just post a single block of text, the forum will wrap the text to retain the CSS style.

corkscrew
August 7th, 2009, 10:17 AM
What is the exact command you're using to mount the share?



Sorry, I've been out on a business trip and have only had sporadic internet connections.

I think you should probably mount the share as danny's numeric uid (if you want to use it as danny) and gid 12345. I think that will give you the results you're after.

Edit:
Also, regarding the space in the mount line, you should always use [code] bbc markup because the code tags retain original formating. If you just post a single block of text, the forum will wrap the text to retain the CSS style.

Hi (this will answers danny,s comment about not seeing anything in my fstab as well)
I figured trying to mount manually 1st as per the 1st page in your post before embarking on editing my fstab. Here's the command I'm running and the resulting output

cem@m3n78:~$ sudo mount -t cifs //LAN-DISK1/store1 /media/store1 -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77
mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
cem@m3n78:~$

damien82
August 7th, 2009, 04:22 PM
dmizer: thank you! if i recall correctly what your guide does was default in earlier versions of ubuntu, been bugging me since i installed jaunty a week ago, now everything's back to normal.

//danny

dannyboy79
August 8th, 2009, 10:40 AM
What is the exact command you're using to mount the share?



Sorry, I've been out on a business trip and have only had sporadic internet connections.

I think you should probably mount the share as danny's numeric uid (if you want to use it as danny) and gid 12345. I think that will give you the results you're after.

Edit:
Also, regarding the space in the mount line, you should always use [code] bbc markup because the code tags retain original formating. If you just post a single block of text, the forum will wrap the text to retain the CSS style.

ok, prior to mounting either of the 2 shares: winxp_shared and winxp_pictures, the shared folder is owned by daniel and group daniel and is rwx for all. the pictures folder is owned by mythtv and group mythtv and is rwx by all. BUT after I mount them they become unwritable. so I have done what you suggested and made them uid daniel (1000) and gid mythtv (12345) BUT that still doesn't work.

before mounting:
drwxrwxrwx 2 daniel mythtv 4096 2009-08-06 19:44 winxp_pictures
drwxrwxrwx 2 daniel daniel 4096 2009-08-01 12:53 winxp_shared

after mounting:
dr-xr-xr-x 1 daniel mythtv 0 2009-08-07 08:57 winxp_pictures
dr-xr-xr-x 1 daniel mythtv 0 2009-07-29 13:05 winxp_shared

and here's the fstab lines:
//192.168.0.4/My\040Pictures /mnt/winxp_pictures cifs auto,noperm,noexec,users,nounix,uid=1000,gid=12345 ,credentials=/etc/samba/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

//192.168.0.4/SharedDocs /mnt/winxp_shared cifs auto,noperm,noexec,users,nounix,uid=1000,gid=12345 ,credentials=/etc/samba/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0



what am i doing wrong?? I have checked the permissions on the windows side a million times and they are full control, what is weird though is that there is no write entry when I go into sharing for these 2 folders. see picture:

i for some reason can't get to imageshack.com right now so I am posting to my mobileme public folder, you can download and view them from there. i would really appreciate it.

http://idisk.mac.com/enterprise6-Public?view=web

dmizer
August 9th, 2009, 06:12 AM
Try adding the rw option.
//192.168.0.4/My\040Pictures /mnt/winxp_pictures cifs rw,auto,noperm,noexec,users,nounix,uid=1000,gid=12 345,credentials=/etc/samba/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

dmizer
August 9th, 2009, 10:23 AM
Hi (this will answers danny,s comment about not seeing anything in my fstab as well)
I figured trying to mount manually 1st as per the 1st page in your post before embarking on editing my fstab. Here's the command I'm running and the resulting output

cem@m3n78:~$ sudo mount -t cifs //LAN-DISK1/store1 /media/store1 -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77
mount error(5): Input/output error
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
cem@m3n78:~$

Add the nounix option to your mount command like so:
sudo mount -t cifs //LAN-DISK1/store1 /media/store1 -o guest,nounix,rw,iocharset=utf8,file_mode=0777,dir_ mode=0777

dannyboy79
August 9th, 2009, 10:27 AM
Try adding the rw option.
//192.168.0.4/My\040Pictures /mnt/winxp_pictures cifs rw,auto,noperm,noexec,users,nounix,uid=1000,gid=12 345,credentials=/etc/samba/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

nope, that didn't do it either. do you use simple file sharing in winxp or is it in vista? i am not using simple file sharing. i just can't believe i have a total of 5 or 6 shares from winxp and all of them but the pictures and the shared folder just will NOT mount writable. i don't knaw what elsse to do. i have covered every base I can think of.

dmizer
August 9th, 2009, 11:02 AM
nope, that didn't do it either. do you use simple file sharing in winxp or is it in vista? i am not using simple file sharing. i just can't believe i have a total of 5 or 6 shares from winxp and all of them but the pictures and the shared folder just will NOT mount writable. i don't knaw what elsse to do. i have covered every base I can think of.

Would you believe ...

I haven't used Windows file sharing at all for the past 3 years. I only have one Windows network I administer. The server is Ubuntu Dapper, and I've disabled file sharing on all the clients, so everything I know about Samba and CIFS, I've gleaned from supporting this thread.

Are all the Windows computers able to read and write to one another? Do I recall correctly that you said you are able to read and write correctly when using smbclient? What is the output of:
smbtree

corkscrew
August 10th, 2009, 04:45 AM
Add the nounix option to your mount command like so:
sudo mount -t cifs //LAN-DISK1/store1 /media/store1 -o guest,nounix,rw,iocharset=utf8,file_mode=0777,dir_ mode=0777

:)Success!!! thank you very much for your patience dmizer, i've been struggling with this for weeks.

The nounix edit did the trick I managed to mount both NAS drives using this, further more I then edited my fstab including the same edit again perfect. My next steps are too putmy passwords back on the drives and try again.

One niggle is there is quite a delay when I shut the machine down, the screen goes black and 2 messages appear I will need to scribble them down and post, one starts cifs vfs....

dmizer
August 10th, 2009, 07:09 AM
That would be "CIFS VFS: Server not responding". There's a fix for that listed in the tutorial under the "Troubleshooting" section. :)

dannyboy79
August 10th, 2009, 11:41 AM
Would you believe ...

I haven't used Windows file sharing at all for the past 3 years. I only have one Windows network I administer. The server is Ubuntu Dapper, and I've disabled file sharing on all the clients, so everything I know about Samba and CIFS, I've gleaned from supporting this thread.

Are all the Windows computers able to read and write to one another? Do I recall correctly that you said you are able to read and write correctly when using smbclient? What is the output of:
smbtree
well, smbclient appears to work. i was able to mkdir as well as mput a text.txt file on the share. see below:

daniel@dell:~$ smbclient \\\\WINXP\\SharedDocs
Enter daniel's password:
Domain=[WINXP] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
smb: \> mput test.txt
Put file test.txt? Y
putting file test.txt as \test.txt (0.0 kb/s) (average 0.0 kb/s)
smb: \> ls
. DR 0 Mon Aug 10 10:46:14 2009
.. DR 0 Mon Aug 10 10:46:14 2009
.Trash-root D 0 Mon Nov 26 20:47:11 2007
Adobe PDF 6.0 D 0 Fri Sep 28 18:58:26 2007
ballys_renewal_4-21-2009.pdf A 107253 Tue Jun 2 08:32:06 2009
current_benefit_costs A 121940 Wed Apr 15 19:32:33 2009
desktop.ini AHS 128 Mon Aug 13 01:13:46 2007
dvd D 0 Wed Jul 29 12:01:32 2009
fesity-fstab.txt A 1776 Fri Jun 12 23:39:47 2009
InstallUtil.exe A 28672 Wed Oct 24 01:47:40 2007
InstallUtil.InstallLog A 736 Tue Jun 2 20:26:43 2009
InstallUtilLib.dll A 65032 Wed Oct 24 01:47:40 2007
iphone D 0 Fri Jul 3 14:18:12 2009
linux-distros D 0 Wed Jul 29 09:37:46 2009
My Music DR 0 Thu Jul 9 12:32:19 2009
My Pictures DR 0 Sun Apr 19 17:14:51 2009
My Videos DR 0 Mon May 4 12:34:51 2009
mythtv frontend universal D 0 Fri Jun 26 18:59:48 2009
pet warehouse.pdf A 1036315 Sun Jun 7 07:31:14 2009
printer D 0 Sun Jun 7 07:31:53 2009
send to printer link.txt A 55 Tue Jun 2 20:03:55 2009
SendToPrinter.exe A 20480 Mon Mar 30 15:45:46 2009
SendToPrinter.InstallLog A 810 Tue Jun 2 20:26:43 2009
SendToPrinter.InstallState A 5012 Tue Jun 2 20:26:43 2009
SendToPrinterConfig.xml A 201 Tue Jun 2 20:08:27 2009
test D 0 Mon Aug 10 10:45:06 2009
test.txt A 0 Mon Aug 10 10:46:14 2009
xbox_suff D 0 Wed Jul 29 13:58:15 2009
zek_kit.jpg A 231130 Thu Jun 11 21:48:16 2009

38142 blocks of size 2097152. 20980 blocks available
smb: \> exit


when I issue smbtree and enter the password for the windows machine shares (all usernames and password are the same. this is what it returns:
daniel@dell:~$ smbtree
Password:
LINUX
\\WINXP dans windows computer
\\WINXP\LexmarkX Lexmark X5400 Series
\\WINXP\Printer Microsoft XPS Document Writer
\\WINXP\C$ Default share
\\WINXP\ADMIN$ Remote Admin
\\WINXP\My Pictures WINXP Pictures
\\WINXP\WINXP My Videos
\\WINXP\I$ Default share
\\WINXP\print$ Printer Drivers
\\WINXP\SharedDocs WINXP Shared docs
\\WINXP\D$ 500gb on winxp
\\WINXP\IPC$ Remote IPC
\\WINXP\daniel
\\WINXP\xbox_games
\\DELL dell
\\DELL\IPC$ IPC Service (dell)
\\DELL\music Mythtv music on dell
\\DELL\videos Mythtv videos on dell
\\DELL\recordings TV Recordings on dell
\\DELL\mythtv Mythtv folder on dell
\\DELL\music2 Music2 folder on dell
\\DELL\fat32 Movies on dell
\\DELL\fat32_movies Movies on dell
\\DELL\500gb1 500gb1 storage on dell
\\DELL\500gb 500gb storage on dell
\\DELL\recordings2 MythTV secondary folder on dell
\\DELL\print$ Printer Drivers
\\CORE2DUO core2duo
\\CORE2DUO\pdf
\\CORE2DUO\print$ Printer Drivers
\\CORE2DUO\daniel Home Directories
\\CORE2DUO\danielvideos Daniel Videos folder on core2duo
\\CORE2DUO\IPC$ IPC Service (core2duo)


so why does smbclient work but mounting it with fstab doesn't? i ahev ensured that /etc/samba/.smbcredentials does contain this:

username=daniel
password=mazDA@01!

and yes, there is a empty line after the password line. isn't there suppose to be? is it maybe a problem with cifs? I did try smbfs as well. it just won't mount writable. i thought this would be an easy problem but it's being just the opposite. i believe i have documented all the pertinent info, let me know if there's more you need to see and I'll be happy to post as I really need to solve this issue. all my pictures are on the windows machine, I am just about to move them over to ext3 on linux if I can't figure this out. what weird is that the other windows shares are writable and I am using the same exact fstab entries and i have verified that all permissions on the 2 windows shares are the same as the shares that are writable. folder permissions on the linux folders prior to mounting are all rwx by all. WEIRD hey?

dmizer
August 10th, 2009, 12:03 PM
Try this and see if it gives us any more information:
sudo mount -v -t cifs //192.168.0.4/My\040Pictures /mnt/winxp_pictures -o credentials=/etc/samba/.smbcredentials,rw,nounix,iocharset=utf8,file_mode =0777,dir_mode=0777

I'm headed to Korea for a 3 day long business trip. I'll try to check in on my way to the ferry port tomorrow morning, but don't count on anything until Friday.

corkscrew
August 11th, 2009, 11:48 AM
That would be "CIFS VFS: Server not responding". There's a fix for that listed in the tutorial under the "Troubleshooting" section. :)
Yes right again, that fixed it, thanks for help with all this:)

dannyboy79
August 11th, 2009, 01:19 PM
Try this and see if it gives us any more information:
sudo mount -v -t cifs //192.168.0.4/My\040Pictures /mnt/winxp_pictures -o credentials=/etc/samba/.smbcredentials,rw,nounix,iocharset=utf8,file_mode =0777,dir_mode=0777

I'm headed to Korea for a 3 day long business trip. I'll try to check in on my way to the ferry port tomorrow morning, but don't count on anything until Friday.
thanks for the help thus far. it returned this:

mount.cifs kernel mount options unc=//192.168.0.4\My040Pictures,user=daniel,pass=notfora nyoneseyes,ver=1,rw,credentials=/etc/samba/.smbcredentials,nounix,iocharset=utf8,file_mode=07 77,dir_mode=0777
retrying with upper case share name

mount.cifs kernel mount options unc=//192.168.0.4\MY040PICTURES,user=daniel,pass=mazDA@0 1!,ver=1,rw,credentials=/etc/samba/.smbcredentials,nounix,iocharset=utf8,file_mode=07 77,dir_mode=0777
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

yet, smbtree and entering my password returns this (WINXP is 192.168.0.4):
LINUX
\\WINXP dans windows computer
\\WINXP\LexmarkX Lexmark X5400 Series
\\WINXP\Printer Microsoft XPS Document Writer
\\WINXP\C$ Default share
\\WINXP\ADMIN$ Remote Admin
\\WINXP\My Pictures WINXP Pictures
\\WINXP\WINXP My Videos
\\WINXP\I$ Default share
\\WINXP\print$ Printer Drivers
\\WINXP\SharedDocs WINXP Shared docs
\\WINXP\D$ Default share
\\WINXP\IPC$ Remote IPC
\\WINXP\daniel
\\WINXP\xbox_games

the usernames and password are the same on the windows box as well as the ubuntu machine trying to mount it. ok, i tried
sudo mount -v -t cifs //192.168.0.4/My\ Pictures /mnt/winxp_pictures -o credentials=/etc/samba/.smbcredentials,rw,nounix,iocharset=utf8,file_mode =0777,dir_mode=0777
and that actually worked but it still isn't writable. see ls -l output:
dr-xr-xr-x 1 root root 0 2009-08-10 14:32 winxp_pictures

so without the uid and gid, it's getting mounted with root user and root group. its werid that it just won't mount as writable. I still want to solve this issue but for now, i just moved all my pictures over to the server which is ext3 and i am sharing them out via nfs to linux boxes and samba to windows

dmizer
August 11th, 2009, 07:35 PM
dannyboy79, at this point I'm almost 100% positive that the problem is on the share permissions side of Windows. I'm not sure what is wrong or how to change it, but we've tried just about everything I can think of on the Ubuntu side and we still end up without write permission.

dannyboy79
August 14th, 2009, 09:28 AM
dannyboy79, at this point I'm almost 100% positive that the problem is on the share permissions side of Windows. I'm not sure what is wrong or how to change it, but we've tried just about everything I can think of on the Ubuntu side and we still end up without write permission.
i am guessing the same thing but I don't know what else to do. security and sharing is allowing my user FULL CONTROL of the share. what's more weird is the default shared folder in winxp pro isn't even writable over smb. i just moved my pictures over to the file server as that's the machine that is on all the time, but i still can't write to the shared docs folder over smb. very weird. i am not familiar with windows permissions so i really don't know what else to do. i have double and triple checked that it is writable in sharing and security. i don't know what else to try. maybe i'll try to add another group to the machine, and add my username to that group and then give that group write permissions. thanks for trying to help me though.

dmizer
August 14th, 2009, 10:40 AM
What version of XP (and what service pack) are you using?

dannyboy79
August 14th, 2009, 10:42 AM
What version of XP (and what service pack) are you using?

win xp pro version 2003 service pack 3

dmizer
August 14th, 2009, 10:46 AM
Have a look here: http://www.practicallynetworked.com/sharing/xp_filesharing/whole.htm

Eladon
September 5th, 2009, 03:45 AM
Well, I came to this post, found it wasn't really to do with my problem, but couldn't help but keep reading because it was just so comprehensive and well written, and spectacular learning materials. Kudos dmizer! Particularly considering you actually ended up fixing my seemingly unrelated problem!

Ever since I upgraded to Jaunty, I have been unable to open up TrueCrypt volumes from my Samba server (server is running Hardy). Every time I tried, either the volume was unexplainably read-only, or I would get the error message:
Input/output error:
/dev/mapper/truecrypt7

The drive is damaged (there is a physical defect on it) or a cable is damaged, or the memory is malfunctioning.
(etc)

I noticed the fix regarding troubles opening Open Office files. I hadn't yet had any troubles with Open Office yet, but thought "aw heck, haven't had success with anything else, I should try this". So I added the nobrl option, and unbelievably it fixed my problem!

Just thought I would let you and your readers know! Thanks again for a great guide!

HyugaRicdeau
September 6th, 2009, 02:22 AM
Hate to bring this up again, but I'm suddenly having the same problem as dannyboy79.

I'm trying to mount a few Windows XP shares, but when I perform the mount, the permissions on the mount point itself become "dr-xr-xr-x" no matter what I try.

I'm using file_mode=744,dir_mode=744, and everything *under* the mount point has the correct modes. Both the mount point and everything under it do have the correct ownership. Specifically, I'm performing the following:
sudo mount -t cifs //NAVI/Code /mnt/smb/navi/code -o rw,iocharset=utf8,credentials=etc/.smbcredentials,file_mode=0744,dir_mode=744,uid=10 00,gid=1000

Basically everything else is as dannyboy79 described. I've done this a bunch of times before, with the same shares, which have not changed recently to my knowledge. But this is on a new server running Jaunty--first time I've used it. I don't know if it's something about Jauny or what, but there's definitely something fishy going on here, and I don't think it's on the windows side. I can interact with the share normally with smbclient.

Could this have something to do with AppArmor? I'm not very familiar with it...

dmizer
September 7th, 2009, 10:15 PM
I'm trying to mount a few Windows XP shares, but when I perform the mount, the permissions on the mount point itself become "dr-xr-xr-x" no matter what I try.
It may be a firewall interfering.

Please post the output of the following from both the server and the client:
sudo iptables -L


Could this have something to do with AppArmor? I'm not very familiar with it...

I doubt it, unless you've played with apparmor's configuration.

Burky
October 3rd, 2009, 10:08 AM
When I add this to the Fstab //compac/External%20(j)/ /media/sharename cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0 and run sudo mount -a i get this
david@nx9010:~$ sudo mount -a
retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)


but I know it exists because I copy and pasted it from the smbtree.
Any suggestions?

dmizer
October 4th, 2009, 05:55 AM
//compac/External%20(j)/ /media/sharename cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0

Your mount line should probably look like this:
//compac/External/ /media/sharename cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0
When looking at smbtree, you will see both the share name as well as the comment. In your case, the (j) is a comment meaning what drive letter. This is not needed in your mount command.

If you are still unsuccessful, you will probably have to rename the share on the Windows machine so that it does not contain the parentheses.

Burky
October 4th, 2009, 10:05 AM
Your mount line should probably look like this:
//compac/External/ /media/sharename cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0
When looking at smbtree, you will see both the share name as well as the comment. In your case, the (j) is a comment meaning what drive letter. This is not needed in your mount command.

If you are still unsuccessful, you will probably have to rename the share on the Windows machine so that it does not contain the parentheses.

I was unable to get it to work with
//compac/External/ /media/sharename cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0

So I got on the Compac, went to "My Network Places" found the External drive, and renamed it just "External". When I went into that machine over the network on my Ubuntu machine, it was still called "External (J)" and I still could get it to work the way you told me.

Anything I'm doing wrong? Any Suggestions?

dmizer
October 4th, 2009, 10:13 AM
So I got on the Compac, went to "My Network Places" found the External drive, and renamed it just "External". When I went into that machine over the network on my Ubuntu machine, it was still called "External (J)" and I still could get it to work the way you told me.

I think you changed the share name in the wrong place.

Open "My Computer", right click on the J drive and select "Sharing and Security", then click on the "Sharing" tab. You may see a warning that says "If you understand the risk ... click here". This is where you should change the share name.

You should probably reboot the Windows computer after making this change.

Burky
October 4th, 2009, 10:19 AM
Open "My Computer", right click on the J drive and select "Sharing and Security", then click on the "Sharing" tab. You may see a warning that says "If you understand the risk ... click here". This is where you should change the share name.

Where it says "Share Name: EXTERNAL (J)" the box is grey and won't let me type in it.

dmizer
October 4th, 2009, 10:25 AM
Where it says "Share Name: EXTERNAL (J)" the box is grey and won't let me type in it.

This is probably a stupid question on my part, but you never know so ...

Are you sure that there's a checkmark in the "Share this folder on the network" box?

Otherwise, you're probably not signed in with a username that has the correct permissions to change the share name. You'll have to log in as an Administrator. If you don't know how, either refer to your computer's user manual, or post your computer's make and model number here.

Edit:
One final thought. You may be able to un-share the folder and recreate the share under a different name. Be sure to remove the (J) automatically placed on the end of the share name for a full drive share.

Burky
October 4th, 2009, 10:30 AM
My account does have Administrative privileges, it's just not the owner? And my computer is a Compaq Presorio sr1503wm.

dmizer
October 4th, 2009, 10:39 AM
My account does have Administrative privileges, it's just not the owner? And my computer is a Compaq Presorio sr1503wm.

Did you set up the external drive on a different computer perhaps? Can you unshare the share? Can you create a new folder on the drive? If so, can you share the newly created folder? If so, I HIGHLY suggest moving all the content into that folder so you have something like:


J:/Shared-content
/Music
/Video
/Documents
/Other-data
Where "Shared-content" is the actual shared folder rather than sharing the whole drive (which even Windows strongly suggests not doing).

If this is not satisfactory, I'll do some digging on your specific model. But I think the above will be the easiest solution.

Burky
October 4th, 2009, 10:44 AM
Thanks a lot Dmizer! I got it to work, I forgot I had to unshare the folder first before I could change the name.

dmizer
October 4th, 2009, 10:45 AM
Thanks a lot Dmizer! I got it to work, I forgot I had to unshare the folder first before I could change the name.

Sweet! :guitar:

HyugaRicdeau
October 4th, 2009, 08:23 PM
It may be a firewall interfering.

Please post the output of the following from both the server and the client:
sudo iptables -L


Not likely. The server is a Windows XP machine, for one. The Linux machine doesn't have any settings in iptables currently--they're both behind a separate firewall.

When I mount the share, the Windows permissions seem to behave as expected. In fact, I can write a file to the root of the share as root. For example, sudo touch /path/to/share/test. But no matter what I do, mount would set write permission on the mount point. Very strange.

HyugaRicdeau
October 4th, 2009, 08:49 PM
Hate to bring this up again, but I'm suddenly having the same problem as dannyboy79.

I'm trying to mount a few Windows XP shares, but when I perform the mount, the permissions on the mount point itself become "dr-xr-xr-x" no matter what I try.

I'm using file_mode=744,dir_mode=744, and everything *under* the mount point has the correct modes. Both the mount point and everything under it do have the correct ownership. Specifically, I'm performing the following:
sudo mount -t cifs //NAVI/Code /mnt/smb/navi/code -o rw,iocharset=utf8,credentials=etc/.smbcredentials,file_mode=0744,dir_mode=744,uid=10 00,gid=1000

Basically everything else is as dannyboy79 described. I've done this a bunch of times before, with the same shares, which have not changed recently to my knowledge. But this is on a new server running Jaunty--first time I've used it. I don't know if it's something about Jauny or what, but there's definitely something fishy going on here, and I don't think it's on the windows side. I can interact with the share normally with smbclient.

I seem to have solved my problem--probably dannyboy79's problem too. mount cifs is paying attention to the readonly flag on the Windows share directory. Apparently it didn't do this with earlier kernel versions, which is why I'm just having this problem now.

Now, I never intended for those directories to be set read-only. And in fact, they really aren't. So this surprised me. According to Microsoft:

Unlike the Read-only attribute for a file, the Read-only attribute for a folder is typically ignored by Windows, Windows components and accessories, and other programs. For example, you can delete, rename, and change a folder with the Read-only attribute by using Windows Explorer. The Read-only and System attributes is only used by Windows Explorer to determine whether the folder is a special folder, such as a system folder that has its view customized by Windows (for example, My Documents, Favorites, Fonts, Downloaded Program Files), or a folder that you customized by using the Customize tab of the folder's Properties dialog box. As a result, Windows Explorer does not allow you to view or change the Read-only or System attributes of folders.

*sigh* That comes from here: http://support.microsoft.com/kb/326549/

Using the attrib command to remove the read-only flag solved the problem.

dmizer
October 4th, 2009, 11:17 PM
That was a fantastic find! I will update the troubleshooting section of the howto when I get home from work this evening.

Thank you!

swatsbiz
October 15th, 2009, 01:58 PM
new problem with a fresh install of karmic;

I have two shares on the same network drive, one is Public, and has no username/password settings, the other uses a username, but no password.

I have repeated the steps to get my Jaunty install to connect, but the one using .smbcredentials file access the drive but does not access the folder - i.e I get an empty folder.

The Public folder works fine.

Any thoughts?

David

dmizer
October 15th, 2009, 08:02 PM
new problem with a fresh install of karmic;

I have two shares on the same network drive, one is Public, and has no username/password settings, the other uses a username, but no password.

I have repeated the steps to get my Jaunty install to connect, but the one using .smbcredentials file access the drive but does not access the folder - i.e I get an empty folder.

The Public folder works fine.

Any thoughts?

David

What does your credentials file look like? Also, please post your /etc/fstab mount lines.

swatsbiz
October 15th, 2009, 08:02 PM
I've discovered that files I move into the folder stay there and show up when logging into the folder over:

Places > Network > Windows Network > netbios > folder

Just nothing shows through the fstab option!

swatsbiz
October 15th, 2009, 08:04 PM
credentials file looks like:

username=xxxxxxx
password=

password is blank, and work fine like this in Jaunty

//mss-014588/church /media/Church cifs credentials=/root/.smbcredentials,iocharset=utf8,gid=1000,uid=1000,n ounix,nobrl,file_mode=0777,dir_mode=0777 0 0
//mss-014588/Public /media/Public cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0

dmizer
October 15th, 2009, 08:33 PM
Try this:
//mss-014588/church /media/Church cifs user=your-username,iocharset=utf8,gid=1000,uid=1000,nounix,n obrl,file_mode=0777,dir_mode=0777 0 0

Dareus
October 16th, 2009, 02:48 AM
I'm having a similar problem:

my timecapsule has a guest account and I mount it using this one but I cannot see what's inside the storage but files are there because cd works fine and I can even read files if I use the appropriate sw (e.g. mplayer for .mp3) but ls doesn't show anything on the device and even nautilus behaves the same.

EDIT:

user=guest doesn't do the job

dmizer
October 16th, 2009, 06:29 AM
I'm having a similar problem:

my timecapsule has a guest account and I mount it using this one but I cannot see what's inside the storage but files are there because cd works fine and I can even read files if I use the appropriate sw (e.g. mplayer for .mp3) but ls doesn't show anything on the device and even nautilus behaves the same.

EDIT:

user=guest doesn't do the job

What is the output of:
sudo ls -la /media/sharename
Replace sharename with the actual name of the folder you mounted the timecapsule in.

Dareus
October 16th, 2009, 08:00 AM
What is the output of:
sudo ls -la /media/sharename
Replace sharename with the actual name of the folder you mounted the timecapsule in.


$ sudo ls -la /media/timecapsule/
totale 4
drwxr-xr-x 1 root root 0 2009-09-23 14:42 .
drwxr-xr-x 4 root root 4096 2009-10-16 12:55 ..


That's it, I told that ls wasn't working well..

but I'm still able to navigate the mount if I know what to look for


$ getfacl /media/timecapsule/Musica
getfacl: Removing leading '/' from absolute path names
# file: media/timecapsule/Musica
# owner: root
# group: root
user::rwx
group::r-x
other::r-x

dmizer
October 16th, 2009, 10:12 AM
$ sudo ls -la /media/timecapsule/
totale 4
drwxr-xr-x 1 root root 0 2009-09-23 14:42 .
drwxr-xr-x 4 root root 4096 2009-10-16 12:55 ..


That's it, I told that ls wasn't working well..

but I'm still able to navigate the mount if I know what to look for


$ getfacl /media/timecapsule/Musica
getfacl: Removing leading '/' from absolute path names
# file: media/timecapsule/Musica
# owner: root
# group: root
user::rwx
group::r-x
other::r-x



Under Troubleshooting, try the fix labeled: Files owned by root / "The folder contents could not be displayed"

Dareus
October 16th, 2009, 10:23 AM
Under Troubleshooting, try the fix labeled: Files owned by root / "The folder contents could not be displayed"


I already have specified my uid and gid in /etc/fstab but that doesn't seem to work.

This is the line in my fstab:

#Time capsule
//Time-capsule.local/Disco\040Airport /media/timecapsule cifs users,password=***,uid=1000,gid=1000,rw,nounix,nob rl 0 0

dmizer
October 16th, 2009, 12:14 PM
I already have specified my uid and gid in /etc/fstab but that doesn't seem to work.

This is the line in my fstab:

#Time capsule
//Time-capsule.local/Disco\040Airport /media/timecapsule cifs users,password=***,uid=1000,gid=1000,rw,nounix,nob rl 0 0


In this post: http://ubuntuforums.org/showpost.php?p=8112752&postcount=1090 you indicate that your time capsule has a guest account. If that's the case, why are you mounting with a password? Also, if you're mounting with a password, why are you not including a username?

swatsbiz
October 16th, 2009, 01:38 PM
now "only root can mount" the drive

:-(

Don't have time to do digging, will check back when I get back in

Dareus
October 16th, 2009, 01:39 PM
In this post: http://ubuntuforums.org/showpost.php?p=8112752&postcount=1090 you indicate that your time capsule has a guest account. If that's the case, why are you mounting with a password? Also, if you're mounting with a password, why are you not including a username?

The share has an option that works like that: every user that logs to the share specifying the right password can read/write on the drive.

In other words there's no need to specify an user. I mounted my Timecapsule with those options for years and everything worked (more or less) perfectly.

dmizer
October 16th, 2009, 01:52 PM
now "only root can mount" the drive

:-(

Don't have time to do digging, will check back when I get back in

Only root can mount the drive unless you add the "users" option to the mount line. This is expected behavior. That's why you need to type "sudo" in the line: "sudo mount -a" as outlined in the tutorial.

Try rebooting and see if the share is mounted correctly upon reboot.

The share has an option that works like that: every user that logs to the share specifying the right password can read/write on the drive.

In other words there's no need to specify an user. I mounted my Timecapsule with those options for years and everything worked (more or less) perfectly.

There's no need to specify a user when you mount the share with Windows because Windows sends the username by default. Try adding: user=your-ubuntu-username as an option. Have you checked to make sure there's no firewall interfering?

Either way, your files are clearly mounting as root rather than your user and that's what's causing your problem.

Dareus
October 16th, 2009, 01:58 PM
There's no need to specify a user when you mount the share with Windows. Try adding: user=your-ubuntu-username as an option. Have you checked to make sure there's no firewall interfering?

Either way, your files are clearly mounting as root rather than your user and that's what's causing your problem.

I added user=myubuntuusername and nothing changed, no firewall anyway...

I'm starting to worry... :(:(:(

dmizer
October 16th, 2009, 02:06 PM
I added user=myubuntuusername and nothing changed, no firewall anyway...

I'm starting to worry... :(:(:(

What's the model number of your time capsule? Have you checked to see if there are any firmware updates for it? NAS devices with old firmware and/or old Samba support have been the single biggest headache for me in this thread ... lol.

Edit:
Are there any Windows Vista or Win7 machines that access this Timecapsule device?

Dareus
October 16th, 2009, 02:12 PM
What's the model number of your time capsule? Have you checked to see if there are any firmware updates for it? NAS devices with old firmware and/or old Samba support have been the single biggest headache for me in this thread ... lol.

Edit:
Are there any Windows Vista or Win7 machines that access this Timecapsule device?

1. No newer firmware: I've already looked for that...

2. No, I use it only with my laptop (which is a dual boot with winXP, with whom the Timecapsule works just fine except for unicode...)

dmizer
October 16th, 2009, 08:12 PM
No, I use it only with my laptop (which is a dual boot with winXP, with whom the Timecapsule works just fine except for unicode...)

You may check this post: http://ubuntuforums.org/showpost.php?p=8053685&postcount=1083

I believe that fix is only related to Vista and Win7, but I don't currently have any Windows machines on my network for testing and it's about the only idea I have left for you at this point.

swatsbiz
October 16th, 2009, 10:09 PM
Here's my new fstab line:

//mss-014588/church /media/Church cifs user=david,iocharset=utf8,gid=1000,uid=1000,nounix ,nobrl,file_mode=0777,dir_mode=0777 0 0


Ans still getting "only root can mount" error

dmizer
October 17th, 2009, 06:47 AM
Ans still getting "only root can mount" error

As I said before, this is not an error. This is a notification. Try running this command in the terminal:
sudo mount -a

stylofone
October 18th, 2009, 01:38 AM
Thank you for these very thoughful instructions. Unfortunately, I have found this general area of Ubuntu so annoying and fiddly that it has repeatedly made me give up on the whole thing and return to Windows, with its comparatively elegant 'map network drive' drop-down menu.

swatsbiz
October 18th, 2009, 03:42 AM
david@david-desktop:~$ sudo mount -a
[sudo] password for david:
Password:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
david@david-desktop:~$


And still I get:

mount: only root can mount //mss-014588/church on /media/Church

dmizer
October 18th, 2009, 06:07 AM
Thank you for these very thoughful instructions. Unfortunately, I have found this general area of Ubuntu so annoying and fiddly that it has repeatedly made me give up on the whole thing and return to Windows, with its comparatively elegant 'map network drive' drop-down menu.
Have you seen: http://ubuntuforums.org/showthread.php?t=1186877 and http://ubuntuforums.org/showthread.php?t=1169149 both of which work more like your Windows shares do

This howto is geared to Linux style mounts. I wrote it this way so that it can work across the multiple environments that Ubuntu supports (Ubuntu, Kubuntu, Xubuntu etc). I did not write it because it was the only way you could mount shares in Linux. It does have some advantages and disadvantages. Some people feel that one of the disadvantages is that it requires some CLI use.

david@david-desktop:~$ sudo mount -a
[sudo] password for david:
Password:
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
david@david-desktop:~$


And still I get:

mount: only root can mount //mss-014588/church on /media/Church


Please post the output of:
sudo iptables -L

swatsbiz
October 21st, 2009, 01:58 PM
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Dareus
October 21st, 2009, 03:07 PM
You may check this post: http://ubuntuforums.org/showpost.php?p=8053685&postcount=1083

I believe that fix is only related to Vista and Win7, but I don't currently have any Windows machines on my network for testing and it's about the only idea I have left for you at this point.

I tried but got no luck... :(

dmizer
October 21st, 2009, 10:14 PM
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

That looks fine. Are there any firewalls on the Windows machine? If so, try disabling them for testing.

dmizer
October 21st, 2009, 10:20 PM
I tried but got no luck... :(

Are you sure that there's a user with UID and GID of 1000 on your Ubuntu machine? Sometimes this is not the case if you add accounts or if you enable the root password.

Double check the /etc/passwd file to be sure.

Also, try removing the "users" option from the mount line. I'm not positive, but that could be conflicting with the UID and GID options later in the mount line, especially if the user mounting the share is not UID/GID 1000.

Dareus
October 22nd, 2009, 08:53 AM
Are you sure that there's a user with UID and GID of 1000 on your Ubuntu machine? Sometimes this is not the case if you add accounts or if you enable the root password.

Double check the /etc/passwd file to be sure.

Also, try removing the "users" option from the mount line. I'm not positive, but that could be conflicting with the UID and GID options later in the mount line, especially if the user mounting the share is not UID/GID 1000.

Double checked... my user has 1000:1000, I removed the "users" option but didn't worked.

I really don't know what to think...


Another little issue:
My timecapsule gets mounted every login (unuseful without the possibility to read files - I still can write them - but that's it). This is my /etc/gdm/PostSession/Default

#!/bin/sh

#Smontare i dischi prima di uscire
/etc/init.d/umountnfs.sh

exit 0


But I'm still getting the "CIFS VFS: No response for cmd 50" error, I think that the script doesn't gets executed, how can I solve it: I'm wasting lot of time at shutdown for a thing that I can't actually use.

dmizer
October 22nd, 2009, 09:32 AM
Are you sure you ran the

sudo apt-get install smbfs

command? You may have to run it again after an upgrade.

Dareus
October 22nd, 2009, 09:39 AM
Are you sure you ran the

sudo apt-get instal smbfs

command? You may have to run it again after an upgrade.

there's an "l" missing in "install", but I certainly have smfs installed (I even tried again), the umountnfs.sh file is there and is working, I can run it from my session but it doesn't get executed from PostSession/Default

I'll check for that file's permissions, I'm not sure about it...

EDIT: Everything was fine a+x...

dmizer
October 22nd, 2009, 09:54 PM
there's an "l" missing in "install", but I certainly have smfs installed (I even tried again), the umountnfs.sh file is there and is working, I can run it from my session but it doesn't get executed from PostSession/Default

I'll check for that file's permissions, I'm not sure about it...

EDIT: Everything was fine a+x...
Sorry about the missing l. I posted that from my cell phone and apparently I missed it ;)

I really can't see anything wrong with your CIFS configuration on the Ubuntu side. I suggest taking a very close look at the configuration on your Timecapsule.

Dareus
October 24th, 2009, 06:15 AM
I really can't see anything wrong with your CIFS configuration on the Ubuntu side. I suggest taking a very close look at the configuration on your Timecapsule.

The strange thing is that I WAS able to use my Timecapsule before upgrading to karmic and I haven't changed my TC config since then...

dmizer
October 24th, 2009, 10:21 AM
The strange thing is that I WAS able to use my Timecapsule before upgrading to karmic and I haven't changed my TC config since then...

Then perhaps it's time for a bug report? Can you use the above method to connect to shares other than your Timecapsule?

Dr_Hugh
October 25th, 2009, 10:31 AM
dmizer

Firstly many thanks for putting together and maintaining this thread on samba shares. I think file sharing is important enough for it to be a sticky.

Using your guide I managed to share and mount the home directories on booting.

The mistakes I made were to assume the server share path was //server/home/user not //server/user and my original user password used punctuation which caused errors when testing from the command line.

The second concerns roaming usershares. Somewhere around page 50 of this thread you mentioned looking into roaming clients. Have you had chance to do anything?

I started a thread at

http://ubuntuforums.org/showthread.php?t=1296167

but as yet have had no response.

dmizer
October 25th, 2009, 10:56 AM
dmizer

Firstly many thanks for putting together and maintaining this thread on samba shares. I think file sharing is important enough for it to be a sticky.

Using your guide I managed to share and mount the home directories on booting.

The mistakes I made were to assume the server share path was //server/home/user not //server/user and my original user password used punctuation which caused errors when testing from the command line.

The second concerns roaming usershares. Somewhere around page 50 of this thread you mentioned looking into roaming clients. Have you had chance to do anything?

I started a thread at

http://ubuntuforums.org/showthread.php?t=1296167

but as yet have had no response.

I have, and I've created a howto. Please see the 6th link in my sig :)

Dareus
October 25th, 2009, 02:02 PM
Then perhaps it's time for a bug report? Can you use the above method to connect to shares other than your Timecapsule?

Unfortunately I don't have another share to make some tests with.

BETELGEUSE58
October 27th, 2009, 10:07 AM
I used the trouble shooting section and entered these commands:

ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K15umountnfs.sh
ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K15umountnfs.sh

Had to enter sudo before them.

A word of warning, it caused my wireless to stop working. I believe it was those commands because I used them, rebooted (and it didn't fix the cifs vfs problem for me), and now wireless is gone.

dmizer
October 27th, 2009, 08:55 PM
I used the trouble shooting section and entered these commands:

ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K15umountnfs.sh
ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K15umountnfs.sh

Had to enter sudo before them.

A word of warning, it caused my wireless to stop working. I believe it was those commands because I used them, rebooted (and it didn't fix the cifs vfs problem for me), and now wireless is gone.

It's not possible for the above two lines to break your wireless. It's possible that the wins edit in /etc/nsswitch.conf did though.

There are two fixes for the CIFS VFS: Server not responding. Use the one listed under "Jaunty Users"

Davidovitch
October 28th, 2009, 09:30 AM
What I was looking for was to access my network shares from any program. Since the out of the box samba share (via GVFS) was only visible in Nautilus I had a problem. For me following post solved my problem:

www.g-loaded.eu/2008/12/08/access-gvfs-mounts-from-the-command-line/ (http://www.g-loaded.eu/2008/12/08/access-gvfs-mounts-from-the-command-line/)

which simply identified the "virtual mount point" (I don't know how to name it otherwise) of the GVFS mount as follows:
/home/<USER>/.gvfs/<server_connection_name>
Now I simply created a link in my favourites to the folder:
/home/<USER>/.gvfs/
so I could always approach easily the network share from anywhere.

After a quick search in this thread I thought nobody mentioned it earlier. So I hope this is not a double or irrelevant post...

Dr_Hugh
October 29th, 2009, 06:09 AM
dmizer,

thanks for your reply. I failed to explain that it is the Ubuntu shares I am having the most trouble with. I had hoped someone would come up with a simple solution for four people to use three computers without the complexity of LDAP to keep their files separate :(

dmizer
October 29th, 2009, 08:10 AM
dmizer,

thanks for your reply. I failed to explain that it is the Ubuntu shares I am having the most trouble with. I had hoped someone would come up with a simple solution for four people to use three computers without the complexity of LDAP to keep their files separate :(

Perhaps I've misunderstood but ... the 6th link in my sig has nothing to do with LDAP at all.

Dareus
October 29th, 2009, 10:31 AM
Then perhaps it's time for a bug report?

I just looked in launchpad and that (https://bugs.launchpad.net/ubuntu/+source/linux/+bug/406466)'s what I found.

Known issue and high priority... :(

EDIT: BUT there's a workaround: if the fs is mounted with the "noserverino" option, the files become visible again

naftali
October 30th, 2009, 07:55 AM
Hi

first of all, I'd like to thank you for this great tutorial, it worked perfectly in jaunty!

However, I installed karmic yesterday (clean install), and folowing your guide, when I try to mount -a I get the following error:

mount error: could not resolve address for homenas: Name or service not known
No ip address specified and hostname not found

this is the line I added to /etc/fstab (exactly the same as what worked in jaunty):

//homenas/public /media/Server cifs credentials=/root/.smbcredentials,rw,iocharset=utf8,gid=1000,uid=100 0,nounix,file_mode=0777,dir_mode=0777 0 0

the strange thing is, that if I select the connect to server option in nautilus, and put in homenas as server, public as folder, and the correct username and password, it works. This isn't a good enough solution for me because my music library is on the nas and most music players aren't very good at connecting to samba shares...

additional info: smbtree won't show anything, and trying to browse to the shared folders in nautilus doesn't work.

Thanks in advance!

^_Pepe_^
October 30th, 2009, 08:09 AM
Then, you probably crash against this bug: https://bugs.launchpad.net/bugs/406466. You have to put noserverino option to go.

This worked for me.

Regards,
^_Pepe_^^

Hi

first of all, I'd like to thank you for this great tutorial, it worked perfectly in jaunty!

However, I installed karmic yesterday (clean install), and folowing your guide, when I try to mount -a I get the following error:



this is the line I added to /etc/fstab (exactly the same as what worked in jaunty):

//homenas/public /media/Server cifs credentials=/root/.smbcredentials,rw,iocharset=utf8,gid=1000,uid=100 0,nounix,file_mode=0777,dir_mode=0777 0 0

the strange thing is, that if I select the connect to server option in nautilus, and put in homenas as server, public as folder, and the correct username and password, it works. This isn't a good enough solution for me because my music library is on the nas and most music players aren't very good at connecting to samba shares...

additional info: smbtree won't show anything, and trying to browse to the shared folders in nautilus doesn't work.

Thanks in advance!

dmizer
October 30th, 2009, 12:57 PM
Then, you probably crash against this bug: https://bugs.launchpad.net/bugs/406466. You have to put noserverino option to go.
Thanks to Dareus (http://ubuntuforums.org/showpost.php?p=8187618&postcount=1126), I added this information to the troubleshooting section.

However, this error doesn't seem to be related to the bug:

mount error: could not resolve address for homenas: Name or service not known
No ip address specified and hostname not found

naftali, have you checked for firewalls both on your Karmic machine as well as on the server?

naftali
October 31st, 2009, 01:16 PM
Hi,

My problem was that going a second time through the tutorial, I accidentaly skipped editing /etc/nsswitch.conf and installing winbind... :oops:

I didn't need to add the noserverino option once I did these steps.

Thanks!
naftali

shug33
November 3rd, 2009, 05:33 PM
I am running Karmic on an EeePC 1005ha.

Your "How To" worked perfectly except for having the "CIFS VFS: No response for cmd 50 ..." error on shutdown.

Your fix listed for Jaunty under troubleshooting solved it perfectly for Karmic, too. [edit: I first thought it solved, but on subsequent shutdowns and restarts found erratic boot and shutdown behaviour, such as going into recovery mode menu screen during shutdown, thence to a login cursor. See last paragraph below for more.]

The first fix by adding links removed the "CIFS..." error notice, but left a one minute hang with a blinking cursor during shutdown, so that way is apparently not good for Karmic.

After much suffering, I removed all the edits and used the dmizer "Howto: Fix Windows share browsing issues". This requires manual share mount, but it works without any problems.

ottar t
November 5th, 2009, 05:41 PM
Hello
Have upgraded to 9.10 from 9.04. Have been using mounting of network folders via fstab entry since 8.04. The fixes to get pass the "CIFS VFS: noe response form server mid 50 mid nnn" does not work for 9.10; putting "/etc/init.d/umountnfs.sh" in the /etc/gdm/PostSession/Default file even stop shutdown from getting passed the white ubuntu ring prior to the cifs vfs ... error message.

I'm using WLAN, so this might have an impact on this issue?
I have set wlan accessible for all users, as this was necessary to make cifs work in 9.04...

Have created a script w/ sudo /etc/init.d/umountnfs.sh that I run before shutdown, but look forward to a permanent fix...

Sader
November 6th, 2009, 05:57 AM
Hello

Thanks for how-to. I was able to mount the windows share via /etc/fstab.... However I'm not able to write it as normal user....any Ideas ?

//192.168.1.100/public /media/public cifs rw,exec,credentials=/etc/cifspw,iocharset=utf8,codepage=cp1251,gid=****,uid =**** 0 0


Pls can you help me with an advise.....

dmizer
November 6th, 2009, 10:21 AM
Hello

Thanks for how-to. I was able to mount the windows share via /etc/fstab.... However I'm not able to write it as normal user....any Ideas ?

//192.168.1.100/public /media/public cifs rw,exec,credentials=/etc/cifspw,iocharset=utf8,codepage=cp1251,gid=****,uid =**** 0 0


Pls can you help me with an advise.....

Looks like you've converted an old smbfs mount command instead of following the howto. Also, you're using the "exec" mount option which could be causing you problems, and finally you're not using the "file_mode" and "dir_mode" options like the examples in the howto. Try this instead:
//192.168.1.100/public /media/public cifs rw,noserverino,nounix,credentials=/etc/cifspw,iocharset=cp1251,gid=****,uid=****,file_mod e=0777,dir_mode=0777 0 0

moorsey
November 6th, 2009, 03:05 PM
Firstly, massive thanks to dmizer for this incredible guide, there is very little info on the web that pulls everything together like this.

I tried to avoid asking a question, but have been banging my head for weeks now. Mounting shares in Ubuntu has been the single hardest thing I have tried to do, hope someone can help.

I have 2 samba shares running on a 9.10 server, and 2 users that access them, one user can write to both, the other user can write to one and only read from the other.

My smb.conf is as follows (could be correct and the fstab that is causing the problems, not sure):

[global]
; General server settings
netbios name = SERVER146
server string =
workgroup = WORKGROUP
announce version = 5.0
socket options = TCP_NODELAY IPTOS_LOWDELAY SO_KEEPALIVE SO_RCVBUF=8192 SO_SNDBUF=8192

passdb backend = tdbsam
security = user
null passwords = true
username map = /etc/samba/smbusers
name resolve order = hosts wins bcast

wins support = yes

printing = CUPS
printcap name = CUPS

syslog = 1
syslog only = yes

[read]
path = /shared/read
browseable = yes
write list = airc
read list = cadet airc
guest ok = no
create mask = 0777
directory mask = 0777

[write]
path = /shared/write
browseable = yes
write list = cadet airc
read list = cadet airc
guest ok = no
create mask = 0777
directory mask = 0777
This has been seup according to the guide here:
http://ubuntuforums.org/showthread.php?t=202605

Only difference is that the shares are symlinks to other directories, hope this doesn't cause issues, haven't thought to test that one!

Now, my fstab on the client PCs, also 9.10, have been setup according to your guide, using the credentials file:

//server/read /media/read cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0
//server/write /media/write cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

This worked fine, but any folders that was created in the writable share, came with a padlock on them. This meant that once a folder was created, it couldn't be edited or written inside.

Looking in the troubleshooting, I added the "nounix" switch to prevent this, which worked a treat! BUT, as a consequence, files copied to the share become corrupted.

What I mean by this, when a spreadsheet for example is copied to the write share and then opened again from the share, it is blank! Opening the same file in Windows shows a corrupted file, with some of the original data there, but very garbled.

Copying the file 4 or 5 times and opening from the share after each one will work sometimes on one of the attempts, bit hit and miss though.

I did also try adding the gid and uid lines in fstab. Finally, I tried the nobrl command in fstab. Same results.

Any help appreciated!

moorsey
November 6th, 2009, 03:58 PM
just to make clear, the nounix option is the cause of the blank files, removing this option fixes the file corruption, but then the folder locking starts, so it's one or the other it seems

Humanity to others
November 6th, 2009, 11:37 PM
I have also upgraded to 9.10 from 9.04. Have been using mounting of network folders from windows 2003 server via fstab entry since 8.04. Now I am facing the same problem that permanently mounted windows shares are getting readonly.

I was used the help following topic to configure windows shares on my Ubuntu desktop.

https://help.ubuntu.com/community/MountWindowsSharesPermanently

my fstab entry as follows
//192.168.0.5/e /home/anil/work smbfs username=administrator,password=admin 0 0

How can use my windows shares with read write & execute permissions as I enjoyed in 9.04

Thanks in advance

Anil

ottar t
November 7th, 2009, 07:58 AM
if you followed the howto in the link (https://help.ubuntu.com/community/Mo...resPermanently)you, you probably already have added smbfs(which include cifs) trough this command
> sudo apt-get install smbfs

in that case, just try changing smbfs to cifs in your fstab entry
like this
//192.168.0.5/e /home/anil/work cifs username=administrator,password=admin 0 0

try sudo mount -a in terminal afterwards to check if it works...

you probably get the cifs vfs: server not responding... error during shutdown, but thats already covered in the tread. Except for the jaunty fix for putting /etc/init.d/umountnfs.sh above exit 0 in the /etc/gdm/PostSession/Default file. Doesn't work trough wireless in 9.10

I run the same command as root> sudo /etc/init.d/umountnfs.sh before shutdown and the pc shuts down without any probl..

arryo
November 9th, 2009, 03:17 AM
I use permanent mount like the guide, but whenever I start ubuntu computer, the mount is gone until I type "sudo mount -a"

Is there any way that the mount is actually permanent?

I'm using Ubuntu 9.10 and mount to a share folder in Windows 7

Thank you

Humanity to others
November 10th, 2009, 08:10 AM
//192.168.0.5/e /home/anil/work cifs username=administrator,password=admin 0 0



same result as by using cifs insted of smbfs

I AM GETTING THE FOLDER AS MOUNTED BUT IT IS GETTING READ ONLY, IN 9.04 I HAD NO PROBLEM !

dmizer
November 10th, 2009, 09:42 AM
same result as by using cifs insted of smbfs

There is a fix for this listed in the howto underKARMIC: Files owned by root / "The folder contents could not be displayed"

dmizer
November 10th, 2009, 09:44 AM
I use permanent mount like the guide, but whenever I start ubuntu computer, the mount is gone until I type "sudo mount -a"

Is there any way that the mount is actually permanent?

I'm using Ubuntu 9.10 and mount to a share folder in Windows 7

Thank you

Add "mount -a" to the /etc/rc.local file before the "exit 0" line like so:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
mount -a
exit 0

dmizer
November 10th, 2009, 09:48 AM
just to make clear, the nounix option is the cause of the blank files, removing this option fixes the file corruption, but then the folder locking starts, so it's one or the other it seems

You can't only add the "nounix" option. You have to also add the uid and gid options as listed in the Files owned by root / "The folder contents could not be displayed" troubleshooting section.

arryo
November 11th, 2009, 03:48 PM
Add "mount -a" to the /etc/rc.local file before the "exit 0" line like so:
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
mount -a
exit 0

Thank you very much. It worked!

Humanity to others
November 13th, 2009, 06:45 AM
There is a fix for this listed in the howto under

Fix the problem by adding noserverino

Thank you very much

Ubuntu Fan

moorsey
November 16th, 2009, 09:42 AM
You can't only add the "nounix" option. You have to also add the uid and gid options as listed in the Files owned by root / "The folder contents could not be displayed" troubleshooting section.

thanks for the reply

I gave this another try, but can confirm it still causes the same problem, corrupt files are copied to the samba server.

So, I decided instead of killing myself from stress trying to get this working, I setup NFS for Ubuntu sharing and left Samba running for the Windows clients also. I'm sure it is totally insecure with completely open permissions etc, but I honestly don't care any more. This whole experience has been a massive stress and desperately needs integrating into Ubuntu.

Windows has one checkbox to do what fstab does for example. I do love Ubuntu, but this has put me of a little.

dannyboy79
November 16th, 2009, 10:56 PM
Windows has one checkbox to do what fstab does for example. I do love Ubuntu, but this has put me of a little.
windows boxes are also controlled in 50,000 count netbot's that take down bank websites and hack social security numbers. if you don't mind that your windows box lets anyone and everyone have root access at any given time so be it.

DownTown22
November 16th, 2009, 11:58 PM
I currently run Ubuntu 9.10 and connect to a D-Link DNS-323.

Previously, I used the guide found here (http://www.marcus-furius.com/?p=59) to connect.

What is the advantage to using the method listed in this guide?
More precisely, why mount my NAS drive under /media instead of /home ?
Also, what does adding the guest,rw do, exactly?

Sader
November 17th, 2009, 12:16 AM
Looks like you've converted an old smbfs mount command instead of following the howto. Also, you're using the "exec" mount option which could be causing you problems, and finally you're not using the "file_mode" and "dir_mode" options like the examples in the howto. Try this instead:
//192.168.1.100/public /media/public cifs rw,noserverino,nounix,credentials=/etc/cifspw,iocharset=cp1251,gid=****,uid=****,file_mod e=0777,dir_mode=0777 0 0

Thanks for suggestion. Tried the option mentioned with putting UID & GID details - now i works fine :)
However - all Russian letters are now as �����.......any ideas ?

P.S. thanks a lot for your help

dmizer
November 17th, 2009, 12:50 AM
I currently run Ubuntu 9.10 and connect to a D-Link DNS-323.

Previously, I used the guide found here (http://www.marcus-furius.com/?p=59) to connect.

What is the advantage to using the method listed in this guide?
More precisely, why mount my NAS drive under /media instead of /home ?
Also, what does adding the guest,rw do, exactly?

This guide (for the most part) is basically the same. Really, it doesn't matter WHERE you mount the drive, but when you mount in /media, nautilus automatically adds a mounted volume icon to your desktop.

You can find more information about all the cifs options by looking at the manual for mount.cifs:
man mount.cifs

Here's the reason for the guest option:
password=arg
specifies the CIFS password. If this option is not given then the
environment variable PASSWD is used. If the password is not
specified directly or indirectly via an argument to mount,
mount.cifs will prompt for a password, unless the guest option is
specified.

The major difference between the guide you followed is that my guide covers more material, and comes with my personal support :)

dmizer
November 17th, 2009, 12:58 AM
However - all Russian letters are now as �����.......any ideas ?

P.S. thanks a lot for your help

Try changing cp1251 to utf8.

virtualXTC
November 17th, 2009, 05:58 PM
Hi dmizer,
Thanks for the very useful thread!

Just an FYI; I'm running Karmic have a apple time capsule and found that I had to use both the Karmic AND the Hardy trouble shooting options in order to fix the problem (per this tread: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/406466 )

Once again thanks for such a nice tread.

DownTown22
November 17th, 2009, 07:44 PM
Thanks a lot for the info!

The major difference between the guide you followed is that my guide covers more material, and comes with my personal support :)

And, I do enjoy the personal support!

DownTown22
November 17th, 2009, 08:34 PM
I've noticed since I upgraded to 9.10, that browsing my NAS drive has become very slow. Particularly, when browsing folders that contain images. Is there anything I can do to speed this up?

I currently run 9.10 and my NAS drive is a D-Link DNS-323.

Also, below is the fstab entry.

//192.168.0.101/Volume_1 /home/aaron/DNS-323 cifs guest,rw,iocharset=utf8,nounix,gid=1000,uid=1000,f ile_mode=0777,dir_mode=0777 0 0

Sader
November 19th, 2009, 10:18 AM
Try changing cp1251 to utf8.

Man you're amazing! Already done that by myself though....:D

Thanks a bunch for your help,
Regards
Sader

dmizer
November 19th, 2009, 07:55 PM
I've noticed since I upgraded to 9.10, that browsing my NAS drive has become very slow. Particularly, when browsing folders that contain images. Is there anything I can do to speed this up?

I currently run 9.10 and my NAS drive is a D-Link DNS-323.

Also, below is the fstab entry.

//192.168.0.101/Volume_1 /home/aaron/DNS-323 cifs guest,rw,iocharset=utf8,nounix,gid=1000,uid=1000,f ile_mode=0777,dir_mode=0777 0 0

This is a Nautilus feature. Remember, Nautilus loads thumbnails of all the images (as well as other files) so if you have huge folders full of images it will take a while to load them all. However, after the first time accessing the folder and after allowing all the thumbnails to load, you won't have the speed problem anymore.

If you're still having problems, there's a discussion earlier in this thread regarding this problem but the resolution was to change from Nautilus to Xubuntu's Thunar.

Velophile
November 23rd, 2009, 04:42 PM
.....
you probably get the cifs vfs: server not responding... error during shutdown, but thats already covered in the tread. Except for the jaunty fix for putting /etc/init.d/umountnfs.sh above exit 0 in the /etc/gdm/PostSession/Default file. Doesn't work trough wireless in 9.10

I run the same command as root> sudo /etc/init.d/umountnfs.sh before shutdown and the pc shuts down without any probl..

Which is the problem I'm trying to solve, shutdown works fine with CIFS mounted windows shares when I'm using the ethernet network but get the 'server not responding' error when on WiFi.

I've tried adding umounts in all the places suggested in this guide plus a few others (rc6.d, if-down.d).

Any ideas on how I can try and sort this out?

varanasi
November 23rd, 2009, 09:06 PM
The bug report (https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/211631/comments/108) sums up my experience with the error:

The moving/copying of the rc0/6 scripts doesn't seem to work in Karmic RC (using wireless). I just get a hang on shutdown with the message "init: usplash post-start process (2446) terminated with status 1" and never seems to shut down. If I put the scripts back the way they're supposed to be, then I simply get the usual CIFS VFS errors.

and

Confirmed here too. I've tried all the solutions listed previously to resolve this issue in Karmic and Wireless, but I always experience a hang on shutdown. The only "workaround" (not really) I've found so far is to add the "users" option to my /etc/fstab entry for my cifs share, then manually unmount the volume before shutting down / restarting the laptop.

dmizer
November 23rd, 2009, 11:00 PM
Which is the problem I'm trying to solve, shutdown works fine with CIFS mounted windows shares when I'm using the ethernet network but get the 'server not responding' error when on WiFi.

I've tried adding umounts in all the places suggested in this guide plus a few others (rc6.d, if-down.d).

Any ideas on how I can try and sort this out?

Are you using WPA encryption on your wireless, and are you using NetworkManager to manage your wireless connection?

Velophile
November 24th, 2009, 05:25 AM
Hi dmizer, thanks for the reply/help.

In short; yes and yes.

I tried switching to wicd to see if that helped and it didn't. I could try a test with different/no security (temporarily) when I get home.

varanasi
November 24th, 2009, 01:50 PM
I have the same problem with wep (and Karmic.)

(BTW, when I checked this thread this morning, I was surprised to find myself rooting for a poster on a help thread! Go dmizer! Crush the bug! Find a workaround!)

kalyp
November 27th, 2009, 04:53 PM
Hello,

Another karmic upgrade problem... I'm sorry if the answer is somewhere in the 117 pages, I couldn't read everything :)
I upgraded from jaunty to karmic a few days ago and cannot mount samba shares anymore even manually. I used to (and still can on another computer not yet upgraded) be able to manually mount typing:
sudo mount //netbiosname/sharename mount_point -o username=myname,password=mypsswd

This doesn't work anymore on karmic. I checked smbfs, samba, modified nsswitch.conf, installed winbind, tried different versions of the manual mount (adding -t cifs, adding options like iocharset=utf8,file_mode=0777,dir_mode=0777 or noserverino and nounix), nothing works. I get a mount error(110), timed out or something.
Using nautilus, I do get prompted for my password, but then after a little bit, I get an error "impossible to mount the windows share" (translated from French so something like that :)).

Sorry if the solution is obvious or already said somewhere, I just can't find it!
Thanks a lot in advance.

dmizer
November 29th, 2009, 09:32 PM
Hello,

Another karmic upgrade problem... I'm sorry if the answer is somewhere in the 117 pages, I couldn't read everything :)
I upgraded from jaunty to karmic a few days ago and cannot mount samba shares anymore even manually. I used to (and still can on another computer not yet upgraded) be able to manually mount typing:
sudo mount //netbiosname/sharename mount_point -o username=myname,password=mypsswd

This doesn't work anymore on karmic. I checked smbfs, samba, modified nsswitch.conf, installed winbind, tried different versions of the manual mount (adding -t cifs, adding options like iocharset=utf8,file_mode=0777,dir_mode=0777 or noserverino and nounix), nothing works. I get a mount error(110), timed out or something.
Using nautilus, I do get prompted for my password, but then after a little bit, I get an error "impossible to mount the windows share" (translated from French so something like that :)).

Sorry if the solution is obvious or already said somewhere, I just can't find it!
Thanks a lot in advance.

Please post the complete current mount command with directory locations.

kalyp
November 29th, 2009, 10:40 PM
What works in my still-jaunty computer is
sudo mount //sirocco/wwwroot/ /media/test/ -o username=myname,password=mypassword

That doesn't work anymore in my new-karmic computer. I also tried
sudo mount -t cifs //sirocco/wwwroot/ /media/test/ -o username=myname,password=mypassword,iocharset=utf8 ,file_mode=0777,dir_mode=0777
for instance. Same, works with jaunty, not with karmic.
I only did an upgrade, and it used to work with jaunty on the same computer...

The error (that I get after 5 min maybe, as if it was trying to connect but couldn't) is
mount error(110): Connexion terminée par expiration du délai d'attente
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
(kind of, connexion ended because the waiting time expired)

Thanks for your help!

dmizer
November 30th, 2009, 10:23 AM
That doesn't work anymore in my new-karmic computer. I also tried
sudo mount -t cifs //sirocco/wwwroot/ /media/test/ -o username=myname,password=mypassword,iocharset=utf8 ,file_mode=0777,dir_mode=0777
for instance. Same, works with jaunty, not with karmic.
I only did an upgrade, and it used to work with jaunty on the same computer...

The error (that I get after 5 min maybe, as if it was trying to connect but couldn't) is
mount error(110): Connexion terminée par expiration du délai d'attente
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)
(kind of, connexion ended because the waiting time expired)

Thanks for your help!

On the Karmic computer, please post the output of this command:
sudo iptables -L

kalyp
November 30th, 2009, 12:20 PM
Hi dmizer,

On the Karmic computer, please post the output of this command:
sudo iptables -L

Chain INPUT (policy DROP)
target prot opt source destination
ufw-before-logging-input all -- anywhere anywhere
ufw-before-input all -- anywhere anywhere
ufw-after-input all -- anywhere anywhere
ufw-after-logging-input all -- anywhere anywhere
ufw-reject-input all -- anywhere anywhere
ufw-track-input all -- anywhere anywhere

Chain FORWARD (policy DROP)
target prot opt source destination
ufw-before-logging-forward all -- anywhere anywhere
ufw-before-forward all -- anywhere anywhere
ufw-after-forward all -- anywhere anywhere
ufw-after-logging-forward all -- anywhere anywhere
ufw-reject-forward all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ufw-before-logging-output all -- anywhere anywhere
ufw-before-output all -- anywhere anywhere
ufw-after-output all -- anywhere anywhere
ufw-after-logging-output all -- anywhere anywhere
ufw-reject-output all -- anywhere anywhere
ufw-track-output all -- anywhere anywhere

Chain ufw-after-forward (1 references)
target prot opt source destination

Chain ufw-after-input (1 references)
target prot opt source destination
RETURN udp -- anywhere anywhere udp dpt:netbios-ns
RETURN udp -- anywhere anywhere udp dpt:netbios-dgm
RETURN tcp -- anywhere anywhere tcp dpt:netbios-ssn
RETURN tcp -- anywhere anywhere tcp dpt:microsoft-ds
RETURN udp -- anywhere anywhere udp dpt:bootps
RETURN udp -- anywhere anywhere udp dpt:bootpc
RETURN all -- anywhere anywhere ADDRTYPE match dst-type BROADCAST

Chain ufw-after-logging-forward (1 references)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 3/min burst 10 LOG level warning prefix `[UFW BLOCK] '

Chain ufw-after-logging-input (1 references)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 3/min burst 10 LOG level warning prefix `[UFW BLOCK] '

Chain ufw-after-logging-output (1 references)
target prot opt source destination

Chain ufw-after-output (1 references)
target prot opt source destination

Chain ufw-before-forward (1 references)
target prot opt source destination
ufw-user-forward all -- anywhere anywhere

Chain ufw-before-input (1 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ufw-logging-deny all -- anywhere anywhere state INVALID
DROP all -- anywhere anywhere state INVALID
ACCEPT icmp -- anywhere anywhere icmp destination-unreachable
ACCEPT icmp -- anywhere anywhere icmp source-quench
ACCEPT icmp -- anywhere anywhere icmp time-exceeded
ACCEPT icmp -- anywhere anywhere icmp parameter-problem
ACCEPT icmp -- anywhere anywhere icmp echo-request
ACCEPT udp -- anywhere anywhere udp spt:bootps dpt:bootpc
ufw-not-local all -- anywhere anywhere
ACCEPT all -- BASE-ADDRESS.MCAST.NET/4 anywhere
ACCEPT all -- anywhere BASE-ADDRESS.MCAST.NET/4
ufw-user-input all -- anywhere anywhere

Chain ufw-before-logging-forward (1 references)
target prot opt source destination

Chain ufw-before-logging-input (1 references)
target prot opt source destination

Chain ufw-before-logging-output (1 references)
target prot opt source destination

Chain ufw-before-output (1 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
ufw-user-output all -- anywhere anywhere

Chain ufw-logging-allow (0 references)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 3/min burst 10 LOG level warning prefix `[UFW ALLOW] '

Chain ufw-logging-deny (2 references)
target prot opt source destination
LOG all -- anywhere anywhere limit: avg 3/min burst 10 LOG level warning prefix `[UFW BLOCK] '

Chain ufw-not-local (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere ADDRTYPE match dst-type LOCAL
RETURN all -- anywhere anywhere ADDRTYPE match dst-type MULTICAST
RETURN all -- anywhere anywhere ADDRTYPE match dst-type BROADCAST
ufw-logging-deny all -- anywhere anywhere limit: avg 3/min burst 10
DROP all -- anywhere anywhere

Chain ufw-reject-forward (1 references)
target prot opt source destination

Chain ufw-reject-input (1 references)
target prot opt source destination

Chain ufw-reject-output (1 references)
target prot opt source destination

Chain ufw-track-input (1 references)
target prot opt source destination

Chain ufw-track-output (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere state NEW
ACCEPT udp -- anywhere anywhere state NEW

Chain ufw-user-forward (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere

Chain ufw-user-input (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT udp -- anywhere anywhere udp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:4662
ACCEPT udp -- anywhere anywhere udp dpt:4672
ACCEPT tcp -- anywhere anywhere tcp dpt:5900
ACCEPT udp -- anywhere anywhere udp dpt:5900
RETURN all -- anywhere anywhere

Chain ufw-user-logging-forward (0 references)
target prot opt source destination

Chain ufw-user-logging-input (0 references)
target prot opt source destination

Chain ufw-user-logging-output (0 references)
target prot opt source destination

Chain ufw-user-output (1 references)
target prot opt source destination
RETURN all -- anywhere anywhere

I do have the firewall enabled (Gufw 9.10.4), but that was already the case before the upgrade. I tried to turn it off, in which case iptables gives

Chain INPUT (policy ACCEPT)
target prot opt source destination
ufw-before-logging-input all -- anywhere anywhere
ufw-before-input all -- anywhere anywhere
ufw-after-input all -- anywhere anywhere
ufw-after-logging-input all -- anywhere anywhere
ufw-reject-input all -- anywhere anywhere
ufw-track-input all -- anywhere anywhere

Chain FORWARD (policy ACCEPT)
target prot opt source destination
ufw-before-logging-forward all -- anywhere anywhere
ufw-before-forward all -- anywhere anywhere
ufw-after-forward all -- anywhere anywhere
ufw-after-logging-forward all -- anywhere anywhere
ufw-reject-forward all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ufw-before-logging-output all -- anywhere anywhere
ufw-before-output all -- anywhere anywhere
ufw-after-output all -- anywhere anywhere
ufw-after-logging-output all -- anywhere anywhere
ufw-reject-output all -- anywhere anywhere
ufw-track-output all -- anywhere anywhere

Chain ufw-after-forward (1 references)
target prot opt source destination

Chain ufw-after-input (1 references)
target prot opt source destination

Chain ufw-after-logging-forward (1 references)
target prot opt source destination

Chain ufw-after-logging-input (1 references)
target prot opt source destination

Chain ufw-after-logging-output (1 references)
target prot opt source destination

Chain ufw-after-output (1 references)
target prot opt source destination

Chain ufw-before-forward (1 references)
target prot opt source destination

Chain ufw-before-input (1 references)
target prot opt source destination

Chain ufw-before-logging-forward (1 references)
target prot opt source destination

Chain ufw-before-logging-input (1 references)
target prot opt source destination

Chain ufw-before-logging-output (1 references)
target prot opt source destination

Chain ufw-before-output (1 references)
target prot opt source destination

Chain ufw-reject-forward (1 references)
target prot opt source destination

Chain ufw-reject-input (1 references)
target prot opt source destination

Chain ufw-reject-output (1 references)
target prot opt source destination

Chain ufw-track-input (1 references)
target prot opt source destination

Chain ufw-track-output (1 references)
target prot opt source destination

but it still doesn't work...

dmizer
November 30th, 2009, 07:35 PM
I do have the firewall enabled (Gufw 9.10.4), but that was already the case before the upgrade. I tried to turn it off, in which case iptables gives

A disabled firewall will look like this: http://pastebin.com/f564e1a42, so even though you thought the firewall was disabled ... it was not.

I suspect that your problem is directly related to your firewall rules. You may be successful by following the directions in the 6th link in my sig under "Problem 4"

kalyp
November 30th, 2009, 08:23 PM
A disabled firewall will look like this: http://pastebin.com/f564e1a42, so even though you thought the firewall was disabled ... it was not.

I suspect that your problem is directly related to your firewall rules. You may be successful by following the directions in the 6th link in my sig under "Problem 4"

Sorry... it doesn't seem like a firewall problem. After disabling it (uncheck the "activated" case under Gufw), I also restarted the computer this time, and then iptables actually gives
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination


Still doesn't work though...

This being said, that would probably be best if I added the samba rules to ufw instead of disabling it anyway. I had a question about it: when you say "Make sure to change 192.168.29.0/24 so that it matches your own network IP range.", if ifconfig gives 134.89.8.143 for wlan0 but 134.89.11.129 for eth0 (and I'm at work so that my network will be different at home...), should I use 134.89.8.0 and 134.89.11.0 and run the commands for these 2 IP ranges?

In case it helps: if I run the command without the password, for instance
sudo mount //sirocco/wwwroot/ /media/test/ -o username=myname
I'm actually prompted for my password... but then it hangs, and time out.

(BTW I didn't mention that I tried to check the proposed updates since someone else mentioned it, but there was nothing related to samba when I looked)

Thanks a lot for your help. I'm starting to wonder if there's a bug somewhere. Maybe I'll try a clean install at some point. Just wish I could avoid it...

cptvitamin
November 30th, 2009, 11:51 PM
I am having the same problem as kalyp. All my 9.10 machines can no longer mount Buffalo TeraServer. my 9.04 machines have no problem. no firewalls. My fstab entries looks something like this:
//server/share /home/user/net-public cifs credentials=/home/user/.smbcred,noperm,nocase,user,iocharset=utf8,file_mo de=0777,dir_mode=0777 0 0

When I try to mount manually, I get the following error
/etc/mount error(11): Resource temporarily unavailable
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)

I have not found anything useful when searching for information on that error.

Velophile
December 1st, 2009, 11:51 AM
Certainly seems like the problem I'm trying to fix is because of WiFi as shutdown with eth0 in use instead of WiFi is pretty instant, even with the CIFS shares mounted.

lanops
December 4th, 2009, 12:33 PM
Question.
Do you have to change any settings for the Master browser?
If so, how do you go about checking which server is the master browser,
and how to set it so that only one server is the master browser?

I find when you plug in appliances, some of them try to takeover the Master Browser.

ubradford
December 6th, 2009, 05:36 AM
I found a fix for the CIFS VFS error / haning issue on shutdown for Karmic (9.10) and wireless (WPA). I posted it here:
http://ubuntuforums.org/showthread.php?p=8449027#post8449027

kalyp
December 6th, 2009, 03:30 PM
It works!!! I finally found the trick. Really interesting, I have no idea why I need to do that now. Could interest cptvitamin too.
I used to be able to mount samba shares on jaunty by doing
sudo mount //netbiosname/sharename mount_point -o username=myname,password=mypsswd which doesn't work anymore on karmic.

But I get it to work by doing
sudo mount //netbiosname.workgroupname/sharename mount_point -o username=myname,password=mypsswd
where workgroupname is shore.mbari.org in my case (to give an example)
ie. I have to type the whole adress of netbiosname. Which is weird because I can ping netbiosname (without having the enter the whole adress) and I specified workgroupname as the workgoup in smb.conf.

Hope that will help others :)

edit: I had to do a fresh re-install because of another problem. And this time I could mount netbiosname directly without having to specify workgroupname. So my problem was related to something that went wrong during the upgrade...

dmizer
December 19th, 2009, 10:09 AM
Those of you with problems connecting only to Vista or Win7 (everything is fine with XP), please see this post: http://ubuntuforums.org/showpost.php?p=8524499&postcount=45

Let me know if that helps your problem. If so, I'll add it to the howto.

jamesisin
December 30th, 2009, 08:18 PM
dmizer - Would you take a look at this thread and, if possible, offer any insight?

http://ubuntuforums.org/showthread.php?p=8584687

dmizer
December 30th, 2009, 08:35 PM
ie. I have to type the whole adress of netbiosname. Which is weird because I can ping netbiosname (without having the enter the whole adress) and I specified workgroupname as the workgoup in smb.conf.

Hope that will help others :)

edit: I had to do a fresh re-install because of another problem. And this time I could mount netbiosname directly without having to specify workgroupname. So my problem was related to something that went wrong during the upgrade...

It looks like your previous install had a local DNS server. That's what would make that difference. You weren't having to type the "whole netbios name", you were having to type the domain name. Netbios and DNS serve similar purposes with regards to naming conventions on local networks, but they are not the same thing.

dmizer
December 30th, 2009, 08:38 PM
Question.
Do you have to change any settings for the Master browser?
If so, how do you go about checking which server is the master browser,
and how to set it so that only one server is the master browser?

I find when you plug in appliances, some of them try to takeover the Master Browser.

For a pure client, this should not make a difference. It will only make a difference if you are also sharing files, in which case you'll have to make changes to /etc/samba/smb.conf in order to either allow foreign master browsers, or to force a re-election.

akhilbehl
January 18th, 2010, 12:07 PM
Hey All,

I have had this problem too. I am working presently on Karmic and access network from wireless and wired connections at different times.

I tried three different solutions for this problem:
1. The one given here: http://ubuntuforums.org/showthread.php?t=1347340
2. The one given by dmizer here: http://ubuntuforums.org/showthread.php?t=288534
3. And the one given here: http://ubuntuforums.org/showthread.php?t=293513

However none of the solutions fixed my problem. I read in one of the posts that the real problem was to run the /etc/init.d/umountnfs.sh before the system is killed.

This gave me the simple idea, since I always have a terminal open, I wrote this bash function:

function bringdown()
{
sudo /etc/init.d/umountnfs.sh && sudo shutdown -h now
}

This simply solves my problem.

However I was thinking of a more generic solution. I have never tried scripting. I was wondering if there can be a more elegant and generic solution to this. I have an idea, someone please let me know if this is feasible.

We can create a script which runs this function `bringdown' as given above (preferable without the need for a sudo password prompt [perhaps using a credentials file or editing visudo]) and put this in the $PATH of each user, so that one can simply call the run dialog and bring the system down.

Please let me know if writing such a script is possible and easy. I am willing to learn and do homework if any is needed.

Thanks for reading the long post. Hoping for some replies.

dlabelle11
February 5th, 2010, 04:55 PM
mount error: can not change directory into mount target /media/epublic




this is the error I get



I think its the same thing thats stopping from browsing just under network.

dmizer
February 5th, 2010, 08:26 PM
mount error: can not change directory into mount target /media/epublic




this is the error I get



I think its the same thing thats stopping from browsing just under network.

Please post the results of this command:
sudo ls -la /media

dlabelle11
February 6th, 2010, 02:26 AM
ok enother problem solved, thanks, was a simple win 7 folder property keeping me out... so I just went to properties and then the security tab and then I just had to hit edit and add everyone...


So now I have windows 7 and ubuntu sharing like the best of friends. Thanks.:P

Telengard C64
February 20th, 2010, 11:49 PM
Thank you very much for this informative article. I did not know I needed the iocharset option for mount until I found out that Japanese characters in file names weren't surviving the trip to my mounted Samba share. Thanks to this article, and the mount manpage, I have solved my problem.

:D

panthermartin
March 1st, 2010, 05:22 PM
Hello, all. I have been able to get "mount -t cifs ..." working now on 32 bit Karmic Ubuntu desktop machines. Yea! But still no joy mounting NAS with Ubuntu Karmic Server 64 bit no matter how I configure the mount command. It times out - "Error connecting to socket." (-512) Thanks for any tips.

dmizer
March 1st, 2010, 09:20 PM
Hello, all. I have been able to get "mount -t cifs ..." working now on 32 bit Karmic Ubuntu desktop machines. Yea! But still no joy mounting NAS with Ubuntu Karmic Server 64 bit no matter how I configure the mount command. It times out - "Error connecting to socket." (-512) Thanks for any tips.

What make and model of NAS are you using?

panthermartin
March 1st, 2010, 09:42 PM
Thanks, dmizer. It's the NetGear Stora. I have the Ubuntu Karmic workstations mounting it perfectly thanks to the tips in this thread. However, my two Ubuntu servers (Karmic, 64 bit) still are having trouble - the only obvious difference (other than 64 bit servers vs. 32 bit desktops) is the servers have fixed IP's whereas all the workstations use DHCP. All the machines and the NAS are behind the same router.

dmizer
March 1st, 2010, 11:41 PM
the servers have fixed IP's whereas all the workstations use DHCP

How did you configure "fixed IPs"? This may very well be the root of your problem.

panthermartin
March 2nd, 2010, 12:36 AM
I was just starting to think the same thing...sorry to sidetrack this thread...it almost certainly is related to my router and network settings for those fixed IP servers. However, this thread has been invaluable for getting the cifs mounts working on my other machines. Thanks!

dmizer
March 2nd, 2010, 03:56 AM
I was just starting to think the same thing...sorry to sidetrack this thread...
Ubuntu karmic server (64 bit)
/etc/network/interfaces:
iface eth0 inet static
address 75.151.87.xxx
netmask 255.255.255.248
gateway 75.151.87.xxx

Maybe not a mount issue at all. Does that netmask prevent the server from being able to mount shared drives on my NAS (10.1.10.5)? The router DHCP range is 10.1.10.xxx/255.255.255.0
It can see it and ping with no problem.

We should move this to a new thread. Sorry, again.

Is your router not capable of assigning a permanent IP lease according to the NICs MAC address? What make and model of router are you using?

Don't worry about derailing the thread, your problem is at least related to this thread.

panthermartin
March 2nd, 2010, 04:33 AM
This is a pretty typical set-up, so it might be useful to others getting started like I am and learnimg as they go.
To answer your question, yes, the router does allow several configuration options for those fixed IP addresses.
I have a SMC D3G type router from Comcast (business internet account) with a pool of 5 static IP addresses to work with. The router is configured use DHCP (10.1.10.10/255.255.255.0) for most workstations/NAS devices inside the LAN. However, I also have two ubuntu servers configured with static IP addresses (75.151.87.xxx/255.255.255.248) that the router recognizes and for which it allows internet traffic through (on certain ports only).
Anyway, I figured this smart router would allow me to have the fixed IP servers mount the shared NAS drive (on 10.1.10.5) just like the workstations (10.1.10.xxx) do, even though they are not in the 10.1.10.xxx subnet. In retrospect, that was a naive assumption - but it made me learn more about subnetting, which is a good thing!
If anyone has a link or ideas on how people typically connect the fixed IP servers to the DHCP assigned resources in a LAN, I would be grateful! Thanks.

dmizer
March 2nd, 2010, 08:48 AM
What I've always done is assign permanent DHCP leases to servers so that the router always assigns the same IP to servers. The problem is, that the vocabulary used varies from manufacture to manufacture, and even varies from model to model.

You could try something like this: http://www.watchingthenet.com/linksys-tip-assign-static-ip-address-to-printer-while-using-dhcp-on-your-wireless-network.html

panthermartin
March 2nd, 2010, 10:05 PM
Thanks, again, dmizer. For anyone out there curious, here is the solution that worked for everything I needed, including allowing my servers to mount the NAS cifs shares this thread is about. It was relatively simple!
Set the Ubuntu servers inside the LAN to fixed IP addresses, but NOT the external IP addresses - instead set them to addresses within the private subnet (10.1.10.1/255.255.255.0) but outside the DHCP range. THEN set the router to use 1-1 NAT to match the static external IP addresses up with the fixed internal addresses. Now I have the best of both worlds - internally the servers can access the same network resources as the other ubuntu workstations cvause they are within the subnet, but they still are dedicated servers to the outside world on a fixed IP. And on this SMC router, the port filtering still works, even when using the 1-1 NAT.
Hope this helps out someone else. Laissez les bon temps rouler!

bkadoctaj
March 5th, 2010, 03:28 PM
I just want to point out that after installing winbind in Ubuntu Karmic 64-bit my Internet connection slowed way down, at least in terms of connecting to websites.

See my thread here:
http://ubuntuforums.org/showthread.php?t=1422567

Any thoughts on the matter?

Btw, great thread. :)

zakarra
March 9th, 2010, 05:28 AM
Hi,

I'm using samba and cifs method for sharing network windows folders. I have a file with username and password for protected folders. Now i want to add another password protected folder and i would like to know how can i insert more than one user in credentials file, without creating a file for each username.

thanks

dmizer
March 9th, 2010, 10:11 AM
Hi,

I'm using samba and cifs method for sharing network windows folders. I have a file with username and password for protected folders. Now i want to add another password protected folder and i would like to know how can i insert more than one user in credentials file, without creating a file for each username.

thanks

Sorry, you will have to create a separate credentials file for each username/password combination. Alternatively, and preferably, you should simply add your Ubuntu user's name and password to the Windows file server, and that will completely eliminate the need for separate credentials files.

pmdkh
March 15th, 2010, 09:02 PM
I'm having problems mounting an SMB share using "mount -t smbfs" or "mount -t cifs". However, both smbclient and "Places -> Connect to Server" work fine.

I'm using Hardy and the SMB share in question allows anonymous access. I am having the same problem with another SMB share at work.


$USERNAME@singularity:~$ smbclient -L $IP_ADDRESS
Password:
Domain=[DESKTOP] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

Sharename Type Comment
--------- ---- -------
IPC$ IPC Remote IPC
print$ Disk Printer Drivers
SharedDocs Disk
ADMIN$ Disk Remote Admin
C$ Disk Default share
Lexmark Printer Lexmark 2600 Series
session request to $IP_ADDRESS failed (Called name not present)
session request to $FIRST_8_BITS_OF_IP_ADDRESS failed (Called name not present)
Domain=[DESKTOP] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

Server Comment
--------- -------

Workgroup Master
--------- -------


Also:


$USERNAME@singularity:~$ smbclient //$IP_ADDRESS/SharedDocs -U Guest
Password:
Domain=[DESKTOP] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]
smb: \>


However, when I use the mount command, the command hangs and never completes. E.g.,


sudo mount -t smbfs //$IP_ADDRESS/SharedDocs smb/ -o username=Guest,password=


The same thing happens if I use "mount -t cifs", or if I use a credentials file.

I'm basically having the same problem as the person in this thread (http://ubuntuforums.org/showthread.php?t=239500), but the solution doesn't work here.

Similar problems were encountered by this person (http://ubuntuforums.org/showthread.php?t=129603), but, once again, the solutions don't work.

If you need me to post more information, please let me know.

Thanks for your help.

P.S. - I also am curious as to where the SMB share is mounted when you use "Places -> Connect to Server". I don't see it when I use the "mount" command. Is it not really mounted in the traditional way?

P.P.S - I didn't read through this thread, so if this isn't the appropriate place to ask this question, let me know. Thanks again.

dmizer
March 15th, 2010, 09:26 PM
I'm having problems mounting an SMB share using "mount -t smbfs" or "mount -t cifs". However, both smbclient and "Places -> Connect to Server" work fine.

I'm using Hardy and the SMB share in question allows anonymous access. I am having the same problem with another SMB share at work.

Have you tried following the howto in the first post of this thread? There are many tips and it also includes troubleshooting. The first post has been continuously updated with new information as I learn it, so it is current and should be sufficient for helping you solve your problem.

johnmark54
March 16th, 2010, 07:29 PM
This method also works with VM Workstation (a virtualization platform) to mount the Windows parent file system in an Ubuntu guest OS. Ironically the Ubuntu file browser network menu item will open the parent shares, but they will not be visible (e.g. mounted) in the Unix file tree.

pmdkh
March 16th, 2010, 09:33 PM
Have you tried following the howto in the first post of this thread? There are many tips and it also includes troubleshooting. The first post has been continuously updated with new information as I learn it, so it is current and should be sufficient for helping you solve your problem.

I read through all of the first post and tried the manual mount command that you gave (with the correct values, of course):


sudo mount -t cifs //netbiosname/sharename /media/sharename -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77


I am still having the same problem, though.

dmesg | tail gives this:


[ 1599.762193] CIFS VFS: Error connecting to IPv4 socket. Aborting operation
[ 1599.762208] CIFS VFS: cifs_mount failed w/return code = -512


I know that this isn't a firewall problem because I can connect to this share from a Windows XP laptop.

Let me know if you need more information. Thanks again.

dmizer
March 17th, 2010, 12:22 AM
I know that this isn't a firewall problem because I can connect to this share from a Windows XP laptop.
Linux is not Windows, so it doesn't matter if Windows works or not, it could still be a firewall problem. Try without it.

Let me know if you need more information. Thanks again.

Does the share mount if you run this command?
sudo mount -a

Is your computer connecting wirelessly?

DownTown22
March 17th, 2010, 06:33 PM
So, when I'm away from my home network (thus, not connecting to my NAS drive) my computer shuts down in about 5 seconds...max.

However, when I am on my home network (and connecting to my NAS drive) my computer tends to take forever to shut down. Is there a way to speed this up? Also during shutdown, no error messages appear (that I can remember).

And the following commands have also been ran:

ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K15umountnfs.sh
ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K15umountnfs.sh

My fstab entry below:

//192.168.0.101/Volume_1 /home/aaron/DNS-323 cifs guest,rw,iocharset=utf8,nounix,gid=1000,uid=1000,f ile_mode=0777,dir_mode=0777 0 0

P.S. I actually won't be able to test anything suggested here for another couple weeks.

pmdkh
March 17th, 2010, 08:58 PM
Linux is not Windows, so it doesn't matter if Windows works or not, it could still be a firewall problem. Try without it.

To make sure it wasn't a firewall problem, I had my router forward port 445 to the correct computer, and I opened up port 445 in the Windows Firewall.

Does the share mount if you run this command?
sudo mount -a

No, it still hangs with the same error displayed in dmesg.

Here is the output:

tylergreen@singularity:~$ sudo mount -v -a
mount: proc already mounted on /proc
mount: UUID=9647ecf0-850e-4afd-96ee-a23c0ea4c988 already mounted on /boot

mount.cifs kernel mount options: unc=//$IP_ADDRESS\SharedDocs,ip=$IP_ADDRESS,user=root,ve r=1,rw,guest,iocharset=utf8,file_mode=0777,dir_mod e=0777

Is your computer connecting wirelessly?

Yes, it is.

dmizer
March 18th, 2010, 12:47 AM
Fisrt of all, disable the port forwarding ASAP. Port forwarding in your router is only for forwarding web traffic to a server, so you are currently forwarding port 445 from the web to your Windows box. By firewall, I am talking about local software firewalls on your individual machines.

If you're connecting wirelessly, are you positive that you are connected to your own wireless network?

dmizer
March 18th, 2010, 12:49 AM
So, when I'm away from my home network (thus, not connecting to my NAS drive) my computer shuts down in about 5 seconds...max.

However, when I am on my home network (and connecting to my NAS drive) my computer tends to take forever to shut down. Is there a way to speed this up? Also during shutdown, no error messages appear (that I can remember).

And the following commands have also been ran:

ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K15umountnfs.sh
ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K15umountnfs.sh

My fstab entry below:

//192.168.0.101/Volume_1 /home/aaron/DNS-323 cifs guest,rw,iocharset=utf8,nounix,gid=1000,uid=1000,f ile_mode=0777,dir_mode=0777 0 0

P.S. I actually won't be able to test anything suggested here for another couple weeks.

There are two fixes posted for the hang during shutdown. Try the second one as well.

pmdkh
March 18th, 2010, 09:27 AM
Fisrt of all, disable the port forwarding ASAP. Port forwarding in your router is only for forwarding web traffic to a server, so you are currently forwarding port 445 from the web to your Windows box. By firewall, I am talking about local software firewalls on your individual machines.

If you're connecting wirelessly, are you positive that you are connected to your own wireless network?

Ya, I realized that it didn't make sense to forward the port, but I thought that is what you were talking about.

I don't have any other firewalls configured, and I am connected to my own wireless network.

dmizer
March 18th, 2010, 10:29 AM
I don't have any other firewalls configured, and I am connected to my own wireless network.

Just to be sure, please post the output of:
sudo iptables -L

Can you ping the server? If you've not tried it yet, do you get improved results if you use the NetBIOS name instead of and IP address?

pmdkh
March 18th, 2010, 08:54 PM
Just to be sure, please post the output of:
sudo iptables -L

<snip>


Can you ping the server? If you've not tried it yet, do you get improved results if you use the NetBIOS name instead of and IP address?

I can ping the server. When I use the NetBios name, the name doesn't resolve. I did follow what the guide said about editing the /etc/nsswitch.conf file.


sudo mount -v -t cifs //DESKTOP/Shareddocs /media/home-smb -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77

mount error: could not find target server. TCP name DESKTOP/Shareddocs not found
No ip address specified and hostname not found

dmizer
March 18th, 2010, 09:20 PM
removed by request

That is a firewall. Go to system > administration > Firewall configuration and uncheck "enabled".

If there is no "Firewall configuration" in the administration menu, then open a terminal and run this command:
sudo ufw disable
Then try this
sudo mount -a
See if you get connected to your share then.

pmdkh
March 18th, 2010, 10:17 PM
That is a firewall. Go to system > administration > Firewall configuration and uncheck "enabled".

If there is no "Firewall configuration" in the administration menu, then open a terminal and run this command:
sudo ufw disable
Then try this
sudo mount -a
See if you get connected to your share then.

Sorry about the misinformation concerning the firewall. I hadn't thought about that. I ran the "ufw disable" command and that fixed the problem. I can now mount the share.

Now the question is, how do I modify the iptables rules to allow this service to run? I'm going to start trying to figure that out, but if you (or anyone) would happen to know, I'd appreciate any help.

Thanks, dmizer, for your help.

dmizer
March 18th, 2010, 10:58 PM
Sorry about the misinformation concerning the firewall. I hadn't thought about that. I ran the "ufw disable" command and that fixed the problem. I can now mount the share.

Now the question is, how do I modify the iptables rules to allow this service to run? I'm going to start trying to figure that out, but if you (or anyone) would happen to know, I'd appreciate any help.

Thanks, dmizer, for your help.

Are you positive you need a local firewall? Since you have a firewalled gateway, odds are that you probably don't.

pmdkh
March 19th, 2010, 09:17 AM
Are you positive you need a local firewall? Since you have a firewalled gateway, odds are that you probably don't.

I have thought about that but I'm doing this on a work computer, so I don't think I should disable the firewall that was installed by default.

I came across your thread here (http://ubuntuforums.org/showthread.php?t=1169149), where you mention how to fix the firewall problem. I tried those things, but I am still only able to connect by completely disabling the firewall. I'll give you some more detailed information the next time I get a chance to.

pmdkh
March 20th, 2010, 07:50 AM
I am going to take this issue up with the tech support folks at my workplace, because I believe that this issue arises from our company-specific firewall.

If the solution to this problem is applicable to everyone, I will come back to this thread and post it.

Thanks again for your help, dmizer.

neo unplugged
March 23rd, 2010, 11:12 AM
Hello Dmizer,
I quite a newbie to linux and Karmic. recently installed Ubuntu 9.10 and trying to mount other network drives at work. I followed your instructions but I always get the following weird error.
I tried cifs manual instructions and also tried the fstab option

Here's what am doing:

>> mount -t cifs -o username=DOMAIN/MYNAME, password=pAsSwOrD //SERVERNAME/SHARENAME /media/sdrive

>> ls /media/sdrive/

ls: cannot access /media/sdrive/d: No such file or directory
ls: cannot access /media/sdrive/?..: No such file or directory
ls: cannot access /media/sdrive/FM: No such file or directory
ls: cannot access /media/sdrive/MD-MA: No such file or directory
ls: cannot access /media/sdrive/??????: No such file or directory
ls: cannot access /media/sdrive/N~1: No such file or directory
ls: cannot access /media/sdrive/eca: No such file or directory
ls: cannot access /media/sdrive/N~1: No such file or directory
. <more such directories>
.
.
ls: cannot access /media/sdrive/???: No such file or directory
ls: cannot access /media/sdrive/???: No such file or directory
ls: cannot access /media/sdrive/BBF40.: No such file or directory
ls: cannot access /media/sdrive/B~1: No such file or directory
??? ??? ?.. 1.P 6.2 8_Ali A~1 ?B2 cr D~1 E~1 F~1 FMD ign L~1 ?MD- N~1 P~1 R~1 S200 T~1 Y~1
? ??? ????? ~1 4 7-0 8.p B~1 B72EC. d D~1 eca FEmp FMD- K~1 L~1 ?MD-MA N~1 pri R~1 S2007-0 ta. y.pd
?? ??? ?????? -~1 4.p 7-0059 A~1 B~1 BBF40. D~1 E~1 f FM for L- ls? N~1 O~1 R~1 S20 S85 Ver

I dont understand what am doing wrong here. I've been reading online forums and man pages but couldn't find anything that could fix this.
Any suggestions are greatly appreciated.

Best.

dmizer
March 23rd, 2010, 12:47 PM
What happens if you run the following command:
sudo ls -la /media/sdrive

neo unplugged
March 23rd, 2010, 01:53 PM
[Before mounting]
sudo ls -la /media/sdrive
total 8
drwxr-xr-x 2 root root 4096 2010-03-23 10:34 .
drwxr-xr-x 4 root root 4096 2010-03-23 10:34 ..

[After mounting i.e. $ sudo mount -t cifs //sam301z70/shared /media/sdrive/ -o username=DOMAIN/username,password=passWord]


$ sudo ls -la /media/sdrive

ls: cannot access /media/sdrive/Q: No such file or directory
ls: cannot access /media/sdrive/ vs : No such file or directory
.
.
. <more of these errors>
ls: cannot access /media/sdrive/L~1: No such file or directory
ls: cannot access /media/sdrive/????: No such file or directory
ls: cannot access /media/sdrive/B~1: No such file or directory
total 4
drwxr-xr-x 1 root root 0 2010-03-08 13:58
drwxr-xr-x 1 root root 0 2010-03-08 13:58
drwxr-xr-x 1 root root 0 2010-03-08 13:58
drwxr-xr-x 1 root root 0 2010-03-08 13:58
drwxr-xr-x 1 root root 0 2010-03-08 13:58
drwxr-xr-x 1 root root 0 2010-03-08 13:58
d????????? ? ? ? ? ? ?
d????????? ? ? ? ? ? ??
d????????? ? ? ? ? ? ??
d????????? ? ? ? ? ? ???
d????????? ? ? ? ? ? ???
d????????? ? ? ? ? ? ???
d????????? ? ? ? ? ? ????
drwxr-xr-x 1 root root 0 2010-03-08 13:58 .
drwxr-xr-x 4 root root 4096 2010-03-23 10:34 ..
d????????? ? ? ? ? ? @
d????????? ? ? ? ? ? *
d????????? ? ? ? ? ? 0
d????????? ? ? ? ? ? ~1
d????????? ? ? ? ? ? -~1
.
.
<more of these>
d????????? ? ? ? ? ? T~1
d????????? ? ? ? ? ? vs
d????????? ? ? ? ? ? Y~1

Thanks.

neo unplugged
March 23rd, 2010, 03:42 PM
hey Dmizer,

i just reinstalled ssh and smbfs and it worked.. i am able to get all drives mounted.
Thank you

dmizer
March 23rd, 2010, 09:54 PM
hey Dmizer,

i just reinstalled ssh and smbfs and it worked.. i am able to get all drives mounted.
Thank you

Good to hear!

dik23
April 24th, 2010, 01:37 PM
Using Hardy I am getting

CIFS VFS: Send error in SETFSUnixInfo = -11

Any idea what this is ? I can't find anything about it.

dannyboy79
April 24th, 2010, 07:47 PM
still getting the CIFS VFS error upon shutdown which makes shutdown hang. I haver tried these solutions

created the K15umountnfs.sh symlink

also added
#!/bin/sh
/etc/init.d/umountnfs.sh
}
exit 0

to /etc/gdm/PostSession/Default but I still get the error upon shutdown and it never happens.

any thoughts on how to solve

jimthefen
April 26th, 2010, 09:51 PM
dmizer, your great step-by-step just resolved a problem that I've lived with for months. Seemed very clear and easy to follow; even this n00b was able to get three NAS samba shares mounted and accessible to all my non-Nautilus apps. MANY, many thanks!!!

dannyboy79
April 27th, 2010, 10:29 AM
still getting the CIFS VFS error upon shutdown which makes shutdown hang. I haver tried these solutions

created the K15umountnfs.sh symlink

also added
#!/bin/sh
/etc/init.d/umountnfs.sh
}
exit 0

to /etc/gdm/PostSession/Default but I still get the error upon shutdown and it never happens.

any thoughts on how to solve
bump, anyone else still having this issue in lucid besides me?

Irwin J. Finster
May 6th, 2010, 06:54 AM
Problem with mounting
Hi,

I've been trying to follow this great tutorial but I have problem.

I can mount my network drive just fine with:

sudo mount -t cifs //netbiosname/sharename /media/sharename -o username=winusername,password=winpassword,iocharse t=utf8,file_mode=0777,dir_mode=0777

But when I follow the rest of the instructions I get the Mount error 13. If you are seeing "mount error 13 = Permission denied" when running sudo mount -a.

I tried the Fix for Hardy users, but it won't work here - I am running lucid.

Any help would be great!

Thanks!

dannyboy79
May 6th, 2010, 10:06 AM
Problem with mounting
Hi,

I've been trying to follow this great tutorial but I have problem.

I can mount my network drive just fine with:

sudo mount -t cifs //netbiosname/sharename /media/sharename -o username=winusername,password=winpassword,iocharse t=utf8,file_mode=0777,dir_mode=0777

But when I follow the rest of the instructions I get the Mount error 13. If you are seeing "mount error 13 = Permission denied" when running sudo mount -a.

I tried the Fix for Hardy users, but it won't work here - I am running lucid.

Any help would be great!

Thanks!

show us the result of this command after issuing sudo mount -a
tail dmesg
are you sure that the above fstab entry is the one that is causeing hte error when issuing sudo mount -a. how many other smb shares are you mounting with sudo mount -a? can you post your entire fstab? is this something the forum did? put a space in the word iocharset? (iocharse t)
you can ping the windows machine by netbios name correct? what are the permission on the dfolder named /media/sharename? also, who owns it and the group owner?

Irwin J. Finster
May 6th, 2010, 03:34 PM
show us the result of this command after issuing sudo mount -a
tail dmesg

When I enter tail dmesg I get the reply:

tail: "dmesg" can not be opened to read: No such file or directory


are you sure that the above fstab entry is the one that is causeing hte error when issuing sudo mount -a. how many other smb shares are you mounting with sudo mount -a? can you post your entire fstab? is this something the forum did? put a space in the word iocharset? (iocharse t)
you can ping the windows machine by netbios name correct? what are the permission on the dfolder named /media/sharename? also, who owns it and the group owner?

root owns the folder /media/NAS and it can read and write.

I am only mounting this one share here is my fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=e0519f9a-d3bd-41d6-9c56-8e62f4d54f65 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=ece0e11a-c5d4-48ac-a2fc-523828dbbdcf none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
//WHITE_RABBIT/NAS /media/NAS cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

dannyboy79
May 6th, 2010, 04:50 PM
When I enter tail dmesg I get the reply:

tail: "dmesg" can not be opened to read: No such file or directory



root owns the folder /media/NAS and it can read and write.

I am only mounting this one share here is my fstab:

# /etc/fstab: static file system information.
#
# Use 'blkid -o value -s UUID' to print the universally unique identifier
# for a device; this may be used with UUID= as a more robust way to name
# devices that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc nodev,noexec,nosuid 0 0
# / was on /dev/sda1 during installation
UUID=e0519f9a-d3bd-41d6-9c56-8e62f4d54f65 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda5 during installation
UUID=ece0e11a-c5d4-48ac-a2fc-523828dbbdcf none swap sw 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
//WHITE_RABBIT/NAS /media/NAS cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0
sorry, it's
dmesg | tail
if the folder is owned by root, that may be your problem. here is the permissions of a folder I mount a smb share to. the folder is named fat32 and is located within /media/
drwxr-xr-- 2 daniel daniel 4096 2009-06-16 14:38 fat32
/media/ has these permission.
drwxr-xr-x 12 daniel daniel 4096 2010-05-05 18:32 media

my fstab line is this
//192.168.0.5/fat32 /media/fat32 cifs auto,noexec,users,nounix,uid=1000,gid=1000,credent ials=/etc/samba/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0
and the file .smbcredentials has these permissions.
-r-------- 1 daniel daniel 35 2009-06-21 01:55 /etc/samba/.smbcredentials
look at these things. also, can you show me the smb.conf for the share from the server? this is mine

[fat32]
path = /media/fat32
comment = Movies on dell
available = yes
browsable = yes
read only = No
store dos attributes = no
create mask = 0755
directory mask = 0755
public = yes
writable = yes
guest ok = yes
force user = daniel
force group = daniel


good luck

dmizer
May 6th, 2010, 09:01 PM
//WHITE_RABBIT/NAS /media/NAS cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

sudo mount -t cifs //netbiosname/sharename /media/sharename -o username=winusername,password=winpassword,iocharse t=utf8,file_mode=0777,dir_mode=0777
The difference between these two is that you are not using /root/.smbcredentials to mount manually. Take a look at your .smbcredentials file and make sure it's formated correctly.

Also try this to test the credentials file:
sudo mount -t cifs //netbiosname/sharename /media/sharename -o credentials=/root/.smbcredentials,iocharse t=utf8,file_mode=0777,dir_mode=0777

dmizer
May 6th, 2010, 09:04 PM
bump, anyone else still having this issue in lucid besides me?

I haven't had much time to play with this, but the problem is related to network-manager.

If you're willing to remove network-manager, and use gnome-network-admin instead, this will resolve your problem.

Irwin J. Finster
May 7th, 2010, 05:21 AM
Thanks folks, now it works, don't really know why caus I didn't do anything but hey IT WORKS :p

THANKS!

cstorvold
May 13th, 2010, 05:25 PM
This guide is WIN.

I successfully connected to my Western Digital My Book World Edition. Thank-you.

This type of guide is very helpful to an inexperienced user like myself.

Now to put in my 2c regarding the "My Book World Edition" specifically:

I had some trouble finding the netbios name. To find it yourself, type in the drive's IP address into your browser address bar (eg. mine is 192.168.0.150) and login using usr:admin pw:admin (unless you've changed it of course). Go into "System Status" and see the netbios name under System Information - Device Name. Default is "MyBookWorld". The share name on this drive is "public"

Thanks again.

cstorvold
May 13th, 2010, 05:30 PM
I have one question:

Does anyone know how to make the desktop icon show up in the Netbook Remix under "Files and Folders", either under Folders or Volumes?

Thanks

jing2
May 28th, 2010, 08:21 PM
WOW!:KS you just save my day, thanks for the post regarding with the mount samba share... it helps a lot...

orsonj
June 11th, 2010, 06:12 PM
Nice tutorials. before reading them I couldn't get any connection to speak of. Currently I am able to use smbclient //ourserver.domain.com/shares -U myusername to connect. (it asks for a password, which I enter and gain access)

The Places > Connect to Server... and the mount methods don't work though.


$ sudo mount -t cifs //ourserver.domain.com/shares /media/shares -o username=myusername
Password:
retrying with upper case share name
mount error(6): No such device or address
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


Any ideas on why one works, but not the other?

Relevant lines from config files.

/etc/nsswitch.conf
hosts: files mdns4_minimal [NOTFOUND=return] wins dns mdns4

/etc/samba/smb.conf
workgroup = OURGROUP
netbios name = myhostname
name resolve order = lmhosts wins bcast host

In part of my earlier testing, I got this bit of information about the server:
Domain=[OURGROUP] OS=[Windows Server 2008 R2 Enterprise 7600] Server=[Windows Server 2008 R2 Enterprise 6.1]

I am using Ubuntu 10.04

Note: I did sanitize the domain/hostnames/usernames above, but the styles should match

Cenci-Thomas
June 18th, 2010, 12:35 PM
dmizer, THANK YOU SIR. I was having the worst time trying to keep my windows shares connected and this howto fixed the issue. I was worried that I'd have no choice but to go back to windows but thankfully you have saved me from that. Again, THANKS.

lifecycled
July 3rd, 2010, 09:34 PM
Hi Demizer, Brilliant post. I always refer when adding network devices. Just added a Netgear Stora NAS. I have limited access, (no delete rights) on my share after implimenting your post for mounting on boot. Curiously if i use Places Network, I have full access.
In short smb://familylibrary link has full access but /media/FamilyLibrary has no delete rights. from /etc/fstab
//stora/FamilyLibrary /media/FamilyLibrary cifs credentials=root/.nascredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0
I have a small USB NAS device that does not have this issue, the /media/usbnas link has full read write links. One subtle difference, the credentials password for the USB NAS is different to the Stora NAS. Stora NAS has same password as ubuntu login. Any advice on how to get full access with /media/FamilyLibrary?
Thanks
Mark

dmizer
July 4th, 2010, 09:43 PM
Hi Demizer, Brilliant post. I always refer when adding network devices. Just added a Netgear Stora NAS. I have limited access, (no delete rights) on my share after implimenting your post for mounting on boot. Curiously if i use Places Network, I have full access.
In short smb://familylibrary link has full access but /media/FamilyLibrary has no delete rights. from /etc/fstab
//stora/FamilyLibrary /media/FamilyLibrary cifs credentials=root/.nascredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0
I have a small USB NAS device that does not have this issue, the /media/usbnas link has full read write links. One subtle difference, the credentials password for the USB NAS is different to the Stora NAS. Stora NAS has same password as ubuntu login. Any advice on how to get full access with /media/FamilyLibrary?
Thanks
Mark

Try adding the rw option like so
//stora/FamilyLibrary /media/FamilyLibrary cifs rw,credentials=root/.nascredentials,iocharset=utf8,file_mode=0777,dir_ mode=07

dmizer
July 4th, 2010, 09:48 PM
Nice tutorials. before reading them I couldn't get any connection to speak of. Currently I am able to use smbclient //ourserver.domain.com/shares -U myusername to connect. (it asks for a password, which I enter and gain access)
If your server has an actual fully qualified domain (ourserver.domain.com) for access, that means you have a DNS sserver on your local network. Because of that, you should not use wins for host name resolution and this could be the source of your problem.

Instead, you should remove the winbind server and the references to wins, and make sure that your network is pointed to your office's correct DNS servers.

Sorry I took so long to reply to this. I thought I'd already done so.

lifecycled
July 5th, 2010, 12:45 AM
Try adding the rw option like so
//stora/FamilyLibrary /media/FamilyLibrary cifs rw,credentials=root/.nascredentials,iocharset=utf8,file_mode=0777,dir_ mode=07

Thanks, Tried, made no difference. (rebooted ubuntu to be sure). I see this is permissions related but not sure of the difference in passing login credentials via nautilus- samba mount with fstab, or via nautilus Network.
Some more tests:- When accessing via Stora webtool I copied a folder. This copied folder was locked and contents not viewable via samba mount. Also I tried creating a file via samba mount. This was available for deletion. Any new file not created from samba mount has restricted permissions. Perhaps i should discuss this on a Stora user forum instead?
Mark

dmizer
July 5th, 2010, 08:57 AM
Perhaps i should discuss this on a Stora user forum instead?
Mark
Looks that way to me. That, or just review the permission settings on the Stora device.

lifecycled
July 9th, 2010, 09:59 AM
Looks that way to me. That, or just review the permission settings on the Stora device.

WORKING: I am a little baffled and humbled. Do not know what the fix was. After a few days confirming the problem was still there, it simply disappeared today. Now my auto mount of the network NAS folders are unlocked. I have recently modified the web login to my Stora NAS to bypass MYStora.com as default and login via direct local LAN IP but do not think this is related. I have no server PC on my LAN. My wireless router provides IP addresses, and most devices on LAN are allocated permanent IP addresses.

Oh well.

Mark

mendhak
July 14th, 2010, 03:35 PM
A thank you to dmizer in 2006 from 2010.

I was using Unison to sync between a mounted folder and a local folder, but I noticed the troubles it was having with unicode file names. Found your tutorial, simple change to fstab, things are faster now and the synchronization works perfectly.

dmizer
July 14th, 2010, 08:06 PM
A thank you to dmizer in 2006 from 2010.

I was using Unison to sync between a mounted folder and a local folder, but I noticed the troubles it was having with unicode file names. Found your tutorial, simple change to fstab, things are faster now and the synchronization works perfectly.

Glad to know it helped.

corkscrew
July 15th, 2010, 04:02 PM
Hi Dmizer,
you helped me in the past hope you can do the same again, when I was running Hardy I followed your tutorial and with help from you got my Ready NAS duo backup drives mounting on boot. I upgraded to jaunty and then to Karmic everything continued to work.

I have now done a clean install of Lucid, I can browse to all my network through nautilus including windows shares, digital entertainment centre and my NAS back up drive.

I decided to try to manually mount the drive as per your tutorial with the following command without doing any of the pre work you list just to see if Lucid would work straight out of the box

sudo mount -t cifs //netbiosname/sharename /media/sharename -o username=winusername,password=winpassword,iocharse t=utf8,file_mode=0777,dir_mode=0777

This is the error message I get

mount: wrong fs type, bad option, bad superblock on //NAS-88-7D-78/backup,
missing codepage or helper program, or other error
(for several filesystems (e.g. nfs, cifs) you might
need a /sbin/mount.<type> helper program)
In some cases useful info is found in syslog - try
dmesg | tail or so

Should i do all the pre work as before ie samba?

dmizer
July 15th, 2010, 09:32 PM
Should i do all the pre work as before ie samba?
You'll need to install smbfs. I suggest that you avoid the rest of the prework as it could break your currently working samba browsing.

corkscrew
July 17th, 2010, 04:50 AM
Did as you suggested and installed smbfs,the erroe message I got was to do with the nebios name which I found a bit strange since as I said in my 1st post all the shares are visible in nautilus by their netbios name?
Maybe somthing to do with the settings in my ReadyNas duo which has 3 shares in it one read write for me only and it's cifs & NFS, the other 2 shares are read write for me and read only for everyone else and they are cifs cant remember why i set it up that way maybe that will cause me other problems.
Anyway ran the next 2 commands from your tutorial for nsswitch and winbind and everyhting works again all 3 mount on boot and no shut down problems.

Just for my own knowledge maybe I should un tick the nfs

corkscrew
July 18th, 2010, 04:48 AM
help, spoke to soon
story so far have installed smbfs, nsswitch and winbind, I can mount my 3 shares on ReadyNas duo. I can also browse to my digital entertainment centre.

I cannot see the 2 laptops on my network both running karmic, and I cant see windows vista desktop on same network. I could see all these prior to moving from karmic to Lucid.

Any ideas?

Regards

mip
July 26th, 2010, 09:00 AM
I have a Lacie NAS at mylacie.local.

I'm trying to mount it using the following command:

mount -t cifs //mylacie.local/directory /media/share -o username=***,password=***,iocharset=utf8,file_mode =0777,dir_mode=0777

I'm getting the following error:


mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


dmesg returns:


[13992.766847] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
[13992.766857] CIFS VFS: Send error in SessSetup = -13
[13992.766870] CIFS VFS: cifs_mount failed w/return code = -13


Anyone have any ideas?

dmizer
August 5th, 2010, 08:04 AM
I have a Lacie NAS at mylacie.local.

I'm trying to mount it using the following command:

mount -t cifs //mylacie.local/directory /media/share -o username=***,password=***,iocharset=utf8,file_mode =0777,dir_mode=0777

I'm getting the following error:


mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g. man mount.cifs)


dmesg returns:


[13992.766847] Status code returned 0xc000006d NT_STATUS_LOGON_FAILURE
[13992.766857] CIFS VFS: Send error in SessSetup = -13
[13992.766870] CIFS VFS: cifs_mount failed w/return code = -13


Anyone have any ideas?
Take a look at the troubleshooting section of the howto. There is a fix for the error 13, It's marked for Hardy, but it is valid for other versions as well.

mip
August 6th, 2010, 07:32 AM
Thanks dmizer. I'll give it a try.

M.

fcigoi
August 9th, 2010, 03:46 AM
All my 'mount' commands are preceded by 'sudo', never tried to mount anything other than as su...

dmizer
August 9th, 2010, 08:41 AM
All my 'mount' commands are preceded by 'sudo', never tried to mount anything other than as su...

I am confused by this comment. I do not suggest that you perform any mounts without sudo unless the mount lines appear in /etc/fstab configuration file. Since /etc/fstab has root permissions, it is not necessary to prepend the command with sudo.

roberthr
August 16th, 2010, 05:11 AM
I have some weird filename on Samba mounted fs which can't be read and since this file includes network key of a program, this program does not run. If I mount same filesystem with NFS it's ok.

The fstab with smb mounted system has a line:
//192.168.50.5/desk /media/desk cifs guest,iocharset=utf8,noperm,file_mode=0777,dir_mod e=0777,rw 0 0

The problematic file has a filename ASP32$$$.ID2. No metter what I try with this file, I always get permission denied under CIFS

Is there a way to get around this?