PDA

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


Pages : 1 2 3 [4] 5 6

dmizer
November 14th, 2008, 09:20 AM
Well, "Places > Connect to Server" I knew and it works both as FTP and CIFS.
My problem is that I need to mount the share in my file system because I also have programs running with wine that need to access that remote folder.
Double check the permissions on the NAS itself. Does it have any way of verifying the uid and gid of the nas user?

What line did you use when you tried to mount the NAS with NFS?

Hi Dmizer,

I have set up the connection between an Intel NAS and my machines using your how-to, and it worked very well.
However, I have bumped into a problem once I tried to set up other users on such machines to access only certain shares on the NAS.
Having set up the mounts in fstab, whatever user logs on to a specific machine, it will get the same shares as me....NO GOOD.
I'm sure there's a way to allow the other users to access only their share, and me to access all, but I don't think fstab is the way to go. What's the suggested alternatives ?
It is significantly more difficult. You'll need to set up mounts with autofs as discussed in this thread: http://ubuntuforums.org/showthread.php?t=959123

lviggiani
November 14th, 2008, 09:33 AM
Double check the permissions on the NAS itself. Does it have any way of verifying the uid and gid of the nas user?

What line did you use when you tried to mount the NAS with NFS?


It is significantly more difficult. You'll need to set up mounts with autofs as discussed in this thread: http://ubuntuforums.org/showthread.php?t=959123

Good question!
I tried but when try so, (afer some seconds) I get an error (internal error) and the mount fails. Since I didn't find any help on that (and again since cifs was working in Hardy) at the end a gave up...

fcigoi
November 14th, 2008, 10:24 AM
Mmhhh this is me being thick, but I had a look at that thread you mentioned, and also at that referenced in there, but could not find anything that looked useful for my needs.
What I need is something to allow mounting of shares A,B and C to user 1, B to user 2 and C to user 3. How can I achieve that with Autofs ? Can you give me an example ?

dmizer
November 14th, 2008, 12:15 PM
Good question!
I tried but when try so, (afer some seconds) I get an error (internal error) and the mount fails. Since I didn't find any help on that (and again since cifs was working in Hardy) at the end a gave up...

I really think NFS will be your long term answer to this problem. Try NFS again, and if you are unsuccessful, post a thread in the networking & wireless forum, and send me a pm with a link to the thread.

Alternatively, see if your NAS has any firmware updates available. That may fix your problem as well.

dmizer
November 14th, 2008, 12:16 PM
Mmhhh this is me being thick, but I had a look at that thread you mentioned, and also at that referenced in there, but could not find anything that looked useful for my needs.
What I need is something to allow mounting of shares A,B and C to user 1, B to user 2 and C to user 3. How can I achieve that with Autofs ? Can you give me an example ?

You're not thick, I linked the wrong thread ... :oops:

Take a look here instead: http://ubuntuforums.org/showthread.php?t=961624

fcigoi
November 15th, 2008, 07:32 AM
I keep feeling thick. I read through the new link, but it appears to be more suited to a need to mount different shares, with different usernames and password to the same machine for everyone's use than to mount each share to a different user.

dmizer
November 15th, 2008, 08:37 AM
I keep feeling thick. I read through the new link, but it appears to be more suited to a need to mount different shares, with different usernames and password to the same machine for everyone's use than to mount each share to a different user.

Nope, that link is what you need. The main part of autofs is in auto.master file where all the shares are mapped, but the only way the auto.master file can be triggered is by the /home/user/.auto.smb file in each respective users's home directory.

So, auto.master has the maps for all the shares (A B and C), but none are mounted on boot. When user 1 logs in and clicks on the directory mapped in the auto.master file, the users custom /home/user1/.auto.smb triggers the mount for share B. So user 1 cannot see A or C because they are not even mounted.

That's the sum total of my knowledge of autofs. It's difficult for me to explain it well, because I have only used it once.

fcigoi
November 15th, 2008, 09:04 AM
Ok, I start seeing some light now. I'll give it a try tonight....

artio
November 16th, 2008, 07:43 AM
Amazing help that's been given on this thread, dmizer!

I have a similar problem as lviggiani. On xubuntu 8.04.1, after connecting to my university via vpnc, I use

sudo mount -t cifs -o user=bajoerg,domain=d.ethz.ch //hes-server/pepe-home$/users/b/bajoerg /home/joerg/bajoerg

in an xterm, the mounted directory shows in red and ls -l says:

?????????? ? ? ? ? ? bajoerg

information that might help eliminate some possible causes:
- mounting the department's public folder, as opposed to my private folder, works ok (mount -t cifs -o user=bajoerg,domain=d.ethz.ch //hes-server/pepe$ /home/joerg/pepe)
- mounting my private folder with the same vpnc configuration/connection and mount command on an ubuntu 8.10 box works (vpnc version is 0.5.1 on both boxes; smbfs on xubuntu 8.04.1 is 3.0.28a-1ubuntu4.7, smbfs on ubuntu 8.10 is 2:3.2.3-1ubuntu3)
- I've tried different -o additions, such as _netdev,file_mod=0777,dir_mode=0777, iocharset=utf8,uid=1000,gid=1000 in different combinations, but nothing works

I still get a "mounted" folder that is inaccessible, i.e. ls bajoerg gives ls: cannot access bajoerg: No such file or directory

When I umount it, I get it back as
drwxr-xr-x 2 joerg joerg 6 2008-11-16 11:01 bajoerg

Any ideas? Thanks in advance?

dmizer
November 17th, 2008, 04:04 AM
artio, what language encoding are the bajoerg shares? Are you attemting to connect to shares on an AD network?

artio
November 18th, 2008, 12:54 PM
dmizer,

I'm not sure what language encoding my bajoerg shares are. How would I find out?

I'm also not sure what an AD network is.

dmizer
November 18th, 2008, 09:29 PM
dmizer,

I'm not sure what language encoding my bajoerg shares are. How would I find out?

Well, they do not appear to be in utf8, so what language are the file names written in? There may only be one option for your language, but if not, it will essentially come down to trial and error.

I'm also not sure what an AD network is.
AD means "Active Directory (http://en.wikipedia.org/wiki/Active_Directory)". You may have to contact the network administrator to find out for sure.

reets
November 19th, 2008, 09:35 PM
I am mounting folders from a NAS. I can manage files on the drive no problem but when I use a program like gedit or bluefish to edit a file they cannot save the file.

mount command used: sudo mount -t cifs //192.168.0.141/Volume_1/docs /media/docs -o username=uname,password=pass,iocharset=utf8,file_m ode=0777,dir_mode=0777


gedit error is "Unexpected error: Not a directory" and bluefish just says "Cannot write file".

dmizer
November 19th, 2008, 09:43 PM
I am mounting folders from a NAS. I can manage files on the drive no problem but when I use a program like gedit or bluefish to edit a file they cannot save the file.
[snip]
gedit error is "Unexpected error: Not a directory" and bluefish just says "Cannot write file".

I discuss this issue in the howto:
A bug (described here (https://bugs.launchpad.net/gedit/+bug/34813)) in gedit prevents gedit from saving to files located on CIFS mounted shares. If you need to use gedit, you should explore other share options. This is not a bug with Samba or CIFS, so other text editors will work fine. Thank you MountainX (http://ubuntuforums.org/showpost.php?p=4597915&postcount=379) for reporting this very helpful information. *Update* Possible workaround for this error is located here (http://chrisnicholls.ca/2008/03/22/using-gedit-over-sshfs-or-smbcifs-without-being-annoyed/). Please post if this fixes your gedit problem.

reets
November 19th, 2008, 09:55 PM
http://chrisnicholls.ca/2008/03/22/using-gedit-over-sshfs-or-smbcifs-without-being-annoyed/

that link no longer exists for the possible gedit fix. i tried bluefish and nano to edit the same file and both gave a similar error as gedit.

OpenOffice gives a possibly better error. "The object cannot be accessed due to insufficient user rights." Keep in mind i am able to add, move, and delete files on the drives so i don't think it's a permissions issue.

dmizer
November 20th, 2008, 01:24 AM
http://chrisnicholls.ca/2008/03/22/using-gedit-over-sshfs-or-smbcifs-without-being-annoyed/

that link no longer exists for the possible gedit fix.
Well that's not good news.

i tried bluefish and nano to edit the same file and both gave a similar error as gedit.

OpenOffice gives a possibly better error. "The object cannot be accessed due to insufficient user rights." Keep in mind i am able to add, move, and delete files on the drives so i don't think it's a permissions issue.
There is also a note about this under the troubleshooting section. You may be able to resolve this issue by adding the nobrl option like so:
sudo mount -t cifs //192.168.0.141/Volume_1/docs /media/docs -o username=uname,password=pass,iocharset=utf8,nobrl, file_mode=0777,dir_mode=0777

reets
November 20th, 2008, 07:07 PM
tried the nobrl and nounix options (seperately by umounting and then remounting with the other option) and same error message. i also get this error on folders on the drive that are not protected with a user/pass combo.

not sure if this matters but mounting the same docs folder in windows vista and editing the same files works fine.

dmizer
November 20th, 2008, 07:28 PM
tried the nobrl and nounix options (seperately by umounting and then remounting with the other option) and same error message. i also get this error on folders on the drive that are not protected with a user/pass combo.

not sure if this matters but mounting the same docs folder in windows vista and editing the same files works fine.

Try mounting via fstab. You'll need to add the winbind options for name resolution as outlined under the prework. Then you'll need to edit /etc/fstab and add this line:

//netbiosname/Volume_1/docs /media/docs cifs username=uname,password=pass,iocharset=utf8,nobrl, nounix,file_mode=0777,dir_mode=0777 0 0

You'll need to change netbiosname to the actual netbios name of your Windows computer. For more information on that, see post #2 in this thread.

scoopy
November 20th, 2008, 07:37 PM
Hi there again

I'm having uses unmounting my CIFS shares on shut down.
CIFS VFS: Server not responding

Takes about 5 mins to get past a number of errors like this.

Any ideas? Have upgraded to 8.10 now.

Scoopy

dmizer
November 20th, 2008, 07:43 PM
Hi there again

I'm having uses unmounting my CIFS shares on shut down.
CIFS VFS: Server not responding

Takes about 5 mins to get past a number of errors like this.

Any ideas? Have upgraded to 8.10 now.

Scoopy

This thread: http://ubuntuforums.org/showthread.php?t=293513 is linked under my "Troubleshooting" section with the title "CIFS VFS error on shutdown" ;)

reets
November 20th, 2008, 07:56 PM
after that and then doing the "sudo mount -a" I get this when opening the docs folder:

"docs" could not be found. Perhaps it has recently been deleted.

also, the shares are running on a DLINK DNS-323 NAS and not on a windows machine.

dmizer
November 20th, 2008, 08:29 PM
after that and then doing the "sudo mount -a" I get this when opening the docs folder:

"docs" could not be found. Perhaps it has recently been deleted.

also, the shares are running on a DLINK DNS-323 NAS and not on a windows machine.

What is the output of:
smbtree

reets
November 20th, 2008, 08:35 PM
reets@ubuntu:~$ smbtree
Password:
Server requested LANMAN password (share-level security) but 'client lanman auth' is disabled
failed tcon_X with NT_STATUS_OK
Server requested LANMAN password (share-level security) but 'client lanman auth' is disabled
failed tcon_X with NT_STATUS_OK
reets@ubuntu:~$

i typed in my normal admin password when it asked, not sure if that's what it wanted (it's the same password on my shares also).

dmizer
November 20th, 2008, 08:42 PM
reets@ubuntu:~$ smbtree
Password:
Server requested LANMAN password (share-level security) but 'client lanman auth' is disabled
failed tcon_X with NT_STATUS_OK
Server requested LANMAN password (share-level security) but 'client lanman auth' is disabled
failed tcon_X with NT_STATUS_OK
reets@ubuntu:~$

i typed in my normal admin password when it asked, not sure if that's what it wanted (it's the same password on my shares also).

Sorry, use this instead:
smbtree user=username[password]
Replace "username" and "password" with the same ones you used in the CIFS mount command.

reets
November 20th, 2008, 08:51 PM
reets@ubuntu:~$ smbtree user=reets
Password:
reets@ubuntu:~$


reset the pass on the NAS to make sure and how nothing seems to happen (i use the same username and pass on the shares as i do for my ubuntu login)

this is in my fstab:

//DLINK-80CEDB/Volume_1/docs /media/docs cifs username=reets,password=pass,iocharset=utf8,nobrl, nounix,file_mode=0777,dir_mode=0777 0 0


this is in my nsswitch.conf:

passwd: compat
group: compat
shadow: compat

hosts: files mdns4_minimal [NOTFOUND=return] wins dns mdns4
networks: files

protocols: db files
services: db files
ethers: db files
rpc: db files

netgroup: nis

mojohn
November 21st, 2008, 10:32 PM
Hello. I'm new to this thread and need some help.

I followed the instructions in the first post in this thread "to the T" and yet, when I type "sudo mount -a", I get the following error message:

mount error 6 = No such device or address

Following are extracts from the various files I changed while attempting to set up my Windows share as a permanent SMB mount:

Text added to /etc/fstab

# smb share
//office/backup /media/backup cifs guest,rw,file_mode=0777,dir_mode=0777 0 0

Output of smbtree

john@john-desktop:~$ smbtree
Password:
MSHOME
\\OFFICE OFFICE

Text from /etc/samba/smb.conf – not the entire file, just the part that seemed relevant.

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = MSHOME

# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
# wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no

# What naming service and in what order should we use to resolve host names
# to IP addresses
; name resolve order = lmhosts host wins bcast

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes

From /etc/nsswitch.conf:
hosts: files mdns4_minimal [NOTFOUND=return] wins dns mdns4

Any ideas why I can't mount my Windows share successfully, either manually or "automagically"?

FWIW, I'm able to mount my network drives through Nautilus by navigating to the drive, right-clicking and selecting "mount volume" (or some such).

Thanks, mojohn

notbitmonk
November 22nd, 2008, 06:57 PM
Dmizer, this has been a great HOWTO. I have a NAS device (an HDD enclosure) connected to my router (Netgear Rangemax Wireless Router). I followed your howto but got stumped on the netbios part. Although this computer is a dual boot with XP, the NAS doesn't have anything to do with the two OSes I have. I am able to access the NAS from XP and was able to access the NAS from Hardy without any trouble. As soon as I upgraded to Intrepid I lost my connection to the NAS. This is the link to my NAS (http://www.premiertek.net/products/enclosure35/ED-35-LANII.html). If you follow the page you can see that it says that it has a mini server offering FTP/SMB server services. Although it has a web administration page, it is very basic and limited and I'm not able to access the server configuration. I think that the problem lies with the upgrade in Intrepid (something made by Ubunutu) or by the Samba people. I do not have a full Samba server configured, only the smbclient and common files. There is some problem with the repositories that prevents me from doing a full install. I did a firmware upgrade and that didn't work. Would you have a suggestion on how to make it work? I would even try installing FreeNAS on the device if there was a way to do it withoutha big chance of ending up with a brick.

on5sl
November 22nd, 2008, 07:08 PM
Maybe it would be handy for the start post to add this:
When you've got a share with different restrictions per user, you can add different lines to mount a share, and you the noauto option. Then you create a script for each user when he log's on he can mount the share.
Therefore the line in your fstab needs the users option. Watch out, your mounting point must have read/write right to mount your share!

a little example (for user flipo):

//xxx.xxx.x.xxx/main /mnt/nas cifs users,credentials=/home/flipo/.smbcred,iocharset=utf8,file_mode=0777,dir_mode=07 77,uid=flipo,gid=flipo,auto 0 0

then in the ls -l output of /mnt/nas must be:
-rw------- 1 flipo flipo 36 2008-11-22 23:47 .smbpasswd

to do this you can use this command:
sudo chown flipo:flipo /mnt/nas
sudo chmod 600 /home/flipo/.smbcred

in the .smbcred file there must be
username=flipo
password="flipo'spass"

with user in this file it apparently doesn't work on intrepid?

lviggiani
November 25th, 2008, 05:56 AM
@dmizer:
Finally I could solve my problem with Imomega StoreCenter Pro.
I switched to ntp (cifs still has problems with 8.10).
The problem with ntp is that you have to specify on NAS settings a valid range of IP (or even * for all) that have access to it otherwise it will not mout.
Thanks.

artio
November 26th, 2008, 05:55 AM
Well, they do not appear to be in utf8, so what language are the file names written in? There may only be one option for your language, but if not, it will essentially come down to trial and error.

The files in my home directory are written in the same language as the files on the department folder, which I am able to mount without a problem. I'm therefore not sure that encoding is the problem

AD means "Active Directory (http://en.wikipedia.org/wiki/Active_Directory)". You may have to contact the network administrator to find out for sure.

Same as above, the fact that I can mount the department folders but not my own lead me to believe AD does not have anything to do with it.

In other words, I'm still clueless

dmizer
November 27th, 2008, 09:21 PM
Sorry folks, I've been tied up at work. I'll try to reply to everyone here. If I've missed someone please let me know.

Thank you.

reets@ubuntu:~$ smbtree user=reets
Password:
reets@ubuntu:~$
Try this command instead:
smbclient -L DLINK-80CEDB

Output of smbtree

john@john-desktop:~$ smbtree
Password:
MSHOME
\\OFFICE OFFICE

Text from /etc/samba/smb.conf – not the entire file, just the part that seemed relevant.

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = MSHOME
Two things I need to see here.

1) Please post the output of:
smbclient -L OFFICE

