PDA

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


Pages : 1 2 [3] 4 5 6

dmizer
June 5th, 2008, 12:57 AM
exact syntax in the smb credentials file is critical.

substituting "user" for "username" and "pass" for "password" will result in a non-functional smb credentials file.

dmizer
June 5th, 2008, 02:17 AM
Thanks for a great thread - it has been a huge help to me.
I am using a network with a single windows machine and a number of Hardy boxes. The windows machine has a partition D$ which gives access to the Hardy machines using cifs.

If I use the following format in /etc/fstab of a Hardy box it mounts the share correctly in the directory /media/windata at boot.

//192.168.72.1/D$ /media/windata cifs rw,user=<MyUsername>,pass=<MyPassword>,domain=<MyWorkgroup>,nounix 0 0

However, If I use a credentials file as below:

//192.168.72.1/D$ /media/windata cifs rw,credentials=/root/.smb_credentials,domain=<MyWorkgroup>,nounix 0 0

the directory is empty. Changing permissions on the credentials file appears to make no difference nor does placing the credentials file in my home directory.

Why?

final fix for this problem was to install smbfs with the following command:
sudo aptitude install smbfs
shares became available once smbfs was installed.

bobd72
June 5th, 2008, 02:36 AM
Thanks you for you help with this problem dmizer. Now everything works OK. I have another Hardy machine - a Laptop - which has exactly the same problem which I can now resolve.
I had read somewhere that smbfs was replaced in Hardy by cifs. Is this correct?
If this is the case and smbfs isn't installed by default but cifs is dependent on it for some functions, others may experience problems. The fact that it worked without the credentials file even though smbfs wasn't installed would perhaps support this?

dmizer
June 5th, 2008, 02:48 AM
Thanks you for you help with this problem dmizer. Now everything works OK. I have another Hardy machine - a Laptop - which has exactly the same problem which I can now resolve.
glad we got you going.

I had read somewhere that smbfs was replaced in Hardy by cifs. Is this correct?
yes, this is correct. there is more information in the afterword of the howto regarding this.

If this is the case and smbfs isn't installed by default but cifs is dependent on it for some functions, others may experience problems. The fact that it worked without the credentials file even though smbfs wasn't installed would perhaps support this?
no ... in Hardy, smbfs is merely the name of a metapackage (https://help.ubuntu.com/community/MetaPackages) which installs all the requirements for cifs. so, interestingly, "sudo aptitude install smbfs" doesn't actually install smbfs in hardy.

as near as i can guess, in order to allow Nautilus to mount windows shares in Hardy (in previous releases, nautilus used smbfs not cifs), some basic cifs functionality must be enabled by default.

Bobba
June 8th, 2008, 12:54 PM
Any ideas on how to make Greek characters appear correctly with samba?

Browsing the folder on the network smb:// appears with the correct filenames in Greek characters, but when I mount the folder I see question marks instead of the correct characters.

I'm running Fesity and my fstab looks like this:

//192.168.1.4/music /media/sda7/music/Xanthi cifs guest,iocharset=utf8 0 0

akahige
June 8th, 2008, 03:02 PM
I'm on a Hardy system, and while I have been able to browse/read network shares -- WinXP, and an Infrant ReadyNAS (cifs, smb, nfs capable) -- I've had problems writing to them (I get timeout errors that result in empty files). So I decided to try your way of doing things.

Followed the directions. Everything seemed to go okay, but now I'm seeing differences and problems.

1) I'm able to mount some of the shares, but many -- not all -- of the files/directories have locks indicating that I don't have permission to write to them. This isn't an issue when I browse the same share with the same credentials from Windows.

2) I see that now smbtree no longer displays everything in the network (even though I can browse things that "aren't there" in Nautilus)

3) On certain shares, even though it mounts (or appears to mount) I can't browse it. I get "The folder contents could not be displayed. You do not have the permissions necessary to view the contents of..."

This is about the point where I decided that it's in my best interests to stop experimenting with things I don't grok, and ask for help.

dmizer
June 8th, 2008, 07:32 PM
Any ideas on how to make Greek characters appear correctly with samba?

Browsing the folder on the network smb:// appears with the correct filenames in Greek characters, but when I mount the folder I see question marks instead of the correct characters.

I'm running Fesity and my fstab looks like this:

//192.168.1.4/music /media/sda7/music/Xanthi cifs guest,iocharset=utf8 0 0

try this:
//192.168.1.4/music /media/sda7/music/Xanthi cifs guest,iocharset=iso8859-7 0 0

dmizer
June 8th, 2008, 07:34 PM
I'm on a Hardy system, and while I have been able to browse/read network shares -- WinXP, and an Infrant ReadyNAS (cifs, smb, nfs capable) -- I've had problems writing to them (I get timeout errors that result in empty files). So I decided to try your way of doing things.

Followed the directions. Everything seemed to go okay, but now I'm seeing differences and problems.

1) I'm able to mount some of the shares, but many -- not all -- of the files/directories have locks indicating that I don't have permission to write to them. This isn't an issue when I browse the same share with the same credentials from Windows.

2) I see that now smbtree no longer displays everything in the network (even though I can browse things that "aren't there" in Nautilus)

3) On certain shares, even though it mounts (or appears to mount) I can't browse it. I get "The folder contents could not be displayed. You do not have the permissions necessary to view the contents of..."

This is about the point where I decided that it's in my best interests to stop experimenting with things I don't grok, and ask for help.

what is the exact mount command you're using?

akahige
June 8th, 2008, 09:04 PM
what is the exact mount command you're using?

//RGONAS-01/media /media/nas_media cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0


And then simply changing the share and mount point to mount different ones.

dmizer
June 8th, 2008, 09:33 PM
okay, post the output of:
ls -l /media/nas_media
ls -n /media/nas_media
cat /etc/passwd

akahige
June 8th, 2008, 09:43 PM
ls -l /media/nas_media
total 0
drwxrwxrwx 6 98 98 0 2007-12-31 22:43 audio
drwxrwxrwx 11 98 98 0 2008-06-08 12:31 images
drwxrwxrwx 11 98 98 0 2008-04-14 10:12 videos



ls -n /media/nas_media
total 0
drwxrwxrwx 6 98 98 0 2007-12-31 22:43 audio
drwxrwxrwx 11 98 98 0 2008-06-08 12:31 images
drwxrwxrwx 11 98 98 0 2008-04-14 10:12 videos



cat /etc/passwd
root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
sync:x:4:65534:sync:/bin:/bin/sync
games:x:5:60:games:/usr/games:/bin/sh
man:x:6:12:man:/var/cache/man:/bin/sh
lp:x:7:7:lp:/var/spool/lpd:/bin/sh
mail:x:8:8:mail:/var/mail:/bin/sh
news:x:9:9:news:/var/spool/news:/bin/sh
uucp:x:10:10:uucp:/var/spool/uucp:/bin/sh
proxy:x:13:13:proxy:/bin:/bin/sh
www-data:x:33:33:www-data:/var/www:/bin/sh
backup:x:34:34:backup:/var/backups:/bin/sh
list:x:38:38:Mailing List Manager:/var/list:/bin/sh
irc:x:39:39:ircd:/var/run/ircd:/bin/sh
gnats:x:41:41:Gnats Bug-Reporting System (admin):/var/lib/gnats:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
dhcp:x:100:101::/nonexistent:/bin/false
syslog:x:101:102::/home/syslog:/bin/false
klog:x:102:103::/home/klog:/bin/false
avahi-autoipd:x:103:109:Avahi autoip daemon,,,:/var/lib/avahi-autoipd:/bin/false
messagebus:x:104:110::/var/run/dbus:/bin/false
avahi:x:105:111:Avahi mDNS daemon,,,:/var/run/avahi-daemon:/bin/false
cupsys:x:106:113::/home/cupsys:/bin/false
haldaemon:x:107:114:Hardware abstraction layer,,,:/home/haldaemon:/bin/false
hplip:x:108:7:HPLIP system user,,,:/var/run/hplip:/bin/false
gdm:x:109:118:Gnome Display Manager:/var/lib/gdm:/bin/false
michael:x:1000:1000:Michael Venables,,,:/home/michael:/bin/bash
ntp:x:110:120::/home/ntp:/bin/false
libuuid:x:111:121::/var/lib/libuuid:/bin/sh
polkituser:x:112:124:PolicyKit,,,:/var/run/PolicyKit:/bin/false
festival:x:113:29::/home/festival:/bin/false
pulse:x:114:116:PulseAudio daemon,,,:/var/run/pulse:/bin/false



I've also been reading over on the ReadyNAS forum, and there may be an issue of the UID numbers needing to match in order for the permissions to be totally sorted. (Can those be changed arbitrarily without creating problems? On the Linux machine to match the NAS, seems to be the best solution.)

dmizer
June 9th, 2008, 02:15 AM
I've also been reading over on the ReadyNAS forum, and there may be an issue of the UID numbers needing to match in order for the permissions to be totally sorted. (Can those be changed arbitrarily without creating problems? On the Linux machine to match the NAS, seems to be the best solution.)

actually that's what i was trying to determine via the above commands. it looks like the uid and gid on the nas is 98 (which seems strange, so double check that).

if it is 98, then you could mount with this command:
//RGONAS-01/media /media/nas_media cifs credentials=/root/.smbcredentials,iocharset=utf8,uid=98,gid=98,file_ mode=0777,dir_mode=0777 0 0

akahige
June 9th, 2008, 03:22 AM
actually that's what i was trying to determine via the above commands. it looks like the uid and gid on the nas is 98 (which seems strange, so double check that).

if it is 98, then you could mount with this command:
//RGONAS-01/media /media/nas_media cifs credentials=/root/.smbcredentials,iocharset=utf8,uid=98,gid=98,file_ mode=0777,dir_mode=0777 0 0

I did some looking at the files/directories that have locks vs the ones that don't. The ones that don't have "owner = 98 & group = 98", whereas the locked ones are "owner = 1002 & group = users".

The thing I'm totally baffled by is that I created all of these as my normal user-self (on Windows). I'll have to post to the NAS support forum and see if I can get an explanation as to why this is. Can't remotely fathom why the uid/gid should be anything other than 1002/users -- nor do I get why the smb authentication is doing something different with the same credentials that Windows feeds it.

Here's an interesting thought, though... I'm wondering if the uid/gid = 98 thing might not be some kind of generic permission that is basically ignored by other uid/gid combinations. If that makes any sense, might it be possible to change your mount command as follows?
//RGONAS-01/media /media/nas_media cifs credentials=/root/.smbcredentials,iocharset=utf8,uid=1002,gid=users, file_mode=0777,dir_mode=0777 0 0

Once I get some kind of answer from the ReadyNAS folks, I'll post back here and see if we can't make some more headway...

akahige
June 9th, 2008, 01:23 PM
Something of an update... more like a change in status, since now I've gotten some sleep and had a chance to take a closer look at the consequences of what happened last night.

Haven't heard from the NAS people, but there's a much more critical problem: smb is completely FUBAR. Using "Places" in Gnome, I can browse some things on the network, but even that is glacially slow. There are all kinds of errors: connection timeouts, files that transfer (writes) at 1k per second and then fail, "didn't get stream file descriptor", etc. And sometimes Nautilus will crash.

By contrast, the mount point for the NAS that was created in fstab browses instantly -- but the previously mentioned write issues still exist.

I'm totally out of my depth here, and desperately hoping this can be unhosed, somehow...

dmizer
June 9th, 2008, 07:31 PM
well, try changing your ubuntu uid number to 1002.

this line in /etc/passwd represents your ubuntu user:
michael:x:1000:1000:Michael Venables,,,:/home/michael:/bin/bash
edit the file with your favorite text editor (i like nano) like so:
sudo nano /etc/passwd
then, simply change the 1000:1000 to 1002:1002 like so:
michael:x:1002:1002:Michael Venables,,,:/home/michael:/bin/bash
remount and see if that changes anything for you.

akahige
June 9th, 2008, 07:47 PM
Well, it certainly changed something... it killed my ability to sudo because it's looking for the old uid -- which also means that I can't change it back.

Thoughts...?

dmizer
June 9th, 2008, 08:03 PM
ugh ... sorry about that.

boot into recovery mode:
press <ESC> at the startup, where grub is counting down. recovery mode should be the second kernel option in the list. use your arrows to select it, and hit <ENTER> to boot it.

you will be presented with a root command line.
edit /etc/group like so:
nano /etc/group
look for the line that says:
michael:x:1000:
and change it to this:
michael:x:1002:

reboot with the following command:
reboot

akahige
June 9th, 2008, 08:29 PM
ugh ... sorry about that.

Keep those apologies comin'! :)

Okay, I followed your recovery instructions and things broke even further. When I went to log back into the desktop, I got the following:

User's $HOME/.dmrc file is being ignored. This prevents the default session and language from being saved. File should be owned by user and have 644 permissions. User's $HOME directory must be owned by user and not writable by other users.

Then the session terminated and it threw me back to the login screen.

At this point, I went back into recovery mode and regressed the uid changes from /etc/group and /etc/passwd so that I could get back into the desktop, if nothing else.

Now what...?

dmizer
June 9th, 2008, 09:08 PM
frankly, i've never done this before so i'm not entirely sure what you'll run into. didn't expect it to be this difficult though. it's much easier in gutsy where you can edit the users uid/gid via system > admin > users

here is the fix for your previous error.

after changing the /etc/group file, reboot into recovery mode again, and run these commands:
[clipped]
see this post: http://ubuntuforums.org/showpost.php?p=5161005&postcount=523

that should be the end of the issues.

akahige
June 9th, 2008, 10:08 PM
frankly, i've never done this before so i'm not entirely sure what you'll run into.
I hope you're taking notes since the pain of being a guinea pig should go to the greater good. ;)


that should be the end of the issues.
End of the issues that was keeping me out of the desktop, yes. However, the chmod -R 700 probably wasn't the best way of going about things. Did I really need my text files to be set to executable? (And the fact that I had my home directory on the NAS mounted in the local home didn't help when -R went howling into it, either. That's my bad.)

So... the good news... directories that are mounted in fstab browse very quickly (they should, they're all being served over a gig-e network). However, I can't write to any of them without timeouts -- and at a transfer speed of about 1k, which will then proceed to fail.

When I try to browse the smb shares on the network (via Gnome places), I continually get errors like this:

Couldn't display [path]
There is no application installed for this file type.


Or timeouts as it struggles to read.

dmizer
June 9th, 2008, 10:24 PM
sheesh ... i guess i should never assume anything. the fstab mount command you gave me earlier had your share mounted in /media, so i didn't foresee you having a problem with the -R switch.

you shouldn't have to use the places menu to browse your share. you should see it in your home directory as an additional folder, just as though it's physically located in your ubuntu machine. but maybe i'm just misunderstanding what you meant.

try copying a file to your share via the command line and see if there are errors shown.

akahige
June 9th, 2008, 10:49 PM
sheesh ... i guess i should never assume anything. the fstab mount command you gave me earlier had your share mounted in /media, so i didn't foresee you having a problem with the -R switch.
I know. Like I said, that was my bad. Too much stress, too little sleep.


you shouldn't have to use the places menu to browse your share. you should see it in your home directory as an additional folder, just as though it's physically located in your ubuntu machine. but maybe i'm just misunderstanding what you meant.
That's all well and fine, but you (the royal you) don't want to mount every machine you *might* consider browsing or throwing a file on. I can barely read those machines -- and I can't even begin to write to them. (I'm not kidding about the 1k per sec. write times. And yet I can stream music to Rhythmbox without a problem.)

Whatever bad is going on with Places is crashing Nautilus and bits of the desktop. Like I said before, it used to work, but after I installed smbfs, everything started slipping. And shortly thereafter, there was a blizzard of updates to what looked like most of those installed packages. I don't know if that helped or hurt things.

If there's some kind of network activity via smb, even clicking the Places button will lockup the entire toolbar until things either finish or get canceled.


try copying a file to your share via the command line and see if there are errors shown.
No errors. It just takes forever to create a 0 byte file in the destination directory. (1.5 mins to copy a 16k text file.)

