Page 1 of 1

Mouting /home/storage as samba share - problem

Posted: 21 Oct 2009, 22:25
by RandomUsername
Hi,

I can access the /home/storage directory on my Bubba Two via Windows Explorer and via the Ubuntu (9.04) "Connect to Server" option with no problems.

However, as soon as I try to mount the share on the same Ubuntu box via fstab things go a bit wrong. This way I can browse, open, delete and create files, but I can't edit existing files. I don't get permission errors, it's more as if the share is totally inaccessible to the application I'm using.

This is my line in fstab as it is at the moment:

Code: Select all

//192.168.10.1/storage /mnt/darren/storage smbfs credentials=/root/.credentialsdarren,gid=users 0 0
I've also tried any number of different options on that line such as mask, gid, uid, user etc. etc. but everything's giving the same result.

Can someone post their line from fstab as there must be an option I need to set that I haven't tried so far?

Thanks.

Re: Mouting /home/storage as samba share - problem

Posted: 22 Oct 2009, 08:08
by RandomUsername
As usual a night of searching the interwebs turns up nothing and the minute I post a question in a forum I find the answer. :roll:

The option "nodfs" works for me but others have also reported success with "nounix".

Re: Mouting /home/storage as samba share - problem

Posted: 23 Oct 2009, 06:51
by redw0001
Hi, I have a similar problem I think. I seem to have R/O access to files I copied 'en-mass' to start with, but as they are jpgs and mp3s it is ok. What I'd not noticed is that it was all files. I've fiddled with fstab on my Linux machines (2) and ended up with the following:

//192.168.1.3/home/storage/music /music cifs username=xxxx,password=yyyy,fmask=0777,dmask=0777 0 0

This has improved my position in as far as now I can create and update files in /home/storage but only from the PC I created them from. I want to be able to share them from multiple PCs (each has its own user).

Can you post the your fstab line please. robin

Re: Mouting /home/storage as samba share - problem

Posted: 23 Oct 2009, 18:12
by RandomUsername
Hi,

Here's my fstab line. It's working great at the moment.

Code: Select all

//192.168.10.1/storage /mnt/darren/storage smbfs nodfs,credentials=/root/.credentialsdarren,gid=users,uid=darren 0 0
/root/.credentialsdarren is a root-readable-only file with the format

Code: Select all

username=xxxxxx
password=xxxxx
domain=xxxxx
This is so you don't have to store your password and username in a world-readable file such as fstab. I'm currently exploring ways to have the username and password encrypted totally but haven't found much so far. It would be great if Samba could use the Gnome Keyring.
[EDIT]http://ubuntuforums.org/showthread.php?t=1186877 this looks quite promising.
[EDIT2]I now mount all my shares using the method described in that URL. Works great.

Regarding your problem of only being able to edit files from one PC, I've made some changes to the file /etc/samba/smb.conf on the Bubba that might interest you (see below). The two lines "inherit permissions" and "inherit owner" make any newly created files have the same permissions as the parent folder no matter who creates them (you don't go into much detail but the only reason I can think of that would be causing your problem is that you are using different accounts on each PC).

Code: Select all

[storage]
   comment = Common storage
#   writeable = yes
   read only = yes
#   guest ok = yes
   guest ok = no
#   public =yes
   public = no
#   force group = users
#   force create mode= 0755
#   force directory mode = 0755
   path = /home/storage
   hide files = /lost+found/
   hide special files = yes
#Added the following lines myself
   write list = darren
   admin users = darren
   inherit owner = yes
   inherit permissions = yes
   browseable = yes

HTH.

Re: Mouting /home/storage as samba share - problem

Posted: 24 Oct 2009, 12:12
by redw0001
Hi, thank you for the comments. I should have explained more:

Logging on to Bubba2 with ssh shows a file like this:
-rwxrwxr-x 1 robin users 173653 2009-09-15 20:20 XXXXXXXXXX Noticeboard.sxw
PC1 (user robin) ... can edit and save file

PC2 (user rita) ... can only open it read only and cannot update, even doing a 'save as' fails.

The thing I note from the second PC is that it is misunderstanding the user and group as it appears as root and root when in the OOo file open menu instead of robin and users.

What puzzles me is why the user on the second PC thinks the uid and gid are both root. Any ideas please?

robin

Re: Mouting /home/storage as samba share - problem

Posted: 24 Oct 2009, 12:49
by RandomUsername
Are the username and password in your fstab the same on both computers? I thought that Samba only looks at the credentials in the mount line so it shouldn't matter if the local accounts on the two PCs are different.

Re: Mouting /home/storage as samba share - problem

Posted: 24 Oct 2009, 14:33
by redw0001
Hmm, no, they are not, I'd assumed (probably wrongly) that because there uids are the same on the bubba2 and a PC that there should not be a problem .... both uids being in the same gid.

Will try setting them the same to see if it sorts it.

robin