2) Your smb.conf does not give your Ubuntu computer a netbios name. Please add an option after "workgroup = MSHOME" (highlighted above in red) which can be used to identify your computer on the network like so:
netbios name = Ubuntu_computer_name
replace "Ubuntu_computer_name" with whatever you'd like your ubuntu computer to be known as on your network (usually whatever comes after the @ symbol in your cli prompt.

Then, restart your samba server with the following command:
sudo /etc/init.d/samba restart

Dmizer, this has been a great HOWTO. I have a NAS device (an HDD enclosure) connected to my router (Netgear Rangemax Wireless Router). I followed your howto but got stumped on the netbios part. Although this computer is a dual boot with XP, the NAS doesn't have anything to do with the two OSes I have. I am able to access the NAS from XP and was able to access the NAS from Hardy without any trouble. As soon as I upgraded to Intrepid I lost my connection to the NAS.
My best suggestion to you is to mount this device with FTP instead of SMB. I only looked briefly at the specs for your device, but my success rate with NAS devices in this thread has been limited. If you have problems with FTP as well, let me know and I'll try to dig deeper.

@dmizer:
Finally I could solve my problem with Imomega StoreCenter Pro.
I switched to ntp (cifs still has problems with 8.10).
The problem with ntp is that you have to specify on NAS settings a valid range of IP (or even * for all) that have access to it otherwise it will not mout.
Thanks.
I am so glad you got that working! As I mentioned above, NAS devices just don't seem to cooperate well with CIFS.

Same as above, the fact that I can mount the department folders but not my own lead me to believe AD does not have anything to do with it.

In other words, I'm still clueless
The whole network doesn't have to be AD. The department folders may be on a simple samba server for easy access, and your personal folder restricted by AD for security reasons. Also, an AD server can handle permissions differently according to the needs of the shares. In other words, open shares can be given access outside of AD logins while your personal shares remain protected.

That said, my understanding of AD is limited, and I have very little experience with it. However, even if AD is NOT the problem, it's still a good idea to investigate it as a potential problem.

mojohn
November 27th, 2008, 10:37 PM
dmizer, the output of smbclient -L OFFICE is:

Domain=[OFFICE] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

Sharename Type Comment
--------- ---- -------
My Docs Disk
IPC$ IPC Remote IPC
print$ Disk Printer Drivers
SharedDocs Disk
LaserJet3020 Printer hp LaserJet 3020 PCL 6
Printer4 Printer Canon PIXMA iP6000D
Printer2 Printer Print2Mail
backup (L) Disk
Printer Printer Print2PDF
Domain=[OFFICE] OS=[Windows 5.1] Server=[Windows 2000 LAN Manager]

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

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

After editing smb.conf to add netbios name = john-laptop, I restarted samba and got the following message in my terminal window:

john@john-laptop:~$ sudo mount -t cifs //office/backup /mnt/windowsmount error: could not find target server. TCP name office/backup not found
No ip address specified and hostname not found

So, I changed the netbios name to the IP address:

john@john-laptop:~$ sudo mount -t cifs //192.168.1.100/backup /mnt/windows
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 other thoughts?

Thanks, mojohn

dmizer
November 27th, 2008, 11:09 PM
mojohn, do you have a samba server configured on your Ubuntu machine? If so, please post the contents of /etc/samba/smb.conf

Also, double check to make sure that cifs is actually installed:
sudo aptitude install smbfs

edit: actually on second thought, the (L) tag on the backup share name could be significant. I'm not sure what it means, but it could be some kind of special lock or security enabled on the backups share. Are you able to mount the "My Docs" share with something like this:
//office/My\040Docs /media/docs cifs guest,rw,file_mode=0777,dir_mode=0777 0 0
Of course, you will also have to make a /media/docs directory.

artio
November 28th, 2008, 02:51 AM
..even if AD is NOT the problem, it's still a good idea to investigate it as a potential problem.

Thanks, dmizer, I'll take this up with the network administrators

mojohn
November 28th, 2008, 12:33 PM
dmizer, cifs is installed. The complete text of my smb.conf file is:

#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# - When such options are commented with ";", the proposed setting
# differs from the default Samba behaviour
# - When commented with "#", the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
# A well-established practice is to name the original file
# "smb.conf.master" and create the "real" config file with
# testparm -s smb.conf.master >smb.conf
# This minimizes the size of the really used smb.conf file
# which, according to the Samba Team, impacts performance
#

#======================= Global Settings =======================

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = MSHOME

# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
# wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no

# What naming service and in what order should we use to resolve host names
# to IP addresses
; name resolve order = lmhosts host wins bcast

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
# syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
# security = user

# You may wish to use password encryption. See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
encrypt passwords = true

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
passdb backend = tdbsam

obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
; domain logons = yes
#
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of the user's profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
# logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
# logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
# load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
; printing = bsd
; printcap name = /etc/printcap

# CUPS printing. See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
; printing = cups
; printcap name = cups

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
# for details
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192
# socket options = TCP_NODELAY

# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is recommended.
# domain master = auto

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash

# The following was the default behaviour in sarge,
# but samba upstream reverted the default because it might induce
# performance issues in large organizations.
# See Debian bug #368251 for some of the consequences of *not*
# having this setting and smb.conf(5) for details.
; winbind enum groups = yes
; winbind enum users = yes

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled.
; usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
;[homes]
; comment = Home Directories
; browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
; read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
; create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
; directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server. Un-comment the following parameter
# to make sure that only "username" can connect to \\server\username
# This might need tweaking when using external authentication schemes
; valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes
; share modes = no

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# Replace 'ntadmin' with the name of the group your admin users are
# members of.
; write list = root, @ntadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
; comment = Samba server's CD-ROM
; read only = yes
; locking = no
; path = /cdrom
; guest ok = yes

# The next two parameters show how to auto-mount a CD-ROM when the
# cdrom share is accesed. For this to work /etc/fstab must contain
# an entry like this:
#
# /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
# is mounted on /cdrom
#
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom

halful01
December 1st, 2008, 10:00 PM
Hi,

I am having a problem mounting a windows share using kerberos authentication.
I run the command:
sudo mount.cifs //smb.pass.psu.edu/emw5051 /media/pass --verbose -o user=dce.psu.edu/emw5051,password=***,sec=krb5
where *** is my actual password.
Then I get the output:
mount.cifs kernel mount options unc=//smb.pass.psu.edu\emw5051,ip=128.118.2.227,domain=d ce.psu.edu,ver=1,user=emw5051,,,,,,,,,,,,,password =***,sec=krb5
mount error 2 = No such file or directory
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

With any other security option I get a permission denied error.
I have checked krb5.conf to make sure I have the correct settings.
I am running ubuntu 8.04.
I can't figure it out, help is appreciated.

dmizer
December 1st, 2008, 10:28 PM
dmizer, cifs is installed. The complete text of my smb.conf file is:
Okay that doesn't tell me anything. Are you able to mount any other shares on that server? This could be a permissions problem with that particular share on the Windows computer itself.

Hi,

I am having a problem mounting a windows share using kerberos authentication.
I run the command:
sudo mount.cifs //smb.pass.psu.edu/emw5051 /media/pass --verbose -o user=dce.psu.edu/emw5051,password=***,sec=krb5
where *** is my actual password.
Then I get the output:
mount.cifs kernel mount options unc=//smb.pass.psu.edu\emw5051,ip=128.118.2.227,domain=d ce.psu.edu,ver=1,user=emw5051,,,,,,,,,,,,,password =***,sec=krb5
mount error 2 = No such file or directory
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

With any other security option I get a permission denied error.
I have checked krb5.conf to make sure I have the correct settings.
I am running ubuntu 8.04.
I can't figure it out, help is appreciated.

The mount line does not look right at all, but I am really weak with AD, and this howto doesn't cover AD. But ... "smb.pass.psu.edu" seems like a strange netbios name. the "user" option should only be this: emw5051 you'll also need to add "dce.psu.edu" as a domain option. So once you know the correct netbios name of the server, your mount command should probably look something like this:
sudo mount.cifs //netbiosname/emw5051 /media/pass --verbose -o user=emw5051,password=***,domain=dce.psu.edu,sec=k rb5
Also, I may not be correct here, but I believe this may not be possible unless you've successfully logged into the AD with your GDM login.

LordKelvan
December 12th, 2008, 09:02 PM
Hi:

I tried this HOWTO, but I cannot get it working. My set-up is that I'm at school, and I would like to access my music folder on my home machine. I've already set-up the port-forwarding rules on my router for the appropriate ports (TCP 445 and TCP 139), and I've configured Windows Firewall to open these ports. My school computer is not running a firewall. The problem is that always times out when I try to connect to my shared folders. This happens regardless of whether I use "Connect to Server", typing "smb://...." into the location bar of Nautilus, or use CLI commands "mount -t cifs ....".

Do you have any suggestions as to what is wrong, or how I might diagnose the problem?

Cheers,
LK

dmizer
December 12th, 2008, 10:18 PM
Hi:

I tried this HOWTO, but I cannot get it working. My set-up is that I'm at school, and I would like to access my music folder on my home machine. I've already set-up the port-forwarding rules on my router for the appropriate ports (TCP 445 and TCP 139), and I've configured Windows Firewall to open these ports. My school computer is not running a firewall. The problem is that always times out when I try to connect to my shared folders. This happens regardless of whether I use "Connect to Server", typing "smb://...." into the location bar of Nautilus, or use CLI commands "mount -t cifs ....".

Do you have any suggestions as to what is wrong, or how I might diagnose the problem?

Cheers,
LK

SAMBA is extremely unsafe to share over the internet. If your windows machine is not already compromized, it will be very soon. Please get that turned off quick.

Please investigate an alternate means of accessing your home network. You should be using an encrypted protocol like VPN or SSH.

LordKelvan
December 12th, 2008, 10:33 PM
Hmm, you don't say.... well thanks for the tip. Is that why I always see people using SAMBA for home networks where both client and server are on the same network?

I'll disable the port-forwarding rules when I get home, and turn off sharing for now. Would you happen to have any free and simple solutions to my problem (like free VPN or something).

Cheers,
LK

dmizer
December 14th, 2008, 04:23 AM
Hmm, you don't say.... well thanks for the tip. Is that why I always see people using SAMBA for home networks where both client and server are on the same network?
yes, SAMBA is meant for intranet only. You need to do a very thorough scan of your Windows machine. I would go so far as to suggest that you reinstall, or at least do a recovery.

Would you happen to have any free and simple solutions to my problem (like free VPN or something).

Cheers,
LK
Both SSH and openVPN are available in Windows.

LordKelvan
December 14th, 2008, 06:32 PM
Hi:

Well I've decided with a slightly more roundabout approach. I am running a VM with an Ubuntu 8.10 Server guest OS, and I'm going to use that to connect to the Music folder (that is shared) on the host OS. Then, I'll use SSHFS to mount the mountpoint on the guest OS onto my school computer. Right now, my Music folder is configured to allow "Full Control" for the admin and lim account (a non-administrative account on my machine). However, if I try to mount it from within the guest OS with:
sudo mount -t cifs //netbiosname/sharename /media/sharename -o username=***,password=***,nounix,rw,iocharset=utf8 ,uid=1000,gid=1000, file_mode=0777,dir_mode=0777
I get the following message:
CIFS VFS: cifs_read_super: get root inode failed
mount error 13 = Permission denied

I get this error message regardless of whether I try to login as admin or as lim. The only way to get rid of this error is to allow "Everyone" "Full Control" to the Music folder (under remote permissions) on my Windows host, which I obviously don't want to do. Do you have any ideas as to how I might fix this problem?

Cheers,
LK

dmizer
December 16th, 2008, 04:11 AM
Well, first of all even if you could mount the SAMBA share from your Ubuntu VM, you wouldn't be able to share it (as far as I know).

Several questions:

What virtualization software are you using?
Do you have your VM configured for NAT or Bridged networking?
Is your Windows share really located at "//netbiosname/sharename"?
Are you sure your gid and uid is 1000?
Does "/media/sharename" exist as an empty folder in your Ubuntu virtual machine?


From the ubuntu virtual machine, please post the output of:
smbclient -L netbiosname
Where "netbiosname" should be replaced with the actual netbios name for your Windows computer. If you don't know what this is, please see the second post in this thread.

LordKelvan
December 16th, 2008, 05:03 AM
Well, first of all even if you could mount the SAMBA share from your Ubuntu VM, you wouldn't be able to share it (as far as I know).

I am running an SSH server on the VM, so I plan to simply use SSHFS to mount the relevant directory (on my VM) onto my school computer

My answers to your questions:

VMware Player/Server
Bridged networking
Yes. I am sure of this, because if I add the group "Everyone" and give it "Full Control" in Windows, then I am able to mount the share.
Yes, when I make the above changes, and the share is mounted, I see that the owner & group are correctly set.
Refer to the answers above.


As for the command, I actually had to run the following one:
smbclient -L netbiosname -U windows_username
since my VM username and Windows username (the particular Windows user account is a non-administrator account I specifically created for this purpose) are different.

The output is:

Sharename Type Comment
--------- ---- -------
E$ Disk Default share
IPC$ IPC Remote IPC
D$ Disk Default share
print$ Disk Printer Drivers
SharedDocs Disk
G$ Disk Default share
Music Disk
ADMIN$ Disk Remote Admin
C$ Disk Default share

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

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


A couple of funny things, I'm not sure if they are relevant:

When it prompts me for a password, and I type in the actual password, it claims that "session setup failed: NT_STATUS_LOGIN_FAILED". However, if I just hit "Enter" (i.e., don't enter in a password), it gives me the above output.
If I run the smbclient command above with "-U admin_username", and I don't enter in a password, then it correctly states that permission is denied, but also correctly lists the Workgroup and Master. If I do enter the correct admin password, then I get the same output as above (including the fact that the Workgroup and Master entries are empty).


Cheers,
LK

graysky
December 20th, 2008, 05:59 AM
I have a script that simply mounts a samba share via this one line command:

sudo mount -t cifs -o username=user,password=password //192.168.1.2/stuff ~/stuff

I don't want to add an entry to my /etc/fstab and prefer to mount it via this script (I have another script that unmounts it as well). This method works just fine EXCEPT that it makes the username/password public. I'd like to use a credentials file, but to my knowledge, this is only appropriate for an entry in the /etc/fstab. Is there a way to use one with a mount command?

When I tried to via the follow, I got an error:

$ sudo mount -t cifs -o credentials=/root/.cred_for_smb //192.168.1.2/stuff ~/stuff
mount: wrong fs type, bad option, bad superblock on //192.168.1.2/stuff,
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

dmizer
December 21st, 2008, 03:43 AM
I'd like to use a credentials file, but to my knowledge, this is only appropriate for an entry in the /etc/fstab. Is there a way to use one with a mount command?

According to man mount.cifs, it's perfectly legal to use a credentials file for any cifs mount. I'm not sure why you're getting an error.

Just to be sure, try this:
sudo aptitude install smbfs

If you are using Hardy or Ibex, they are shipped with a stripped down version of cifs for mounting with Nautilus, but you may not get full functionality until you install the smbfs metapackage.

graysky
December 21st, 2008, 07:11 AM
@dmizer - installing smbfs solved the problem, thanks! Great guide you've written here btw, I have referenced it numerous time.

Gammell
December 22nd, 2008, 01:31 AM
Hm.
So I recently updated from Gutsy->Intrepid on my laptop (I'd had a full HDD for the longest time and was lazy) and started getting an error 13 when trying to mount my smbfs shares. I've updated my fstab following the ideas in this guide, but I still get the error. The samba shares are across my LAN between two linux machines, my laptop (now) running Intrepid and my old desktop serving as a file server/mythtv box and still running Gutsy.
//SERVER/Documents /media/Server/Documents cifs credentials=/root/.smb_pwd,rw,nounix,iocharset=utf8,file_mode=0755,d ir_mode=0755 0 0
And the error:
$sudo mount /media/Server/Documents

mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs) So I have two questions:

is this problem solely on my laptop's side? Is the difference between CIFS/SMBFS transparent to a server or do I need to update my old desktop too? (ok. I know I *need* to update it eventually, but I mean to fix this problem). As I understand it, CIFS came in with Hardy.
help.

dmizer
December 22nd, 2008, 03:17 AM
Hm.
So I recently updated from Gutsy->Intrepid on my laptop (I'd had a full HDD for the longest time and was lazy) and started getting an error 13 when trying to mount my smbfs shares. I've updated my fstab following the ideas in this guide, but I still get the error. The samba shares are across my LAN between two linux machines, my laptop (now) running Intrepid and my old desktop serving as a file server/mythtv box and still running Gutsy.
//SERVER/Documents /media/Server/Documents cifs credentials=/root/.smb_pwd,rw,nounix,iocharset=utf8,file_mode=0755,d ir_mode=0755 0 0
And the error:
$sudo mount /media/Server/Documents

mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs) So I have two questions:

is this problem solely on my laptop's side? Is the difference between CIFS/SMBFS transparent to a server or do I need to update my old desktop too? (ok. I know I *need* to update it eventually, but I mean to fix this problem). As I understand it, CIFS came in with Hardy.
help.


Please try this:
sudo aptitude install smbfs

If that is not successful, please post the output of:
smbclient -L SERVER
Where SERVER is the actual netbios name of your Gutsy server.

Also, since both of your machines are Ubuntu, please consider using NFS instead of SAMBA. It's much more simple to configure, and you'll get better performance. The 4th link in my signature contains great instructions for configuring both the server and the client.

Gammell
December 22nd, 2008, 03:33 AM
Please try this:
sudo aptitude install smbfs
Yeah, I'd already ran apt-get to make sure it hadn't some how been removed



If that is not successful, please post the output of:
smbclient -L SERVER
Where SERVER is the actual netbios name of your Gutsy server.
$smbclient -L SERVER

Sharename Type Comment
--------- ---- -------
IPC$ IPC IPC Service (File Server)
print$ Disk Printer Drivers
CD-ROM Disk CD-ROM
DVD-ROM Disk DVD-ROM
Documents Disk Documents
MythTV Disk MythTV Storage
960c Printer HP Deskjet 960c

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

Workgroup Master
--------- -------
WORKGROUP ROOMMATE-PC
Hmm... 'ROOMMATE-PC' is my roommates pc (which I've obviously renamed), it looks like it's won that samba-master negotiation-thingy for the workgroup... That shouldn't affect anything though, should it?



Also, since both of your machines are Ubuntu, please consider using NFS instead of SAMBA. It's much more simple to configure, and you'll get better performance. The 4th link in my signature contains great instructions for configuring both the server and the client.
This has been on my To-Do list for a very long time. I can never get rid of SAMBA because there are nonlinux boxes on my network from time to time, but the only reason I still use it is legacy. (I learnt linux on the server and didn't switch to linux for day to day use until a year or two later). Thanks for the link, it will be helpful someday soon (I think updating from Gutsy will have priority though ;) ...)

dmizer
December 22nd, 2008, 03:44 AM
Really, the problem is not likely to be related to the fact that your server is still using Gutsy. (Edit to elaborate): I still have a fully functional Dapper SAMBA server which hosts shares to Windows, several different releases of Ubuntu, and a Mac.

On the Gutsy server, please run the following command and post the output:
cat /etc/samba/smb.conf | grep workgroup

Gammell
December 22nd, 2008, 12:57 PM
Really, the problem is not likely to be related to the fact that your server is still using Gutsy. (Edit to elaborate): I still have a fully functional Dapper SAMBA server which hosts shares to Windows, several different releases of Ubuntu, and a Mac.That's good to know, I didn't really understand the difference between CIFS and SMBFS. CIFS kind of came out of nowhere for me.

On the Gutsy server, please run the following command and post the output:
cat /etc/samba/smb.conf | grep workgroup$ cat /etc/samba/smb.conf | grep workgroup

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP
Unless it's that CIFS requires new/additional configurations, I'm confident that the server is set up fine. I'd actually used it right before upgrading to make some room and back up some files.

dmizer
December 22nd, 2008, 08:28 PM
Try adding the domain= option like so:
//SERVER/Documents /media/Server/Documents cifs credentials=/root/.smb_pwd,domain=WORKGROUP,rw,nounix,iocharset=utf8 ,file_mode=0755,dir_mode=0755 0 0

CIFS and SMBFS perform essentially the same function. SMBFS is no longer maintained and has depreciated. CIFS is being maintained and is replacing SMBFS. SMBFS has not been a part of Ubuntu since Gutsy.

SMBFS is also a meta package (https://help.ubuntu.com/community/CommonQuestions#Meta-packages:%20ubuntu-desktop), which means that when you "sudo aptitude install smbfs", you're installing several SAMBA related packages including CIFS and winbind. CIFS has been a part of the SMBFS metapackage since Breezy. Interestingly, the actual SMBFS package has NOT been a part of the SMBFS meta package since Gutsy.

Gammell
December 22nd, 2008, 09:31 PM
Try adding the domain= option like so:
//SERVER/Documents /media/Server/Documents cifs credentials=/root/.smb_pwd,domain=WORKGROUP,rw,nounix,iocharset=utf8 ,file_mode=0755,dir_mode=0755 0 0
I had the domain in my credentials file, moved it out to fstab and still no luck.


CIFS and SMBFS perform essentially the same function. SMBFS is no longer maintained and has depreciated. CIFS is being maintained and is replacing SMBFS. SMBFS has not been a part of Ubuntu since Gutsy.

SMBFS is also a meta package (https://help.ubuntu.com/community/CommonQuestions#Meta-packages:%20ubuntu-desktop), which means that when you "sudo aptitude install smbfs", you're installing several SAMBA related packages including CIFS and winbind. CIFS has been a part of the SMBFS metapackage since Breezy. Interestingly, the actual SMBFS package has NOT been a part of the SMBFS meta package since Gutsy.So does CIFS provide a server as well as a client and if so is the CIFS server any different then a SMBFS server? Are they different OSS implementations of the same protocol or is it that Microsoft's (?) updated the protocol?

dmizer
December 22nd, 2008, 09:40 PM
I had the domain in my credentials file, moved it out to fstab and still no luck.
Any strange characters or spaces in your password or username?

So does CIFS provide a server as well as a client and if so is the CIFS server any different then a SMBFS server? Are they different OSS implementations of the same protocol or is it that Microsoft's (?) updated the protocol?

CIFS and SMBFS are both client only protocols. SAMBA is the server side. CIFS is Microsofts current protocol. More information on the OSS implementation here: http://www.samba.org

Gammell
December 22nd, 2008, 09:52 PM
Any strange characters or spaces in your password or username?Yes, "strange characters". But again, same password as before...
edit:They're simply entered in plain text and without any quotes. As I said, this is what worked before, but does CIFS need them to be escaped or anything? Ex:username = user
password = p@$$word

CIFS and SMBFS are both client only protocols. SAMBA is the server side. CIFS is Microsoft's current protocol. More information on the OSS implementation here: http://www.samba.orgI see, thanks.

moTaro
December 28th, 2008, 07:40 PM
Great Tutorial, i did understand a lot of glitches I had about how samba works.

I do have one annoying problem, all my shares are mounted and working via fstab using -t cifs. Shared resources (Folders) are on Windows 2003 Server, all is good untill I hit a folder (on my Ubuntu mount point) with more than say 500+ files (no matter format of files, jpeg, mp3, etc)

Then I can go make coffie untill content of folder is being parsed to nautilus. It takes like 30 seconds for 2000 files to bi shown. On Folders with smaller amount of files seems to function with acceptable speed.

Time is progresive. The more files, more time is needed just to be shown.

What's my cure :(?

dmizer
December 29th, 2008, 12:32 AM
Great Tutorial, i did understand a lot of glitches I had about how samba works.

I do have one annoying problem, all my shares are mounted and working via fstab using -t cifs. Shared resources (Folders) are on Windows 2003 Server, all is good untill I hit a folder (on my Ubuntu mount point) with more than say 500+ files (no matter format of files, jpeg, mp3, etc)

Then I can go make coffie untill content of folder is being parsed to nautilus. It takes like 30 seconds for 2000 files to bi shown. On Folders with smaller amount of files seems to function with acceptable speed.

Time is progresive. The more files, more time is needed just to be shown.

What's my cure :(?

The more often you visit those directories, the less time it will take to load them. For directories with huge numbers of files, the more you visit them the less time it will take to load (providing that there is not frequent and significant changes to the directory content).

Your LAN performance will also effect this. For example, if you are mounting the folders over wireless, you're going to notice a slowdown as the content loads. If you are connected via cat5, I suggest you look into your network throughput.

The reason for this, is that with fstab, you are physically mounting the content on your local drive. The advantage to this is that you get improved performance for file transfers, but one disadvantage is that large directories with lots of files will take time to cache the first several times through.

dmizer
December 29th, 2008, 12:34 AM
edit:They're simply entered in plain text and without any quotes. As I said, this is what worked before, but does CIFS need them to be escaped or anything? Ex:username = user
password = p@$$word

Ah ha, I missed your edit. CIFS does not like spaces before and after the equal sign. Try removing them and see if that fixes your problem.

Gammell
December 29th, 2008, 01:06 AM
Ah ha, I missed your edit. CIFS does not like spaces before and after the equal sign. Try removing them and see if that fixes your problem.Thanks. I am separated from the offending hardware for a week or so, but I will try it when I get back and report on the results. Let's hope this is it!
edit: Sorry about the edit. (wait... ;) )

kevdog
December 29th, 2008, 01:45 AM
Stupid question --

If CIFS is the client, and you are mounting windows shares -- what is the server? What is Windows running that functions as the server?

moTaro
December 29th, 2008, 07:38 AM
The more often you visit those directories, the less time it will take to load them. For directories with huge numbers of files, the more you visit them the less time it will take to load (providing that there is not frequent and significant changes to the directory content).


It's always same waiting time to parse the content. Btw, those folders are in production enviroment, so 50 ppl are continuosly accesing their content.

Just to make sure I point the problem to the right direction, .thumbnails on client side is feeding with png's awright, so yes, it takes faster every time to show up preview icons in nautilus, but unfortenatly I have to always wait arround 30 seconds every time I click the shared cifs resource with arround 4000 files to parse, in the mean time, all mounted media disapear from desktop, there is system "flash" during reading process.


Your LAN performance will also effect this. For example, if you are mounting the folders over wireless, you're going to notice a slowdown as the content loads. If you are connected via cat5, I suggest you look into your network throughput.


Thought about that too. Since my Office has mingled clients half are Windows XP, half Ubuntu 25/25. Windows XP clients do not have this problem, they parse content in a blink of second (even with 4000 files in the folder) so I ruled out LAN throughput. I use cat5 cabling.



The reason for this, is that with fstab, you are physically mounting the content on your local drive. The advantage to this is that you get improved performance for file transfers, but one disadvantage is that large directories with lots of files will take time to cache the first several times through.

How do you suggest to mount them then (automaticly) to excape this annoying problem?


# CIFS Bring windows shares to LBox

//einstein/Gotovi /home/VECERPRES/bojan/Gotovi cifs exec,credentials=/etc/cifspw 0 0
//paladin/Foto\ arhiva /home/VECERPRES/bojan/Foto cifs exec,credentials=/etc/cifspw 0 0
//paladin/Rabotni /home/VECERPRES/bojan/Rabotni cifs exec,credentials=/etc/cifspwRW 0 0

# NFS Resursi on Ubuntu Server

Sylvanas:/home/Bojan /home/VECERPRES/bojan/Documents nfs rsize=8192,wsize=8192


This is my actual Fstab.

hashimoto
January 2nd, 2009, 02:01 PM
Great! I have a D-Link DNS-323 and using your instructions it was a breeze. Thanks a lot!

Domo arigato gozaimasu!

dmizer
January 4th, 2009, 11:22 AM
Stupid question --

If CIFS is the client, and you are mounting windows shares -- what is the server? What is Windows running that functions as the server?
Not so stupid at all, I had to do some digging to find the answer, which is also not so simple. It depends on what version of Windows you are using. XP pro relies on "classic" file sharing which is based on the closed source version of SMB (Server Message Block (http://en.wikipedia.org/wiki/Server_Message_Block)). Home versions of XP use "Simple File Sharing UI", and I was unable to determine what that was based on, but it is compatible with both the closed and open source versions of SMB and CIFS.

It's always same waiting time to parse the content. Btw, those folders are in production enviroment, so 50 ppl are continuosly accesing their content.

Just to make sure I point the problem to the right direction, .thumbnails on client side is feeding with png's awright, so yes, it takes faster every time to show up preview icons in nautilus, but unfortenatly I have to always wait arround 30 seconds every time I click the shared cifs resource with arround 4000 files to parse, in the mean time, all mounted media disapear from desktop, there is system "flash" during reading process.[snip]
I've been looking for a possible solution for this problem, but I have not been very successful.

Does the problem persist if you disable thumbnail preview? Thumbnail preview in Ubuntu is significantly more sophisticated than in Windows, and this could be a possible explanation for the difference in speed.

Great! I have a D-Link DNS-323 and using your instructions it was a breeze. Thanks a lot!

Domo arigato gozaimasu!
どういたしまして (^-^)

Gammell
January 4th, 2009, 06:00 PM
Ah ha, I missed your edit. CIFS does not like spaces before and after the equal sign. Try removing them and see if that fixes your problem.That did the trick, thanks a lot for the help.

moTaro
January 6th, 2009, 06:18 AM
Does the problem persist if you disable thumbnail preview? Thumbnail preview in Ubuntu is significantly more sophisticated than in Windows, and this could be a possible explanation for the difference in speed.


There is slight difference in performance that way, but still I need the preview icon display.

Interesting this might seem to be Gnome & Nautilus issue after all, not Cifs it self. I will try Kubuntu, I hate KDE but when resolving a problem I am willing to try every radical possible solutions, Will see if KDE performes same way.

I will update.

dmizer
January 6th, 2009, 06:47 AM
There is slight difference in performance that way, but still I need the preview icon display.

Interesting this might seem to be Gnome & Nautilus issue after all, not Cifs it self. I will try Kubuntu, I hate KDE but when resolving a problem I am willing to try every radical possible solutions, Will see if KDE performes same way.

I will update.

I might also suggest trying Thunnar in Gnome. Thunnar isn't as sophisticated as Nautilus, but you may find it more speedy and still may be able to serve your needs. That or a just try Xubuntu (much closer to Gnome in look and feel, and uses Thunnar rather than Nautilus). This should get you thumbnails without quite as much overhead.

moTaro
January 7th, 2009, 06:28 AM
@dmizer, thank you very much for your feedback.

For the record, I tried KDE's dolphin it's even slower regarding that issue (thank god, I just cant do Kde, just can't). I will now switch back to gnome and try Thunnar as suggested and will also try xubuntu as last step.

Thank you for your responses once again, you've been great, and you have earned my respect!


P.S. Edited... Xubuntu's Thunar Kicks ***. Very Acceptable performance!

dmizer
January 7th, 2009, 07:27 AM
P.S. Edited... Xubuntu's Thunar Kicks ***. Very Acceptable performance!
Sweet! That's music to my ears.

nargis.himani
January 7th, 2009, 07:53 AM
I want linux command/shell script similar to ‘net use’ (windows)
I feel mount is one of the ways to get access of network drives on linux.
I need help regarding the mounting network device with ubuntu. The scenario is as follow.
I am using mount.cifs. It is working when I give some shared dir with servername but what we want is mounting with only host name
i.e.:
mount.cifs //servername/shared /mydir/mountpoint -o user=username password=mypassword domain=mydomain
is working fine ,but
mount.cifs //servername /mydir/mountpoint -o user=username password=mypassword domain=mydomain
is not working.
If any other way or approach can help to achieve the same than plz let me know.

dmizer
January 7th, 2009, 08:02 AM
I want linux command/shell script similar to ‘net use’ (windows)
I feel mount is one of the ways to get access of network drives on linux.
I need help regarding the mounting network device with ubuntu. The scenario is as follow.
I am using mount.cifs. It is working when I give some shared dir with servername but what we want is mounting with only host name
i.e.:
mount.cifs //servername/shared /mydir/mountpoint -o user=username password=mypassword domain=mydomain
is working fine ,but
mount.cifs //servername /mydir/mountpoint -o user=username password=mypassword domain=mydomain
is not working.
If any other way or approach can help to achieve the same than plz let me know.

The method outlined in this tutorial is mounting. You cannot mount a server, you can only mount a directory. This is equivalent to Windows "map network drive (http://support.microsoft.com/kb/308582)" functionality.

nargis.himani
January 7th, 2009, 08:15 AM
The method outlined in this tutorial is mounting. You cannot mount a server, you can only mount a directory. This is equivalent to Windows "map network drive (http://support.microsoft.com/kb/308582)" functionality.
than what can be the similer to 'net use' with windows

dmizer
January 7th, 2009, 10:13 AM
than what can be the similer to 'net use' with windows

Click "Places" > "Connect to server"
Change the service type to "Windows share" and type in the server name.

Notes:
1) Performance is bad
2) Connections are sometimes finicky.
3) You'll have to setup a Samba server on Ubuntu so you can specify the netbios name and workgroup.
4) Correctly configure winbind (as outlined in this tutorial)

scoopy
January 11th, 2009, 11:40 PM
hi there dmizer

I'm trying to connect to a NAS server. my fstab file reads:

//backup2/backup /media/backup2/ cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

However I'm getting this error when running sudo mount -a

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

Any suggestions?

thanks

Scoopy

dmizer
January 11th, 2009, 11:53 PM
hi there dmizer

I'm trying to connect to a NAS server. my fstab file reads:

//backup2/backup /media/backup2/ cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

However I'm getting this error when running sudo mount -a

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

Any suggestions?

thanks

Scoopy

According to this post: http://ubuntuforums.org/showpost.php?p=2294202&postcount=203 rebooting fixed the problem. Have you rebooted since editing fstab?

scoopy
January 12th, 2009, 01:16 AM
According to this post: http://ubuntuforums.org/showpost.php?p=2294202&postcount=203 rebooting fixed the problem. Have you rebooted since editing fstab?

Sorry, that didn't work.

any other thoughts?

Scoopy

dmizer
January 12th, 2009, 01:19 AM
Sorry, that didn't work.

any other thoughts?

Scoopy

Please post the output of:
cat /etc/nsswitch.conf | grep hosts

scoopy
January 12th, 2009, 01:22 AM
Please post the output of:
cat /etc/nsswitch.conf | grep hosts

#hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
hosts: files wins dns

Thanks for your help

Scoopy

dmizer
January 12th, 2009, 01:48 AM
Try changing "backup2" to backup2's IP address:
//IP.address.here/backup /media/backup2/ cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

dmizer
January 12th, 2009, 01:54 AM
Just noticed this. You should not end your server or mount path with a "/". So you should change this: "/media/backup2/" to this "/media/backup2"

scoopy
January 12th, 2009, 02:03 AM
Just noticed this. You should not end your server or mount path with a "/". So you should change this: "/media/backup2/" to this "/media/backup2"

Thanks for your help, but still the same error . . .

Scoopy

dmizer
January 12th, 2009, 02:13 AM
What is the make and model of your NAS device?

Edit:
Also, did you try replacing the server netbios name with the server IP address?

scoopy
January 12th, 2009, 02:28 AM
What is the make and model of your NAS device?

Edit:
Also, did you try replacing the server netbios name with the server IP address?

it's a Pleiades USB/LAN

http://www.macpower.com.tw/products/hdd3/pleiades/pd_usblan

dmizer
January 12th, 2009, 03:13 AM
Well, since there are no firmware updates available for your device, I think you will have two choices here. Either use FTP instead of CIFS, or (if you're dead set on using samba protocols) compiling and installing SMBFS. Odds are that the CIFS version that comes with your NAS device is simply too old, and therefore incompatible with Ubuntu.

I highly suggest you try FTP, it's a breeze to setup in Gnome with the "Places" > "Connect to server" function.

scoopy
January 12th, 2009, 03:34 AM
Well, since there are no firmware updates available for your device, I think you will have two choices here. Either use FTP instead of CIFS, or (if you're dead set on using samba protocols) compiling and installing SMBFS. Odds are that the CIFS version that comes with your NAS device is simply too old, and therefore incompatible with Ubuntu.

I highly suggest you try FTP, it's a breeze to setup in Gnome with the "Places" > "Connect to server" function.

thanks, worked a treat!

Scoopy

eanske
January 24th, 2009, 08:20 PM
Thanks dmizer for the great how-to, network drives are working great now. Just wanted to add my two cents. Apologies in advance if this has been mentioned before.

I had a bit of a time with the write permissions on my clarkconnect box, then I realized I needed to input my gid and uid of my cc box into the fstab not the gid and uid from my ubuntu machine. Works like a charm.

Thanks again.

macuser136
February 7th, 2009, 05:18 PM
Thanks for a great How-To but I have one problem.

I can only mount one of my window shares from my Window server. The first one listed inside the fstab mounts first and mounts every time no problem. The second one will not mount but I get this error with sudo mount -a

mount error 79 = Can not access a needed shared library
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

Now if I change the order of the Fstab, the other will mount with out problem but only one will mount and i get the same error.

Here is a copy of my fstab and I hope you can help.

Thank you in advance.



# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=bef2ad25-9388-4698-96fb-6cde1cab0223 / ext3 relatime,erro$
# /dev/sda5
UUID=90347e79-d53b-41ee-915b-b6db241ef615 none swap sw $
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
//Pirate/Pirate_200 /media/Pirate_200 cifs guest,rw,iocharset=utf8$
//Pirate/Pirate_100 /media/Pirate_100 cifs guest,rw,iocharset=utf8$

dmizer
February 7th, 2009, 08:33 PM
Please repost your complete /etc/fstab. Here's how:

Run this command:
cat /etc/fstab
Then post the output here, but make sure you put the output in the bbc markup like so:
[code]/etc/fstab output

The [code] tags are very important because they keep the formatting correct.

macuser136
February 7th, 2009, 08:46 PM
Thank you. I was hoping this thread was not dead.

Full fstab.


# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=bef2ad25-9388-4698-96fb-6cde1cab0223 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda5
UUID=90347e79-d53b-41ee-915b-b6db241ef615 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
//Pirate/Pirate_200 /media/Pirate_200 cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0
//Pirate/Pirate_100 /media/Pirate_100 cifs guest,rw,iocharset=utf8$

eric@eric-laptop:~$

dmizer
February 7th, 2009, 08:49 PM
Well, as you can see from the output above, the second fstab line is incomplete. In nano, the $ symbol means that there is more to the line. If you stretch the terminal window, you'll be able to see the rest of the line, then you can copy and paste it.

macuser136
February 7th, 2009, 09:02 PM
Thanks. I've learned 2 new things already and we have not even gotten to the problem yet. I appreciate it.

=utf8,file_mode=0777,dir_mode=0777 0 0
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=bef2ad25-9388-4698-96fb-6cde1cab0223 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda5
UUID=90347e79-d53b-41ee-915b-b6db241ef615 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
//Pirate/Pirate_200 /media/Pirate_200 cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0
//Pirate/Pirate_100 /media/Pirate_100 cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0


I tinckered a little bit and I am getting a new error.

eric@eric-laptop:~$ sudo mount -a
mount: mount point 0 does not exist
eric@eric-laptop:~$

dmizer
February 7th, 2009, 09:04 PM
At the top of your fstab you have this:
=utf8,file_mode=0777,dir_mode=0777 0 0
You'll have to removed that.

macuser136
February 7th, 2009, 09:08 PM
Perfect. :popcorn:

Thank you for your time.

Can you shed some light as to how or why that line I deleted fixed my problems. I do not know how it got there.

Every little bit of knowledge I gain will help in the future.

Of Course, I know your busy.

dmizer
February 7th, 2009, 09:11 PM
Since that line is the missing section of your Samba mount, I assume that you accidently pasted it at the top instead of at the end of your Samba mount line. :)

macuser136
February 7th, 2009, 09:16 PM
Well, don't that just figure. ;)](*,)

Once again, thank have a good night or day. What ever it is in Japan.

It's PM in Chicago, USA.

dmizer
February 7th, 2009, 09:17 PM
I want some UNOs!

Anyway, don't worry. I still frequently make the same mistake when I switch between a GUI word processor and nano.

kevdog
February 8th, 2009, 10:07 AM
This method is only for mounting sharing, but not sharing folders with other machines -- you would need the samba server for this correct?

I'm curious on how restrictive you are on your windows machines -- or how you are specifically setting up the share folders on the windows machines. Are you using a simple share, or the more advanced share features that can limit by username, domain, screen name, etc?

Off topic
I actually prefer Eduardo's to UNO's, however UNO definitely has the name recognition. Either way Chicago style pizza rocks!

dmizer
February 8th, 2009, 11:05 AM
This method is only for mounting sharing, but not sharing folders with other machines -- you would need the samba server for this correct?
That is correct.

I'm curious on how restrictive you are on your windows machines -- or how you are specifically setting up the share folders on the windows machines. Are you using a simple share, or the more advanced share features that can limit by username, domain, screen name, etc?
In all honesty, I haven't had a Windows box on my network for several years. The one Windows network I do manage is a fairly small network of about 20 machines.

When I configured that network, I removed file and printer sharing on all of the work stations. The only network resources available to the Windows work stations are the central file servers and the network printers. The central file servers are dedicated Dapper Samba servers configured according to Stormbringer's guide linked in my sig, with a few minor tweaks.

macuser136
February 8th, 2009, 11:33 AM
It is just a simple in the house network. The shares are set-up with the simplest of simple LOL. In all honesty, I do have a FTP running on the same machine, but I'm not sure it would be easy for my wife to get to her stuff when she needs it so her Laptop is set up with windows XP Pro with those shares mapped so she can just work right off the server. That's also why I don't really FTP locally because I am accessing my music from there (works great on my laptop now, thanks), your a :KS and spreadsheets and pictures.

UNO's Pizza. Hrmmm. Not a HUGE fan. Really Salty. I prefer Geno's East. They have an awesome Garlic Peperoni pizza. YUMMY Giorgio's is good too. We have on down the street here in the suburbs.

eti.que
February 20th, 2009, 04:39 PM
Hi guys,

I need your help.

I have the following share:
[Vidéos]
path = /media/Vidéos
force create mode = 0775
force directory mode = 0775
force group = users
write list = @users
read only = Yes
guest ok = Yes


It works as intended from both Windows & Linux: someone not authenticated on the samba server can read it, a a valid user as access according to the files permission.

But when trying to permanently mount this share on my Ubuntu box, using the following in fstab:
//server/Vidéos /media/Vidéos cifs guest,nounix,iocharset=utf8 0 0

I always get the following error:
root@mediacenter:/home/xbmc# mount -a
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)


Can anyone give me a hint?

Thanks a lot!

dmizer
February 20th, 2009, 08:43 PM
A very common cause of this error is simply not having smbfs installed. Please make sure smbfs is installed by running the following command:
sudo aptitude install smbfs

If that does not solve your problem, I suggest that you try removing the illegal "é" character from the name of your share as this can cause the error 13 as well.

eti.que
February 21st, 2009, 08:33 AM
Hi dmizer,

I had smbfs installed, but changing my sharename to videos unfortunately didn't make the trick.

I am now using NFS for this anyway, but I'd like to know the root cause for knowledge's sake.

Thanks!

dmizer
February 21st, 2009, 10:31 AM
Hi dmizer,

I had smbfs installed, but changing my sharename to videos unfortunately didn't make the trick.

I am now using NFS for this anyway, but I'd like to know the root cause for knowledge's sake.

Thanks!

You'll have better luck with NFS anyway.

Have you enabled the root account on the client, but not the server? Or, enabled root on both? This could cause problems with uid and gid. There is a fix for this in the troubleshooting section.

Obsolete Zero
February 25th, 2009, 08:26 PM
hey dmizer,

As it seems you are the samba guru on the ubuntuforums :D

I have a question.

I've managed to get most things working, when i check the smbtree everything seems to be there however I'm getting this mount error 6, no such device or directory.

My question is I have this folder on my netdrive called PUBLIC DISK 1 i want to access/ perm mount. i use %20 for the whitespaces in fstab but i'm not sure if this is supported and what I should do to make it work. I think this is the reason for the error.......

added the smbtree.

What are your thoughts?

tnx in advance! :)

dmizer
February 25th, 2009, 08:31 PM
In my howto under "Troubleshooting" there is a section on "Space in path name". That should fix you up :)

Obsolete Zero
February 26th, 2009, 03:05 AM
DOH!!! i can't belief i didnt see that one ](*,)

many thanks!!!!!

just tried, still no luck :( it does add "try with upper case share name" but result is still mount error 6

Well I advanced one step :D

dmizer
February 26th, 2009, 05:32 AM
What's your current /etc/fstab mount line?

Obsolete Zero
February 26th, 2009, 07:48 AM
my mount line is:

//192.168.149/PUBLIC\40DISK\401 cifs credentials=/root/.smbcredentials,nounix,iocharset=utf8,file_mode=07 77,dir_mode=0777 0 0

i use the ip since i gave my network drive a fixed IP.

dmizer
February 26th, 2009, 09:41 AM
You forgot to make a mount point.

In order to make a permanent mount, you need an empty folder where Ubuntu can cache the landisk files. In my howto, I suggest creating an empty folder in /media. For example:
sudo mkdir /media/landisk
Then your fstab line would look like this:
//192.168.149/PUBLIC\40DISK\401 /media/landisk cifs credentials=/root/.smbcredentials,nounix,iocharset=utf8,file_mode=07 77,dir_mode=0777 0 0

Obsolete Zero
March 2nd, 2009, 02:23 PM
eermmm that would be my bad since i forgot to add that to my line of code. I was at the office writing this. I did make a folder to mount it to called netdrive.

I made a landisk in media after your post however, and still i get the same error. I was away for the weekend so i couldn't work on it. I'll let you know if I make any progress this week!

dmizer
March 2nd, 2009, 07:31 PM
If you've enabled netbios name resolution as outlined in my howto, you should also try this:

//netdrive/PUBLIC\40DISK\401 /media/landisk cifs credentials=/root/.smbcredentials,nounix,iocharset=utf8,file_mode=07 77,dir_mode=0777 0 0

Obsolete Zero
March 4th, 2009, 02:45 AM
Hi Dmizer,

I tried, but without success :(

It seems there are more people on the net who have this problem can't solve it. I've been looking for mount error 6 cifs specific.

The strange thing is, I can access the samba drive via places-network-netdrive but it didnt ask for a login so I don't have any rights. This is the reason why I want to perma mount this drive with password access.

I will try by removing credentials to add it but that will get me back to the beginning of why i wanted to have this perma mount....

>> nope didn't work, in the end i still get the mount error 6.

dmizer
March 4th, 2009, 02:47 AM
Hi Dmizer,

I tried, but without success :(

It seems there are more people on the net who have this problem can't solve it. I've been looking for mount error 6 cifs specific.

The strange thing is, I can access the samba drive via places-network-netdrive but it didnt ask for a login so I don't have any rights. This is the reason why I want to perma mount this drive with password access.

I will try by removing credentials to add it but that will get me back to the beginning of why i wanted to have this perma mount....

>> nope didn't work, in the end i still get the mount error 6.

If you can access the drive fine without credentials, then your NAS drive is configured to share files without password protection. This is why you're getting the error 6. Ubuntu is attempting to send a username and password, but your NAS is not responding.

Does this work?
//netdrive/PUBLIC\40DISK\401 /media/landisk cifs guest,rw,nounix,iocharset=utf8,file_mode=07 77,dir_mode=0777 0 0

Obsolete Zero
March 5th, 2009, 02:52 PM
SOLUTION FOUND!!!!!!!!!!!!!!!!!! :D :D :popcorn: :guitar:

sorry, i'm extremely happy :D


ok problem is i found out after more investigations on the interwebs is that for spaces in sharename you need to use \040 not \40

so, it works now :D

thanks for all the help Dmizer! I'm not sure if your tutorial has \40 or \040 but it is the latter that needs to be used!

dmizer
March 5th, 2009, 07:26 PM
SOLUTION FOUND!!!!!!!!!!!!!!!!!! :D :D :popcorn: :guitar:

sorry, i'm extremely happy :D


ok problem is i found out after more investigations on the interwebs is that for spaces in sharename you need to use \040 not \40

so, it works now :D

thanks for all the help Dmizer! I'm not sure if your tutorial has \40 or \040 but it is the latter that needs to be used!
Heh, yup ... tutorial says \040 ;)

Glad you're working!

sloppyc
March 6th, 2009, 01:40 PM
Thanks to the OP! This worked flawlessly on the first try. I just skipped the netbios part and substituted the IP address for my own needs. Now I have my shared media from my Vista box mounted at bootup. Awesome.

:popcorn:

Pas_sa
March 9th, 2009, 12:09 AM
Hi, following your guide got me up and running, however the shares do not mount at boot, rather I have to run 'sudo mount -a' in terminal to get the shares to appear (after which they work flawlessly).

Here is my fstab:
//familydesktop/c /media/familyc cifs iocharset=utf8,credentials=/home/family/.smbcredentials,uid=1000,_netdev 0 0
//familydesktop/media /media/media cifs iocharset=utf8,credentials=/home/family/.smbcredentials,uid=1000,_netdev 0 0
//familydesktop/music /media/music cifs iocharset=utf8,credentials=/home/family/.smbcredentials,uid=1000,_netdev 0 0

Any help would be much appreciated :) as you can see I added '_netdev' in the hope it would fix my problem but alas, it wasn't the case.

dmizer
March 9th, 2009, 12:15 AM
Try editing /etc/rc.local and add "mount -a" to the file like so:

sudo nano /etc/rc.local

#!/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

Pas_sa
March 16th, 2009, 12:45 AM
I tried that.. on reboot, still nothing mounts automatically.

Any other ideas?

dmizer
March 16th, 2009, 12:50 AM
What Ubuntu release are you using (Hardy, Ibex ...)?

Please post the contents of /etc/network/interfaces

Bule
March 16th, 2009, 11:02 PM
Hi,

I'm having problems mounting the smb shares on my networkdrive.
I'm using Ubuntu 8.10 and the network drive is a sitecom MD-250.

I can't mount my shares. When i use Places => Network i can browse and see //Storage and the shares that are on it but i can mount and when i try to open them i get put back in my home.

- I've installed smbfs and winbind.
- I added wins to nsswitch.conf (before dns)
- I've created /media/PUBLIC

- fstab looks like this.

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=9c9a4500-96f5-4c94-a12c-cd423860501b / ext3 relatime,errors=remount-ro 0 1
# /dev/sda5
UUID=703c8617-51b7-4a56-9a73-7203fe7c514b none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
#NETWORK SHARES
//storage/PUBLIC /media/PUBLIC cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0


- smbtree only gives

WORKGROUP
\\STORAGE


- smbclient -L //storage shows

Domain=[ȇ] OS=[] Server=[���]

Sharename Type Comment
--------- ---- -------
PUBLIC_FTP Disk
PRIVATE Disk
PUBLIC Disk
UPLOAD Disk
IPC$ IPC

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

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


Could someone give me a suggestion what i can do to make this work?

dmizer
March 16th, 2009, 11:18 PM
What is the output of:
sudo mount /media/PUBLIC

Also, try adding the workgroup to your mount command like so
//storage/PUBLIC /media/PUBLIC cifs guest,rw,domain=WORKGROUP,iocharset=utf8,file_mode =0777,dir_mode=0777 0 0

Bule
March 16th, 2009, 11:33 PM
mount -a and mount /media/PUBLIC give the following error


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


I added the workgroup to fstab and rebooted just to be sure.

Bule
March 16th, 2009, 11:48 PM
Btw, i have also added the following two lines to smb.conf

client plaintext auth = yes
client lanman auth = yes

(i should actually be sleeping now. It's 04:47 for me :))

dmizer
March 16th, 2009, 11:49 PM
Check here and apply any firmware updates: http://www.sitecom.com/drivers_result.php?groupid=15&productid=540&NAS%20Ready%20Case&MD-250

That probably won't work though. Research on your NAS device indicates that it doesn't support CIFS, only SMB. I suggest you try using FTP instead. Otherwise you'll have to install SMBFS from source (http://ubuntuforums.org/showthread.php?t=707370).

dmizer
March 16th, 2009, 11:53 PM
Btw, i have also added the following two lines to smb.conf

client plaintext auth = yes
client lanman auth = yes

(i should actually be sleeping now. It's 04:47 for me :))

Heh, I just had lunch ;)

Just for good measure, try posting your smb.conf file.

Bule
March 16th, 2009, 11:59 PM
I had already gotten FTP to work but wasn't satisfied with it. Don want to share all drives through FTP. The FTP part is open to the internet and there are some pretty private things on some of the shares. :D

smbfs is already installed

smb.conf

#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
# - When such options are commented with ";", the proposed setting
# differs from the default Samba behaviour
# - When commented with "#", the proposed setting is the default
# behaviour of Samba but the option is considered important
# enough to be mentioned here
#
# NOTE: Whenever you modify this file you should run the command
# "testparm" to check that you have not made any basic syntactic
# errors.
# A well-established practice is to name the original file
# "smb.conf.master" and create the "real" config file with
# testparm -s smb.conf.master >smb.conf
# This minimizes the size of the really used smb.conf file
# which, according to the Samba Team, impacts performance
#

#======================= Global Settings =======================

[global]

client plaintext auth = yes
client lanman auth = yes

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
server string = %h server (Samba, Ubuntu)

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
# wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
; wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
dns proxy = no

# What naming service and in what order should we use to resolve host names
# to IP addresses
; name resolve order = lmhosts host wins bcast

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
; interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself. However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
; bind interfaces only = yes



#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
max log size = 1000

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
# syslog only = no

# We want Samba to log a minimum amount of information to syslog. Everything
# should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log
# through syslog you should set the following parameter to something higher.
syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
panic action = /usr/share/samba/panic-action %d


####### Authentication #######

# "security = user" is always a good idea. This will require a Unix account
# in this server for every user accessing the server. See
# /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/ServerType.html
# in the samba-doc package for details.
# security = user

# You may wish to use password encryption. See the section on
# 'encrypt passwords' in the smb.conf(5) manpage before enabling.
encrypt passwords = true

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
passdb backend = tdbsam

obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
map to guest = bad user

########## Domains ###########

# Is this machine able to authenticate users. Both PDC and BDC
# must have this setting enabled. If you are the BDC you must
# change the 'domain master' setting to no
#
; domain logons = yes
#
# The following setting only takes effect if 'domain logons' is set
# It specifies the location of the user's profile directory
# from the client point of view)
# The following required a [profiles] share to be setup on the
# samba server (see below)
; logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
# logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
; logon drive = H:
# logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
; logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe. The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

########## Printing ##########

# If you want to automatically load your printer list rather
# than setting them up individually then you'll need this
# load printers = yes

# lpr(ng) printing. You may wish to override the location of the
# printcap file
; printing = bsd
; printcap name = /etc/printcap

# CUPS printing. See also the cupsaddsmb(8) manpage in the
# cupsys-client package.
; printing = cups
; printcap name = cups

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
; include = /home/samba/etc/smb.conf.%m

# Most people will find that this option gives better performance.
# See smb.conf(5) and /usr/share/doc/samba-doc/htmldocs/Samba3-HOWTO/speed.html
# for details
# You may want to add the following on a Linux system:
# SO_RCVBUF=8192 SO_SNDBUF=8192
# socket options = TCP_NODELAY

# The following parameter is useful only if you have the linpopup package
# installed. The samba maintainer and the linpopup maintainer are
# working to ease installation and configuration of linpopup and samba.
; message command = /bin/sh -c '/usr/bin/linpopup "%f" "%m" %s; rm %s' &

# Domain Master specifies Samba to be the Domain Master Browser. If this
# machine will be configured as a BDC (a secondary logon server), you
# must set this to 'no'; otherwise, the default behavior is recommended.
# domain master = auto

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
; idmap uid = 10000-20000
; idmap gid = 10000-20000
; template shell = /bin/bash

# The following was the default behaviour in sarge,
# but samba upstream reverted the default because it might induce
# performance issues in large organizations.
# See Debian bug #368251 for some of the consequences of *not*
# having this setting and smb.conf(5) for details.
; winbind enum groups = yes
; winbind enum users = yes

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled.
; usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
usershare allow guests = yes

#======================= Share Definitions =======================

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
;[homes]
; comment = Home Directories
; browseable = no

# By default, the home directories are exported read-only. Change the
# next parameter to 'no' if you want to be able to write to them.
; read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
; create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
; directory mask = 0700

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server. Un-comment the following parameter
# to make sure that only "username" can connect to \\server\username
# This might need tweaking when using external authentication schemes
; valid users = %S

# Un-comment the following and create the netlogon directory for Domain Logons
# (you need to configure Samba to act as a domain controller too.)
;[netlogon]
; comment = Network Logon Service
; path = /home/samba/netlogon
; guest ok = yes
; read only = yes
; share modes = no

# Un-comment the following and create the profiles directory to store
# users profiles (see the "logon path" option above)
# (you need to configure Samba to act as a domain controller too.)
# The path below should be writable by all users so that their
# profile directory may be created the first time they log on
;[profiles]
; comment = Users profiles
; path = /home/samba/profiles
; guest ok = no
; browseable = no
; create mask = 0600
; directory mask = 0700

[printers]
comment = All Printers
browseable = no
path = /var/spool/samba
printable = yes
guest ok = no
read only = yes
create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = yes
read only = yes
guest ok = no
# Uncomment to allow remote administration of Windows print drivers.
# Replace 'ntadmin' with the name of the group your admin users are
# members of.
; write list = root, @ntadmin

# A sample share for sharing your CD-ROM with others.
;[cdrom]
; comment = Samba server's CD-ROM
; read only = yes
; locking = no
; path = /cdrom
; guest ok = yes

# The next two parameters show how to auto-mount a CD-ROM when the
# cdrom share is accesed. For this to work /etc/fstab must contain
# an entry like this:
#
# /dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0
#
# The CD-ROM gets unmounted automatically after the connection to the
#
# If you don't want to use auto-mounting/unmounting make sure the CD
# is mounted on /cdrom
#
; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom

Bule
March 17th, 2009, 12:05 AM
i just found this on an other site.


It turns out that the new world has switched to using something called CIFS, which seems to be backward compatible with SMBFS (as used by Samba). However, it seems some of the new protocols are not backward compatible with the old Samba 2.0 protocols (which is what my old NAS box uses). From what I can interpret of the error message, it seems like Ubuntu tries to set Unix file system attributes on the newly mounted Samba share, which of course fails miserably. The solution, as it turns out, is simply to turn off this feature. I had to Google for this, but hopefully it saves you the time and bother. The command is:

smbmount //nas/share /mnt/share -o username=guest,password=,nounix

Et voilà!

The only downside is obviously all your files are mounted world read-writable, but I guess it is no worse than being on a Windows box...


I now have my drive mounted. :D:D:D
Now to see how to put this into fstab so it mounts on boot.

dmizer
March 17th, 2009, 12:22 AM
This way:
//storage/PUBLIC /media/PUBLIC cifs guest,rw,domain=WORKGROUP,nounix,iocharset=utf8,fi le_mode=0777,dir_mode=0777 0 0

Bule
March 17th, 2009, 12:35 AM
Now both my unprotected and protected shares are mounted during boot.


# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=9c9a4500-96f5-4c94-a12c-cd423860501b / ext3 relatime,errors=remount-ro 0 1
# /dev/sda5
UUID=703c8617-51b7-4a56-9a73-7203fe7c514b none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
#NETWORK SHARES
//storage/PUBLIC /media/PUBLIC cifs guest,rw,domain=WORKGROUP,nounix,iocharset=utf8,fi le_mode=0777,dir_mode=0777 0 0
//storage/PRIVATE /media/PRIVATE cifs credentials=/home/erwin/.smbcredentials,rw,domain=WORKGROUP,nounix,iochars et=utf8,file_mode=0777,dir_mode=0777 0 0


But it seems now i get some kind of "error/message" while i shutdown.


[ 1290.948082] CIFS VFS: server not responding
[ 1290.948198] CIFS VFS: No response for cmd 50 mid 458


Have to look at that later. Now i need to get a bit of sleep. The alarm goes in 1,5 hour.

Tnx for your help dmizer.

dmizer
March 17th, 2009, 12:47 AM
But it seems now i get some kind of "error/message" while i shutdown.


[ 1290.948082] CIFS VFS: server not responding
[ 1290.948198] CIFS VFS: No response for cmd 50 mid 458


There's a fix for that listed under the troubleshooting section :)

Bule
March 17th, 2009, 01:07 AM
Didn't find it. Actually didn't see a part called troubleshooting but i might just be too sleepy.

dmizer
March 17th, 2009, 01:21 AM
Didn't find it. Actually didn't see a part called troubleshooting but i might just be too sleepy.

Just double checked, it's there. For the sleep impaired, ;) the fix is found here: http://ubuntuforums.org/showthread.php?t=293513

Bule
March 17th, 2009, 06:26 AM
Tnx,

Preformed the fix this morning after i woke up and before leaving for work. It now all works perfectly.

\\:D/

slyman1973
March 27th, 2009, 06:04 PM
Hurrah!! I've been wanting to do this for ages!!!!
:)

souravmohanty
March 28th, 2009, 05:44 AM
Thnks for the Post worked for me...

cheers,
Sourav Mohanty

slyman1973
March 30th, 2009, 12:06 PM
Thanks much! This got my Thecus N5200 box with the winduhs shares working! Now next will be to figure out how to do more linux friendly shares on it.

:popcorn:

^_Pepe_^
April 12th, 2009, 12:51 PM
Hi everyone!

I'm a almost "reading-only" forum user, mainly because the DIY method works, most times work.

But I have founded this incredible post, making me crazy to get what I miss from windows. That is, to create (permanently) a network connection to use those files from Amarok, Picasa... :D

This is my case.

I usually use a netbook, with 8.10, but all information is stored in a 8.10 machine, with a 1TB HDD (called TERA :D).


This are my (failed) lines of fstab

#//192.168.1.13/tera /mnt/tera smbfs auto,exec,user,rw,nounix,iocharset=utf8,codepage=c p850,cp850 0 0
#//192.168.1.13/tera /mnt/tera cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0
//192.168.1.13/tera /mnt/tera cifs guest,iocharset=iso8859-7 0 0

But no luck.

ISSUES.

I can found my /mnt/tera mounted unit but,

a) Encoding is not correct. Look at this...

papa@maggi:~$ ls /mnt/tera/
00.Backup 05-Libros Mis Documentos
00.Dibus de ?ngel 06.TG Mis formas
01.Fotos 08.Libros Moralzarzal_22minutos_mpg4V2.avi
02-Al Filo 10.HOUSE S05 pepe
02.Juegos 11.Grey S05 RECYCLER
02.Software 12.Mentalista S01 s1008100.exe
03.Esc?ner 20.MoTeC System Volume Information
03.M?sica $AVG8.VAULT$ Tux
04-Pelis Mis archivos recibidos VTLT.pdf

:-( ... Yes, spanish has accents...

b) If I type /mnt/tera/ on a terminal or either on Nautilus, I can find the mounted unit. But...I was expecting that a new unit as my / would appear into "Places". I don't know if could explain myself.

I tried to read so huge post, but to be honest I did it diagonally. Sorry if answer is already on the post.

Thank you so much for your help!!!

Ahhh!! "TERA" is ntfs formatted.

^_Pepe_^

dmizer
April 12th, 2009, 07:35 PM
If you want the share to appear in places, you have to mount it in /media rather than /mnt like so:

//192.168.1.13/tera /media/tera cifs guest,rw,iocharset=iso8859-7,file_mode=0777,dir_mode=0777 0 0

Let me know if that does what you need.

blithen
April 13th, 2009, 04:06 AM
I LOVE YOU!!! IT FINALLY WORKS OH GOD!! THANK YOU!!!!!!!!!!! Also a learned a lot, and I now what a netbios is :D Anyway again thank you for taking the time to write this.

^_Pepe_^
April 13th, 2009, 09:29 AM
Thank you so much!!

I have now my TERA (1 TB :-)) in "places"....