dmizer
June 11th, 2008, 12:45 AM
well, i found a post (on experts-exchange (http://www.experts-exchange.com/OS/Linux/Administration/Q_22878164.html) of all places) that gives a better way of changing the uid and gid:

sudo usermod -u 1002 michael
sudo groupmod -g 1002 michael

then you'll need to search for the old files and folders you created with the old uid/gid:
sudo find / -uid 1000 | xargs ls -al >> olduid.txt
sudo find / -gid 1000 | xargs ls -al >> oldgid.txt
review these files to make sure all is accurate. if they all should be changed, then you can run these commands to change the permissions on those files:
sudo su
find / -uid 1000 | xargs chown michael
find / -gid 1000 | xargs chgrp michael

i'm afraid that some of your instability issues may be related to the -R switch, but i have no way of verifying that. if i had given this suggestion even a few seconds of consideration, i wouldn't have posted it. :( ... you may be better off at this point if you create a new user on your system, so that you have a fresh home folder with all the correct permissions.

as for slow data transfer ... do you have firestarter, or some other iptables script enabled on your ubuntu computer?

akahige
June 11th, 2008, 01:19 AM
well, i found a post (on experts-exchange (http://www.experts-exchange.com/OS/Linux/Administration/Q_22878164.html) of all places) that gives a better way of changing the uid and gid:
Is this moot since it's working, now, or are bits of it still relevant?


i'm afraid that some of your instability issues may be related to the -R switch, but i have no way of verifying that. if i had given this suggestion even a few seconds of consideration, i wouldn't have posted it. :( ... you may be better off at this point if you create a new user on your system, so that you have a fresh home folder with all the correct permissions.
I haven't seen any evidence that the -R had any negative effect on anything. It's fairly easy to turn the -x bit off of text files. So far, everything else seems to be working as it was previously.

The thing with -R and the NAS is I'd mounted my home dir on the NAS in my /home dir on the local machine. It's pretty much all data and media. Any apps are Windows based, and Windows doesn't seem to care about the UNIX permissions.


as for slow data transfer ... do you have firestarter, or some other iptables script enabled on your ubuntu computer?
Nope. Firestarted not installed. Haven't done anything to iptables. Should all be stock.

Here's an interesting question, though... I was doing some research on my own to see if I could find anything out about this transfer/connect issue. Haven't come up with anything, but the networking forum is full of people experiencing the exact same thing -- and finding no one with any clue why.

There were a blizzard of updates to some of the networking components in the last few days. I don't think they helped anything, but I can't tell if they broke things worse than they were before.

Got any thoughts on that?

dmizer
June 11th, 2008, 01:28 AM
Is this moot since it's working, now, or are bits of it still relevant?

I haven't seen any evidence that the -R had any negative effect on anything. It's fairly easy to turn the -x bit off of text files. So far, everything else seems to be working as it was previously.

The thing with -R and the NAS is I'd mounted my home dir on the NAS in my /home dir on the local machine. It's pretty much all data and media. Any apps are Windows based, and Windows doesn't seem to care about the UNIX permissions.

if it's working, then leave well enough alone, but keep this in mind if you run into problems later.


Nope. Firestarted not installed. Haven't done anything to iptables. Should all be stock.

Here's an interesting question, though... I was doing some research on my own to see if I could find anything out about this transfer/connect issue. Haven't come up with anything, but the networking forum is full of people experiencing the exact same thing -- and finding no one with any clue why.

There were a blizzard of updates to some of the networking components in the last few days. I don't think they helped anything, but I can't tell if they broke things worse than they were before.

Got any thoughts on that?
at this point, i would ditch cifs in favor of nfs since your nas supports nfs.

akahige
June 11th, 2008, 01:33 AM
if it's working, then leave well enough alone, but keep this in mind if you run into problems later.
Will do.


at this point, i would ditch cifs in favor of nfs since your nas supports nfs.

That would be fine, except for the fact that it's not just the nas that was effected by this. I have no ability to write to Windows machines.

I did some looking, but didn't turn up any tutorials on getting nfs working. Do you know of anything that I might have missed?

dmizer
June 11th, 2008, 01:54 AM
That would be fine, except for the fact that it's not just the nas that was effected by this. I have no ability to write to Windows machines.

I did some looking, but didn't turn up any tutorials on getting nfs working. Do you know of anything that I might have missed?

there is a great nfs howto in my sig, but that won't help you with your windows machines.

on one of your windows machines, try the manual mount with the verbose option like so:
sudo mount -t cifs //netbiosname/sharename /media/sharename --verbose -o username=winusername,password=winpassword,iocharse t=utf8,file_mode=0777,dir_mode=0777

and post the output (be sure to sensor your password)

akahige
June 11th, 2008, 02:04 AM
there is a great nfs howto in my sig, but that won't help you with your windows machines.
Uh... well... I sure managed to miss that. :)


on one of your windows machines, try the manual mount with the verbose option like so:
sudo mount -t cifs //netbiosname/sharename /media/sharename --verbose -o username=winusername,password=winpassword,iocharse t=utf8,file_mode=0777,dir_mode=0777

and post the output (be sure to sensor your password)

parsing options: rw,username=XXX,password=XXX,iocharset=utf8,file_m ode=0777,dir_mode=0777
mount error: can not change directory into mount target /media/~xfer

dmizer
June 11th, 2008, 02:23 AM
humm ... add the rw option, and try making a mountpoint that doesn't contain a tilda. like this:
sudo mkdir /media/xfer
sudo chmod 777 /media/xfer
sudo mount -t cifs //netbiosname/sharename /media/xfer --verbose -o rw,username=winusername,password=winpassword,iocha rset=utf8,file_mode=0777,dir_mode=0777
see if you have more success with writing to this share. does the windows sharename also contain a tilda?

akahige
June 11th, 2008, 02:45 AM
humm ... add the rw option, and try making a mountpoint that doesn't contain a tilda. like this:
sudo mkdir /media/xfer
sudo chmod 777 /media/xfer
sudo mount -t cifs //netbiosname/sharename /media/xfer --verbose -o rw,username=winusername,password=winpassword,iocha rset=utf8,file_mode=0777,dir_mode=0777
see if you have more success with writing to this share. does the windows sharename also contain a tilda?

Windows share name contains tilde. Actually, I screwed up with the initial mount, since I actually did create the mount point as /media/xfer.

Followed your instructions. Able to browse and write to the mounted directory. First time I tried copying a directory and got a permission denied, but copied a file then went back and tried the directory again, and that worked okay. Not blazingly fast, but not dog-slow, either -- about 600kbps - 900kbps.

This seems rather like progress. Given this, do you have any theory as to why writing to the nas isn't performing to the same degree (or should we just give up on that and go with nfs)?

dmizer
June 11th, 2008, 02:51 AM
Windows share name contains tilde. Actually, I screwed up with the initial mount, since I actually did create the mount point as /media/xfer.

Followed your instructions. Able to browse and write to the mounted directory. First time I tried copying a directory and got a permission denied, but copied a file then went back and tried the directory again, and that worked okay. Not blazingly fast, but not dog-slow, either -- about 600kbps - 900kbps.
sounds good to me.

This seems rather like progress. Given this, do you have any theory as to why writing to the nas isn't performing to the same degree (or should we just give up on that and go with nfs)?
theory: many nas devices are made cheaply with inferior firmware programming which is incapable of interfacing well with linux. a quick search through this thread should validate my claim ;)

action: give up and go with nfs for connecting to your nas, and then maybe you can get back to your rounds in the secret garden.

cifs_sucks
June 11th, 2008, 03:29 PM
I had been pretty annoyed for the last few weeks with the substitution of smbfs with cifs in hardy.
I had tried all the usual hints in this forum but still couldn't get rid of
"mount error 13 = Permission denied"

Until now! This sh..y cifs can't deal properly with passwords containing special charakters like german mutated vowels.

I substituted the "ö" with "#" and my shares have been mounted again! :guitar:

Maybe this helps someone else out there.

dmizer
June 11th, 2008, 07:30 PM
I had been pretty annoyed for the last few weeks with the substitution of smbfs with cifs in hardy.
I had tried all the usual hints in this forum but still couldn't get rid of
"mount error 13 = Permission denied"

Until now! This sh..y cifs can't deal properly with passwords containing special charakters like german mutated vowels.

I substituted the "ö" with "#" and my shares have been mounted again! :guitar:

Maybe this helps someone else out there.

you can use proxy authentication through squid and smb_auth in order to authenticate with german umlauts.

Bobba
June 13th, 2008, 02:03 PM
try this:
//192.168.1.4/music /media/sda7/music/Xanthi cifs guest,iocharset=iso8859-7 0 0
Thanks for the prompt reply dmizer
I tried iocharset=iso8859-7 and it changes the greek chracters to a black diamond with a question mark in the middle. Any other ideas?!

grebulator
June 14th, 2008, 06:26 PM
Hi dmizer

I have followed your instructions to mount a share manually to the letter and when trying to mount my windows xp pro share using 'sudo mount -t cifs //flem/Music /mnt/music -o username=mywindowsusername,password=mywindowspassw ord,iocharset=utf8,file_mode=0777,dir_mode=0777' I receive the error 'mount error 6 = No such device or address'

I can connect to the share through nautilus, and can ping the box by ip and by name. I'm new to Linux and can't work out where to go from here. I've looked around and cant find anyone with the same problem or any solution.

Is there any chance you can help me?

Thanks in advance.

grebulator
June 14th, 2008, 07:12 PM
Ignore my post please, I've figured it out :)

Thanks :)

dmizer
June 15th, 2008, 10:11 AM
Thanks for the prompt reply dmizer
I tried iocharset=iso8859-7 and it changes the greek chracters to a black diamond with a question mark in the middle. Any other ideas?!

well, as far as i can tell, there are only two possible encodings for you to use with greek characters (iso8859-7 and unicode), you may need to look into making sure your local login has all the necessary encodings to support greek characters.

you may have to make sure you're using the LANG environment variable of el_GR.iso8859-7.

were the file names created on a windows or a linux computer?

jwillar
June 18th, 2008, 10:12 PM
I'm new to this post and have read the entire 54 pages, whew! My NAS drive (ext2) mounts fine using your guide using cifs. However when trying to move/copy files from my Desktop (Kubuntu 8.04) to the NAS drive folder, I get the error "Could not change permissions for "xxxx.xxx". The files eventually copy over but when copying folders, not all sub-folders and/or files are brought over. Do you have any words of wisdom with this problem? Yes, I'm fairly new to Linux (1 year) and learned a lot reading your post, thanks for being so helpful.

dmizer
June 18th, 2008, 11:59 PM
I'm new to this post and have read the entire 54 pages, whew!
just for future reference, when you run into threads like this one that have been around for years and have tens of pages of replies, your best bet is to start from the back and work forward. that way you get the most recent (and most relevant) posts. in this thread, probably the first 10 to 20 or so pages contain very little information that's relevant, or has not been updated an addressed in the first post.

My NAS drive (ext2) mounts fine using your guide using cifs. However when trying to move/copy files from my Desktop (Kubuntu 8.04) to the NAS drive folder, I get the error "Could not change permissions for "xxxx.xxx". The files eventually copy over but when copying folders, not all sub-folders and/or files are brought over. Do you have any words of wisdom with this problem? Yes, I'm fairly new to Linux (1 year) and learned a lot reading your post, thanks for being so helpful.
it's no problem, glad you were able to learn a lot.

please post the output of:
ls -l /media/sharename
where "/media/sharename" is the mountpoint you used in your mount line.

snakdoc
June 19th, 2008, 01:14 AM
thanks for the help will look and see if i can't get this

fig_wright
June 20th, 2008, 07:54 AM
I'm having similar issues to this thread since upgrading to Hardy. On shutdown I has getting smb dismount hangs, but these were solved with:
sudo ln -s /etc/init.d/umountnfs.sh /etc/rc0.d/K15umountnfs.sh
sudo ln -s /etc/init.d/umountnfs.sh /etc/rc6.d/K15umountnfs.sh

Although there were messages on boot also, once fully booted the shared drives were actually mounted OK. However, I wanted to get rid of the errors anyway... First, I was getting:
mount error: could not find target server. TCP name gateway/shared not found. No ip address specified and hostname not found.
Having a quick search I found that cifs apparently uses IP addresses. Fine, so I changed them in the /etc/fstab. But then the errors changed to
error connecting to ipv4 socket cifs_mount failed
Again, once fully booted the shared are mounted OK, so something is bombing out but then trying again successfully later? How can I resolve the original mount failures?

dmizer
June 20th, 2008, 08:00 AM
how are you connecting to the internet?

fig_wright
June 20th, 2008, 08:04 AM
Via the network server as a gateway. The gateway hands out DHCP and samba shares. It is Clarkconnect 4.2 (based on RedHat Enterprise).

Interestingly, those error messages above only seem to occur on the console itself - I cant find them in any of the actual logs...

dmizer
June 20th, 2008, 08:06 AM
actually, i should have asked, "are you connecting to the internet wirelessly?"

fig_wright
June 20th, 2008, 08:12 AM
No, gigabit ethernet cable to server, then ADSL to internet.

dmizer
June 20th, 2008, 08:16 AM
but after you log in, it works fine?

you'll need to enable name resolution by installing and configuring wins according to the "prework" section of the howto. then cifs can resolve host name unless there is something blocking wins. contrary to what you've read, cifs does just fine with resolving host names.

fig_wright
June 20th, 2008, 08:37 AM
Yes, by the time I am logged in, the shares are up and running. As indeed they were even with the WINS names rather than IP addresses used. Evidently, the first time the mount is called during boot, it cant do either WINS or IP connection for some reason, but by the time I am logged in it can do both by itself. I wonder what is trying the first and second mounts? Presumably the /etc/fstab mount-all is one of them!

dmizer
June 20th, 2008, 08:42 AM
i suspect that it tries the mount several times during the boot process, but is only successful after the wins server has started. you might try changing the runlevel of the wins server, but i'm no expert at runlevels, so that's probably as much advice as you'll get from me on the subject.

Edk
June 24th, 2008, 04:37 PM
Hope I can piggy-back on this one please! I am tearing my hair out!!

Thanks for the help here. I have read the entries but am still having real problems.

1. I run Hardy Heron and have nfs-common installed - perhaps not relevant

2. I want to mount //192.168.0.9/Public to /mnt/qnap

3. As root I created /mnt/qnap

4. Permissions of qnap are:

drwxr-xr-x 2 edward root 4096 2008-06-18 19:20 qnap

5. I have tried this command:
sudo mount -t cifs //192.168.0.9/Public /mnt/qnap -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77

and this command:

mount -t nfs 192.168.0.9:/Public /mnt/qnap


The qnap mounts and is accessible via the terminal. Most of the files at the first level are permissions nobody/nogroup

6. If I navigate to /mnt/qnap using Nautilus I can see the files BUT even if I do mothing, after a few seconds, Nautilus greys out, locks up and I have to kill it off. Fairly useless!

7. The same happens if I mount at /home/edward/qnap

8 I had a bit more success with:
sudo mount -t cifs //192.168.0.9/Public /mnt/qnap -o username=edward,password=edward,iocharset=utf8,fil e_mode=0777,dir_mode=0777

At least nautilus was useable, BUT if I created a folder under one of the root folders, the new folder has an Owner of 501 (!) with full access, and Group Users with Access only, and Others folder access - Access files

This is not much use to create files/folders!!

Has anyone any ideas as it seems daft that I cannot mount one Linux box to another! Please be simple as I am still learning!

Thanks in advance

Ed

c0njur
June 24th, 2008, 05:09 PM
dmizer:

I tried
sudo aptitude install smbfs
but was told it was already installed.

This command worked, however I want to mount the shares using fstab.
sudo mount -t cifs //192.168.xx.xx/the_shared_dir /media/mount_point/ -o username=your_username,uid=your_username,gid=users

Any other ideas?

dmizer
June 24th, 2008, 08:07 PM
Hope I can piggy-back on this one please! I am tearing my hair out!!

Thanks for the help here. I have read the entries but am still having real problems.

1. I run Hardy Heron and have nfs-common installed - perhaps not relevant

2. I want to mount //192.168.0.9/Public to /mnt/qnap

3. As root I created /mnt/qnap

4. Permissions of qnap are:

drwxr-xr-x 2 edward root 4096 2008-06-18 19:20 qnap

5. I have tried this command:
sudo mount -t cifs //192.168.0.9/Public /mnt/qnap -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77

and this command:

mount -t nfs 192.168.0.9:/Public /mnt/qnap


The qnap mounts and is accessible via the terminal. Most of the files at the first level are permissions nobody/nogroup

6. If I navigate to /mnt/qnap using Nautilus I can see the files BUT even if I do mothing, after a few seconds, Nautilus greys out, locks up and I have to kill it off. Fairly useless!

7. The same happens if I mount at /home/edward/qnap

8 I had a bit more success with:
sudo mount -t cifs //192.168.0.9/Public /mnt/qnap -o username=edward,password=edward,iocharset=utf8,fil e_mode=0777,dir_mode=0777

At least nautilus was useable, BUT if I created a folder under one of the root folders, the new folder has an Owner of 501 (!) with full access, and Group Users with Access only, and Others folder access - Access files

This is not much use to create files/folders!!

Has anyone any ideas as it seems daft that I cannot mount one Linux box to another! Please be simple as I am still learning!

Thanks in advance

Ed

do you have the same username on both the boxes?

if so, please post the output of (from both boxes)
cat /etc/passwd | grep edward
don't worry, this will not expose your password.

dmizer:

I tried
sudo aptitude install smbfs
but was told it was already installed.

This command worked, however I want to mount the shares using fstab.
sudo mount -t cifs //192.168.xx.xx/the_shared_dir /media/mount_point/ -o username=your_username,uid=your_username,gid=users

Any other ideas?

did you enable netbios name resolution by installing winbind?

Edk
June 25th, 2008, 01:13 PM
dmizer - thanks for replying.

I am about to dash out, but here is the output from cat /etc/passwd | grep edward

edward:x:1000:1000:Edward Kerr,,,:/home/edward:/bin/bash

I got a bit further on last night:

Using this:

sudo mount -t cifs //192.168.0.9/Public /mnt/qnap -o username=edward,password=edward,uid=edward,gid=nog roup,iocharset=utf8,file_mode=0777,dir_mode=0777

I managed to do all except get the group right. I am now owner

I am aiming (I hope correctly!) to get this:

Group - nogroup - create and delete files
others - create and delete files


If this does not make sense, let me know and I will post again, realistically tomorrow night!

Thanks again for help - much appreciated


Ed

bradrourke
June 25th, 2008, 06:04 PM
I have got this working like a champ (my windows share appears on my desktop) but ONLY if I put my credentials (username, pwd) in fstab. Calling from .smbcredentials just doesn't work.

Since I am a single user network I am not too concerned but I hate when I can't figure out why things don't work.

dmizer
June 25th, 2008, 06:38 PM
dmizer - thanks for replying.

I am about to dash out, but here is the output from cat /etc/passwd | grep edward

edward:x:1000:1000:Edward Kerr,,,:/home/edward:/bin/bash
it's important to have this information from both your server and your client.

I got a bit further on last night:

Using this:
sudo mount -t cifs //192.168.0.9/Public /mnt/qnap -o username=edward,password=edward,uid=edward,gid=nog roup,iocharset=utf8,file_mode=0777,dir_mode=0777

I managed to do all except get the group right. I am now owner

I am aiming (I hope correctly!) to get this:

Group - nogroup - create and delete files
others - create and delete files


try removing the group option like so:
sudo mount -t cifs //192.168.0.9/Public /mnt/qnap -o username=edward,password=edward,uid=edward,iochars et=utf8,file_mode=0777,dir_mode=0777

dmizer
June 25th, 2008, 06:41 PM
I have got this working like a champ (my windows share appears on my desktop) but ONLY if I put my credentials (username, pwd) in fstab. Calling from .smbcredentials just doesn't work.

Since I am a single user network I am not too concerned but I hate when I can't figure out why things don't work.

most frequently, this is because the smbcredentials file is not formatted correctly.

username=xxx
password=xxxx

there must be no space before or after the equal sign.

bradrourke
June 25th, 2008, 08:15 PM
Thanks for the reply, dz . . . but it is not spaces around the equal signs. The /root/.smbcredentials is properly formatted (I think):


username=rourke
password=xxxxxxx


Also chmod to 700.

Ah, well.....

dmizer
June 25th, 2008, 08:22 PM
Thanks for the reply, dz . . . but it is not spaces around the equal signs. The /root/.smbcredentials is properly formatted (I think):


username=rourke
password=xxxxxxx


Also chmod to 700.

Ah, well.....

what text editor did you use when you created the file?

c0njur
June 25th, 2008, 09:58 PM
did you enable netbios name resolution by installing winbind?

Yes I installed winbind but it shouldn't matter as I'm accessing the server using the IP address and not the netbios name.

dmizer
June 25th, 2008, 10:04 PM
Yes I installed winbind but it shouldn't matter as I'm accessing the server using the IP address and not the netbios name.

when creating your fstab entry, you should use the server's netbios name instead of ip address, or you will get errors.

c0njur
June 25th, 2008, 10:56 PM
when creating your fstab entry, you should use the server's netbios name instead of ip address, or you will get errors.

Wow, I used the netbios name and now it works perfectly! I suppose I should have followed the instructions more explicitly (since your howto does say to use a netbios name) but up until now in my linux experience the netbios name and the IP gave the same result. I'm just glad samba works now.

Thank you very much for your help, I really appreciate you taking time to help users like me.

bradrourke
June 25th, 2008, 11:27 PM
I used nano, as per original howto. Thx.

dmizer
June 25th, 2008, 11:55 PM
I used nano, as per original howto. Thx.

do you have any unusual characters or spaces in your username or password?

bradrourke
June 26th, 2008, 12:02 AM
No unusual characters or nuthin'! Just numbers, actually. (Shh, don't tell.)

dmizer
June 26th, 2008, 12:12 AM
the only other thing i can think of then is to double check, and make sure that the spelling and directory path are the same.

beyond that, i can't imagine anything else could be wrong.

Edk
June 26th, 2008, 02:39 PM
dmizer

I am back again. I want to echo what someone else has said - thank you so much for all your help and patience. REALLY appreciated.

OK.

1. How do I get "cat /etc/passwd | grep edward" for the server?

2. I tried your suggestion of:

sudo mount -t cifs //192.168.0.9/Public /mnt/qnap -o username=edward,password=edward,uid=edward,iochars et=utf8,file_mode=0777,dir_mode=0777

The result was:

Owner - edward - Create and delete files

Group - Users - Access files

Others - Folder Access - Access files

Using my last attempt:

sudo mount -t cifs //192.168.0.9/Public /mnt/qnap -o username=edward,password=edward,uid=edward,gid=nog roup,iocharset=utf8,file_mode=0777,dir_mode=0777


This gets the
owner - edward - Create and delete files (What I want)
Group as nogroup - correct, but the permissions only as Folder Access - Access files only

This is the only error left now. I would like the nogroup to have full read/write access if possible. Is this in fact possible?

Once again - thanks for all your help. I guess I would be somewhat lost without your help

IbuildDW
June 26th, 2008, 04:23 PM
I am having trouble mounting a windows share.

Once in about every 50 attempts
mount -t cifs //server/share /media/share -o username=user,password=pwd,file_mode=0777,dir_mode =0777
will work. Every other attempt I receive

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


If I run

smbtree -N

I can see the share, but I'm unable to connect to it.

I can connect to other servers using the above command and then umount then re-mount over and over again. But to this server one in 50 times if I'm lucky. If I do get connected, the mount is disconnected at some point.

I am using this share from a windows box with no problem.


mount error 5


doesn't seem to be a very common issue, I didn't find much on this forum or on Google.

I hope it's a simple issue.

Thanks in advance for any help you may be able to provide

dmizer
June 26th, 2008, 06:46 PM
dmizer

I am back again. I want to echo what someone else has said - thank you so much for all your help and patience. REALLY appreciated.

OK.

1. How do I get "cat /etc/passwd | grep edward" for the server?
i thought you mentioned in post 549 (http://ubuntuforums.org/showpost.php?p=5254067&postcount=549) that you were trying to connect two linux boxes together. did i misunderstand?

2. I tried your suggestion of:

sudo mount -t cifs //192.168.0.9/Public /mnt/qnap -o username=edward,password=edward,uid=edward,iochars et=utf8,file_mode=0777,dir_mode=0777

The result was:

Owner - edward - Create and delete files

Group - Users - Access files

Others - Folder Access - Access files

Using my last attempt:

sudo mount -t cifs //192.168.0.9/Public /mnt/qnap -o username=edward,password=edward,uid=edward,gid=nog roup,iocharset=utf8,file_mode=0777,dir_mode=0777


This gets the
owner - edward - Create and delete files (What I want)
Group as nogroup - correct, but the permissions only as Folder Access - Access files only

This is the only error left now. I would like the nogroup to have full read/write access if possible. Is this in fact possible?

Once again - thanks for all your help. I guess I would be somewhat lost without your help

this permissions issue is not likely to be fixed by changing things on the client side. i think this problem is coming from the server side.

dmizer
June 26th, 2008, 06:51 PM
I am having trouble mounting a windows share.

Once in about every 50 attempts
mount -t cifs //server/share /media/share -o username=user,password=pwd,file_mode=0777,dir_mode =0777
will work. Every other attempt I receive

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


If I run

smbtree -N

I can see the share, but I'm unable to connect to it.

I can connect to other servers using the above command and then umount then re-mount over and over again. But to this server one in 50 times if I'm lucky. If I do get connected, the mount is disconnected at some point.

I am using this share from a windows box with no problem.


mount error 5


doesn't seem to be a very common issue, I didn't find much on this forum or on Google.

I hope it's a simple issue.

Thanks in advance for any help you may be able to provide

try connecting by ip address instead of by server name:
mount -t cifs //server-ip-address/share /media/share -o username=user,password=pwd,file_mode=0777,dir_mode =0777
this problem could occur if a firewall on your windows machine is blocking name resolution.

if this does not work, please provide more information about the server. is it a windows computer, or NAS device? if windows, what version? any security software enabled?

IbuildDW
June 27th, 2008, 07:14 AM
try connecting by ip address instead of by server name:

Thank-you for the suggestion. I get the same result by ip address. I changed the user/passwd to a domain admin and it works.. There must be something wrong with the permissions of the user I created. I gave the user access to the share, and file permissions. User in the Domain Admin group, works.. User I created not so much.. :confused:

dmizer
June 27th, 2008, 07:35 AM
There must be something wrong with the permissions of the user I created. I gave the user access to the share, and file permissions. User in the Domain Admin group, works.. User I created not so much.. :confused:
sounds like a good start to me.

does the same user account work on another windows computer? can you provide more information about the server hosting the shares (vista? xp? a nas device?)

Krydahl
June 28th, 2008, 05:10 PM
Anyone seen any strange permissions issues since the recent update to smbfs et al?

I'd got everything working ok (thanks to this thread). Now I'm having a few issues again. I use an app called unison (in the repositories) to sync files on a NAS box and 2 computers (both Hardy, both mounting the NAS via cifs). This was all working fine, now unison seems to be having trouble changing files. The strange thing is it's not reporting any errors and seems to think it's written the change, but it hasn't.

As far as I know unison makes use of rsync to do its thing.

I've listed the mounted directories using vdir and they all see to be mounted with my uid and gid. Any suggestions of where to look welcomed.

palmdoc
June 28th, 2008, 05:39 PM
Thanks to everyone, esp Dmizer for this wonderful thread. Finally managed to mount shared folders in my NAS drive

I can however only mount it from root, and when I issue the Echo command or Linux extensions. This is what works for me


sudo bash
echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled
sudo mount -t cifs //192.168.1.69/Podcasts /media/Podcasts -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77


Now the part I can't understand is for password protected folders, I can mount only ONE, and when I try a second, it gives me an error:


sudo mount -t cifs //192.168.1.69/Treo /media/Treo -o username=***,password=***,iocharset=utf8,file_mode =0777,dir_mode=0777

- mounts OK

sudo mount -t cifs //192.168.1.69/Backup /media/Backup -o username=***,password=***,iocharset=utf8,file_mode =0777,dir_mode

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

Any tips for this Ubuntu newbie much appreciated!

dmizer
June 29th, 2008, 09:06 PM
Anyone seen any strange permissions issues since the recent update to smbfs et al?

I'd got everything working ok (thanks to this thread). Now I'm having a few issues again. I use an app called unison (in the repositories) to sync files on a NAS box and 2 computers (both Hardy, both mounting the NAS via cifs). This was all working fine, now unison seems to be having trouble changing files. The strange thing is it's not reporting any errors and seems to think it's written the change, but it hasn't.

As far as I know unison makes use of rsync to do its thing.

I've listed the mounted directories using vdir and they all see to be mounted with my uid and gid. Any suggestions of where to look welcomed.

most permissions issues i've run into during the course of supporting this thread are related to the server rather than the client. for cifs, it's a good idea to have different usernames for each device on your network. if you do have identical usernames, you'll have to make sure that the uid and gid numbers match.

what nas device are you using?

dmizer
June 29th, 2008, 09:14 PM
Thanks to everyone, esp Dmizer for this wonderful thread. Finally managed to mount shared folders in my NAS drive

I can however only mount it from root, and when I issue the Echo command or Linux extensions. This is what works for me


sudo bash
echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled
sudo mount -t cifs //192.168.1.69/Podcasts /media/Podcasts -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77


Now the part I can't understand is for password protected folders, I can mount only ONE, and when I try a second, it gives me an error:


sudo mount -t cifs //192.168.1.69/Treo /media/Treo -o username=***,password=***,iocharset=utf8,file_mode =0777,dir_mode=0777

- mounts OK

sudo mount -t cifs //192.168.1.69/Backup /media/Backup -o username=***,password=***,iocharset=utf8,file_mode =0777,dir_mode

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

Any tips for this Ubuntu newbie much appreciated!
i think your best bet for solving all of these problems will be by mounting with fstab instead of manually via the CLI. but before you can get that set up, you'll have to do several things.

first of all, you'll need to make a credentials file as outlined under the "Permanent mount" section. this should solve your problem with only being able to mount one password protected share.

next, you'll need to configure your ubuntu client so it mounts your share with netbios name instead of ip address as outlined under the "Prework" section of the howto.

let me know when that's done, and i'll show you how to automatically disable unix extensions on boot so you don't have to touch anything.

Edk
June 30th, 2008, 01:27 PM
dmizer

I think I had rather reached the same conclusion. I do not think there is an error in the QNAP server, rather it is inerrant in the design of Unix file permissions!

To answer your other query, I am not trying to link two Linux boxes together in the normal way, just that I had assumed that as QNAP is running Linux, and so am I it should be a piece of cake!

Anyway, I shall continue to explore this and other threads, and I think all will be well. Will keep you posted

Ed

Krydahl
June 30th, 2008, 05:13 PM
most permissions issues i've run into during the course of supporting this thread are related to the server rather than the client. for cifs, it's a good idea to have different usernames for each device on your network. if you do have identical usernames, you'll have to make sure that the uid and gid numbers match.

what nas device are you using?

I think it's unlikely to be the server that's the problem, since it was working before. It's a vantec nexstar - a very cheap and cheerful NAS enclosure that you put your own drive into.

The usernames are the same for both machines - but the uid and gid do match. It's occurred to me that when I was having problems both machines had the NAS mounted at the same time. I guess that might confuse things. I'll have a go with each machine separately and also try changing one of the user ids and get back to you when I have more info (bit short of time to experiment at the moment).

Krydahl
July 2nd, 2008, 05:46 PM
OK, I'm confused.

I've simplified things. I've made sure the laptop is off so that there's only the 1 machine writing to the NAS. I've created some new files to test on and I'm using rsync direct to check it isn't a problem with the unison tool.

What I find is that rsync copies new files to the NAS no problem, but when it finds a file that has been modified it creates a hidden file with the changed file's name plus some kind of hash. I'm assuming this is a safety feature where it checks it can write the changes before deleting anything. The last step, presumably, should be to delete the old file and change the name of the new. It doesn't seem to be doing this any more. However, the log file output by rsync is reporting no errors.

Also note that this was working correctly a week or so ago, with the NAS mounted the same way it is now and on Hardy.

Current fstab line:
//NASNAME/PUBLIC /media/nas/ cifs guest,rw,nounix,iocharset=utf8,uid=<username>,gid=<username>,file_mode=0777,dir_mode=0777 0 0

output of ls -al:
drwxrwxrwx 1 <username> <username> 0 2007-12-23 16:19 .
drwxr-xr-x 6 root root 4096 2008-07-02 10:53 ..
drwxrwxrwx 1 <username> <username> 0 2006-01-01 00:28 Compendium
drwxrwxrwx 1 <username> <username> 0 2006-01-01 00:28 Compressed Music
drwxrwxrwx 1 <username> <username> 0 2006-01-01 02:46 ConnectedText
drwxrwxrwx 1 <username> <username> 0 2006-01-01 00:10 Documents
drwxrwxrwx 1 <username> <username> 0 2006-04-13 01:39 .Trash
drwxrwxrwx 1 <username> <username> 0 2008-02-09 21:40 Wallpapers
drwxrwxrwx 1 <username> <username> 0 2006-01-04 14:26 Weeklydocs

Output from vdir looks identical except it omits ..

output from ls -ln:
drwxrwxrwx 1 1000 1000 0 2006-01-01 00:28 Compendium
drwxrwxrwx 1 1000 1000 0 2006-01-01 00:28 Compressed Music
drwxrwxrwx 1 1000 1000 0 2006-01-01 02:46 ConnectedText
drwxrwxrwx 1 1000 1000 0 2006-01-01 00:10 Documents
drwxrwxrwx 1 1000 1000 0 2008-02-09 21:40 Wallpapers
drwxrwxrwx 1 1000 1000 0 2006-01-04 14:26 Weeklydocs

Rsync works fine to an internal HDD. Any hints about what to try next or where to look greatly appreciated.

dmizer
July 2nd, 2008, 08:39 PM
OK, I'm confused.

I've simplified things. I've made sure the laptop is off so that there's only the 1 machine writing to the NAS. I've created some new files to test on and I'm using rsync direct to check it isn't a problem with the unison tool.

What I find is that rsync copies new files to the NAS no problem, but when it finds a file that has been modified it creates a hidden file with the changed file's name plus some kind of hash. I'm assuming this is a safety feature where it checks it can write the changes before deleting anything. The last step, presumably, should be to delete the old file and change the name of the new. It doesn't seem to be doing this any more. However, the log file output by rsync is reporting no errors.

Also note that this was working correctly a week or so ago, with the NAS mounted the same way it is now and on Hardy.
this may best be addressed with the rsync team then. so, this may be a good place to start: http://samba.anu.edu.au/rsync/issues.html

this is really outside the bounds of this howto, but what's your rsync syntax?

Krydahl
July 3rd, 2008, 04:10 AM
rsync -r --delete /home/<username>/Documents/ /media/nas/Documents/

I'll have a look round the link you sent. Ta.

palmdoc
July 3rd, 2008, 09:18 AM
i think your best bet for solving all of these problems will be by mounting with fstab instead of manually via the CLI. but before you can get that set up, you'll have to do several things.

first of all, you'll need to make a credentials file as outlined under the "Permanent mount" section. this should solve your problem with only being able to mount one password protected share.

next, you'll need to configure your ubuntu client so it mounts your share with netbios name instead of ip address as outlined under the "Prework" section of the howto.

let me know when that's done, and i'll show you how to automatically disable unix extensions on boot so you don't have to touch anything.

Thanks for your reply! Firstly I am esctatic that the last Ubuntu update fixed something in the smb system such that I can see the network shares at last in Nautilus!!

OK I have done the credentials file and edited the fstab
When I call:
sudo mount -a
I get an error unless I call as root:
echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled
from the terminal first.
Then when I call
sudo mount -a
the drive is mounted
Appreciate tips on how to automatically disable unix extensions on boot!

Cheers!

dmizer
July 3rd, 2008, 07:42 PM
rsync -r --delete /home/<username>/Documents/ /media/nas/Documents/

I'll have a look round the link you sent. Ta.
as far as i can see, this should work with no problems. it does work on my dapper install, but i haven't tested it on hardy yet.

Thanks for your reply! Firstly I am esctatic that the last Ubuntu update fixed something in the smb system such that I can see the network shares at last in Nautilus!!

OK I have done the credentials file and edited the fstab
When I call:
sudo mount -a
I get an error unless I call as root:
echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled
from the terminal first.
Then when I call
sudo mount -a
the drive is mounted
Appreciate tips on how to automatically disable unix extensions on boot!

Cheers!

okay ... almost done.

now edit /etc/rc.local like so:
sudo nano /etc/rc.local
edit the file so it looks like this:
#!/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.

echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled
mount -a
exit 0
reboot, and your share will be mounted automatically.

Krydahl
July 4th, 2008, 05:12 AM
as far as i can see, this should work with no problems. it does work on my dapper install, but i haven't tested it on hardy yet.

Worked on Fiesty and Gutsy, used to work on Hardy - still does to an internal drive.

I'll start my own thread and see if anyone else can throw any light on the problem. Thanks for your input.

waydownsouth
July 7th, 2008, 06:29 PM
Hi,

Sorry if this has been covered earlier in this thread... 59 pages takes a fair while to trawl through.

Anyway, I've followed the how to, and have struck a problem:

I have samba running on a Xubuntu Hardy box which I access via my laptop running Ubuntu Hardy and my desktop which is running Windows XP.

I can access my shares via XP with full read/write permissions... no problems there.

When connecting via the laptop, the shares mount and appear on the desktop. I initially had problems with the shares being owned by root but fixed that with chmod.

But now, anytime I copy a file from my laptop to the share I sometimes get errors saying I don't have permission and any file that does copy gets owned by root.

I did have the root account enabled through my own inexperience with Ubuntu, but have since disabled it (I think?).

any pointers or ideas?

dmizer
July 7th, 2008, 06:42 PM
do you have the same username on both the laptop and your xubuntu server?

waydownsouth
July 7th, 2008, 06:52 PM
Nope, should they be?

dmizer
July 7th, 2008, 07:49 PM
they do not need to be the same. it can cause problems if they are, so that's why i asked.

how are you mounting the share from your laptop? please post the line you're using.

also, please post your /etc/samba/smb.conf from your xubuntu server.

waydownsouth
July 7th, 2008, 08:21 PM
from fstab

3 shares:

//BOB/music /media/music cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0
//BOB/public /media/public cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0
//BOB/private /media/private cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

smb.conf as created by GSAMBAD


[global]
server string = BOB
workgroup = therapy
security = user
hosts allow = 127. 192.168.1.
interfaces = 127.0.0.1/8 192.168.1.1/24
remote announce = 192.168.1.255
remote browse sync = 192.168.1.255
printcap name = /etc/printcap
cups options = raw
log file = /var/log/samba/samba.log
max log size = 1000
username level = 8
password level = 8
unix password sync = yes
socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
local master = no
domain master = no
preferred master = no
os level = 33
logon drive = m:
logon home = \\%L\homes\%u
logon path = \\%L\profiles\%u
logon script = %G.bat
name resolve order = wins lmhosts bcast
wins server =
dns proxy = no
client use spnego = no
client signing = no
client schannel = no
server schannel = no
allow trusted domains = no
obey pam restrictions = yes
enable spoolss = yes
follow symlinks = no
update encrypted = yes
passwd chat timeout = 120
username map = /etc/samba/smbusers
passwd program = /usr/bin/passwd '%u'
passwd chat = *New*password* %n\n *ReType*new*password* %n\n *passwd*changed*\n
add user script = /usr/sbin/useradd -d /dev/null -c 'Samba User Account' -s /dev/null '%u'
add user to group script = /usr/sbin/useradd -d /dev/null -c 'Samba User Account' -s /dev/null -g '%g' '%u'
add group script = /usr/sbin/groupadd '%g'
delete user script = /usr/sbin/userdel '%u'
delete user from group script = /usr/sbin/userdel '%u' '%g'
delete group script = /usr/sbin/groupdel '%g'
add machine script = /usr/sbin/useradd -d /dev/null -g sambamachines -c 'Samba Machine Account' -s /dev/null -M '%u'
machine password timeout = 120
idmap uid = 16777216-33554431
idmap gid = 16777216-33554431
template shell = /dev/null
winbind use default domain = yes
winbind separator = @
winbind cache time = 360
winbind trusted domains only = yes
winbind nested groups = no
winbind nss info = no
; encrypt passwords = yes
; guest ok = no
; guest account = nobody

[homes]
comment = Home Directories
path = /home
read only = no
share modes = no
locking = no

[netlogon]
comment = Network Logon Service
path = /home/netlogon
read only = no
share modes = no
locking = no

[profiles]
comment = User Profiles
path = /var/samba/profiles
read only = no
browseable = no
locking = no
create mode = 0600
directory mask = 0700

[printers]
comment = All Printers
path = /var/spool/samba
printable = yes
share modes = no
locking = no

[pdf-documents]
path = /home/pdf-documents
comment = Converted PDF Documents
writeable = yes
guest ok = yes

[pdf-printer]
path = /tmp
comment = PDF Printer Service
printable = yes
guest ok = yes
use client driver = yes
printing = bsd
print command = /usr/bin/gsambadpdf %s %u
lpq command =
lprm command =

[bel]
path = /home/bel
comment = files
valid users = Bel
write list = Bel
writeable = yes
; available = yes
share modes = no
locking = no
; browseable = yes

[music]
path = /home/music
comment = music
valid users = wds
write list = wds
admin users = wds
writeable = yes
; available = yes
; browseable = yes
; printable = no
share modes = no
locking = no

[Private]
path = /home/private
comment = Private
valid users = wds
invalid users = Bel
write list = wds
admin users = wds
writeable = yes
; available = yes
; browseable = yes
; printable = no
share modes = no
locking = no

[public]
path = /home/public
comment = No comment
valid users = Bel, wds
write list = wds
admin users = wds
writeable = yes
; available = yes
; browseable = yes
; printable = no
share modes = no
locking = no

dmizer
July 7th, 2008, 08:37 PM
on the xubuntu server, please post the output of:
stat %a /home/music

waydownsouth
July 7th, 2008, 09:15 PM
therapy@BOB:~$ stat %a /home/music
stat: cannot stat `%a': No such file or directory
File: `/home/music'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 813h/2067d Inode: 7905281 Links: 8
Access: (0770/drwxrwx---) Uid: ( 1000/ therapy) Gid: ( 0/ root)
Access: 2008-07-08 09:47:22.000000000 +1200
Modify: 2008-07-08 09:49:48.000000000 +1200
Change: 2008-07-08 09:49:48.000000000 +1200

dmizer
July 7th, 2008, 09:32 PM
regarding the credentials file on your laptop, does it contain the user and password of your xubuntu server, or the user/password of your laptop?

waydownsouth
July 7th, 2008, 09:44 PM
just double checked,
its got the user/pass of my user name in samba on the xubuntu server

dmizer
July 7th, 2008, 09:51 PM
okay ... let's try this.

on your xubuntu server, add your laptop user like so:
sudo useradd -s /bin/true laptop-username
sudo smbpasswd -L -a laptop-username
sudo smbpasswd -L -e laptop-username
be sure to replace "laptop-username" with your actual laptop user name. also, make sure that when it asks for the password (on the second command), that you enter your laptop users password.

restart your samba server for good measure:
sudo /etc/init.d/samba restart

then update your credentials file on the laptop so that it contains your laptop username and password. remount, and see if that corrects your permission problems.

waydownsouth
July 7th, 2008, 10:29 PM
ok, did that, rebooted everything & its still doing the same.

any file I copy to the server from the laptop gets its owner status changed to root...

dmizer
July 7th, 2008, 10:45 PM
ha! i found it!

your problem is highlighted in red, below:
therapy@BOB:~$ stat %a /home/music
stat: cannot stat `%a': No such file or directory
File: `/home/music'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 813h/2067d Inode: 7905281 Links: 8
Access: (0770/drwxrwx---) Uid: ( 1000/ therapy) Gid: ( 0/ root)
Access: 2008-07-08 09:47:22.000000000 +1200
Modify: 2008-07-08 09:49:48.000000000 +1200
Change: 2008-07-08 09:49:48.000000000 +1200
this shows that the group owner of your shared folder is root. this is why your files are getting changed to root permissions.

to correct this problem, on your server, you need to change the group permissions for your share to your user with the following command:
sudo chgrp -R therapy /home/music
restart your samba server with this command:
sudo /etc/init.d/samba restart
then copy a file into your music folder from your laptop and see if it retains proper permissions. if it does, perform the same modification to the rest of your shares.

waydownsouth
July 7th, 2008, 11:12 PM
righto, changed the permissions on the server

therapy@BOB:~$ stat %a /home/music
stat: cannot stat `%a': No such file or directory
File: `/home/music'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 813h/2067d Inode: 7905281 Links: 6
Access: (0770/drwxrwx---) Uid: ( 1000/ therapy) Gid: ( 1000/ therapy)
Access: 2008-07-08 14:59:50.000000000 +1200
Modify: 2008-07-08 14:59:44.000000000 +1200
Change: 2008-07-08 14:59:44.000000000 +1200

still no joy...

then thought to add my login to the therapy group...

still no joy... :confused:

Am I getting to the point where I should set this all up from scratch again?

dmizer
July 7th, 2008, 11:23 PM
righto, changed the permissions on the server

therapy@BOB:~$ stat %a /home/music
stat: cannot stat `%a': No such file or directory
File: `/home/music'
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 813h/2067d Inode: 7905281 Links: 6
Access: (0770/drwxrwx---) Uid: ( 1000/ therapy) Gid: ( 1000/ therapy)
Access: 2008-07-08 14:59:50.000000000 +1200
Modify: 2008-07-08 14:59:44.000000000 +1200
Change: 2008-07-08 14:59:44.000000000 +1200

still no joy...

then thought to add my login to the therapy group...

still no joy... :confused:
well, at least things look okay for permissions on your server.

Am I getting to the point where I should set this all up from scratch again?
nope, i think we'll just need to include your laptop id as a samba user on your xubuntu server.

to do this, use the following commands:
sudo useradd -s /bin/true laptop-user
sudo smbpasswd -L -a laptop-user
sudo smbpasswd -L -e laptop-user
be sure to change "laptop-user" to your actual laptop users id. also, with the second command, be sure to enter the password you use to log into your laptop.

also, update your credentials file on your laptop, so that your laptop userid and password are in it instead of your xubuntu server user id and password.

restart your samba server again, remount the shares, and try to copy a file to your samba share again.

waydownsouth
July 7th, 2008, 11:46 PM
and thats still a negative...

dmizer
July 8th, 2008, 12:12 AM
try copying a file into the music share from your xp machine, and post the output of
ls -l /home/music

waydownsouth
July 8th, 2008, 12:29 AM
it would appear that the XP machine does the same... hmmm, I thought it was all good :(

-rwxr--r-- 1 root users 37 2008-07-08 16:14 this is a test file from XP.txt

as compared to:

drwxrwx--- 14 therapy therapy 4096 2008-07-05 17:12 Music

this is a file saved via the laptop:

-rwxr--r-- 1 root therapy 8439412 2008-07-08 15:36 file from laptop.pdf

dmizer
July 8th, 2008, 04:22 AM
can you link me to the howto you used to create that smb.conf?

waydownsouth
July 8th, 2008, 04:31 PM
The smb.conf file was created with the gui program GSAMBAD, having looked into samba a little more it seems overly complex for what my needs are. Would you agree?

One idea that has been bugging me, as I did have the root account enabled on the laptop which is now disabled (I think?), could this have somehow messed with the default permissions etc of the inner workings of my OS?

I'm still coming to terms with the whole sudo vs su idea so I apologize for the newbie question, but hey, I am a newbie... :)

dmizer
July 8th, 2008, 07:26 PM
seems way overly complex, but i'm not sure what you're trying to do. having root access and then subsequently disabling it would have had no effect on this issue as far as i know. this appears to be more closely related to your samba server setup.

have a look at the first link in my sig. i'm positive that the smb.conf example in that howto works.

waydownsouth
July 8th, 2008, 08:14 PM
Roger that,

I guess I was looking for an quick & easy way to set up samba using a gui, I blame way to many years using Windows and being stuck in that mindset.

I did a bit of googling and came up with a couple of similar issues:

here (http://ubuntuforums.org/showthread.php?t=12131) and here (http://blog.andrewbeacock.com/2006/06/solving-ubuntu-permission-problems.html)

But, I'm not sure if that relates to what we've been trying to fix.

Having read into samba a bit more, it doesn't seem all that hard to manually configure... especially as I'm only looking to facilitate basic file sharing. So I might just start from scratch...

Thanks for your input and patience... I'll let you know how I get on

dmizer
July 8th, 2008, 08:22 PM
well, either way you'll have to address your smb.conf configuration because you said you were having problems with windows permissions as well.

both of the links you posted are talking about permission problems with smbfs not cifs. they are also both quite old, and i'm quite sure that the solution posted in the second link will no longer be successful.

waydownsouth
July 8th, 2008, 08:47 PM
Figured as much with regards to smbfs & the relative age of the info.

Hence why I'm starting again...

waydownsouth
July 8th, 2008, 11:08 PM
Ok,

I started everything from scratch and ended up with the same result...:confused:

But, having done a bit more reading, I found something that seems to work:

in the smb.conf file, when I added the line:

inherit owner = Yes

under each share, it all started working as it should...

:guitar:

imthemp3king
July 17th, 2008, 11:18 AM
Thank you for these well-written instructions. Perhaps you can help me with this problem. After mounting, I can change directory ( to several levels in the mount), create directory and list directories. But if I try to read a file (with cat or more) the terminal hangs following error in kern.log:

CIFS VFS: RFC1001 size 135 bigger than SMB for Mid=48
Bad SMB: : dump of 48 bytes of data at 0xdebff380

I am running a fully patched Hardy and my /etc/fstab entry for the mount is:
//abcdef/HOME /media/documents cifs auto,iocharset=utf8,uid=abc,gid=abc,credentials=/root/.cifscredentials,file_mode=0755,dir_mode=0755 0 0

I have searched in vain for clues as to where the fault may lie, but have had no success. Have you seen this type of error before?

Many thanks.

Just thought I would add some info to this since I didn't see an explanation to this particular issue. I am experiencing the same issue that earthenergie reported above. Googling and speaking with our storage admin here at work provided this link
http://kbase.redhat.com/faq/FAQ_103_11046.shtm (http://kbase.redhat.com/faq/FAQ_103_11046.shtm)

The EMC case referenced in that link states the following:
Environment: Product: Celerra

Environment: EMC SW: NAS Code 5.5.26.x and earlier

Environment: Protocol: Server Message Block (SMB)

Environment: Protocol: Common Internet File System (CIFS)

Environment: OS: SuSE Linux 10.2 (2.6.18 Kernel, 1.45 CIFS)

Environment: OS: Fedora Core 6 (2.6.20 Kernel, 1.47 CIFS)

Problem: After recent Linux upgrade, accessing CIFS shares causes Linux CIFS client to hang or possibly panic.

Problem: Celerra server log contains the following or similar error messages when a client attempts to read a file:

SMB: 3: Client=10.0.0.1 OS='Linux version 2.6.20-1.2925.fc6', LM='CIFS VFS Client for Linux' not registered capa=0xd0dc (R=8/8)

SMB: 3: Client=10.0.0.1 OS=Linux version 2.6.20-1.2925.fc6 LM=CIFS VFS Client for Linux Extra=- type=- (1)

SMB: 3: Client=10.0.0.1 OS='Linux version 2.6.20-1.2925.fc6', LM='CIFS VFS Client for Linux' not registered capa=0xd0dc (R=8/8)

SMB: 3: Client=10.0.0.1 OS=Linux version 2.6.20-1.2925.fc6 LM=CIFS VFS Client for Linux Extra=- type=- (1)



Change: Recent upgrade to Linux client.

Root Cause: EMC DART OS was modified to return extended response to NTcreateX only if the bit 0x10 is set in the Create Flag, instead of assuming the extended info is required for a Windows 2000 client (see below). With the code modification, the extended response is only returned when the Extended Response Create Flag is set.

Affected versions include:



Fedora Core 6 (32-bit)

Kernel: 2.6.20-1.2925

CIFS Module Version: 1.47



SuSe Linux 10.2

Kernel: 2.6.18.2-34-default

CIFS Module Version: 1.45



SMB Header

NT Create AndX Request

Create Flags: 0x00000010

.... .... .... .... .... .... ...1 .... = Extended Response: Extended responses required

.... .... .... .... .... .... .... 0... = Create Directory: Target of open can be a file

.... .... .... .... .... .... .... .0.. = Batch Oplock: Does NOT request batch oplock

.... .... .... .... .... .... .... ..0. = Exclusive Oplock: Does NOT request oplock

Fix: Upgrade to NAS Code 5.5.27.5 or later.

Notes: See AR 87272 for more information.
Hopefully this information helps. As for testing the above, we have 2 Celerra NAS device from EMC, one with a newer code level and I can browse files on it without a problem. The other has the code referenced and Gnome just spins it's wheels when trying to browse

dmizer
July 17th, 2008, 11:30 AM
Just thought I would add some info to this since I didn't see an explanation to this particular issue.
thank you so much for the follow up. i couldn't come up with anything myself. glad to have your experience in the thread.

sputnikkk
July 23rd, 2008, 12:40 AM
This tutorial rocked my world for my Win2k Advanced Server and Win2k shares on the home lan. Desktop rig is Ubuntu 8.04 Hardy Heron. All 7 of my windows shares show up as sexy little Hard Drive ICONS on the desktop.

Thank you my good man!

Chewiesw
July 23rd, 2008, 06:19 AM
Thanks for the great guide, I have manged to mount everything I need. My only problem is that my network connection is a little slow. I am using a wireless connections that activates using a script in the .rc file, which I presume executes after the fstab file, so my shares won't mount until I run the mount -a cmd. Is there antway I can automate this mount -a cmd so I don't have to do it manually everytime ?

dmizer
July 23rd, 2008, 06:30 AM
Thanks for the great guide, I have manged to mount everything I need. My only problem is that my network connection is a little slow. I am using a wireless connections that activates using a script in the .rc file, which I presume executes after the fstab file, so my shares won't mount until I run the mount -a cmd. Is there antway I can automate this mount -a cmd so I don't have to do it manually everytime ?

edit /etc/rc.local
sudo nano /etc/rc.local
add this line:
mount -a
on a new line after your wireless script.

save the file, and that should remedy your problem.

Bernie01
July 24th, 2008, 06:10 AM
Hello, I hope I am in the right place. I have followed the initial instructions at the start of this post and got to "sudo mount -a" with the following result

"mount error: could not find target server. TCP name bernie-vista/music not found
No ip address specified and hostname not found"

I wasn't sure what to do next and read on to "smbtree" This produced

"WORKGROUP
\\MATT-PC
cli_rpc_pipe_open: cli_nt_create failed on pipe \srvsvc to machine MATT-PC. Error was NT_STATUS_ACCESS_DENIED
\\MAIN Main
\\MAIN\Printer Intuit Internal Printer
\\MAIN\Printer2 Change save options with Printer Properties.
\\MAIN\operate sys
\\MAIN\Printer5 Canon MF4200 Series UFRII LT
\\MAIN\Printer4 hp deskjet 3820 series (Copy 1)
\\MAIN\Printer6 Canon MF4200 Series (FAX)
\\MAIN\SharedDocs
\\MAIN\print$ Printer Drivers
\\MAIN\IPC$ Remote IPC
\\BERNIE-VISTA
\\BERNIE-VISTA\Public
\\BERNIE-VISTA\print$ Printer Drivers
\\BERNIE-VISTA\PageManager PDF Writer Change save options with Printer Properties.
\\BERNIE-VISTA\Music Located on Vista PC as G: Drive
\\BERNIE-VISTA\J$ Default share
\\BERNIE-VISTA\IPC$ Remote IPC
\\BERNIE-VISTA\I$ Default share
\\BERNIE-VISTA\H$ Default share
\\BERNIE-VISTA\G$ Default share
\\BERNIE-VISTA\F$ Default share
\\BERNIE-VISTA\Canon MF4200 Series UFRII LT Canon MF4200 Series UFRII LT
\\BERNIE-VISTA\Canon MF4200 Series (FAX) Canon MF4200 Series (FAX)
\\BERNIE-VISTA\C$ Default share
\\BERNIE-VISTA\ADMIN$ Remote Admin
\\BERNIE-MINT Samba 3.0.28a
\\BERNIE-MINT\IPC$ IPC Service (Samba 3.0.28a)"

I am not concerned about 'MATT" and 'MAIN" appears to do what I want but 'BERNI-VISTA" is still causing problems and I have no idea where to go from here. Can anybody point me in the right direction?

dmizer
July 24th, 2008, 06:15 AM
Linux is case sensitive, so bernie-vista/music is not the same as bernie-vista/Music

try capitalizing Music in your fstab line and see if you're able to connect then.

Bernie01
July 24th, 2008, 06:21 AM
Thanks for the quick reply dmizer but I still get exactly the same messages. Is there something else I can try?

dmizer
July 24th, 2008, 09:35 AM
Thanks for the quick reply dmizer but I still get exactly the same messages. Is there something else I can try?

humm, i was pretty sure that would fix things for you.

did you configure winbind as outlined under "prework"? are you using any kind of firewall?

can you post your fstab line please?

Bernie01
July 24th, 2008, 09:52 AM
I have managed to crash my system and have only just completed reinstalling. I will rework your guide and then post my fstab file.

Interestingly the LiveCD will read Bernie-Vista but not the installed version. Even the fresh instal

Bernie01
July 25th, 2008, 08:29 AM
My system is rebuilt and I have reworked your guide. Here is my fstab file

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda2
UUID=8fb6e396-2fe0-4b44-a1ae-9578310d597b / ext3 relatime,errors=remount-ro 0 1
# /dev/sda4
UUID=09A8-7D8D /windows vfat utf8,umask=007,gid=46 0 1
# /dev/sda1
UUID=6771186a-124d-06b3-ec58-3965eb7d0248 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
//BERNIE-VISTA/vista-data /media/vista-data cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0

My current error message is

"sudo mount -asudo gedit
mount: wrong fs type, bad option, bad superblock on //BERNIE-VISTA/vista-data,

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
"

I have run dmesg | tail and the result from that is:-

"dmesg | tail

[ 132.929786] usb-storage: device scan complete

[ 132.936801] scsi 4:0:0:0: Direct-Access General Flash Disk Drive 3.10 PQ: 0 ANSI: 2

[ 132.943785] scsi 4:0:0:1: Direct-Access General Flash Disk Drive 3.10 PQ: 0 ANSI: 2

[ 132.954806] sd 4:0:0:0: [sdb] Attached SCSI removable disk

[ 132.954872] sd 4:0:0:0: Attached scsi generic sg2 type 0

[ 132.965795] sd 4:0:0:1: [sdc] Attached SCSI removable disk

[ 132.965854] sd 4:0:0:1: Attached scsi generic sg3 type 0

[ 1741.059360] cdrom: This disc doesn't have any tracks I recognize!

[ 2635.248028] CIFS VFS: No username specified

[ 2635.248038] CIFS VFS: cifs_mount failed w/return code = -22
"

which means nothing at all to me.

Am I getting anywhere with this?

dmizer
July 25th, 2008, 10:35 AM
try this:
sudo aptitude install smbfs
then retry your mount and see if you still get the same error.

Bernie01
July 27th, 2008, 05:54 AM
Thankyou dmizer it all works now. I had installed smbfs previously but as soon as I installed it again everything worked.

It is fantastic to be able to access such assistance and patience as can be ound on this forum

Thankyou again.

Cheers, Bernie

zeezam
July 29th, 2008, 10:18 AM
Still getting the "mount error 13 = Permission denied" error message when I'm using this in fstab:

//192.168.0.100/fred /media/fred cifs credentials=/root/.smbcredentials,rw,nounix,iocharset=utf8,file_mode =0777,dir_mode=0777 0 0

I try to connect to share from windows servers.
I use a credential file with username='user name'
password='pass word'

The user have administrative rights and can access everything from a windows xp machine.

thanks

dmizer
July 29th, 2008, 07:00 PM
Still getting the "mount error 13 = Permission denied" error message when I'm using this in fstab:

//192.168.0.100/fred /media/fred cifs credentials=/root/.smbcredentials,rw,nounix,iocharset=utf8,file_mode =0777,dir_mode=0777 0 0



Make sure you use the netbios name instead of the IP address. Enable wins support as outlined under "Pre Work".

This DOES make a difference.

zeezam
July 30th, 2008, 03:03 AM
Make sure you use the netbios name instead of the IP address. Enable wins support as outlined under "Pre Work".

This DOES make a difference.

Did those settings and restarted networking in /etc/init.d.
Still the same:

# mount -a
mount: mount point does not exist
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)

dmizer
July 30th, 2008, 03:07 AM
do your windows username or password contain spaces or other unusual characters?

zeezam
July 30th, 2008, 05:45 AM
do your windows username or password contain spaces or other unusual characters?

Yes. I did try with username='my username'
password='my password'

dmizer
July 30th, 2008, 08:57 AM
Try it without the ' around it. The credentials file does not support usernames or passwords with leading spaces, but the man file doesn't say anything special about spaces in any other location.

zeezam
July 30th, 2008, 10:32 AM
Try it without the ' around it. The credentials file does not support usernames or passwords with leading spaces, but the man file doesn't say anything special about spaces in any other location.

Thanks now it worked when I removed the ' around '.

dmizer
July 30th, 2008, 11:00 AM
Thanks now it worked when I removed the ' around '.

Fantastic! That's really good to know.

rastem
August 6th, 2008, 11:58 PM
Hey dmizer,

I've read through a lot of this forum, and saw a lot of great help, thanks for helping all us ubuntu babies out. :)

I've run into a problem with mounting windows vista shares. I'm on hardy.

I've followed the step-by-step, having installed smbfs and have wins support. Still, when I try to mount my windows share permanently I get this error:

rastem@MediaCenter:~$ sudo mount -a
retrying with upper case share name
mount error 6 = No such device or address
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)


fstab
# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda6
UUID=200497fd-8b90-479f-b7f5-232b8dfc5d18 / ext3 relatime,errors=remount-ro 0 1
# /dev/sdb5
UUID=dc873d9d-e8ba-469d-aa41-7ce76038daaa /home ext3 relatime 0 2
# /dev/sda5
UUID=1fe1161e-af21-4dc8-979e-7beb34ae0b5e none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0
//sinistar/deep%20space /media/metroid cifs credentials=/root/.smbcredentials,rw,noperm,iocharset=utf8,file_mode =0777,dir_mode=0777 0 0


dmesg | tail
CIFS VFS: cifs_mount failed w/return code = -6


vdir /media
total 12
lrwxrwxrwx 1 root root 6 2008-08-06 19:15 cdrom -> cdrom0
drwxr-xr-x 2 root root 4096 2008-08-06 19:15 cdrom0
lrwxrwxrwx 1 root root 7 2008-08-06 19:15 floppy -> floppy0
drwxr-xr-x 2 root root 4096 2008-08-06 19:15 floppy0
drwxr-xr-x 3 root root 4096 2008-08-06 22:57 metroid


smbtree
rastem@MediaCenter:~$ smbtree
Password:
WORKGROUP
\\SINISTAR


Sinistar is the name of the vista computer. I can ping via wins and IP, and I can also connect to the folder via Places -> Connect to server

Am I missing something obvious? I've seen a lot of folks talking about different errors, but not much on error 6. It's either something wily, or cockpit error on my part, but I wanted to throw it up here.

Any help is greatly appreciated!

J.

dmizer
August 7th, 2008, 01:21 AM
Heh ... "I hunger!"

Looks like you've escaped your space incorrectly. Try your fstab line like so:
//sinistar/deep\040space /media/metroid cifs credentials=/root/.smbcredentials,rw,noperm,iocharset=utf8,file_mode =0777,dir_mode=0777 0 0
If that doesn't work, try creating a new test share without a space in the directory name, and see if you can connect to that.

It would so help if little things like this were standardized so that %20 always worked, or \040 always worked.[/rant]

rastem
August 7th, 2008, 03:48 AM
That did the trick, you are my hero!

Nowhere in my research did I find that spaces could cause this issue, though I had a sneaking suspicion it had to be that since 'no such device or address' kept hinting at me that it was something like that.

Thanks so much for the easy-to-follow walkthrough and your help! I can't wait to hit up amarok now.

J.

dmizer
August 7th, 2008, 04:13 AM
That did the trick, you are my hero!

Nowhere in my research did I find that spaces could cause this issue, though I had a sneaking suspicion it had to be that since 'no such device or address' kept hinting at me that it was something like that.

Thanks so much for the easy-to-follow walkthrough and your help! I can't wait to hit up amarok now.

J.

Fantastic!

Easiest fix I've had all day. :)

Squizzle
August 7th, 2008, 08:18 PM
Just followed your permanent mount method, perfect, exactly what I needed to have my networked music in Amarok, thanks so much :)

TTTamer
August 11th, 2008, 11:41 AM
thanks a lot dmizer!!!!! Finally get my vista files!!! \\:D/\\:D/

Covn
August 18th, 2008, 11:34 AM
Im getting the same error as some has reported as well. This is my fstab:

//fredrik/Downloads /media/fileserver cifs credentials=/root/.smbcredentials,nounix,iocharset=utf8,file_mode=07 77,dir_mode=0777 0 0

and this is the error it produces:

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

For reference, I made a useraccount in Vista with ubuntu/ubuntu as username/password.

.smbcredentials:

username=ubuntu
password=ubuntu


Thanks.

Edit: I used a manual mount command instead of fstab now, and it worked. strange.

sudo mount -t cifs //fredrik/Downloads /media/fileserver -o username=ubuntu,password=ubuntu,iocharset=utf8,fil e_mode=0777,dir_mode=0777

dmizer
August 18th, 2008, 07:24 PM
Does "ubuntu" have permission to view the vista shares on vista?

Have you tried:
sudo aptitude install smbfs
That's been the most common fix for this error.

Covn
August 19th, 2008, 05:31 AM
Does "ubuntu" have permission to view the vista shares on vista?

Have you tried:
sudo aptitude install smbfs
That's been the most common fix for this error.

the user ubuntu got the permissions set. I did try sudo aptitude install smbfs.

dmizer
August 19th, 2008, 07:02 AM
Okay, please post your fstab line, as well as the output of:
smbtree

Covn
August 19th, 2008, 07:43 AM
Fstab:

//fredrik/Downloads /media/fileserver cifs credentials=/root/.smbcredentials,nounix,iocharset=utf8,file_mode=07 77,dir_mode=0777 0 0[/codesfredrik@fredrik-laptop:~$ smbtree



smbtree:

Password:
\\FREDRIK-LAPTOP fredrik-laptop server (Samba, Ubuntu)
\\FREDRIK-LAPTOP\Epson Printer i annen etasje
\\FREDRIK-LAPTOP\PDF PDF
\\FREDRIK-LAPTOP\Stylus_Photo_R200 EPSON Stylus Photo R200
\\FREDRIK-LAPTOP\IPC$ IPC Service (fredrik-laptop server (Samba, Ubuntu))
\\FREDRIK-LAPTOP\print$ Printer Drivers
\\FREDRIK

mentose457
August 22nd, 2008, 12:54 AM
I am new to Linux and Ubuntu so yes, i am stupid and i dont know what im doing. Anyway i am having some problems getting my network setup. I followed all of the steps in your post but had some spelling errors (i could be the worlds worst speller). so when i type "sudo mount -a" i get the following error:

brent@brent-laptop:~$ sudo mount -a
mount error: can not change directory into mount target /media/C

What does that mean and how can i fix it? Any advice would be appreciated. Thanks

dmizer
August 22nd, 2008, 02:36 AM
I am new to Linux and Ubuntu so yes, i am stupid and i dont know what im doing. Anyway i am having some problems getting my network setup. I followed all of the steps in your post but had some spelling errors (i could be the worlds worst speller). so when i type "sudo mount -a" i get the following error:

brent@brent-laptop:~$ sudo mount -a
mount error: can not change directory into mount target /media/C

What does that mean and how can i fix it? Any advice would be appreciated. Thanks

Please post the output of:
ls /media

TwiceOver
August 22nd, 2008, 07:24 PM
******FEISTY USERS******
If you see an error on 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

please see the fix provided in this link: http://ubuntuforums.org/showthread.php?t=293513
*thanks to incoming429 for testing the fix on this error.

This affects Hardy also (me at least) the fix still works.

dwitkin
August 30th, 2008, 07:53 PM
dmizer,

I'm hoping you can help me. I used to be able to mount a Windows PC network drive / share, but I've messed it up somehow.

Share and folder: //MEDIA-PC/dwitkin
IP Address of PC: 192.168.1.100

When I use smbtree, I get:
dave@dave-laptop:~$ smbtree
Password:
failed tcon_X with NT_STATUS_ACCESS_DENIED
failed tcon_X with NT_STATUS_ACCESS_DENIED
dave@dave-laptop:~$


I've tried a few things:
1. I've shut down the firewall on the windows server, and still the same thing.
2. I can successfully ping the PC using either the IP address or the pc name.
3. I tried mounting using the IP address rather than the name of the server. No luck, same thing.
4. I made sure that winbind, samba, smbfs and smbclient are installed
5. I tried:
dave@dave-laptop:~$ smbclient -L //192.168.1.100/dwitkin
Error connecting to 192.168.1.100 (Connection refused)
Connection to 192.168.1.100 failed (Error NT_STATUS_CONNECTION_REFUSED)


Can you walk me through some additional troubleshooting steps?

Your help and expertise is appreciated...

dmizer
August 30th, 2008, 08:58 PM
Hi dwitkin,

Is there a firewall in place on the Ubuntu machine as well? To double check, please post this command:
sudo iptables -L

The output should look like this:
$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Do you also have a samba server configured to share files from Ubuntu to Windows? If so, please post the contents of /etc/samba/smb.conf

dwitkin
August 31st, 2008, 01:06 PM
Hi dwitkin,

Is there a firewall in place on the Ubuntu machine as well? To double check, please post this command:
sudo iptables -L

The output should look like this:
$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Do you also have a samba server configured to share files from Ubuntu to Windows? If so, please post the contents of /etc/samba/smb.conf

dmizer,

Thanks for the quick response and help. I just realized that now I can't print to my network printers (which are attached the the windows PC also), which makes it even more urgent for me to solve this.

In any case, no, I don't think I have a firewall setup on the ubuntu machine (my laptop). Here is the output from the iptables command you suggested:

dave@dave-laptop:~$ sudo iptables -L
[sudo] password for dave:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
dave@dave-laptop:~$


On your second question, no, I don't currently use samba to share files from Ubuntu (my laptop) to Windows.

Let me know what you suggest next. In the meantime, I think I'm going to try uninstalling and re-installing Samba and the other related packages... worth a shot.

dmizer
August 31st, 2008, 08:01 PM
dwitkin,

On the Ubuntu computer, please post the output of the following command:
uname -n

Also, post the contents of /etc/hosts

dwitkin
August 31st, 2008, 09:14 PM
dmizer,

Nevermind... figured it out. Actually, I think you might have guessed the answer because you asked me to post my hosts file. It turns out that the Hosts file was the culprit. Many months ago, I added my home server to the hosts file pretending it had a static IP address because that was the only way I could figure out how to address it from my Ubuntu laptop. I have maybe 5 ip-addressable devices on my network, but my home pc server usually has 192....100. Usually, but not always... I got the connection denied message because another device too the IP address I hard-coded into the Hosts file. Ugh.

Any idea of where there is a good how-to on getting ubuntu to figure out the right IP address from the host name without hard-coding it into the Hosts file?

In any case, again, I appreciate your help.

dmizer
August 31st, 2008, 09:24 PM
Glad you got it sorted!

Just a quick run through on name resolution because that's not really what this howto is about but this should get you started:

I use winbind and samba for my local name resolution. At least one computer on your network will need to have a properly configured samba server (Windows or Ubuntu. For configuring an Ubuntu samba server, see the first link in my sig), then (on all Ubuntu computers in your network) follow the steps in this howto under "Pre-work" below where it says, "To mount a windows share on a DHCP network, it is convenient to be able to mount by netbios name ..."

Make a backup of your current hosts configuration for safety's sake, and then remove all the hand configured stuff. Reboot the network, and you should have DHCP name resolution.

There are other ways as well, like Bind9 for example. You can look for more information at http://help.ubuntu.com

zwyber
September 2nd, 2008, 10:11 AM
Great Guide!!!

I fall in love with Geany but it didn't support network shares :S Now I have found this guide I can use Geany! \\:D/

I use a temp mount, but using desktop icons to mount or unmount it. If you want to do it too:

Replace sudo with gksu and put double quotes around the command. Voila!

This guide really makes me realise that even if it doesn't work out of the box, you can still make it work using guides like this one!

With Windows if it doesn't work it doesn't work. No other way out.

Thanks again!
Paul

suzypeppercorn
September 8th, 2008, 01:50 PM
i have just recently ran into a problem. anything i write to my network folder is owned by root.

has anyone else run into this problem?

dmizer
September 8th, 2008, 09:22 PM
i have just recently ran into a problem. anything i write to my network folder is owned by root.

has anyone else run into this problem?

I've seen this a number of times. First, I need to know some information about your setup.

What OS is hosting the share?
What is the exact line you're using to mount the share?
Have you enabled the root account?
Is there more than one linux computer accessing the share?

suzypeppercorn
September 8th, 2008, 11:46 PM
i'm not for sure what Os is handling the share because this is my network drive at my college. I assume its windows but i'm not for sure. This is my line to mount the share.

//student/gilberjp$ /media/NDrive cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0

What do you mean have i enabled the root account? I don't follow. Is there a way to figure it out. And no i am the only one who has access to this share and this is the only machine i have any form of linux on.

Thanks for the troubleshooting help. Its appreciated.

dmizer
September 9th, 2008, 12:07 AM
i'm not for sure what Os is handling the share because this is my network drive at my college. I assume its windows but i'm not for sure. This is my line to mount the share.

//student/gilberjp$ /media/NDrive cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0
Try this line:
//student/gilberjp$ /media/NDrive cifs credentials=/root/.smbcredentials,nounix,iocharset=utf8,file_mode=07 77,dir_mode=0777 0 0

What do you mean have i enabled the root account? I don't follow. Is there a way to figure it out.
Don't worry about it. If you had done so, you would know it. There's no need to enable it, but if you had, it may cause this problem.

And no i am the only one who has access to this share and this is the only machine i have any form of linux on.

Thanks for the troubleshooting help. Its appreciated.
It's no problem, hope that gets you working.

suzypeppercorn
September 9th, 2008, 09:42 AM
i tried the new line in my fstab and i even restarted my system and the problem is still there.

I'm so confused as to why this isn't working. Any other ideas? Could it be something that i didn't set correctly with my permissions?

dmizer
September 9th, 2008, 10:33 AM
i tried the new line in my fstab and i even restarted my system and the problem is still there.

I'm so confused as to why this isn't working. Any other ideas? Could it be something that i didn't set correctly with my permissions?

The answer to this problem exists in this thread somewhere. I'm not too sure exactly where though so I'll have to dig a bit, and I'm under some tight deadlines at work.

I'll do what I can to find the answer as soon as possible though. I know it's probably critical for you to have this access.

suzypeppercorn
September 9th, 2008, 10:52 AM
i looked through most of the thread and someone had almost the exact same problem and they said their solution was to add a line to the end of their samba.conf file of something close to that.

The line was inherit owner yes or something similar. I tried that before and it didn't work. I'm not if i completely understood the directions though.

Its not really that critical for me as i only use my network drive for backups and storage. I use it incase my laptop crashes or something. And plus i have windows on here and i can access my network drive from there fine. If you got work you don't have to rush around for me. Just whenever you get some free time we can try and fix this.

Thanks for the help man

dmizer
September 11th, 2008, 07:04 AM
Okay, let's take a deeper look at things. Please post the output of:
ls -l /media/NDrive
and
ls -n /media/NDrive
and
cat /etc/passwd | grep ubuntu-username
replace ubuntu-username with your actual ubuntu user name.

suzypeppercorn
September 11th, 2008, 09:54 PM
ls -l /media/NDrive

ls -l /media/NDrive
total 1
drwxrwxrwx 1 root root 0 2008-08-28 10:37 Backups
-rwxrwxrwx 1 root root 79 2008-09-11 12:56 desktop.ini
drwxrwxrwx 1 root root 0 2008-09-11 12:56 My Music
drwxrwxrwx 1 root root 0 2008-09-11 12:56 My Pictures
drwxrwxrwx 1 root root 0 2007-09-13 17:03 RECYCLER
drwxrwxrwx 1 root root 0 2008-09-08 19:57 School Work


$ ls -n /media/NDrive
total 1
drwxrwxrwx 1 0 0 0 2008-08-28 10:37 Backups
-rwxrwxrwx 1 0 0 79 2008-09-11 12:56 desktop.ini
drwxrwxrwx 1 0 0 0 2008-09-11 12:56 My Music
drwxrwxrwx 1 0 0 0 2008-09-11 12:56 My Pictures
drwxrwxrwx 1 0 0 0 2007-09-13 17:03 RECYCLER
drwxrwxrwx 1 0 0 0 2008-09-08 19:57 School Work

cat /etc/passwd | grep joe

joe:x:1000:1000:Joe,,,:/home/joe:/bin/bash

hows it looking?

dmizer
September 11th, 2008, 10:07 PM
Okay, lets try changing the ownership on one directory for testing:
sudo chown -R joe:joe /media/NDrive/RECYCLER
Run this command again:
ls -l /media/NDrive
If the output shows this:
drwxrwxrwx 1 joe joe 0 2007-09-13 17:03 RECYCLER
Then try to unmount and remount the drive to see if the permissions are persistent. If they are persistent, try running the same command on the rest of the directories. It's entirely possible that it was simply a glitch on the server side.

iamshawnrice
September 11th, 2008, 11:42 PM
I followed the directions to a T, but when I tested, this came up:

wawny@sgt-pepper:~$ sudo mount -a
mount error: could not find target server. TCP name netbiosname/WAWNY. not found
No ip address specified and hostname not found


I can confirm that the Netbiosname and Share name are correct.

Any ideas?

dmizer
September 12th, 2008, 01:54 AM
I followed the directions to a T, but when I tested, this came up:

wawny@sgt-pepper:~$ sudo mount -a
mount error: could not find target server. TCP name netbiosname/WAWNY. not found
No ip address specified and hostname not found


I can confirm that the Netbiosname and Share name are correct.

Any ideas?

Please post your fstab line, as well as the output of:
smbtree

suzypeppercorn
September 12th, 2008, 01:36 PM
Okay, lets try changing the ownership on one directory for testing:
sudo chown -R joe:joe /media/NDrive/RECYCLER
Run this command again:
ls -l /media/NDrive
If the output shows this:
drwxrwxrwx 1 joe joe 0 2007-09-13 17:03 RECYCLER
Then try to unmount and remount the drive to see if the permissions are persistent. If they are persistent, try running the same command on the rest of the directories. It's entirely possible that it was simply a glitch on the server side.

I tried these instructions out and everything worked great. I unmounted and remounted and the ownership was still mine. So i changed the ownership for everything to mine using the command you provided. Everything worked great.

However, anything i copy to the server is still owned by the root. Here is my updated ownerships. epic.txt is the file i just copied over to the NDrive. Why is everything owned by the root by default? Its almost as if root is copying over the files.

Maybe my account doesn't have permissions to copy files to a server? Here is what i get when i run ls -l /media/NDrive.

joe@joe-PC:~$ ls -l /media/NDrive
total 5
drwxrwxrwx 1 joe joe 0 2008-08-28 10:37 Backups
-rwxrwxrwx 1 joe joe 79 2008-09-11 12:56 desktop.ini
-rw-r--r-- 1 root root 995 2008-09-12 13:34 epic.txt
drwxrwxrwx 1 joe joe 0 2008-09-11 12:56 My Music
drwxrwxrwx 1 joe joe 0 2008-09-11 12:56 My Pictures
drwxrwxrwx 1 joe joe 0 2007-09-13 17:03 RECYCLER
drwxrwxrwx 1 joe joe 0 2008-09-08 19:57 School Work

dmizer
September 12th, 2008, 01:50 PM
Okay, try adding the noperm option like so:
//student/gilberjp$ /media/NDrive cifs credentials=/root/.smbcredentials,nounix,noperm,iocharset=utf8,file_ mode=0777,dir_mode=0777 0 0

suzypeppercorn
September 12th, 2008, 03:47 PM
Okay, try adding the noperm option like so:
//student/gilberjp$ /media/NDrive cifs credentials=/root/.smbcredentials,nounix,noperm,iocharset=utf8,file_ mode=0777,dir_mode=0777 0 0


This did the trick for me. I can copy files to it and still edit the and everything. However, when i run the commandls -l /media/NDrive, this is the output.

total 1
drwxrwxrwx 1 root root 0 2008-09-12 15:36 Backups
-rwxrwxrwx 1 root root 79 2008-09-11 12:56 desktop.ini
drwxrwxrwx 1 root root 0 2008-09-11 12:56 My Music
drwxrwxrwx 1 root root 0 2008-09-11 12:56 My Pictures
drwxrwxrwx 1 root root 0 2007-09-13 17:03 RECYCLER
drwxrwxrwx 1 root root 0 2008-09-12 15:37 School Work


It still says everything is owned by the root. Should this be something to worry about? Is it only doing this because it is ignoring permissions? Also, i was thinking of trying to get rsync to backup my files to my NDrive using cron to automate the process to a schedule . I have read that i might have to give cron root permissions to run successfully. Do you think cron and rsync with root permissions copying files over to the NDrive will have any bad effects on the permissions we have just fixed?

Thank you so much for all the troubleshooting help!!

dmizer
September 12th, 2008, 08:16 PM
This did the trick for me. I can copy files to it and still edit the and everything. However, when i run the commandls -l /media/NDrive, this is the output.

total 1
drwxrwxrwx 1 root root 0 2008-09-12 15:36 Backups
-rwxrwxrwx 1 root root 79 2008-09-11 12:56 desktop.ini
drwxrwxrwx 1 root root 0 2008-09-11 12:56 My Music
drwxrwxrwx 1 root root 0 2008-09-11 12:56 My Pictures
drwxrwxrwx 1 root root 0 2007-09-13 17:03 RECYCLER
drwxrwxrwx 1 root root 0 2008-09-12 15:37 School Work


It still says everything is owned by the root. Should this be something to worry about? Is it only doing this because it is ignoring permissions? Also, i was thinking of trying to get rsync to backup my files to my NDrive using cron to automate the process to a schedule . I have read that i might have to give cron root permissions to run successfully. Do you think cron and rsync with root permissions copying files over to the NDrive will have any bad effects on the permissions we have just fixed?

Thank you so much for all the troubleshooting help!!

No problem. Yes, the new option is simply ignoring the permissions locally. Since the permissions on the server are correct, it won't matter anymore if the shares show root locally.

Enjoy your newfound freedom ... :)

suzypeppercorn
September 14th, 2008, 04:42 PM
No problem. Yes, the new option is simply ignoring the permissions locally. Since the permissions on the server are correct, it won't matter anymore if the shares show root locally.

Enjoy your newfound freedom ... :)