But I couldn`t resolve the encoding issue yet! :-(

I've tried:

iocharset=iso8859-1
iocharset=iso8859-15
nls=iso8859-1 (and 15)
nls=utf8

but no luck. As I said before, TERA is NTFS formatted, but is installed into a 8.10 Ubuntu.

Any help???

Thanks again!

If you want the share to appear in places, you have to mount it in /media rather than /mnt like so:

//192.168.1.13/tera /media/tera cifs guest,rw,iocharset=iso8859-7,file_mode=0777,dir_mode=0777 0 0

Let me know if that does what you need.

dmizer
April 13th, 2009, 12:03 PM
^_Pepe_^, as far as I can see, you have three options:
utf8, iso8859-1, and iso8859-15

You could also try:
iocharset=nls_iso8859-15
iocharset=nls_iso8859-1
iocharset=cp1252

I really struggle to find information about character sets and codepage on the internet. It seems that very few people are knowledgeable about the subject. It would also be extremely helpful to know exactly what characterset you're TERA drive is using.

^_Pepe_^
April 13th, 2009, 05:34 PM
Hi!

Thank you for our time and help.

I think that clearly iso8859-15 is my issue, because it has á,é,í,ó,ú,ñ and € (€ symbols is the difference between -1 and -15 versions).

After this, I have guessed that iocharset=iso8859-15 has been replaced by nls=iso8859-15, but no luck yet.

I have to found out the solution to "CIFS server not responding" hang on logout. Fortunately I found solution on this same forum (with a workaround script).

But the charset is still not fine.

:-(

How can I find my TERA disk charset? This HDD was previously mounted and installed into XP machine, but I installed (without changes) in my Ubuntu machine (virus free)... ;)

This is my recent fstab line (see very useful _netdev command, than wait for network to connect for mounting the unit):

//192.168.1.13/tera /media/TERA cifs _netdev,auto,exec,user,rw,nls=iso8859-15 0 0

Thanks!!!!!!!!!!!!!!


^_Pepe_^, as far as I can see, you have three options:
utf8, iso8859-1, and iso8859-15

You could also try:
iocharset=nls_iso8859-15
iocharset=nls_iso8859-1
iocharset=cp1252

I really struggle to find information about character sets and codepage on the internet. It seems that very few people are knowledgeable about the subject. It would also be extremely helpful to know exactly what characterset you're TERA drive is using.

^_Pepe_^
April 14th, 2009, 06:54 AM
More information to this.

I have VNC connected to my 8.10 machine, where I have physically connected TERA unit, and tried to mount "My Documents" (NTFS, of course) folder from my Windows machine, and I there was strange characters on ñ, á...either using utf8 and iso8859-15.

Regards
^_Pepe_^

dmizer
April 14th, 2009, 07:32 AM
More information to this.

I have VNC connected to my 8.10 machine, where I have physically connected TERA unit, and tried to mount "My Documents" (NTFS, of course) folder from my Windows machine, and I there was strange characters on ñ, á...either using utf8 and iso8859-15.

Regards
^_Pepe_^

Sounds like your file names got corrupted somehow. I've had this happen before and the only fix was to rename all the broken file names.

^_Pepe_^
April 14th, 2009, 07:47 AM
Sounds like your file names got corrupted somehow. I've had this happen before and the only fix was to rename all the broken file names.

I have tried it this morning, but I could. If I press F2 to change the name, system throws an error saying something about codification.

I'll keep on searching....

Rgds

dmizer
April 14th, 2009, 08:22 AM
I have tried it this morning, but I could. If I press F2 to change the name, system throws an error saying something about codification.

I'll keep on searching....

Rgds
You'll have to fix the file names directly rather than over samba.

dmizer
April 14th, 2009, 09:15 AM
This is my recent fstab line (see very useful _netdev command, than wait for network to connect for mounting the unit):

//192.168.1.13/tera /media/TERA cifs _netdev,auto,exec,user,rw,nls=iso8859-15 0 0
That is in the troubleshooting section of my howto ;)

Something that might be causing you trouble is that you're using the nls=iso8859-15 option. This is not a valid cifs option. If you think you need nls, you should try mounting with this option:
iocharset=nls_iso8859-15

I also ran across this earlier: http://www.nslu2-linux.org/wiki/HowTo/MountFATFileSystems

With that in mind, you might try this:
//192.168.1.13/tera /media/TERA cifs _netdev,auto,exec,user,rw,iocharset=cp850 0 0

^_Pepe_^
April 23rd, 2009, 08:48 AM
Ok!

I don't give up, but I didn't improve a bit.

Let's sum up:

1. If I type smb://mylinuxmachineIP/tera, I can reach all my tera files, with perfect codification, both nautilus and console.

2. Unfortunately, this is not enough, because this files can't be reachables from applications (Amarok, Picasa, AFAIK...) unless you mount your unit in /mnt/TERA...

3. If I use my mount in fstab, I can see my TERA disk (ntfs formatted) perfectly but, with wrong codification. ñ,á,é,í,ó,ú are substituted by ?

4. But...(this is incredible...) if I open Picasa 3.0, and I "add folder" from my TERA disk... I can see correct names. Only nautilus and ls command (in console) are wrong.

Ok, I can survive with this, but I'm not giving up.

BTW, Does anybody know how to create a direct link to a "smb://..." location on the desktop. Furthermore, is there any applet for the bars to mount net shares as there're for local mounts?

To be honest, I have spent 3 procrastination days to customize my 9.04 RC... :D

Thanks to everyone
Pepe

^_Pepe_^
April 24th, 2009, 06:32 AM
BTW, Does anybody know how to create a direct link to a "smb://..." location on the desktop. Furthermore, is there any applet for the bars to mount net shares as there're for local mounts?
Thanks to everyone
Pepe

Glubs...

Autoreply. Right button, new luncher, and so on... :-#

Sorry!

Regards

pajarraco
April 24th, 2009, 05:46 PM
Hi, i had the same problems and i fixed like this.

this is my sftab file

//23.11.74.90/Media /mnt/media smbfs iocharset=utf8,username=MyUsername,password=MyPass word,uid=1000,gid=1000,dir_mode=0777,file_mode=077 7 0 0
//23.11.74.90/Document /mnt/document smbfs iocharset=utf8,username=MyUsername,password=MyPass word,uid=1000,gid=1000,dir_mode=0777,file_mode=077 7 0 0
//23.11.74.90/Files /mnt/files smbfs iocharset=utf8,username=MyUsername,password=MyPass word,uid=1000,gid=1000,dir_mode=0777,file_mode=077 7 0 0


I hope this help you

^_Pepe_^
April 26th, 2009, 09:50 AM
Hi, i had the same problems and i fixed like this.

this is my sftab file

//23.11.74.90/Media /mnt/media smbfs iocharset=utf8,username=MyUsername,password=MyPass word,uid=1000,gid=1000,dir_mode=0777,file_mode=077 7 0 0
//23.11.74.90/Document /mnt/document smbfs iocharset=utf8,username=MyUsername,password=MyPass word,uid=1000,gid=1000,dir_mode=0777,file_mode=077 7 0 0
//23.11.74.90/Files /mnt/files smbfs iocharset=utf8,username=MyUsername,password=MyPass word,uid=1000,gid=1000,dir_mode=0777,file_mode=077 7 0 0


I hope this help you

:lolflag: :guitar:
):P ):P

Thank you so much (to everyone). This, finally worked for me.

NOTE: Even though in 9.04, the problem loggin out is present and you have to umount your cifs units before shutdown, otherwise, a pretty freeze is shown.

Best regards!
Pepe

Grimmy
April 27th, 2009, 03:59 AM
@dmizer - Thanks for the guide, I was able to resolve issues I was having with my EeePC seeing my Samba shares correctly (http://ubuntuforums.org/showpost.php?p=7152660&postcount=6) by following the pre-work steps.

dmizer
April 27th, 2009, 04:04 AM
@dmizer - Thanks for the guide, I was able to resolve issues I was having with my EeePC seeing my Samba shares correctly (http://ubuntuforums.org/showpost.php?p=7152660&postcount=6) by following the pre-work steps.

My pleasure.

I also posted a condensed version of the fix in that thread. :)

rmartinus
May 1st, 2009, 10:34 PM
Hi, I'm a new Ubuntu user, and dmizer, the "nounix" option worked for me. What does that option actually do?
Thanks for the guide..

maxim99
May 3rd, 2009, 09:37 AM
Thank you for this post it was very helpful to me. Something that might be helpful to other is that I had to unmount the share, and remount the share in order for the change to take effect. Using mount -a didn't make a difference in the effectivness of the iocharset variable. A umount, then a mount works perfect. Thanks again.

nadip
May 4th, 2009, 11:48 PM
Hi dmizer:
This is my first post on this forum.
I am at the end of my first week learning ubuntu-
I am trying to set up a samba pdc and I might say the progress is noticeable.
My only problem is that I cannot make other admin group users see and edit files on a samba server share, from a winXP machine. Only the root account has been allowed to do that. It is of course a clear case of permissions. How can I change the permissions on those shares so that the files can be accessed by other people than myself (root)?
I have tried to apply your remedy but Iºm a afraid that is too difficult for me at this stage. Basically I have found my UID and GID but I donºt know how to insert them in the fstab file. What do you mean by netbiosname/sharename and media/sharename? And how exactly should I edit the fstab file?
Please help me. My PDC is almost up and running.
Many thanks in advance.


Quote:
Files owned by root. If you can view but not change, delete, or add new files to your Samba share, try this fix:

1) Find your uid and gid (normally both are 1000, but double check):
Code:

cat /etc/passwd | grep ubuntu-username

The output will look something like this (my uid and gid are marked in red):
Code:

$ cat /etc/passwd | grep dmizer
dmizer:x:1000:1000:dmizer,,,:/home/dmizer:/bin/bash

2) Add gid, uid, and nounix options to your fstab line like so:
Code:

//netbiosname/sharename /media/sharename cifs credentials=/root/.smbcredentials,iocharset=utf8,gid=1000,uid=1000,n ounix,file_mode=0777,dir_mode=0777 0 0 (end of quote)

KatmanHH
May 7th, 2009, 02:05 PM
Thank you immensely. After fighting a network storage drive for a day the first post on this thread hooked me right up perfect. Its there through a reboot and everything. SHWEEEEEEEEEET!

KatmanHH
May 7th, 2009, 02:29 PM
Welllllllll I aint quite outta the woods yet. I can access the drive fine but I tried to start moving some data over there and it says I don't have the permission to do that.#-o](*,)

I think it is only a tiny fix but not sure where to go. Could I have a pointer? Please?

Thanks

KatmanHH
May 7th, 2009, 04:08 PM
Is this a problem with my Ubuntu box or with the network storage drive?

dmizer
May 8th, 2009, 02:59 AM
My only problem is that I cannot make other admin group users see and edit files on a samba server share, from a winXP machine.
You'll need to correctly configure a samba server. Please see the 1st link in my sig.

Welllllllll I aint quite outta the woods yet. I can access the drive fine but I tried to start moving some data over there and it says I don't have the permission to do that.#-o](*,)

I think it is only a tiny fix but not sure where to go. Could I have a pointer? Please?

Thanks

What NAS device do you have (make and model number)

KatmanHH
May 8th, 2009, 12:09 PM
Its a 320 Gig Maxtor. Couldn't find a model number..... This seems to be the only discription on it (Maxtor Shared Storage II)....?

Thanks

vussvillem
May 8th, 2009, 12:26 PM
Thanks for the wonderful howto!

With "user=myusername,password=mysambapassword" in/etc/fstab it works like a charm. However, having my credentials in /root/.smbcredentials does not work for me - although I'm on Hardy Heron and do have nounix option in /etc/fstab I still get:


vussvillem@vussvillem-desktop:~$ sudo mount -a
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)


Curiously, if I have both "credentials=/root/.smbcredentials" and "password=mysambapassword" in /etc/fstab I get samba share mounted with this note :) :

vussvillem@vussvillem-desktop:~$ sudo mount -a

mount.cifs warning - password specified twice


So "credentials=/root/.smbcredentials" works only partly for me. Has anyone else had this problem and how to fix it?

May it be related to the fact that I do have a domain in samba server as well? However, I've tried to have "username=WORKGROUP\myusername" in /root/.smbcredentials and I've added "domain=WORKGROUP" option to /etc/fstab without any success.

dmizer
May 10th, 2009, 10:30 PM
Its a 320 Gig Maxtor. Couldn't find a model number..... This seems to be the only discription on it (Maxtor Shared Storage II)....?

Thanks
I could not find very much information on your device.

What is your current fstab line?

[snip]So "credentials=/root/.smbcredentials" works only partly for me. Has anyone else had this problem and how to fix it?

May it be related to the fact that I do have a domain in samba server as well? However, I've tried to have "username=WORKGROUP\myusername" in /root/.smbcredentials and I've added "domain=WORKGROUP" option to /etc/fstab without any success.

Double check to make sure that your /root/.smbcredentials file is formatted correctly. As indicated in the howto, you should NOT use a gui text editor to create the file, and it's VERY sensitive to spaces and line feeds. Make sure that there are NO spaces before or after the equal signs.

As indicated by your error, you can use either smbcredentials or username/password options in your mount line, but you can't use both.

KatmanHH
May 11th, 2009, 12:03 AM
I could not find very much information on your device.

What is your current fstab line?

I'll check at work tomorrow. The drive is at the office. Thanks.

KatmanHH
May 11th, 2009, 12:13 PM
my fstab line.


# Mount our network drive
//mss-willows/Public /media/Public cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0

Is that mode=0777 right? Or does that not have anything to do with it?

Thanks

dmizer
May 11th, 2009, 07:28 PM
Yes, the 0777 is correct. Try the nounix option like so:
//mss-willows/Public /media/Public cifs guest,rw,nounix,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

KatmanHH
May 11th, 2009, 07:53 PM
OKAY...... That worked perfectly. Now if only I even had a clue what makes that make it work.

Thanks a million by the way. That makes my life much easier now.=D>

dmizer
May 11th, 2009, 07:57 PM
OKAY...... That worked perfectly. Now if only I even had a clue what makes that make it work.

Thanks a million by the way. That makes my life much easier now.=D>

Disabling Unix file extensions makes cross platform permissions issues go away :)

KatmanHH
May 11th, 2009, 08:00 PM
OH-Kay. I got it now. Thanks again

swatsbiz
May 14th, 2009, 01:00 PM
CIFS VFS: Server not responding
If you see this error during shutdown, and or your shutdown sequence halts because of this error message:
Code:

[18.312000] CIFS VFS: Server not responding
[18.312000] No response for cmd 5 mid 8

Run these two commands:
Code:

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

Source: http://ubuntuforums.org/showthread.php?t=1128729

*thanks to incoming429 for testing the fix on this error.


I have done the above but I still get the Server not responding message when switching down, I have tried manually unmounting the drives but it says that I need to be root - what have I missed?

David

dmizer
May 14th, 2009, 07:38 PM
I have done the above but I still get the Server not responding message when switching down, I have tried manually unmounting the drives but it says that I need to be root - what have I missed?

David

When it says you need to be root, just prefix your command with sudo like so:
sudo umount /media/sharename

Here's another possibility for fixing the CIFS VFS: Server not responding error:
1) Edit /etc/gdm/PostSession/Default
gksudo gedit /etc/gdm/PostSession/Default
2) Add your unmount line to the top of the file (right below #!/bin/sh) like so:
#!/bin/sh
umount /media/sharename

PATH="/usr/bin:$PATH:/bin:/usr/bin"
OLD_IFS=$IFS

gdmwhich () {
COMMAND="$1"
OUTPUT=
IFS=:
for dir in $PATH
do
if test -x "$dir/$COMMAND" ; then
if test "x$OUTPUT" = "x" ; then
OUTPUT="$dir/$COMMAND"
fi
fi
done
IFS=$OLD_IFS
echo "$OUTPUT"
}

exit 0
Save the file and exit.

swatsbiz
May 15th, 2009, 05:51 AM
Thanks dmizer,

adding the umount for each of the network shares in the PostSession/Default worked a charm

sloppyc
May 20th, 2009, 12:06 PM
Thanks to the OP! This worked flawlessly on the first try. I just skipped the netbios part and substituted the IP address for my own needs. Now I have my shared media from my Vista box mounted at bootup. Awesome.

:popcorn:

Okay, this did work in Hardy. I upgraded to Jaunty, now I get this:

mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)


Here's my fstab:

# /etc/fstab: static file system information.
# Use 'vol_id --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 defaults 0 0
# / was on /dev/sda1 during installation
UUID=af04d48e-9288-41b6-9d3f-d7ced1be6ac8 / ext3 relatime,errors=remount-ro 0 1
# /home was on /dev/sdb1 during installation
UUID=2f52c6fd-e43d-4796-b2a5-fdf944e31ee7 /home ext3 relatime 0 2
# swap was on /dev/sda5 during installation
UUID=63cde2cd-974c-33a1-de20-181f6e7ea2a2 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

##Network shares
//192.168.0.199/Audio /media/Audio cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ m$
//192.168.0.199/Videos /media/Videos cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ m$
//192.168.0.199/Software /media/Software cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ m$
//192.168.0.199/iTunes /media/iTunes cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ m$


I have set up smbpasswd and I can access the shares when I go the "connect to server" route. So the account does have permission.

I tried adding "nounix" after ".smbcredentials" and that made no difference (do I really want "nounix" anyway? I'm just running Vista at the moment, but I will be installing Ubuntu and openSUSE on here and would like the shares avalable to the other PCs no matter what OS I'm in as I did before I upgraded my machines this week)

dmizer
May 20th, 2009, 07:15 PM
@sloppyc:

Make sure that smbfs is installed:
sudo aptitude install smbfs

sloppyc
May 21st, 2009, 05:15 PM
@sloppyc:

Make sure that smbfs is installed:
sudo aptitude install smbfs

It is. :?

dmizer
May 21st, 2009, 07:58 PM
Jaunty seems to have UFW enabled by default. Try this:
sudo ufw disable
Then try to connect again.

WildSioux
May 22nd, 2009, 10:49 AM
Thanks dmizer for creating and posting this tutorial. Without it, I and many other M$ users starting of in Linux would be lost in getting our network drives to work. I was until I found this thread in trying to get my Dlink DNS323 to work.

I am having an issue and I hope you can help. I am using linuxMint 7 based off jaunty. It is in RC1 form right now and I have installed the kubuntu-desktop because I prefer KDE over gnome. I did not have this issue in Gnome...

Here is the problem, with my NAS set to sleep after 30 minutes of inactivity. I have a line in fstab to automount on boot for one folder without password. I have noticed that the drive wakes from sleep without me even navigating to it. The mount is in my /home/usr/mnt/xxx folder. This issue of it waking after boot is irritating me.

It will even wake up when I am using Firefox or Open Office and use the file dialog system. Initially I thought it was due to them being GTK apps. But then I realized that the drive is mounted in my home user folder system and that is where firefox, open office open the file dialog system to.

So I have now moved the mount to my root, /mnt/xxx/ This seems to have solved the problem of it waking up on boot as well as in firefox, open office file dialogs. But if I do a file search in Dolphin it will go through all folders including the root /mnt/ folders and wake up the drive.

Since I have hopefully stopped this from waking up every few minutes without me even navigating to it the file search isn't that big of deal.

Like I said, this is a folder without password restrictions. So I can see where it would search and wake it up.

But do you know how to stop this behavior regardless of where it is mounted, file dialog usage, or file search?

Is there any way of setting a user/password in ubuntu for a guest mounted network drive? Maybe this would stop the behavior in having a password entered before gaining access to it???

Thank you for any help...I do appreciate it on this very aggravating problem.

dmizer
May 22nd, 2009, 11:50 AM
Can't think of anything other than to exclude the directory from the search.

sloppyc
May 28th, 2009, 08:03 PM
Jaunty seems to have UFW enabled by default. Try this:
sudo ufw disable
Then try to connect again.

Good to know, I didn't realize.

That didn't have any effect. I'm embarrassed to admit that the formatting of my .smbcredentials was incorrect all along. That's what I get for doing things in a hurry late at night. :oops:

So, the guide works flawlessly in jaunty as-is, just as it did in Hardy for me. Thanks again:D

dmizer
May 28th, 2009, 08:09 PM
Good to know, I didn't realize.
Well, I've since learned that sometimes it is enabled and sometimes it's not. What causes it to be enabled or disabled, I've yet to determine ...

That didn't have any effect. I'm embarrassed to admit that the formatting of my .smbcredentials was incorrect all along. That's what I get for doing things in a hurry late at night. :oops:

So, the guide works flawlessly in jaunty as-is, just as it did in Hardy for me. Thanks again:D

You might not be surprised to hear that I've made the very same mistake more times than I care to admit :)

sloppyc
May 28th, 2009, 11:38 PM
Haha:D We all have our moments.

swatsbiz
May 29th, 2009, 05:37 AM
I've just installed Kubuntu on another machine, and running into the old cfs server not responding issue on shutdown, however the PostSession file that I used in Ubuntu doesn't exist.

Any help would again be appreciated.
David

dmizer
May 29th, 2009, 08:07 AM
I've just installed Kubuntu on another machine, and running into the old cfs server not responding issue on shutdown, however the PostSession file that I used in Ubuntu doesn't exist.

Any help would again be appreciated.
David
How about an all gui way of doing this?

Open "system settings" > "advanced" > "login manager" > "Shutdown (5)"

Replace the Halt and Reboot commands as follows:
/etc/init.d/umountnfs.sh&&/sbin/halt
/etc/init.d/umountnfs.sh&&/sbin/reboot

Click "apply"

Done.

Fangs404
June 3rd, 2009, 07:35 PM
Alright, I read through the first few pages of this thread, and I haven't gotten anywhere. I have a Thecus N4100Pro that I'm trying to mount via the command line, and I'm having issues. I dual boot between Windows and Ubuntu 9.04, so I'm using CIFS instead of NFS. I feel like I've tried every command known to man. If I go to Places -> Connect to Server..., I can connect to and mount my share just fine:

http://i43.tinypic.com/8vw5jl.png

That works perfectly. I have 2 users, 1 with read/write permission, and 1 with just read permission, and the mount works flawlessly with both users.

However, when I try to mount it via the command line (which is desirable because I eventually want to permanently mount it via fstab later), it just won't work. I can get it to mount via the following command:

sudo mount -t cifs //192.168.1.100/share /media/galactica/ -o user=fangs404,password=PW,domain=WORKGROUP,file_mo de=0777,dir_mode=0777

It mounts, and I see it on my desktop. However, when I go to open the folder, I get this error:

http://i40.tinypic.com/63r7fn.png

What am I doing wrong? Dah, this is frustrating!

dmizer
June 3rd, 2009, 07:46 PM
Try this:
sudo chown fangs404:fangs404 /media/galactica
Where "fangs404" is your UBUNTU username.

Then try your manual mount command again. You will probably also have better luck if you enable name browsing by configuring /etc/nsswitch.conf and installing winbind as outlined under "Pre-work".

Also, a word of advice. Always check the dates of threads. While the first post in this thread is up to date and current (as shown by the "version history"), the subsequent posts are quite old and not current.

So, when you run into a thread like this, don't bother with reading through the first sevral pages, always start from the last page and work your way forward, as the last page will have the most recent and up to date information.

Fangs404
June 3rd, 2009, 11:13 PM
Try this:
sudo chown fangs404:fangs404 /media/galactica
Where "fangs404" is your UBUNTU username.

Then try your manual mount command again. You will probably also have better luck if you enable name browsing by configuring /etc/nsswitch.conf and installing winbind as outlined under "Pre-work".

Also, a word of advice. Always check the dates of threads. While the first post in this thread is up to date and current (as shown by the "version history"), the subsequent posts are quite old and not current.

So, when you run into a thread like this, don't bother with reading through the first sevral pages, always start from the last page and work your way forward, as the last page will have the most recent and up to date information.

Alright, I tried the chown command, and I also installed winbind which allows me to do this now:

http://i42.tinypic.com/1z6azol.png

That works just as 192.168.1.100 did before. It works without issue. Now I try this:

sudo mount -t cifs //galactica/share /media/galactica/ -o user=fangs404,password=PW,domain=WORKGROUP,iochars et=utf8,file_mode=0777,dir_mode=0777

However, the same thing is happening - it's mounting, but I still can't access it due to invalid permissions (the same error I posted above). Have any other ideas?

dmizer
June 3rd, 2009, 11:18 PM
Try this:
sudo mount -t cifs //galactica/share /media/galactica/ -o rw,user=fangs404,password=PW,domain=WORKGROUP,ioch arset=utf8,file_mode=0777,dir_mode=0777

If that doesn't work, please post the output of:
smbtree

Fangs404
June 3rd, 2009, 11:31 PM
It didn't work. I ran smbtree, it asked for my password, I typed it, and then it didn't output anything.

fangs404@fangs404-desktop:~$ smbtree
Password:
fangs404@fangs404-desktop:~$

Not sure why.

dmizer
June 3rd, 2009, 11:39 PM
Try this instead:
smbtree --user=fangs404
Then, when it asks for your password, type the password of the computer you're trying to connect to (not your Ubuntu password).

What OS is running on the computer you're attempting to connect to?

Fangs404
June 3rd, 2009, 11:44 PM
Try this instead:
smbtree --user=fangs404
Then, when it asks for your password, type the password of the computer you're trying to connect to (not your Ubuntu password).

What OS is running on the computer you're attempting to connect to?

This is just weird. smbtree refuses to output anything.

fangs404@fangs404-desktop:~$ smbtree --user=fangs404
Password:
fangs404@fangs404-desktop:~$

I'm typing the password to the share.

I'm connecting to a Thecus N4100Pro NAS (http://www.thecus.com/products_over.php?cid=10&pid=77). I can't tell you what operating system exactly, but it's a Linux variant. I know the drives are formatted to ext3, but that should be completely transparent via CIFS.

dmizer
June 3rd, 2009, 11:54 PM
Try this:
sudo umount /media/galactica
Then run your mount command again.
Then run this command:
sudo ls -ln /media/galactica
And post the output.

Fangs404
June 4th, 2009, 12:00 AM
Ah, finally some good news.

fangs404@fangs404-desktop:~$ sudo umount /media/galactica/
fangs404@fangs404-desktop:~$ sudo mount -t cifs //galactica/share /media/galactica/ -o user=fangs404,password=PW,domain=WORKGROUP,iochars et=utf8,file_mode=0777,dir_mode=0777
fangs404@fangs404-desktop:~$ sudo ls -ln /media/galactica/
total 0
drwxrwx---+ 10 99 99 0 2009-04-25 17:28 Install Files
drwxrwx---+ 3 99 99 0 2009-04-20 12:30 Jobs
drwxrwx---+ 15 99 99 0 2009-05-30 20:11 Music
drwxrwx---+ 7 99 99 0 2009-06-03 18:23 Pictures
drwxrwx---+ 13 99 99 0 2009-04-17 08:58 Projects
drwxrwx---+ 5 99 99 0 2009-04-18 02:54 School
drwxrwx---+ 11 99 99 0 2009-04-17 09:16 Sheet Music
drwxrwx---+ 2 99 99 0 2009-05-29 17:46 Unsorted
drwxrwx---+ 9 99 99 0 2009-04-18 13:26 Videos
fangs404@fangs404-desktop:~$

So it appears to be mounting properly. It's just that I can't view it in the file browser.

Is it because the user IDs are different? My fangs404 user on my Ubuntu install is 1000.

dmizer
June 4th, 2009, 12:03 AM
Yup, let's try this.

Unmount the share again (as described above), and then try this mount command:
sudo mount -t cifs //galactica/share /media/galactica/ -o rw,user=fangs404,password=PW,domain=WORKGROUP,gid= 1000,uid=1000,nounix,iocharset=utf8,file_mode=0777 ,dir_mode=0777

Fangs404
June 4th, 2009, 12:12 AM
Awesome, that finally worked. Thanks for helping me out. And for future reference, I was able to shorten the command to this:

sudo mount -t cifs //galactica/share /media/galactica/ -o user=fangs404,password=PW,domain=WORKGROUP,iochars et=utf8,file_mode=0777,dir_mode=0777,uid=1000,gid= 1000

Thanks so much for your help! God, what a pain in the butt.

dmizer
June 4th, 2009, 12:17 AM
You'll DEFINITELY want to leave the nounix option in the mount command line. This prevents Ubuntu from overwriting local permissions on your NAS device, which could wreak havoc on the NAS device as well as other systems trying to connect to it.

Glad it's working!

Fangs404
June 4th, 2009, 12:23 AM
You'll DEFINITELY want to leave the nounix option in the mount command line. This prevents Ubuntu from overwriting local permissions on your NAS device, which could wreak havoc on the NAS device as well as other systems trying to connect to it.

Glad it's working!

Awesome, then I'll remount it with nounix. Thanks!

Fangs404
June 4th, 2009, 01:06 AM
Just thought I'd bump to say that I also got this guy mounted permanently via fstab using essentially the same command. You rock. :)

dmizer
June 4th, 2009, 01:11 AM
Just thought I'd bump to say that I also got this guy mounted permanently via fstab using essentially the same command. You rock. :)

:-D

Congrats!

billswan
June 6th, 2009, 07:03 PM
Background: I had been unsuccessful in getting xubuntu 8.10 to mount shares from Win (2K & XP) machines on the local network, though pyNeighborhood would see the shares and I was successful in installing a printer shared from the WinXP box.

[Update: :confused: Okay... it scans the network again. Am back to original problem.]
[Update: :confused: No I'm not. Tried the measures here http://ubuntuforums.org/showthread.php?t=1169921&highlight=pyneighborhood and can't seen the Win machines again. Back to problem below.]

Situation: I now have a worse problem -- the xubuntu box won't even see the Windows machines and it won't access the Win-shared printer. What I did: While searching for a solution for the previous issue I ran across this discussion (and discovered Ubuntu Forums):
http://ubuntuforums.org/showthread.php?t=288534
What I read there looked like it could provide the solution to my problem, so I tried it:
"sudo aptitude install smbfs" // aptitude did not appear to install anything, though it did download a file
"sudo mkdir /media/----" // done a while ago, skipped
"sudo nano /etc/nsswitch.conf" // well, I'm an old vi user :p, but made the change as indicated to add "wins" to the hosts: line exactly where shown
"sudo aptitude install winbind" // this one made me a little nervous, it appeared to have had winbind already but downloaded and installed anyway (newer version?)
"reboot" // ...and I haven't seen the Win boxes since.

What I have tried:
1) Restored nsswitch.conf to original configuration. Reboot. No success.
2) Reloaded winbind using Synaptic. Reboot. No success.

When I try to scan the network with PyNeighborhood I see only the xubuntu machine itself. Running Wireshark I see there is NO attempt to locate other machines. (Network access otherwise is fine -- I am typing this on the Xubuntu machine.) I am at a loss -- other than a fresh install.

dmizer
June 7th, 2009, 02:22 AM
Okay, I merged your thread with my tutorial so I can track it easier and get you working. Next time, rather than posting a separate thread, please feel free to post in the howto you followed if you're having problems.

First of all, if you follow this howto, you won't need pyneighborhood. Your shares will be located in /media/mountpoint

If you want, it's very simple to return your box to the way it was before you followed my howto.

Winbind is a daemon which allows Ubuntu to view netbios names. It does nothing else, but could possibly interfere with pyneighborhood. I suggest you uninstall pyneighborhood. If you need Windows share browsing via point and click interface, I suggest you take a look at the 6th link in my signature. That way, you can use Nautilus: places > connect to server ... to browse Windows shares instead of pyneighborhood.

Having done this for many years, trust me ... it works.

billswan
June 7th, 2009, 07:20 PM
Thanks! What I'm looking for is a GUI browser because, while most of the network is fairly stable there are a number of shares, usually machines with shares, that come and go. (Command line simply won't do for other users of this machine.) Per your suggestion I looked at Nautilus but as I feared it wants to pull in a LOT of GNOME and I'm a bit reluctant to load up the xubuntu box with that (not sure about performance hits -- this machine is not exactly one of the faster around).

I went ahead and implemented the changes per your 6th link; as before pyNeighborhood doesn't work; I also tries xsmbrowser (ugh) and it doesn't work either. Although I have noticed something odd twice now -- after I restore the config files to their original states, reboots don't seem to get the networking going (again, as seen with pyNeighborhood) but putting the machine into hibernation and coming back out does.

But that doesn't matter. My first concern is accessing the printer share and that works again, with your changes installed. :)

My second concern are the fixed drive shares, those known in advance and unlikely to change. Your fstab method looks good for those (in addition I can re-enable the passwords I removed in trying to get this all to go). I am presuming different mountpoints are needed for each share I am accessing?

The third concern is browsing capability but that's not urgent at this time.

Oh. And pyNeighborhood is now gone.

dmizer
June 7th, 2009, 07:43 PM
You are correct, Nautilus will bring in too much overhead, sorry. I use Xubuntu myself, and I thought network browsing was built into Thunar as well, but I'll have to check.

Yes, each hard mounted share will need a separate mountpoint.

Do the hard mounted shares work at this point?

Please post the output of:
smbtree

If we can't get network browsing to work, I have an alternative that may be acceptable.

billswan
June 7th, 2009, 07:56 PM
Wow. Waking up a long-dormant thread here.

I followed your directions for mounting via fstab, but seem to be missing something.

When I run mount -a I get the error message "mount error: can not change directory into mount target /media/network" -- /media/network exists.

So I changed it to machine-name and get the error message "mount error: can not change directory into mount target /media/athair-mor" -- /media/athair-mor does not exist.

dmizer
June 7th, 2009, 09:06 PM
Wow. Waking up a long-dormant thread here.
Not hardly. I've been supporting this thread continuously since it's inception. ;)

I followed your directions for mounting via fstab, but seem to be missing something.

When I run mount -a I get the error message "mount error: can not change directory into mount target /media/network" -- /media/network exists.

So I changed it to machine-name and get the error message "mount error: can not change directory into mount target /media/athair-mor" -- /media/athair-mor does not exist.
The mount point "/media/network" must be an EMPTY directory. If there is something in the directory, the mount will fail. Also, if you are trying to mount in "/media/athair-mor" then you will have to first create "/media/athair-mor" with the following command:
sudo mkdir /media/athair-mor

billswan
June 8th, 2009, 07:41 PM
Ah. /media/network had something in it, as you surmised. I fixed that last evening, before other things pulled me away.

I created /media/athair-mor as root, chown a+w (necessary?) and mounted it. It works and I can browse it with Thunar. And the security is back in place. :)

Which only leaves the issue of a Samba browser for the transient shares, but that's not that urgent right now.

Thanks!

billswan
June 9th, 2009, 07:31 PM
smbtree reported an error in the netbios name line. I fixed it and now see:

E------N
\\XUBUNTU-B xubuntu-b server (Samba, Ubuntu)
\\XUBUNTU-B\DESKJET-660C DESKJET-660C
\\XUBUNTU-B\HP5150 HP5150
\\XUBUNTU-B\IPC$ IPC Service (xubuntu-b server (Samba, Ubuntu))
\\XUBUNTU-B\print$ Printer Drivers
\\AN-------ES H----'s box


Interesting! the last machine is not in fstab (it's transient) and athair-mor is turned off.

dmizer
June 9th, 2009, 07:37 PM
Try this:

Hit alt+f2 and type:
smb://AN-------ES

or

smb://x.x.x.x
(where x.x.x.x is AN-------ES IP address)

billswan
June 10th, 2009, 07:58 PM
Oops.. I will have to wait until it (or another transient share) returns...

ZackM
June 15th, 2009, 08:55 AM
This all works well with having a single user, from what I've seen, however I'm going to have multiple users on one machine. We just got in 200+ Acer Aspire1 laptops in, and we've put Ubuntu 9.04 Jaunty on them. I'm working now on a master image, but I want to make the kid's folder display on their desktop. Whether the files show on the desktop, or a folder itself with their name on it, like they would see in Window's My Computer area. I have figured out a way, but I would have to do a lot of work.

What I have is using fstab to mount the share automatically with smbfs (I know it's depreciated). I use credentials and everything so it'll get the password from the kid. Now, what I need is the shares mounted automatically without having to have the kid login to create a profile, then me login as root so I can sudo mount -a to get his stuff to show on the desktop. I'm not above doing this, if that's what I have to do, but I know there has to be an easier way.

Here's what I have. I posted a thread about it, and I've been looking through bodhi.zazen (http://ubuntuforums.org/member.php?u=89054)'s thread on how to fstab. But, again, it's looking like I have to add everything manually. What I have is this:

//SERVERIP/username /home/WORKGROUP/username/Desktop smbfs credentials=/etc/logons/username,uid=username,gid=106 0 0

That works exactly how I want it to, but I'd have to make a line like that for each of the six grade students. Granted we're not a huge school, but damn... Lol. So, if you know of a way to have their shares mounted automatically (Whether it's on the desktop or not. that's not a huge deal... Just mounted somewhere so they don't have to navigate through server ponds and other user folders) then let me know.

Thanks

dmizer
June 15th, 2009, 09:12 AM
Well, first of all smbfs hasn't only depreciated, it doesn't even exist in Ubuntu anymore. So even though your mount command says smbfs, you're actually mounting with cifs.

This is not something I've had to deal with (many people using the same computer), so I'll do some reasearch and get back to you.

ZackM
June 15th, 2009, 09:33 AM
Ah gotcha. I didn't realize that. I had to install smbfs in order to make it work. But, if it's using cifs as default even with smbfs in the line then I guess it doesn't matter. That's just what I got to work anyway. But, thanks for taking the time to do some research. I've been banging my head about it. Lol. I've been looking the last week or two trying to figure it out. And, if the only way to get it to work is by adding each individual student on there, then I guess that's fine.

Another thing I was thinking was writing a batch file to run on login. With that, it would inject the code into fstab and then mount as well after. However, if the login is not in the sudoers file, would that be possible?

dmizer
June 15th, 2009, 09:57 AM
No need for a batch file, just use pam_mount: http://www.novell.com/coolsolutions/feature/15354.html

Edit:
Take a look here for a full example with cifs: http://ubuntuforums.org/showthread.php?t=878685

Smbfs is a metapackage (https://help.ubuntu.com/community/MetaPackages) which contains all the necessary parts for mounting Windows shares. Oddly enough (in this case) the smbfs metapackage doesn't contain the actual smbfs package.

ZackM
June 15th, 2009, 10:23 AM
Interesting. Well thanks for the help. I'll keep you posted on my progress and let you know if I need any more help. Haha. If this does work like I need it to, then I'll be on cloud nine. If not, no biggie... I'll keep working to get something working. If anything I could always fall back on using fstab and manually do it. It may be a pain, but it does work. This being said, so far, without trying pam yet. So... I'll be working on that now. Haha

Thanks again

ZackM
June 15th, 2009, 12:38 PM
Lol okay here's a dumb question. In the Cool Solutions page you posted, it says to edit the main mounting configuration, which is in "/etc/security/pam_mount.conf" However... That's not there for me. Do I have to apt-install something, or what?

bodhi.zazen
June 15th, 2009, 02:52 PM
I think you need to install libpam-mount

sudo apt-get install libpam-mount

ZackM
June 15th, 2009, 03:11 PM
I think you need to install libpam-mount

sudo apt-get -s install libpam-mount

I did that, but it's still not in /etc/security or anywhere that I see.

bodhi.zazen
June 15th, 2009, 04:14 PM
I have not installed / configured it.

Look in /etc/pam.d

ZackM
June 16th, 2009, 08:33 AM
Unfortunately it's still no where to be found. I've looked just about everywhere, even folders I knew it wouldn't be in. Lol

dmizer
June 16th, 2009, 09:11 AM
Unfortunately it's still no where to be found. I've looked just about everywhere, even folders I knew it wouldn't be in. Lol

From man pam_mount
Configuration
The primary configuration file for the pam_mount module is
pam_mount.conf.xml. On most platforms this file is read from
/etc/security/pam_mount.conf.xml. On OpenBSD pam_mount reads its con‐
figuration file from /etc/pam_mount.conf.xml. See pam_mount.conf(5)
documenting its use.
After installing ->
dmizer@ubuntu-jaunty:~$ ls /etc/security/
access.conf limits.conf namespace.init pam_env.conf sepermit.conf
group.conf namespace.conf opasswd pam_mount.conf.xml time.conf
It would probably be quite helpful to at least scan through the man pages for more information, as I really can't offer much help.

ZackM
June 16th, 2009, 09:16 AM
From man pam_mount
Configuration
The primary configuration file for the pam_mount module is
pam_mount.conf.xml. On most platforms this file is read from
/etc/security/pam_mount.conf.xml. On OpenBSD pam_mount reads its con‐
figuration file from /etc/pam_mount.conf.xml. See pam_mount.conf(5)
documenting its use.After installing ->
dmizer@ubuntu-jaunty:~$ ls /etc/security/
access.conf limits.conf namespace.init pam_env.conf sepermit.conf
group.conf namespace.conf opasswd pam_mount.conf.xml time.conf

But it's not in either /etc/security or /etc. That howto guide is stating that it should be there. If I have to create it, that's another thing. Haha. I feel pretty dumb right now, since I can't find this, but I honestly don't see it.

dmizer
June 16th, 2009, 09:21 AM
The howto I pointed you to indicates that the file is pam_mount.conf, but the file is actually pam_mount.conf.xml according to man.

Just to be sure, post the following:
ls /etc/security

Also post:
aptitude search pam-mount

ZackM
June 16th, 2009, 09:30 AM
The howto I pointed you to indicates that the file is pam_mount.conf, but the file is actually pam_mount.conf.xml according to man.

Just to be sure, post the following:
ls /etc/securityAlso post:
aptitude search pam-mount

rootadm@ubuntu1:/etc/security$ ls /etc/security
access.conf limits.conf namespace.init pam_env.conf sepermit.conf
group.conf namespace.conf opasswd pam_lwidentity.conf time.conf

rootadm@ubuntu1:/etc/security$ aptitude search pam-mount
p libpam-mount - PAM module that can mount volumes for a us

dmizer
June 16th, 2009, 09:34 AM
Looks like you don't actually have libpam-mount installed, which would explain why you couldn't find the conf file ;)

Try again:
sudo apt-get install libpam-mount

ZackM
June 16th, 2009, 09:39 AM
Looks like you don't actually have libpam-mount installed, which would explain why you couldn't find the conf file ;)

Try again:
sudo apt-get install libpam-mount

Ah! There we go! Haha thanks a lot! Sorry it took so long for that to finally get resolved.

bodhi.zazen
June 16th, 2009, 12:06 PM
My fault, I had the -s flag in apt-get.

/me fixes previous post.

ZackM
June 16th, 2009, 03:15 PM
My fault, I had the -s flag in apt-get.

/me fixes previous post.

Aha yeah. I wasn't sure if that needed to be there myself. I should have realized it. Ah well. I'm not having much success however, but it's pointless for me to continue trying. My boss says he can get XP Pro licenses for $2 a license... So he wants to go that direction. :( Thanks for the help though. I'm still going to reference this however, and try to figure out how to mount the specific drive to the specific login though. It has me on the ropes, and I'll be damned if I give up! Lol Thanks though.

dmizer
June 16th, 2009, 07:16 PM
My boss says he can get XP Pro licenses for $2 a license... So he wants to go that direction.
Ugh, sorry :(

Don't forget to remind him about the necessary firewall and virus subscriptions (each with yearly renewals of course).

ZackM
June 17th, 2009, 08:44 AM
Ugh, sorry :(

Don't forget to remind him about the necessary firewall and virus subscriptions (each with yearly renewals of course).

Haha thank you for your condolences. He knows about the firewall and virus subscriptions, but feels it'd be easier on everyone I guess. :( Ah well... You win some you lose some I guess. We'll switch to Open Source some day.

Ginsly
June 18th, 2009, 05:40 AM
Great How To dmizer, tried in vein to mount my password protected network drive, and following your instructions (with one minor tweak) now it just works, and with much less fuss than in windows!!

I had read in another How To that when mounting a shared network drive with cifs you need to replace the NETBIOS name with the ip address of the network drive, which was the final tweak to getting everything working for me.

Sorry if this question has been answered already, but this thread is huge!!
My network drive is formatted in FAT32 and is an Airport Disk, being that it is plugged into an Airport Extreme Router. The router uses smb to broadcast a virtual filesystem on the network so as to make it mountable in any OS. Not sure if this is applicable to my problem, but I'm getting the
[18.312000] CIFS VFS: Server not responding
[18.312000] No response for cmd 5 mid 8
error you mentioned on shutdown.

Do I still use the same commands you wrote underneath to fix this, even though my set up is slightly different than mounting shares directly on a server/partition?

dmizer
June 18th, 2009, 06:44 AM
Do I still use the same commands you wrote underneath to fix this, even though my set up is slightly different than mounting shares directly on a server/partition?

I keep the howto current. What you see in the first post is the very latest information. There is a fix for all versions up to Ibex, as well as a Jaunty specific fix for that error. :)

The error you get is actually a client side error, so it doesn't matter how your servers are set up.

Ginsly
June 18th, 2009, 07:19 AM
Oh, ok.... gotcha...

And nice work for keeping this thread active for 2 years +

Thanks very much mate...:wink:

NexusGS
June 27th, 2009, 12:42 PM
Hello all,

First of all gratz for the great guide. I have an issue on mount using cifs:

When I mount the shared folder, I have full read-write perm. But when i create a subfolder for example, this folder is ro to me! I cannot write anything...I have faced the same issue on that at the past but I googled it and found it.If I remember correctly, it's an issue with file_mode and dir_mode but cannot remember what...Anyone can help me on that?

My mount line in fstab:
//server/share /mnt/folder cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0

I want full read-write perm to everyone (shame on me :) )

juliet charley
June 27th, 2009, 04:20 PM
I have followed your tutorial rigourously and complete all the Pre-work, but when I try to mount my XP sharename, it tells me "mount error(112): Host is down." Can you help?

FWIW, I'm new at Ubuntu/Linux so it really needs to kept simple (beginnger level) for me.

Thanks.

billswan
June 27th, 2009, 04:26 PM
I'm back, after travel and illness. Okay. I've set up fstab et al so the Xubuntu box will see network machines that are up when it boots.

Now I am ready to try to dynamically connect.

billswan
June 27th, 2009, 04:33 PM
Read: "browse"

smbtree output:
E-----N
\\XUBUNTU-B xubuntu-b server (Samba, Ubuntu)
\\XUBUNTU-B\DESKJET-660C DESKJET-660C
\\XUBUNTU-B\HP5150 HP5150
\\XUBUNTU-B\IPC$ IPC Service (xubuntu-b server (Samba, Ubuntu))
\\XUBUNTU-B\print$ Printer Drivers
\\DELL-C600 An Innea

xubuntu-b is this machine. DELL-C600 has an open share (for now) but is rarely on so I'd like to browse it.

NexusGS
June 28th, 2009, 05:57 AM
Hello all,

First of all gratz for the great guide. I have an issue on mount using cifs:

When I mount the shared folder, I have full read-write perm. But when i create a subfolder for example, this folder is ro to me! I cannot write anything...I have faced the same issue on that at the past but I googled it and found it.If I remember correctly, it's an issue with file_mode and dir_mode but cannot remember what...Anyone can help me on that?

My mount line in fstab:
//server/share /mnt/folder cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0

I want full read-write perm to everyone (shame on me )

I have to inform you that I found out what was the problem:

There is a bug in Samba that only appears on mount shares on Unix system (that's what I found at Internet) and you can just fix it by adding the "noperm" in fstab or in mount command, for example:

//server/share /mnt/folder cifs guest,noperm,rw,iocharset=utf8,file_mode=0777,dir_ mode=07 77 0 0

dmizer
June 28th, 2009, 07:58 AM
I'm back, after travel and illness. Okay. I've set up fstab et al so the Xubuntu box will see network machines that are up when it boots.

Now I am ready to try to dynamically connect.

Well, your time away has given me the time to write a tutorial for your exact problem. See the 6th link in my sig :)

dmizer
June 28th, 2009, 07:59 AM
I have followed your tutorial rigourously and complete all the Pre-work, but when I try to mount my XP sharename, it tells me "mount error(112): Host is down." Can you help?

FWIW, I'm new at Ubuntu/Linux so it really needs to kept simple (beginnger level) for me.

Thanks.

Please post the output of:
smbtree

And post your current /etc/fstab line (or mount command)

billswan
June 29th, 2009, 08:36 PM
It seems my reply got lost. Thought I was there for a bit but backtracking in Thunar produced a "Transport endpoint is not connected" error. Reading through on a search on that message it appears some module is not thread-safe and a reversion to an earlier one worked for somebody. Naturally, the link to what that person used (for xubuntu 8.10, same as me) is dead.
<p>
And very shortly I will be away from this machine for nearly a month, both business and vacation travel. Oh well, will try to pick it up when I'm back. :-(

dmizer
June 29th, 2009, 08:50 PM
It seems my reply got lost. Thought I was there for a bit but backtracking in Thunar produced a "Transport endpoint is not connected" error. Reading through on a search on that message it appears some module is not thread-safe and a reversion to an earlier one worked for somebody. Naturally, the link to what that person used (for xubuntu 8.10, same as me) is dead.
<p>
And very shortly I will be away from this machine for nearly a month, both business and vacation travel. Oh well, will try to pick it up when I'm back. :-(

No, your post is here -> http://ubuntuforums.org/showthread.php?t=1169149&page=8 and I have replied to it.

Scunnered
July 6th, 2009, 04:49 PM
dmizer

I followed your instructions and am pleased to say that I can read my hard drive on the XP server. Your details were clear and easily followed once I took the time to read and re-read the instructions.

One problem that I still have is that when I access the HD I find that a number of the items that I want to look at end up with a .lnk file extension and that nothing happens when I click on the item.

Can you offer any further guidance?

Thanks

dmizer
July 6th, 2009, 08:13 PM
dmizer

I followed your instructions and am pleased to say that I can read my hard drive on the XP server. Your details were clear and easily followed once I took the time to read and re-read the instructions.

One problem that I still have is that when I access the HD I find that a number of the items that I want to look at end up with a .lnk file extension and that nothing happens when I click on the item.

Can you offer any further guidance?

Thanks

In Windows talk, a .lnk file translates into "shortcut to ...", and either fortunately or unfortunately, Ubuntu won't be able to follow your shortcuts.

Scunnered
July 7th, 2009, 04:36 AM
dmizer

After all that thought and effort put in by you to let me access my XP machine it falls down at the end.

I think that I will go back and ask the individual who wrote the programme that I particularly wanted to access if he can either write it to work with Linux or at least have a sharing property.

I hope that he can do Linux but at worst I will accept a Windows compromise.

If nothing else it has banished my fears of working with the terminal.

My sincere thanks for all your kind assistance in this matter.

jcr1
July 7th, 2009, 03:39 PM
Hi again...

I return to this beast after a year or so to try again.

Set up my NAS. Can mount it dead easy in Places > Connect to Server > Windows Share:

Just by entering
server: ip address of nas
share: PUBLIC (the name of the shared smb folder

it mounts in nautilus as 'public on 192.168.0.3'

I can bookmark it, and clicking on the bookmark will mount it.

BUT... where is this mounting? How do I find it via cmd line?
And why can I not mount it by the means in the beginning of this tutorial?? i.e. if it mounts fine...why cant I do it in fstab?

It is a bit funny... as in, there is no info available on free disk space etc... but i can write to it it seems.

Cheers

Jon

exsysprog
July 7th, 2009, 11:13 PM
Hi gang,

I'm having a strange problem. I'm running 8.04 with Kernel 2.6.24-24. I have mounted a Windows XP shared folder using CIFS. All seems well except ...

I can not copy any files from the share to my home directory if they are of type exe. BUT .txt .doc .msi ... several others I've tested work. I am apparently only unable to copy exe files!!?!??!?? I'm stumped.

When I try to copy an exe file I get an error:

"There was an error copying the file into /home/ ...
Error opening file : Permission denied.

The permissions on the exe files are exactly the same as those on the txt files. The share is mounted as follows

mount.cifs kernel mount options unc=//pmde1505\receive,ip=192.168.1.80,ver=1,username=** **,password=****,
iocharset=utf8,nounix,file_mode=0555,dir_mode=0555 ,uid=1000,gid=1000

ALL file permissions reported by Nautilus as 555.

Copy being done by Ubuntu user with uid=1000,gid=1000 who is also the owner of the files

No mount errors reported in dmesg.

Has anybody seen this before?

dmizer
July 9th, 2009, 10:30 AM
Hi again...

I return to this beast after a year or so to try again.

Set up my NAS. Can mount it dead easy in Places > Connect to Server > Windows Share:

Just by entering
server: ip address of nas
share: PUBLIC (the name of the shared smb folder

it mounts in nautilus as 'public on 192.168.0.3'

I can bookmark it, and clicking on the bookmark will mount it.

BUT... where is this mounting? How do I find it via cmd line?
And why can I not mount it by the means in the beginning of this tutorial?? i.e. if it mounts fine...why cant I do it in fstab?

It is a bit funny... as in, there is no info available on free disk space etc... but i can write to it it seems.

Cheers

Jon
Your problem is the very reason why this tutorial exists. Places > connect to server DOESN'T actually mount anywhere, it only mounts virtually.

If my howto seems a bit too much for you to accomplish, perhaps this is more like what you're looking for:
http://ubuntuforums.org/showthread.php?t=1186877

Hi gang,

I'm having a strange problem. I'm running 8.04 with Kernel 2.6.24-24. I have mounted a Windows XP shared folder using CIFS. All seems well except ...

I can not copy any files from the share to my home directory if they are of type exe. BUT .txt .doc .msi ... several others I've tested work. I am apparently only unable to copy exe files!!?!??!?? I'm stumped.

When I try to copy an exe file I get an error:

"There was an error copying the file into /home/ ...
Error opening file : Permission denied.

The permissions on the exe files are exactly the same as those on the txt files. The share is mounted as follows

mount.cifs kernel mount options unc=//pmde1505\receive,ip=192.168.1.80,ver=1,username=** **,password=****,
iocharset=utf8,nounix,file_mode=0555,dir_mode=0555 ,uid=1000,gid=1000

ALL file permissions reported by Nautilus as 555.

Copy being done by Ubuntu user with uid=1000,gid=1000 who is also the owner of the files

No mount errors reported in dmesg.

Has anybody seen this before?

It may help if you mount by netbios name rather than IP address.

Try copying an exe file via the CLI.

Something like
cp -v /media/mountpoint/somefile.exe /home/your-username
See if that gives you an error of some kind.

exsysprog
July 9th, 2009, 10:07 PM
It may help if you mount by netbios name rather than IP address.

Try copying an exe file via the CLI.

Something like
cp -v /media/mountpoint/somefile.exe /home/your-username
See if that gives you an error of some kind.

Will give it a go upon return from work tomorrow night - gotta sleep now!

israelfreire
July 10th, 2009, 01:51 PM
Hello! I am Brazilian and would like to thank the excellent tutorial!

However, for the mapping function, and can edit any files (not only in openoffice) in the directory mapped, it is necessary to include the "nounix" beyond the syntax "nobrl" ...

This worked 100%!

Big hug, and once again thanks!

exsysprog
July 10th, 2009, 10:22 PM
Share mounted as follows ...

pm:~$ sudo mount.cifs //pmde1505/receive /mnt/pmde1505/receive -v -o username=*****,password=*****,iocharset=utf8,uid=1 000,gid=1000,nounix,file_mode=0555,dir_mode=0555
[sudo] password for pm:
parsing options: username=*****,password=*****,iocharset=utf8,uid=1 000,gid=1000,nounix,file_mode=0555,dir_mode=0555

mount.cifs kernel mount options unc=//pmde1505\receive,ip=192.168.1.80,ver=1,username=** **,password=*****,iocharset=utf8,nounix,file_mode= 0555,dir_mode=0555,uid=1000,gid=1000

ls of subject directory.....

pm:~$ ls -l /mnt/pmde1505/receive/dell
total 31524
dr-xr-xr-x 1 pm pm 0 2008-01-31 00:17 080131
-r-xr-xr-x 1 pm pm 32279040 2008-01-30 23:48 dell_support_center.msi
pm:~$


above file was copied.
copy of msi file .....

pm:~$ cp -v /mnt/pmde1505/receive/dell/dell_support_center.msi /home/pm
`/mnt/pmde1505/receive/dell/dell_support_center.msi' -> `/home/pm/dell_support_center.msi'
pm:~$