thanks so much for the help. i'll definitely enjoy the freedom.

timjak
September 17th, 2008, 11:25 PM
Hey - thanks for this. A cutdown version of these instructions(which didn't require any software installs) worked in fixing my problem with EEEPCs (running Xandros) accessing files on our Windows Server 2003 network. :)

dwitkin
September 21st, 2008, 05:11 PM
dmizer -

Hello. I'm having a new issue mounting a samba share and am hoping you can help. My hope is that you can give me some commands to use to help better troubleshoot this problem.

I am running Ubutnu 8.04 from my laptop. Using my home wireless network, I am trying to mount a share on a Window XP PC.

In the past, I think I was able to connect to my share with the same configuration as I'm currently using; I think this problem is intermittent. Sometimes, I login to my Ubuntu laptop and I can see my printers (which are attached to my Windows XP PC) and my network shares. Othertimes, I see nothing.

To take name resolution out of the equation, I have hardcoded into my hosts file the IP address for my Windows XP PC (192.168.1.100). I've checked my router to validate that this is the assigned IP address. I can successfully ping the IP address and the hp-media-pc hostname.

When I run smbtree, sometimes I get no output. Other times I get:

dave@dave-laptop:~$ smbtree
Password:
MSHOME
\\HP-MEDIA-PC
session request to HP-MEDIA-PC failed (Called name not present)
session request to *SMBSERVER failed (Not listening on called name)
dave@dave-laptop:~$

The entry is my fstab file should be fine... it has worked in the past. However, here is the entry:

//hp-media-pc/dwitkin /media/hp_media_pc cifs credentials=/home/dave/.smbcredentials,uid=1000,nounix,iocharset=utf8,fil e_mode=0777,dir_mode=0777 0 0

When I try to mount manually, I currently get:
dave@dave-laptop:~$ sudo mount -t cifs //192.168.1.100/dwitkin /media/hp_media_pc
[sudo] password for dave:
Password:
mount error 2 = No such file or directory
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
dave@davelaptop:~$

I tried the smbclient command, but here is what I get:
dave@dave-laptop:~$ smbclient -L //192.168.1.100/dwitkin
session request to 192.168.1.100 failed (Called name not present)
session request to 192 failed (Called name not present)
session request to *SMBSERVER failed (Not listening on called name)
dave@dave-laptop:~$

/home/dave/.smbcredentials
This file contains the user id and password for the Windows share -- not the Ubuntu machine. Owner of the file is root, group of the file is root. Owner has read/write permissions. No one else has any rights.

/etc/samba/smbusers
Just one line: dave="dave". Dave is the user name on the Ubuntu machine. My user name on the Windows XP PC is different, but I think I've tested with the other user name and it didn't seem to change the results.

I've tried a few things:
1. I've shut down the firewall on the windows server, and still the same thing.
2. I can successfully ping the PC using either the IP address or the pc name.
3. I made sure that samba, smbfs and smbclient are installed.

Can you give me a list of commands to run through to help troubleshoot? Thanks for your help.

dmizer
September 21st, 2008, 09:23 PM
Hi dwitkin,

Do you have a samba server configured? If so, can you post your /etc/samba/smb.conf file?

Do you have an iptables configuration in place? You can check with the following command:
sudo iptables -L
The output should look like this:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Being able to ping by ip address or pc name doesn't mean that cifs will be able to recognize it. CIFS uses netbios, so you may be able to fix your problem simply by installing winbind, and correctly configuring /etc/nsswitch.conf

Does the manual mount always fail? Does the fstab only fail sometimes on boot? Will the mount work if you do this:
sudo mount /media/hp_media_pc

That should be enough to start with.

timsa
September 22nd, 2008, 07:32 AM
Hi guys I'm having a bit of a funny trying to get my sharing working, and i'm hoping the experts can tell me where i'm going wrong ;-)

I edited the fstab file with these two lines


//Blueslider/CDrive /Share/Blueslider cifs credentials=/home/tim/.smbcredentials,nounix,noperm,iocharset=utf8,file_ mode=0777,dir_mode=0777 0 0
//Fester/c$ /Share/Fester cifs credentials=/home/tim/.smbcredentials,nounix,noperm,iocharset=utf8,file_ mode=0777,dir_mode=0777 0 0


which both mounted perfectly.... in read only mode!
i then experimented with adding noperm,nounix to the lines to see if they made any difference.

after each change i did a sudo mount -a to remount everything. Is this enough, or do i need to do more?

Any thoughts would be appreciated
Thanks!
Tim

dmizer
September 22nd, 2008, 07:44 AM
Hi guys I'm having a bit of a funny trying to get my sharing working, and i'm hoping the experts can tell me where i'm going wrong ;-)

I edited the fstab file with these two lines



which both mounted perfectly.... in read only mode!
i then experimented with adding noperm,nounix to the lines to see if they made any difference.

after each change i did a sudo mount -a to remount everything. Is this enough, or do i need to do more?

Any thoughts would be appreciated
Thanks!
Tim

Hello Tim,

Please use instead of the quote tags, that way the lines will not have arbitrary spaces and line breaks in them.

Tell me a bit more about your setup. The shares you're attempting to connect to, are they on a Windows computer, or on a NAS device?

Try unmounting the shares with this command:
sudo umount /Share/Blueslider
sudo umount /Share/Fester

Then make sure your Ubuntu user has permissions to read and write the target directories:
sudo chmod 777 /Share/Blueslider
sudo chmod 777 /Share/Fester

Then remount your shares with sudo mount -a and see if you have write permissions.

timsa
September 22nd, 2008, 08:59 AM
Thanks will use the code annotation instead of quote.

okay did what you suggested, and i'm now halfway there. I can modify files on the 'fester' server yay!
The other server 'blueslider' is being more stubborn. If i do a ls on the 2 servers i get a different results

tim@tim:/$ ls -lh /Share/Fester/
total 2.0G
drwxrwxrwx 1 tim root 0 2008-06-03 14:09 ADFS
-rwxrw-rwx 1 tim root 0 2007-08-30 10:07 AUTOEXEC.BAT
-rwxrwSrwx 1 tim root 219 2007-08-30 09:57 boot.ini
-rwxrwSrwx 1 tim root 0 2007-08-30 10:07 CONFIG.SYS
drwxrwxrwx 1 tim root 0 2008-09-19 10:22 data

tim@tim:/$ ls -lh /Share/Blueslider/
total 2.0G
drwxrwxrwx 1 root root 0 2006-06-24 20:09 aaadeploy
drwxrwxrwx 1 root root 0 2006-06-24 20:09 accton
-rwxrwxrwx 1 root root 45 2006-06-20 15:16 AUTOEXEC.BAT


ive condensced the results as all i wanted to show was the difference in permissions (Well i presume its permissions)

Both machines are Windows Server 2003

Just to illustrate here is what i did to test if the sharing was working

tim@tim:/$ sudo chmod 777 /Share/Blueslider/
tim@tim:/$ sudo chmod 777 /Share/Fester/
tim@tim:/$ sudo mount -a
tim@tim:/$ touch /Share/Blueslider/new.txt
touch: cannot touch `/Share/Blueslider/new.txt': Permission denied
tim@tim:/$ touch /Share/Fester/new.txt
tim@tim:/$ rm /Share/Fester/new.txt

dmizer
September 22nd, 2008, 09:21 AM
Okay, try this:

Unmount both shares:
sudo umount /Share/Blueslider
sudo umount /Share/Fester

then, list the directories like so:
ls -l /Share

timsa
September 22nd, 2008, 09:46 AM
I think we are progresssing..


tim@tim:/$ sudo umount /Share/Blueslider
tim@tim:/$ sudo umount /Share/Fester/
tim@tim:/$ ls -l /Share/
total 8
drwxrwxrwx 2 root root 4096 2008-09-22 10:43 Blueslider
drwxrwxrwx 2 tim root 4096 2008-09-22 10:50 Fester


I then changed the ownership of the folder to tim

tim@tim:/$ sudo chown tim /Share/Blueslider/
tim@tim:/$ ls -l /Share/
total 8
drwxrwxrwx 2 tim root 4096 2008-09-22 10:43 Blueslider
drwxrwxrwx 2 tim root 4096 2008-09-22 10:50 Fester


but alas i still do not have any write access to blueslider


tim@tim:/$ sudo mount -a
tim@tim:/$ touch /Share/Fester/new.txt
tim@tim:/$ rm /Share/Fester/new.txt
tim@tim:/$ touch Share/Blueslider/newfile.txt
touch: cannot touch `Share/Blueslider/newfile.txt': Permission denied
tim@tim:/$ ls -l /Share/
total 0
drwxrwxrwx 1 root root 0 2008-09-18 12:35 Blueslider
drwxrwxrwx 1 root root 0 2008-09-22 14:55 Fester


I see that the ownership of the share folders changes to root once they are mounted, i presume this is too stop some idiot(myself) from deleting them whilst mounted?

i also checked the following


tim@tim:/$ ls -l /Share/Blueslider/
total 2095945
drwxrwxrwx 1 root root 0 2006-06-24 20:09 aaadeploy
drwxrwxrwx 1 root root 0 2006-06-24 20:09 accton


So i presume i'm missing something fairly simple?

dmizer
September 22nd, 2008, 10:14 AM
Do you use the same login for your Ubuntu machine as for either (or both) of your Windows machines?

timsa
September 22nd, 2008, 10:43 AM
I use a windows domain username for the two servers and another (non windows/standalone )logon for the ubuntu machine

dmizer
September 23rd, 2008, 11:46 PM
Sorry for the delay in my reply. Been quite busy at work.

Okay, you said that you have a different login for both Windows computers, so you should have a separate credentials file for each computer.
Example:
/home/tim/.smbcredentials_blueslider
/home/tim/.smbcredentials_fester

Where .smbcredentials_blueslider has the username and password for blueslider, and .smbcredentials_fester has the unsername and password for fester.

Then your fstab lines will look like this:
//Blueslider/CDrive /Share/Blueslider cifs credentials=/home/tim/.smbcredentials_blueslider,nounix,noperm,iocharset =utf8,file_mode=0777,dir_mode=0777 0 0
//Fester/c$ /Share/Fester cifs credentials=/home/tim/.smbcredentials_fester,nounix,noperm,iocharset=utf 8,file_mode=0777,dir_mode=0777 0 0

Alternatively, you can add your Ubuntu username and password to both Windows computers.

mmavrice
September 24th, 2008, 01:49 PM
I have followed your how to pretty much to the letter, even used the nounix option to try and eliminate the mount error 13: permission denied, but nothing works so far. I get the same error regardless of whether I try to use the wizard for adding a server under places, a sudo mount command or fstab.

Please help.

here is my fstab command:

//CSI/Outdoors /mnt/csi cifs credentials=/home/mmavrice/.smbcredentials,rw,nounix,iocharset=utf8,file_mode =0777,dir_mode=0777 0 0

here is what a verbose mount -a statement produces:

mount: proc already mounted on /proc
parsing options: rw,credentials=/home/mmavrice/.smbcredentials,nounix,iocharset=utf8,file_mode=07 77,dir_mode=0777

Domain reily


mount.cifs kernel mount options unc=//CSI\Outdoors,ip=129.81.248.12,user=mmavrice,domain =reily,pass=reily,ver=1,rw,credentials=/home/mmavrice/.smbcredentials,nounix,iocharset=utf8,file_mode=07 77,dir_mode=0777
mount error 13 = Permission denied

dmizer
September 24th, 2008, 07:54 PM
mmavrice, there are several things (most of them not related to username password) which cause this error.

First, make sure that cifs is actually installed:
sudo aptitude install smbfs

It probably doesn't hurt anything, but it's also probably not a good idea to use a credentials file as well as the user/pass options.

An IPtables configuration (firestarter) could cause this. Please post the output of:
sudo iptables -L

Also post the contents of these two files:

/etc/hosts
/etc/nsswitch.conf


Finally, post the output of:
smbtree

mmavrice
September 25th, 2008, 12:02 PM
Alright, here we go...

smbfs is properly installed, I ran aptitude just in case, didn't install anything new.

I am unclear what you mean when you say i shouldn't use credentials as well as the user/pass options.

Here is the output of iptables -l:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Contents of /etc/hosts/:
127.0.0.1 localhost
127.0.1.1 INTERN-REILY.reily

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

Contents of /etc/nsswitch.conf:
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd: compat
group: compat
shadow: compat

hosts: files wins dns
networks: files

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

netgroup: nis

I have attempted to run smbtree, but it hangs for a long time (I honestly don't know what that is a sign of). Here is the output:
Password:
WORKGROUP
\\XC-8C27EE 106 Reily Center
prs_mem_get: reading data of size 3738880676 would overrun buffer by 3738880426 bytes.
\\XC-8C27EE\XC-8C27EE-P 106 Reily Center
\\XC-8C27EE\IPC$ 0ID4D129.81.248.116
\\SERVICECALLS Network Services Coordinator

dmizer
September 25th, 2008, 07:54 PM
I am unclear what you mean when you say i shouldn't use credentials as well as the user/pass options.
This was my mistake. My apologies.

Here is the output of iptables -l:
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
The above tells me that you don't have a firewall on your Ubuntu machine. But this:
I have attempted to run smbtree, but it hangs for a long time (I honestly don't know what that is a sign of). Here is the output:
Password:
WORKGROUP
\\XC-8C27EE 106 Reily Center
prs_mem_get: reading data of size 3738880676 would overrun buffer by 3738880426 bytes.
\\XC-8C27EE\XC-8C27EE-P 106 Reily Center
\\XC-8C27EE\IPC$ 0ID4D129.81.248.116
\\SERVICECALLS Network Services Coordinator

Tells me that there is probably some sort of firewall in place between your Ubuntu computer and your Windows computer. Does your Windows machine have a firewall in place? Try disabling it and remount.

Everything else looks okay. The problem appears to be that your Ubuntu computer doesn't know where your Windows computer is on the network, and this is usually a sign of a firewall interfering.

Also, make sure that your Windows computer is a member of the workgroup "WORKGROUP".

Right click on "My computer" > select "Properties" > select the "Network Identification" tab

Also try this fstab line:
//CSI/Outdoors /mnt/csi cifs credentials=/home/mmavrice/.smbcredentials,rw,domain=WORKGROUP,nounix,iochars et=utf8,file_mode =0777,dir_mode=0777 0 0

timsa
September 26th, 2008, 03:45 AM
hi dmizer

Sorry for the late reply. haven't been in the office for the last 2 days.

I use the same windows domain password for both the servers. So i would assume then tha i can use the same credentials file for both servers?

I have tried both the administrator username and my own username to ensure that i'm not having a problem with rights once i'm on the windows servers.

mmavrice
September 26th, 2008, 12:23 PM
Dmizer,

I figured out a problem that might have been giving me the permission denied error, which was a part of the way my credentials file was written (it had a space at the end of password=*****).

So now, the folder is mounting (thank you), but I have read-only permission despite the "nounix" option and the "rw" option. So that is my main problem.

The windows machine has a firewall, but I cannot take that down. It is open to sharing folders, however, and my admin tells me I might have to force ubuntu to use certain ports to access it, however. I most certainly have no clue how to go about this.

Also, the workgroup of the windows machine (which I assume is the domain) is not "WORKGROUP", it is "reily". Any way I can change that setting on my machine? Why does the machine insist on WORKGROUP?

kwisher
October 4th, 2008, 02:53 PM
Hello,

How can I allow other users from the same client machine access to the Samba shares? One my main machine my wife and I have accounts. When I log in from my wifes account, I don not have access to the mounted samba shares like I do with my account. In my .smbcredentials file I only have my username and password. When I add a second entry for my wife's account I get mounting errors.

TIA

Skalman5
October 6th, 2008, 03:35 PM
First of all:
Thanks for a great thread!

This thread helped me alot configuring my home network.

The case:
I want you to help me to mount an password encrypted ftp (with RW permission's) when mounting a password protected network share fails. I would find that very helpful for my laptop that i carry with me.

So when:

For a password protected share with read/write permission.

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

...Fails connecting. I want the system to mount an password encrypted ftp with static ip to that sharename instead.

How do i pull this off?

Your help is appreciated! :KS

dmizer
October 7th, 2008, 11:56 PM
hi dmizer

Sorry for the late reply. haven't been in the office for the last 2 days.

I use the same windows domain password for both the servers. So i would assume then tha i can use the same credentials file for both servers?

I have tried both the administrator username and my own username to ensure that i'm not having a problem with rights once i'm on the windows servers.
Believe it or not, I'm still working on this. Most of my problem is that I can't duplicate your issues.

Dmizer,

I figured out a problem that might have been giving me the permission denied error, which was a part of the way my credentials file was written (it had a space at the end of password=*****).

So now, the folder is mounting (thank you), but I have read-only permission despite the "nounix" option and the "rw" option. So that is my main problem.

The windows machine has a firewall, but I cannot take that down. It is open to sharing folders, however, and my admin tells me I might have to force ubuntu to use certain ports to access it, however. I most certainly have no clue how to go about this.

Also, the workgroup of the windows machine (which I assume is the domain) is not "WORKGROUP", it is "reily". Any way I can change that setting on my machine? Why does the machine insist on WORKGROUP?
Sorry, try this instead then:
//CSI/Outdoors /mnt/csi cifs credentials=/home/mmavrice/.smbcredentials,rw,domain=reily,nounix,iocharset=u tf8,file_mode =0777,dir_mode=0777 0 0

Hello,

How can I allow other users from the same client machine access to the Samba shares? One my main machine my wife and I have accounts. When I log in from my wifes account, I don not have access to the mounted samba shares like I do with my account. In my .smbcredentials file I only have my username and password. When I add a second entry for my wife's account I get mounting errors.

TIA
In your case, you'll have to add your ubuntu username and password to your windows computer. Then, update your credentials file with your Ubuntu login and password.

First of all:
Thanks for a great thread!

This thread helped me alot configuring my home network.

The case:
I want you to help me to mount an password encrypted ftp (with RW permission's) when mounting a password protected network share fails. I would find that very helpful for my laptop that i carry with me.

So when:

For a password protected share with read/write permission.

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

...Fails connecting. I want the system to mount an password encrypted ftp with static ip to that sharename instead.

How do i pull this off?

Your help is appreciated! :KS

Sorry, but this is outside the scope of this howto. You should try looking into howto's for fuse.

jakyra_1
October 15th, 2008, 11:51 AM
I was able to use your tutorial to connect to my test server at work. However, I'm having issues with my production server because they're using ntlmv2i

I posted a question about it separately here:
http://ubuntuforums.org/showthread.php?t=947858 but it occurred to me that maybe I should post a comment here to see if you could help.

Thanks for this!

Nxion
October 15th, 2008, 06:05 PM
Introduction
I was having the most difficult time in the world trying to figure out the best way to connect from my ubuntu workstation to a server hosting shares which were created on a windows 2000 server.

Nautilus mounted them fine, and displayed the correct folder and file names. However, the files were not cashed which meant that I was getting very slow response times, and applications which were Nautilus unaware (Open office) could not access the shares. I was also having difficulty with my keyring among a few other share related issues.

I tried using the smbfs mount function, but it didn't want to cooperate with the Japanese file names. So, since cifs is suppose to be poised for a smbfs replacement I decided to take a look into it and see what it could do. So, even if you don't have Japanese (or other non-latin based characters) in your shared folder/file names, you should still take a look at cifs.

Disclaimer:
==================================
Despite the fact that this is a CLI tutorial, I have tried to write at a fairly basic level. Therefore, I've included a lot of commentary to address the needs of a newly established Linux/Ubuntu user which makes this howto seem lengthy (it's really only a couple lines of cli edits). So, if there is confusion, please let me know so I can attempt to clear it up.

Also, I have focused on command line instruction so the methods can be used in any of the Ubuntu based releases (Ubuntu, Kubuntu, Xubuntu et. al.)

Some NAS devices (like the ARGOSY HD363N) have difficulty handling cifs, so if you are trying to connect to a network attached storage unit, you may be stuck with smbfs. If you do have a NAS device, besure to include the device name and model in your post if you are having trouble.

A bug (described here) 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 for reporting this very helpful information.
==================================

Pre-work

There are a few preliminary actions we need to take before we can start mounting using cifs.

Although cifs installs right alongside smbfs, smbfs is not installed by default. Hardy does allow for some cifs functionality out of the box, so it may seem like this command is not necessary, but it is for this howto. Even if you DO have smbfs installed, there's no harm in running this command anyway.
sudo aptitude install smbfsNow we need to create a location where the samba share can mount. Change "sharename" in the following code to something unique to the remote share, and that you will recognize (usually the share name itself). By creating the mount point in the /media folder, you will get a nifty icon to appear on your desktop like when a cdrom mounts.
sudo mkdir /media/sharenameTo mount a windows share on a DHCP network, it is convenient to be able to mount by netbios name, so you don't have to modify the mount parameters every time you reboot your network. This can be easily enabled by doing the following:

Edit your nsswitch file
sudo nano /etc/nsswitch.confsearch through the file and look for the line that looks something like so:

and add "wins" to the end of the line so it looks something like this:

Save the file by hitting ctrl+x, type "y" to save the buffer, and <enter> to exit.
note: "wins" MUST come before "dns" if you are using the openDNS service.

Now you'll need to install winbind
sudo aptitude install winbindReboot, or restart your network.

:!: Before you move on, you'll need to know the netbios name and share name of the computer you are trying to connect to. If you don't know what they are, please see the next post in this thread before continuing


----------------------------------------------------

There are two ways you can mount using cifs; you can mount it manually as a one time use type purpose, or you can mount it permanently. If you only want to mount the share a few times, it's probably best to follow the directions under "Manual mount". If you will be mounting the same share over and over again, follow the directions under "Permanent mount".

In all cases, you will have to replace the following words:
> netbiosname
> sharename

with the actual netbios name and shared folder name of the shares on your remote computer.

Manual mount

If all you want to do is mount the samba share a few times, it's probably not necessary to make modifications to fstab as is the case with a permanent arrangement. Just modify one of the following lines so that it reflects your local needs (ie, change "netbiosname" to the netbios name of the samba server you are attempting to connect to, change "sharename" to the network name of your share, and change 'winusername' and 'winpassword' to the appropriate username and password of the share you are attempting to connect to).

:arrow: For a samba server with password protection:
sudo mount -t cifs //netbiosname/sharename /media/sharename -o username=winusername,password=winpassword,iocharse t=utf8,file_mode=0777,dir_mode=0777:arrow: If your samba share does not require a password (shame on you ) just use the following line instead:
sudo mount -t cifs //netbiosname/sharename /media/sharename -o guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77:arrow: If your guest access does not allow write access, just remove the file and dir modes like so:
sudo mount -t cifs //netbiosname/sharename /media/sharename -o guest,iocharset=utf8Permanent mount

If you connect to the same samba share day in and day out, you'll likely want to mount it with a more permanent arrangement so you don't have to go looking for your mount command every time you boot your computer. To do this, you'll need to modify your fstab file. This is a system critical file (your Ubuntu box will not work correctly if it has a mistake), so you'll want to make a backup in case things go haywire on you:
sudo cp /etc/fstab /etc/fstab_oldif you need to restore your backup, use the following command:
sudo mv /etc/fstab_old /etc/fstabIf your samba server requires a password to access the shared files, you should create a credentials file so the username and password are hidden from prying eyes. If you don't have password protected access to your samba share, skip this section and start with the line that says "Now we edit fstab:".

To create a credentials file, do the following:
sudo nano /root/.smbcredentialsWARNING!!! Do not use a GUI text editor (like KATE) to create this file!!!

Add the following lines (change winusername and winpassword to the correct username and password for the samba/windows server you want to connect to):

Save the file by hitting ctrl+x, type "y" to save the buffer, and <enter> to exit.

Now, change the permissions of the file so only root can read and edit it:
sudo chmod 700 /root/.smbcredentialsNow we edit fstab:
sudo nano /etc/fstaband at the end of the file, insert one (1) of the following 3 lines according to your needs. Make sure you change "netbiosname" and "sharename" to the correct names for the server you are trying to connect to. (if you don't know what these are, please see the next post)

:arrow: For a password protected share with read/write permission.
//netbiosname/sharename /media/sharename cifs credentials=/root/.smbcredentials,iocharset=utf8,file_mode=0777,dir_ mode=0777 0 0:arrow: For a non-password protected share with read/write permission use this instead:
//netbiosname/sharename /media/sharename cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0:arrow: For read only guest access:
//netbiosname/sharename /media/sharename cifs guest,iocharset=utf8 0 0Save the file by hitting ctrl+x, type "y" to save the buffer, and <enter> to exit.
note: if you've used a text editor other than nano, make sure that there is a blank line at the end of this file.

Finally, test your settings to make sure they work:
sudo mount -aIf you get a folder on your desktop with your server shares, then you have configured everything correctly. If not, please review the howto, or post in the thread.

Now, your samba shares will be mounted every time you start the computer. If you are not connected to your network when you boot, this will not cause problems. The share will simply not appear on your desktop.

After word

If you see an error in your dmesg that reads:

you can fix the problem by following the directions here: https://launchpad.net/distros/ubuntu/+source/hal/+bug/44874/comments/48

Thanks to bigbadsi (http://www.ubuntuforums.org/member.php?u=180853) for all the troubleshooting done to find the solution to this error, and for providing the inspiration for this howto: http://www.ubuntuforums.org/showthread.php?t=282008

******FEISTY USERS******
If you see an error on shutdown, and or your shutdown sequence halts because of this error message:
[18.312000] CIFS VFS: Server not responding
[18.312000] No response for cmd 5 mid 8please see the fix provided in this link: http://ubuntuforums.org/showthread.php?t=293513
*thanks to incoming429 (http://ubuntuforums.org/showthread.php?t=469525) for testing the fix on this error.

******HARDY USERS******
If you are seeing "mount error 13 = Permission denied" error ("CIFS VFS: cifs_mount failed w/return code = -13" in dmesg) when entering the "sudo mount -a" command, add the nounix option like so:
//netbiosname/sharename /media/sharename cifs credentials=/root/.smbcredentials,nounix,iocharset=utf8,file_mode=07 77,dir_mode=0777 0 0thanks to TonyS for posting this solution here: http://ubuntuforums.org/showthread.php?t=800313

smbfs is not included in Hardy. If your network needs require smbfs, you will have to compile it from source (http://ubuntuforums.org/showthread.php?t=707370), or continue to use Gutsy.

******ALL USERS******
Here is a fantastic thread for how to configure Firestarter so that name resolution works correctly: http://ubuntuforums.org/showthread.php?t=190542

You can also use this howto for normal samba shares (without utf8 encoding). If the share does not have utf8 encoding, the iocharset option is simply ignored.

Let me know if this helps!

version history:
2007-01-11 > included information about NAS devices in the disclaimer section.
2007-03-10 > changed fstab lines to code bbc markup instead of quote markup in order to fix an arbitrary space.
2007-04-09 > added option "rw" to the mount options for non-password protected read/write shares.
2007-05-11 > possible work-around for opendns. testers wanted.
2007-06-14 > added fix for "cifs vfs: server not responding" error appearing on shutdown in some feisty installs
2007-09-27 > updated with fix for use with openDNS servers.
2008-03-28 > included bug information regarding gedit.
2008-05-20 > added fix for "mount error 13" in Hardy.
2008-05-29 > minor edit in "Disclaimer"
2008-06-01 > added note about the lack of smbfs in Hardy
2008-06-05 > clarified the need for installing smbfs package
2008-06-11 > added link for firestarter configuration

Just like to add:

If you don't know what the server netbios name is you can find it this way:

For windows servers
To find the netbios name in Windows xp:

start > my computer > view system information (under "system tasks" on the left) > computer name (tab)

The netbios name is next to "full computer name"


To find the share name in Windows xp:

Right click on the shared folder and select "properties", and click on the tab that says "sharing".

The share name is listed under "network sharing and security" next to "share name".


For linux servers
Best way I can think of is to look at your smb.conf file to see what your computer is called:
cat /etc/samba/smb.conf | grep netbiosthe output will show your ubuntu server's netbios name.

Alternatively, you can find all the shares and share names on your network by entering the following command:
smbtreeor if your server requires a password:
smbtree user=winusername[winpassword]and you should get results that look like this:
$ smbtree
Password:
MSHOME
\\YAMADA 山田
\\YAMADA\SharedDocs
\\YAMADA\IPC$ Remote IPC
\\SPROUT kasuga
\\SPROUT\C$ Default share
\\SPROUT\ADMIN$ Remote Admin
\\SPROUT\Common Files
\\SPROUT\SharedDocs
\\SPROUT\IPC$ Remote IPC
\\OYAMA
\\OYAMA\IPC$ Remote IPC
\\HIMUROPC himuro
\\HIMUROPC\SharedDocs
\\HIMUROPC\IPC$ Remote IPC\\netbiosname\sharename

the password it asks for is the password for the samba server's share.

Amazing guide, This helped me alot. I have this saved for further use

Alexandre76
October 17th, 2008, 05:13 AM
Introduction
I was having the most difficult time in the world trying to figure out the best way to connect from my ubuntu workstation to a server hosting shares which were created on a windows 2000 server.......

Hi, first of all, many thanks for this post, it's be very helpful in introducing me to the basics of Ubuntu, now that I am trying to get rid of Vista.

I have followed the procedure carefully, but I still get the error 13 :

alexandre@XXXXX:~$ sudo mount -a
sudo: unable to resolve host XXXXX
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
alexandre@XXXXX:~$

I am in a Windows 2003 Domain.

Here the line I have added to the end of my fstab file :

//data01/alexandre /media/alexandre cifs credentials=/root/.smbcredentials,rw,domain=domain.net,nounix,iochar set=utf8,file_mode=0777,dir_mode=0777 0 0

In the .smbcredentials file, I have put alexandre@domain.net as the username, but the result is the same without the @domain.net

Any idea on what's wrong? What additional information shall I provide to help the community help me resolve this problem?

Regards, Alexandre

zumbrujm
October 17th, 2008, 11:33 PM
This guide worked perfectly. After spending several hours searching, it was wonderful to find a guide that is clearly worded in understandable language.

Thanks!

dmizer
October 18th, 2008, 08:32 AM
Hi, first of all, many thanks for this post, it's be very helpful in introducing me to the basics of Ubuntu, now that I am trying to get rid of Vista.

I have followed the procedure carefully, but I still get the error 13 :

alexandre@XXXXX:~$ sudo mount -a
sudo: unable to resolve host XXXXX
mount error 13 = Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)
alexandre@XXXXX:~$

I am in a Windows 2003 Domain.

Here the line I have added to the end of my fstab file :

//data01/alexandre /media/alexandre cifs credentials=/root/.smbcredentials,rw,domain=domain.net,nounix,iochar set=utf8,file_mode=0777,dir_mode=0777 0 0

In the .smbcredentials file, I have put alexandre@domain.net as the username, but the result is the same without the @domain.net

Any idea on what's wrong? What additional information shall I provide to help the community help me resolve this problem?

Regards, Alexandre

Are you attempting to mount a share on an active directory?

jwrede
October 22nd, 2008, 12:03 PM
This is super, thanks for the help! :KS

One thing you may want to include in the tutorial is the 'nobrl' option for users of OpenOffice that open files on CIFS shares. I have a NAS where I store my documents and kept getting errors when I would save my docs to the drive. I discovered that the errors were due to the fact that OpenOffice doesn't use CIFS-style mandatory byte range locks (http://www.swerdna.net.au/linhowtosambacifs.html), so adding the 'nobrl' option in my FSTAB stopped the errors.

My apologies if this was already posted in one of the 70 pages on this thread.

dmizer
October 22nd, 2008, 07:55 PM
This is super, thanks for the help! :KS

One thing you may want to include in the tutorial is the 'nobrl' option for users of OpenOffice that open files on CIFS shares. I have a NAS where I store my documents and kept getting errors when I would save my docs to the drive. I discovered that the errors were due to the fact that OpenOffice doesn't use CIFS-style mandatory byte range locks (http://www.swerdna.net.au/linhowtosambacifs.html), so adding the 'nobrl' option in my FSTAB stopped the errors.

My apologies if this was already posted in one of the 70 pages on this thread.

Thanks for that. I've updated the howto with this information.

Edit:
One request. Can you please provide the exact text of the error you get when not using this option?

leonthelion
October 23rd, 2008, 11:07 PM
Hi dmizer,

Thanks for all your support here!

My first post:

Just installed xubuntu in VMWare in preparation to setting up a fileserver in our office. We have a mix of XP and Vista shares (yuck, I know!) and I'd like to be able to mount those and do some tests on filename compatibility, etc prior to building the real server.

Using your guide, I was able to mount one shared volume which is all in roman characters like so:

sudo mount -t cifs //YUKI/SharedDocs /mnt/sambashare -o username=something,password=something,iocharset=ut f8,file_mode=0777,dir_mode=0777


The charset flags did enable me to view the filenames in Japanese no worries.

BUT, I'm unable to mount a SMB share which is using Japanese characters in the share name itself. ie:

sudo mount -t cifs //YUKI/柿本 - 製作 /mnt/sambashare -o username=something,password=something,iocharset=ut f8,file_mode=0777,dir_mode=0777


Until I set up a new fileserver, there's no chance of having them rename their shares. Do you know, is this error coming from the console or the mount command or the SMB/CIF implementation?

Any help would be greatly appreciated.

Cheers,

Leon

dmizer
October 24th, 2008, 12:01 AM
BUT, I'm unable to mount a SMB share which is using Japanese characters in the share name itself. ie:

sudo mount -t cifs //YUKI/柿本 - 製作 /mnt/sambashare -o username=something,password=something,iocharset=ut f8,file_mode=0777,dir_mode=0777


Until I set up a new fileserver, there's no chance of having them rename their shares. Do you know, is this error coming from the console or the mount command or the SMB/CIF implementation?

Any help would be greatly appreciated.

Cheers,

Leon

I recall having the same problem, but I'm not sure how I resolved it. I think this may work:
sudo mount -t cifs //YUKI/"柿本 - 製作" /mnt/sambashare -o username=something,password=something,iocharset=ut f8,file_mode=0777,dir_mode=0777


I don't have access to a Linux machine at the moment, but as soon as I get home I'll look into this.

The specs for CIFS and SAMBA indicate that anything other than ASCII characters are illegal for share names. That doesn't mean they can't be used, but there is always a chance for problems when doing so.

leonthelion
October 24th, 2008, 12:12 AM
Worked like a charm, thanks!

I can see all the files inside the SMB share with their correct Japanese filenames.

Can copy to the xubuntu desktop no worries, but no progress indicators on file copy progress. Maybe I'm using a crappy file manager (first morning using Ubuntu and many years since playing with Linux desktop :P )

Cheers dmizer!

dmizer
October 24th, 2008, 12:23 AM
That's fantastic! Glad we got you working.

No idea what to tell you about the progress indicators though, sorry. Xubuntu uses Thunar as it's file manager. It's really quite powerful considering how light it is. Do you have problems with the progress indicators when copying files locally? If not, it could be that you're having problems related to VMware. VMware networking can be tricky sometimes.

Dareus
October 24th, 2008, 11:25 AM
hi, just one little question: in 8.04.1 my TimeCapsule (cifs share) was automounted after the network was up (knetworkmanager), now with intrepid that's not the case, i have to manually mount the device, do you know how to solve this issue, too?

dmizer
October 24th, 2008, 10:06 PM
hi, just one little question: in 8.04.1 my TimeCapsule (cifs share) was automounted after the network was up (knetworkmanager), now with intrepid that's not the case, i have to manually mount the device, do you know how to solve this issue, too?

Sorry, I have not even looked at Intrepid yet. I would suggest asking in the Intrepid development area here: http://ubuntuforums.org/forumdisplay.php?f=346

Dareus
October 25th, 2008, 05:15 AM
thanks for your very useful guide, anyway

dmizer
October 25th, 2008, 05:24 AM
thanks for your very useful guide, anyway

It's no problem.

Did you use this guide to mount your shares? You mentioned knetwork manager so I assumed you did not.

Dareus
October 25th, 2008, 08:30 AM
I used this guide to solve some issues (openoffice and shutdown/reboot), those were very annoying problems.

I was saying that probably mount -a is done before the network is available (provided by knetworkmanager)

scoopy
October 26th, 2008, 11:49 PM
Hey thanks for this.

I was directed to this thread as I was having issues with saving OpenOffice files to a windows xp home share.

Got a mount working and it all seems to be running pretty well . . . however, sometimes when i save files to the mounted drive it's read only (little padlock in icon view in nautalis), sometimes this will happen from OpenOffice when I'm doing a save as. sometimes it won't.

This is my fstab code:

//studycom/j/My\040Documents /media/JodieFiles/ cifs guest,rw,iocharset=utf8,file_mode=0777,dir_mode=07 77 0 0

dmizer
October 26th, 2008, 11:53 PM
Got a mount working and it all seems to be running pretty well . . . however, sometimes when i save files to the mounted drive it's read only (little padlock in icon view in nautalis), sometimes this will happen from OpenOffice when I'm doing a save as. sometimes it won't.

Try adding the nounix and nobrl options like so:

//studycom/j/My\040Documents /media/JodieFiles/ cifs guest,rw,iocharset=utf8,nounix,nobrl,file_mode=077 7,dir_mode=0777 0 0
Please let me know if that works :)

scoopy
October 27th, 2008, 03:23 AM
Try adding the nounix and nobrl options like so:

Please let me know if that works :)

Hey, thanks for getting back so quick! what a legend!

Tried what you suggested but no change - new files are read only. I can delete them though.

Thanks again!

dmizer
October 27th, 2008, 03:26 AM
Hey, thanks for getting back so quick! what a legend!

Tried what you suggested but no change - new files are read only. I can delete them though.

Thanks again!

No problem!

Did you remount the share (or reboot) after making the change? If not, you should. The changes will not take effect until you remount.

scoopy
October 27th, 2008, 03:31 AM
Yes I did reboot

dmizer
October 27th, 2008, 03:36 AM
Yeesh, OK ... I will take a look at this when I get home from work and have a bit more time to look for possible solutions.

dmizer
October 29th, 2008, 03:45 AM
Yes I did reboot

scoopy,

I have tested multiple configurations in my sandbox, but I have not been able to duplicate your problem.

Please try this line:
//studycom/j/My\040Documents /media/JodieFiles/ cifs guest,user=windows-username,rw,iocharset=utf8,nounix,nobrl,file_mode= 0777,dir_mode=0777 0 0
Replace "windows-username" with the actual username on your Windows computer (eg. administrator).

If that is not successful, please post the output of:
ls -l /media/JodieFiles

Alexandre76
October 29th, 2008, 03:49 AM
Are you attempting to mount a share on an active directory?

Yes, I was able to access my home folder, but now I had to switch back to Vista as I couldn't access those AD folders

dmizer
October 29th, 2008, 03:54 AM
Yes, I was able to access my home folder, but now I had to switch back to Vista as I couldn't access those AD folders

Sorry, mounting AD folders is significantly more complex and outside the scope of this howto. It is possible, but it's a daunting chore, so I certainly sympathize with your need to return to Vista.

If you feel brave and would like to try again in the future, here are two helpful links: http://anothersysadmin.wordpress.com/2008/04/06/howto-active-directory-authentication-in-ubuntu-804/
http://ubuntuforums.org/showthread.php?t=91510

scoopy
October 29th, 2008, 06:00 AM
scoopy,

I have tested multiple configurations in my sandbox, but I have not been able to duplicate your problem.

Please try this line:
//studycom/j/My\040Documents /media/JodieFiles/ cifs guest,user=windows-username,rw,iocharset=utf8,nounix,nobrl,file_mode= 0777,dir_mode=0777 0 0
Replace "windows-username" with the actual username on your Windows computer (eg. administrator).

If that is not successful, please post the output of:
ls -l /media/JodieFiles

Unfortunately it didn't work.

Here's the output you requested.

total 453
-rwxrwxrwx 1 root root 458840 2008-06-04 18:30 bluesoleil.exe
drwxrwxrwx 1 root root 0 2008-07-23 19:51 Bluetooth
drwxrwxrwx 1 root root 0 2008-04-19 08:25 Cashbook Data
-rwxrwxrwx 1 root root 0 2007-12-03 18:51 Default.rdp
-rwxrwxrwx 1 root root 75 2007-11-29 18:48 desktop.ini
drwxrwxrwx 1 root root 0 2008-09-21 14:58 Downloads
drwxrwxrwx 1 root root 0 2008-06-11 17:44 Duty Rosters
drwxrwxrwx 1 root root 0 2008-10-12 18:46 Ella's Stuff
drwxrwxrwx 1 root root 0 2008-09-24 07:34 Hana's Stuff
drwxrwxrwx 1 root root 0 2008-08-14 18:24 ~Jodie's Stuff
drwxrwxrwx 1 root root 0 2008-10-27 19:55 luketest
drwxrwxrwx 1 root root 0 2007-12-01 16:23 My Google Gadgets
drwxrwxrwx 1 root root 0 2007-11-29 18:48 My Music
drwxrwxrwx 1 root root 0 2008-10-25 17:15 My Pictures
drwxrwxrwx 1 root root 0 2007-12-01 16:47 My Videos
drwxrwxrwx 1 root root 0 2007-12-03 19:38 software
drwxrwxrwx 1 root root 0 2007-12-01 17:45 Vision Design
drwxrwxrwx 1 root root 0 2007-12-01 19:21 web design


it doesn't seem to matter what I put as the username I get the same issue. for that machine the username doesn't have any password attached eg username = bob password = " "

Thanks

Scoopy

dmizer
October 30th, 2008, 08:56 AM
It's difficult to get permissions correct when mounting as a guest.

Try this:
//studycom/j/My\040Documents /media/JodieFiles/ cifs guest,uid=user,gid=users,rw,iocharset=utf8,nounix, nobrl,file_mode=0777,dir_mode=0777 0 0

dmizer
October 30th, 2008, 08:56 AM
It's difficult to get permissions correct when mounting as a guest.

Try this:
//studycom/j/My\040Documents /media/JodieFiles/ cifs guest,uid=user,gid=users,rw,iocharset=utf8,nounix, nobrl,file_mode=0777,dir_mode=0777 0 0

scoopy
October 30th, 2008, 04:31 PM
It's difficult to get permissions correct when mounting as a guest.

Try this:
//studycom/j/My\040Documents /media/JodieFiles/ cifs guest,uid=user,gid=users,rw,iocharset=utf8,nounix, nobrl,file_mode=0777,dir_mode=0777 0 0

on adding this code and executing a mount I get this:

luke@luke-laptop:~$ sudo mount -a
bad user name "user"

scoopy
October 31st, 2008, 02:50 AM
BTW, if I chown files from root to luke it's all good

dmizer
October 31st, 2008, 02:53 AM
BTW, if I chown files from root to luke it's all good

Does it stay that way?

scoopy
October 31st, 2008, 03:22 AM
No, permissions to seem to revert to root again.

DarkDead
November 1st, 2008, 09:44 PM
Hi. Thanks a lot for the thread dmizer. It was really helpful.

I'm having the exact same problem scoopy has. Every file on the share has it's permissions set to root. I can write on them running the applications as root like: gksudo nautilus but that's not very handy.

Has anyone figured out a solution?

--Edit

I found that just the files on the root directory like /media/sharename have write permission only for root. Files in subsequent directories like /media/sharename/something can be writed by any user.

dmizer
November 1st, 2008, 10:03 PM
scoopy and DarkDead, please post the output of:
ls -n /media/sharename

DarkDead
November 2nd, 2008, 12:02 AM
Here it is:
david@principal:~$ ls -n /media/servidor
total 1898
-rwxrwxrwx 1 0 0 57344 2008-03-25 15:27 2430a.xls
-rwxrwxrwx 1 0 0 30550 2008-03-25 15:27 2430a.xlsx
-rwxrwxrwx 1 0 0 56832 2008-03-25 15:27 243.xls
-r-xr-xr-x 1 0 0 211 2006-08-15 04:29 boot.ini
-rwxrwxrwx 1 0 0 1178 2007-02-20 16:43 Default.rdp
-rwxrwxrwx 1 0 0 82 2008-09-16 17:35 desktop.ini
drwxrwxrwx 1 0 0 0 2008-10-31 20:41 Downloads
-rwxrwxrwx 1 0 0 176603 2008-10-05 11:56 inatel imoppi.jpg
-rwxrwxrwx 1 0 0 259871 2008-10-05 11:54 inatel.jpg
-rwxrwxrwx 1 0 0 1985 2008-05-01 16:07 ir.conf
-r-xr-xr-x 1 0 0 250592 2006-08-06 04:32 ntldr
-rwxrwxrwx 1 0 0 43 2007-01-16 01:41 tskill.bat

scoopy
November 2nd, 2008, 02:47 AM
scoopy and DarkDead, please post the output of:
ls -n /media/sharename

-rwxrwxrwx 1 0 0 458840 2008-06-04 18:30 bluesoleil.exe
drwxrwxrwx 1 0 0 0 2008-07-23 19:51 Bluetooth
drwxrwxrwx 1 0 0 0 2008-04-19 08:25 Cashbook Data
-rwxrwxrwx 1 0 0 0 2007-12-03 18:51 Default.rdp
-rwxrwxrwx 1 0 0 75 2007-11-29 18:48 desktop.ini
drwxrwxrwx 1 0 0 0 2008-09-21 14:58 Downloads
drwxrwxrwx 1 0 0 0 2008-06-11 17:44 Duty Rosters
drwxrwxrwx 1 0 0 0 2008-10-12 18:46 Ella's Stuff
drwxrwxrwx 1 0 0 0 2008-09-24 07:34 Hana's Stuff
drwxrwxrwx 1 0 0 0 2008-08-14 18:24 ~Jodie's Stuff
drwxrwxrwx 1 0 0 0 2008-10-27 19:55 luketest
drwxrwxrwx 1 0 0 0 2007-12-01 16:23 My Google Gadgets
drwxrwxrwx 1 0 0 0 2007-11-29 18:48 My Music
drwxrwxrwx 1 0 0 0 2008-10-25 17:15 My Pictures
drwxrwxrwx 1 0 0 0 2007-12-01 16:47 My Videos
drwxrwxrwx 1 0 0 0 2007-12-03 19:38 software
drwxrwxrwx 1 0 0 0 2007-12-01 17:45 Vision Design
drwxrwxrwx 1 0 0 0 2007-12-01 19:21 web design

Cammy
November 2nd, 2008, 06:05 PM
I'm having a similar problems to the others.

I've gotten my shared network hard drive to mount after using tips from this thread, but it's owned by root. I've done a recursive sudo chown and sudo chmod to everything, but if I download a file and save it to the share, it won't save due to insufficient permissions.

I've even unmounted the shared and chown/chmoded the mount point, to no avail.

dmizer
November 3rd, 2008, 02:35 AM
I'm having a similar problems to the others.

I've gotten my shared network hard drive to mount after using tips from this thread, but it's owned by root. I've done a recursive sudo chown and sudo chmod to everything, but if I download a file and save it to the share, it won't save due to insufficient permissions.

I've even unmounted the shared and chown/chmoded the mount point, to no avail.

Any of you with this problem, be sure to check the permissions on the Windows computer. If you are positive that the Windows share permissions are correct, please try adding your Ubuntu user account (same user name and password) to your Windows computer, make sure the Ubuntu user is added to the Windows share, and retest by mounting with a credentials file in /etc/fstab. This should solve the problem.

In the mean time, I am slowly going back through this thread, because I've solved this before ... I just don't remember how. I would be grateful to anyone who could help with that search.

Cammy
November 3rd, 2008, 09:16 AM
In my case, there is no Windows computer. I have an internal hard drive mounted in a USB 2.0 enclosure and connected to a Linysys nslu2 Network Storage link. This is connected via ethernet to my router.

I have the same username on the Linksys device that I have on my local machine, and that username has R/W permissions on the network drive. In fact I'm a member of the admin group on the network drive.

It's the same setup I had when running Feisty, except I had to change my fstab to mount the drive in Hardy because things changed. Here's what my fstab entry for the drive looks like:

//192.168.0.77/music /media/music/ cifs credentials=/root/.credentials/credentials,rw,nounix,iocharset=utf8,file_mode=077 7,dir_mode=0777 0 0

The credentials file just has:


username=myusername
password=mypassword


The drive mounts and I have access, it just seems that anything I download to the drive (or copy to it) ends up owned by "root", assuming the download even works.

dmizer
November 3rd, 2008, 11:47 PM
@scoopy and DarkDead
Please try this (http://ubuntuforums.org/showpost.php?p=4639290&postcount=392) solution:
//studycom/j/My\040Documents /media/JodieFiles/ cifs user,guest,uid=1000,gid=1000,rw,iocharset=utf8,nou nix,nobrl,file_mode=0777,dir_mode=0777 0 0

@Cammy
Finally found what I was looking for here (http://ubuntuforums.org/showpost.php?p=4619711&postcount=384). Please try this:
//192.168.0.77/music /media/music/ cifs credentials=/root/.credentials/credentials,rw,nounix,iocharset=utf8,uid=1000,gid= 1000,file_mode=0777,dir_mode=0777 0 0

There seems to be a difference in how CIFS acts when presented with a guest account rather than an authenticated login.

Cammy
November 4th, 2008, 12:32 AM
YES! You are the bestest ever! Thank you very much! :)

It works properly now.

dmizer
November 4th, 2008, 12:42 AM
YES! You are the bestest ever! Thank you very much! :)

It works properly now.

Fantastic! Sorry that took a while. I'd forgotten how to fix this. I will add this to the troubleshooting section later this evening.

Glad you're working!

scoopy
November 4th, 2008, 01:33 AM
All good!!! You Rock!

DarkDead
November 5th, 2008, 04:12 PM
Thank you dmizer! It seems to work.

There's only one strange thing. With your fix my account has read and write privileges over all files in the share (and it's confirmed it has). However I still can't rename or delete those files, it's like I don't have the privileges. But this only happens in the root directory in subsequent directories like /media/sharename/something everything runs smoothly.

I believe this is probably some problem with Windows file sharing but I couldn't find anything wrong with it. Has anyone experienced something similar?

nexusnode
November 6th, 2008, 01:38 PM
Hey All,

had a recommendation that this was the place to go for cifs problems, so here I am.

I have looked all over the place and I am slowly getting there but I am wondering whether you genii can help that last little bit. (Yes I am hoping flattery will get me everywhere ;))

So, essentially I can browse, add, delete and move files to the share but what I cant do is open an existing file, edit it and save it directly back to the mounted share.

The error message from gedit was "Not a Directory".

I found out thanks to another post on here that adding the nounix switch to the fstab entries meant that the original problems I was having dissapeared, and this works for 90% of the problem but I still get it in Komodo Edit (Excellent Programming IDE)

The Error Message reads:

There was a problem saving project "project.kpf": [Errno 20] Not a Directory:u'/media/files/project.kpf'

The bit that interested me about that was the preceding "u" before the directory string.

Thanks in advance! Any thoughts anyone?

dmizer
November 6th, 2008, 09:28 PM
nexusnode,

Please try adding the nobrl option like so:
//netbiosname/sharename /media/sharename cifs credentials=/root/.smbcredentials,iocharset=utf8,nobrl,file_mode=077 7,dir_mode=0777 0 0

nexusnode
November 7th, 2008, 03:19 PM
Thanks for the pointer, but I am sorry to say that it hasn't helped. Is there any info I could gather that would help the diagnosis?

//10.0.0.11/fred /media/fred cifs credentials=/home/fred/cifscred,iocharset=utf8,nobrl,file_mode=0777,dir_m ode=0777,nounix,noperms,uid=1000,gid=1000, 0 0

That is the line in my fstab at the moment, does that shed any light?

Thanks!!

dmizer
November 7th, 2008, 08:16 PM
I honestly don't have a lot of hope for this one, nexusnode. Komodo appears to be an old gtk only app, and I don't know if it's in development anymore. There are two things you can try.

First, try removing the iocharset=utf8 option and see if that helps. I suspect that komodo can't use utf8. But, that's something of a long shot.

The other thing you can do is try asking this person how he has his cifs mount set up: http://www.nabble.com/Komodo,-Ubuntu,-VMware,-and-sshfs-td15820452.html
http://www.nabble.com/user/UserProfile.jtp?user=688589

nexusnode
November 8th, 2008, 10:43 AM
Oh dear!
Komodo is definetly still in development - they have in the last week or so released a new version! I don't know if its a GTK only app - I'm not sure what I would be looking for to identify it.

I tried removing that utf8 option but that just made everything fail, and I have emailed the user that you referenced.

The bit that confuses me is that whilst using 8.04 I had the same setup but no problems..

Thanks again dmizer!

nexusnode
November 8th, 2008, 01:00 PM
Just spoke to a friend of mine about Komodo being an old GTK app. He says he thinks not. Just to make sure were talking about the same thing, this is the link to their site:

http://www.activestate.com/Products/komodo_ide/komodo_edit.mhtml

dmizer
November 8th, 2008, 10:49 PM
Well, I installed from the repos, and apparently the komodo version in the repos is quite old. 0.9x to be exact. From 2005, and it is most certainly a GTK app ... lol.

It's still probable that it's a GTK app especially since you can use it in Windows and Mac. GTK is more suitable to crossplatform development. Otherwise, you'd have to run komodo through an X server like Cygwin (http://x.cygwin.com/), or write completely different sets of code for all three platforms (unlikely). In any case, since it's still under development, there should not be a problem with CIFS compatibility.

You might also try talking to the komodo community (http://community.activestate.com/forums/komodo-support) to see if anyone else is having the problem. I wish I could offer more assistance, but I'm just not very familiar with this application, and since you indicate that everything else seems to work ok (other than komodo) it would be difficult for me to hunt down this particular issue. Ultimately, it may end up being a bug report, but it's too early to tell yet.

nexusnode
November 9th, 2008, 01:09 PM
Haha no worries - the komodo thats in the repos is something else entirely and yea - doesn't look like its moved for a while.

I emailed that guy you suggested and he has come back with some info but has said that he will have to go to work to get the rest of it so I would have thought it will be sometime this coming week I will get a reply.

The bit that I don't understand, if this is a problem with Komodo, is why it worked fine under 8.04. And the bit thats frustrating me even more is I don't even know where to look for more detailed logs.

I have a couple of avenues of testing to go down yet but im running into a lot of dead ends.

Thanks for the help though, I appreciate it.

dmizer
November 9th, 2008, 09:57 PM
The bit that I don't understand, if this is a problem with Komodo, is why it worked fine under 8.04. And the bit thats frustrating me even more is I don't even know where to look for more detailed logs.

Sorry, I did not mean to suggest that the problem was WITH Komodo. I mean to suggest that since the problem is SPECIFIC to Komodo, people who know Komodo better than me will be more likely to be able to help you.

For example: If you can figure out why this is happening, I might be able to suggest a work around.

lviggiani
November 10th, 2008, 11:49 AM
Hi, I have a problem with a mounted share...
It was working fine with 8.04, I have problems since I updated to 8.10.

I tried many settings in my /etc/fstab entry but nothing changes...

I can create, delete or overwrite files on that mounted share, but I cannot save directly on it (with any program like gedit or openoffice etc).
So, if I open a file on that share for example with gedit, I cannot save it (I get a message saying "unexpected error: not a directory"). So I have to save it locally (Desktop) and then drag and drop with nautilus and overwrite it.

Do you have any idea on how to solve this?
Thanks!

dmizer
November 10th, 2008, 01:16 PM
Hi, I have a problem with a mounted share...
It was working fine with 8.04, I have problems since I updated to 8.10.

I tried many settings in my /etc/fstab entry but nothing changes...

I can create, delete or overwrite files on that mounted share, but I cannot save directly on it (with any program like gedit or openoffice etc).
So, if I open a file on that share for example with gedit, I cannot save it (I get a message saying "unexpected error: not a directory"). So I have to save it locally (Desktop) and then drag and drop with nautilus and overwrite it.

Do you have any idea on how to solve this?
Thanks!

Have you tried the nobrl option? If so, what is your current fstab line?

nexusnode
November 10th, 2008, 02:23 PM
Hi, I had that exact same issue - managed to solve that one but no the one with Komodo.

I added: nounix

nexusnode
November 10th, 2008, 02:24 PM
Dmizer - I will have a dig around and see if I can get more information. Thanks again!

lviggiani
November 11th, 2008, 03:13 AM
Have you tried the nobrl option? If so, what is your current fstab line?

Hi, thanks for the answer... but unfortunately it still don't work.
here is my fstab entry:

//10.0.2.116/public /home/lviggiani/Network cifs username=lviggiani,password=,uid=1000,gid=1000,nob rl 0 0

nexusnode
November 11th, 2008, 08:42 PM
lviggiani

What about the 'nounix' option, did that help?

lviggiani
November 12th, 2008, 03:22 AM
lviggiani

What about the 'nounix' option, did that help?

Well, I've tried that option but as a result I can't neither see the mounted share... For eaxample, if the mount point is /media/myshare, with nounix I cannot see that folder at all.
If I then run "sudo umount /media/myshare" the folder appear again (and obviously is empty.
Please note that the remote folder (the one I'm trying to mount) is on a imega nas whose embedded OS is linux.
Thanks.

dmizer
November 12th, 2008, 07:21 AM
Well, I've tried that option but as a result I can't neither see the mounted share... For eaxample, if the mount point is /media/myshare, with nounix I cannot see that folder at all.
If I then run "sudo umount /media/myshare" the folder appear again (and obviously is empty.
Please note that the remote folder (the one I'm trying to mount) is on a imega nas whose embedded OS is linux.
Thanks.

What is the model number of your imega NAS? You'll probably be better off using something other than CIFS to connect to it. FTP and NFS are usually better options for connecting to Linux based NAS devices.

lviggiani
November 12th, 2008, 08:26 AM
What is the model number of your imega NAS? You'll probably be better off using something other than CIFS to connect to it. FTP and NFS are usually better options for connecting to Linux based NAS devices.

It's a iomega storecenter pro 150d.

To be honest I tried with NFS but when I try to mount it, it waits for about 20 seconds and then gives me an "internal error".
About FTP, I don't know how to mount an ftp share.
BTW, what I cannot uderstand is why with Hardy everything was working ok....

dmizer
November 12th, 2008, 10:33 AM
To be honest I tried with NFS but when I try to mount it, it waits for about 20 seconds and then gives me an "internal error".
You may have success with the client portion of the NFS howto located in the fourth link in my sig.

About FTP, I don't know how to mount an ftp share.
Places > Connect to Server > select either "FTP (with login)" or "Public FTP" > fill in the server information > click "connect".

Fortunately, FTP communication is something that Nautilus actually does fairly well.

BTW, what I cannot uderstand is why with Hardy everything was working ok....
No idea. To be completely honest, I haven't needed to use CIFS since Edgy. If I had to guess, I would suggest version differences. CIFS versions in NAS devices are often static, while Ubuntu frequently updates to more recent versions.

lviggiani
November 12th, 2008, 10:37 AM
You may have success with the NFS shares howto located in the fourth link in my sig.


Places > Connect to Server > select either "FTP (with login)" or "Public FTP" > fill in the server information > click "connect".

Fortunately, FTP communication is something that Nautilus actually does fairly well.


No idea. To be completely honest, I haven't needed to use CIFS since Edgy.

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.

fcigoi
November 14th, 2008, 08:38 AM
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 ?