ls of second subject directory ......

pm:~$ ls -l /mnt/pmde1505/receive/dell/080131
total 62416
-r-xr-xr-x 1 pm pm 2428008 2008-01-31 00:14 R114200.EXE
-r-xr-xr-x 1 pm pm 35980120 2008-01-31 00:16 R127314.EXE
-r-xr-xr-x 1 pm pm 5696560 2008-01-31 00:17 R142470.EXE
-r-xr-xr-x 1 pm pm 15086968 2008-01-31 00:11 R157449_MediaDirect_3_Patch.exe
-r-xr-xr-x 1 pm pm 2589392 2008-01-31 00:14 R90851.EXE
-r-xr-xr-x 1 pm pm 761301 2008-01-31 00:13 SDVD8820_AD20_Philips.zip
-r-xr-xr-x 1 pm pm 1359471 2008-01-31 00:13 TS-L632H_D300.zip
pm:~$

Attempted copy of exe file .....

pm:~$ cp -v /mnt/pmde1505/receive/dell/080131/R114200.EXE /home/pm
`/mnt/pmde1505/receive/dell/080131/R114200.EXE' -> `/home/pm/R114200.EXE'
cp: cannot open `/mnt/pmde1505/receive/dell/080131/R114200.EXE' for reading: Permission denied
pm:~$