OpenSuse 11.4 - ext4 - Samba Share - on External USB drive

Hi All,

This is my first post.
I’m having difficulty in accessing a samba share I have created on my OpenSuse Machine via Windows Vista.
This is on an external USB deive mounted by the root user, I don’t have any issues accessing directories that are on the root disk itself.
I suspect permissions, but really cannot see where exactly.

i.e.

/etc/samba/smb.conf

[global]
workgroup = ECS
ldap ssl = no
socket options = SO_KEEPALIVE TCP_NODELAY IPTOS_LOWDELAY SO_RCVBUF=65536
SO_SNDBUF=65536
unix password sync = Yes
force group = users
remote announce = 192.168.1.255/ECS
os level = 65
interfaces = 192.168.1.57/255.255.255.0
map to guest = Bad User
domain master = Yes
passwd program = /usr/bin/yppasswd %u
keepalive = 30
domain logons = Yes
local master = Yes
preferred master = Yes
security = user
lanman auth = Yes
client lanman auth = Yes
client plaintext auth = Yes
netbios name = k8-fx60-s1

    ldap suffix =
    passdb backend = smbpasswd
    log level = 3

[homes]
comment = Users Home Directories
valid users = %S, %D%w%S
browseable = No
writeable = yes
path = %H
read only = No
create mode = 0750
allow hosts = 192.168.1.0/24
directory mode = 750
create mask = 0750
directory mask = 750
hosts allow = 192.168.1.0/24
inherit acls = Yes
[temp]
comment = Temp Filesystem
locking = No
writeable = yes
path = /tmp
create mode = 0750
allow hosts = 192.168.1.0/24
directory mode = 750
create mask = 0750
directory mask = 750
hosts allow = 192.168.1.0/24
read only = No
[data]
browseable = yes
comment = Data Filesystem
writeable = yes
path = /Data
guest ok = yes
allow hosts = 192.168.1.0/24
hosts allow = 192.168.1.0/24
read only = No
force user = admin

From the above, homes works ok, and this is an automount from another linux machine on the same network
/tmp works ok as well and that is a local directory on the linux machine’s internal root hard disk.
However /data doesn’t work, but this is on the linux machine’s external USB hard disk.

Permissions to the directories are: -

ls -ld /tmp
drwxrwxrwt 143 root root 12288 Mar 23 17:30 /tmp
k8-fx60-s1:/etc/samba # ls -ld /Data
drwxrwxr-x 9 admin users 4096 Mar 23 13:14 /Data

I think the difference above is usual for /tmp. N.B. I am accessing the directories in both cases as the user admin.

As user admin, directly on the linux machine I can access the directory and list it, i.e. command line: -

k8-fx60-s1:/etc/samba # su - admin
admin@k8-fx60-s1:~> cd /Data
admin@k8-fx60-s1:/Data> ls
Apps Audio Download EMU lost+found Utilitys Video

If I do the same with smbclient, I get the following: -

admin@k8-fx60-s1:/Data> smbclient //192.168.1.57/data
Enter admin’s password:
Domain=[ECS] OS=[Unix] Server=[Samba 3.5.7-3.5.1-2573-SUSE-SL11.4-x86_64]
smb: > dir
NT_STATUS_ACCESS_DENIED listing *

            65535 blocks of size 33553920. 65535 blocks available

I really don’t understand this at all as I cannot see any problems.
N.B. “force user = admin” in the smb.conf file was added as I was trying everything
and that was my last attempt, I’ve also stripped mode and mask lines without
success. It still didn’t work.

I’m grateful for any help. Many thanks for reading.

Why not have a look at my blog on Samba SWAT. It has an example smb.conf file you could modify for your setup.

Samba S.W.A.T. - Samba Web Administration Tool Setup for openSUSE - Blogs - openSUSE Forums

Your smb.conf file might look like this:

# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
# Date: 2011-11-02

[global]
    workgroup = ECS
    netbios name = MASTERLINUX
    server string = The Master of the Universe
    security = SHARE
    map to guest = Bad User
    name resolve order = bcast host lmhosts wins
    printcap name = cups
    preferred master = Auto
    local master = No
    domain master = No
    wins support = No
    usershare allow guests = Yes
    usershare max shares = 100
    hosts allow = 192.168.1.0/255.255.255.0, 127.0.0.1
    hosts deny = ALL
    cups options = raw
    write raw = yes
    read raw = no

[Data]
    path = /Data
    read only = No
    acl check permissions = No
    inherit acls = Yes
    guest ok = Yes
    profile acls = Yes

For sharing NTFS partitions, I also make a suggestion on setting up your fstab file for the same partition that you are sharing. If you want to share anything more than the /Data folder, you would need to added it, but keep it simple at first.

Thank You,

I have a new blog that provides a bash script that can create all of the required configurations to enable Samba and to use SWAT: SWAT - Samba Web Administration Tool - Setup & Creation Script - 1.03 - Blogs - openSUSE Forums

Thank You,

Hi jdmcdaniel3

Thanks for your reply’s/comments, but I don’t think this has anything to do with the actual Samba setup for the shares.
i.e. otherwise, why would [Temp] and [Homes] work ok, the settings used are nearly identical apart from I’ve been removing
settings for [Data] to simplify and adding a few to see if any difference is made.
The /Data filesystem is on an external USB drive and is actually an ext4 filesystem.

I really think this is either an OS permissions thing with external drives or an issue with Samba itself.
But for the life of me I cannot see where the issue would be.

N.B. I did forget to mention that the firewall on my machine is completely disabled.

Any more help would be appreciated. Has no one had any similar issues?

When you share a partition, not part of /home, for which a user password may not provide the right authority, who really has authority to write to the partition? If it is only root, that will be a problem going through Samba.

Thank You,

Sorry, you’ve lost me with that statement.
As I detailed in my first thread, the ownership of the filesystem I’m trying to share is that of the user who I’m accessing it with through samba.
And as I also stated I can access it as that user on the server itself by logging on, changing into the directory and viewing and editing files.
I have no issue accessing other filesystems on the internal hard disk of the server, as this user, i.e. filesystems that are on the root disk. But I cannot access anything on the external USB hard disk, this is the issue.

I think that there is an issue with Samba here, either that or with OpenSuse 11.4.

Any other iseas from anyone please?

On Thu April 5 2012 10:56 am, evan almighty wrote:

>
<snip>
>
> Sorry, you’ve lost me with that statement.
> As I detailed in my first thread, the ownership of the filesystem I’m
> trying to share is that of the user who I’m accessing it with through
> samba.
> And as I also stated I can access it as that user on the server itself
> by logging on, changing into the directory and viewing and editing
> files.
> I have no issue accessing other filesystems on the internal hard disk
> of the server, as this user, i.e. filesystems that are on the root disk.
> But I cannot access anything on the external USB hard disk, this is the
> issue.
>
> I think that there is an issue with Samba here, either that or with
> OpenSuse 11.4.
>
> Any other iseas from anyone please?
>
evan almighty;

Samba can only access files and directories that are permitted by the Linux
permissions. Although you posted the permissions for /temp I did not see any
permissions listed for /data. Can you please post the result of:


ls -ld /data

Have you created Samba users with:


su -
smbpasswd -a <username>

Without seeing your logs and with a really fuzzy crystal ball I’m guessing that
you authenticate to Samba as guest ( linux user nobody) and do not have
permission for /Data.

This has nothing to do with your immediate problem but “socket options” is an
obsolete parameter on a modern system. A modern Kernel sets these much better
than any thing you come up with.
SEE:
http://66.135.57.166/lists/samba/msg96247.html
and the last post in:
http://samba.2283325.n4.nabble.com/Strange-Performance-Issue-concurrent-clients-gt-very-very-slow-td3948197.html

Moreover, you have setup Samba as a primary domain controller (PDC). This is
really overkill for simple folder and file sharing. These two articles might
lend some insight:
http://opensuse.swerdna.org/suselanprimer.html
and
http://opensuse.swerdna.org/susesambaserver.html


P. V.
“We’re all in this together, I’m pulling for you.” Red Green

On 2012-04-05 17:56, evan almighty wrote:
> I have no issue accessing other filesystems on the internal hard disk
> of the server, as this user, i.e. filesystems that are on the root disk.
> But I cannot access anything on the external USB hard disk, this is the
> issue.

Is that external space mounted at the time samba starts? If not, you have
to restart samba so that it is seen, I think.

Or, mount that disk via entries in fstab.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

On Thu April 5 2012 02:53 pm, Carlos E. R. wrote:

> On 2012-04-05 17:56, evan almighty wrote:
>> I have no issue accessing other filesystems on the internal hard disk
>> of the server, as this user, i.e. filesystems that are on the root disk.
>> But I cannot access anything on the external USB hard disk, this is the
>> issue.
>
> Is that external space mounted at the time samba starts? If not, you have
> to restart samba so that it is seen, I think.
>
> Or, mount that disk via entries in fstab.
>
The [global] section of /etc/samba/smb.conf is only read when Samba is started.
However the share parameters are reread with each access of the share.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

On 2012-04-06 05:50, PV wrote:
> On Thu April 5 2012 02:53 pm, Carlos E. R. wrote:

> The [global] section of /etc/samba/smb.conf is only read when Samba is started.
> However the share parameters are reread with each access of the share.

But how can you access a share that is not seen? You try to browse the
shares, but the one you are interested in does not show.

Thus, restart it…


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

For a hidden share you can not browse, in Dolphin you would enter: smb://pcname/sharename, for a sharename that you already know exists.

Thank You,

On 2012-04-06 16:36, jdmcdaniel3 wrote:

> For a hidden share you can not browse, in Dolphin you would enter:
> smb://pcname/sharename, for a sharename that you already know exists.

Not a hidden share. A share that does not show in the browser, till you
restart. Or shows on some computers and not others. The random nature of
Windows, a friend of mine says…


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

The random nature can occur while the (new/old) browser master takes control, showing new, old or recently removed/added shares and waiting for them to make their way through the network. If you just restarted a PC, its worth waiting a while for the new setup to take hold.

Thank You,

On 2012-04-06 19:16, jdmcdaniel3 wrote:
>
> The random nature can occur while the (new/old) browser master takes
> control, showing new, old or recently removed/added shares and waiting
> for them to make their way through the network. If you just restarted a
> PC, its worth waiting a while for the new setup to take hold.

I know. But some times some computers do not show at all even after half an
hour, and some shares do not show.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

In such a case one wonders if one of the smb computers is not configured properly, Windows or Linux. And, I have had issues with Samba in Linux having a known problem and a few Windows PC’s that simply never seemed to work right. I can say that when sharing does not work, it can be frustrating that is for sure, but it is the nature of the game.

Thank You,

On Fri April 6 2012 09:18 am, Carlos E. R. wrote:

> On 2012-04-06 05:50, PV wrote:
>> On Thu April 5 2012 02:53 pm, Carlos E. R. wrote:
>
>
<snip>
> But how can you access a share that is not seen? You try to browse the
> shares, but the one you are interested in does not show.
>
> Thus, restart it…

Perhaps it is my old eyes, but I did not read that /data was not visible but
only

However /data doesn’t work,

I assume this means the OP does not have the access he desires. A share listed
in /etc/samba/smb.conf should show up when you browse shares, although it may
be completely inaccessible.

P. V.
“We’re all in this together, I’m pulling for you.” Red Green

On 2012-04-07 06:09, PV wrote:
> On Fri April 6 2012 09:18 am, Carlos E. R. wrote:

> I assume this means the OP does not have the access he desires. A share listed
> in /etc/samba/smb.conf should show up when you browse shares, although it may
> be completely inaccessible.

Yes, reading it again I have not clear what is the problem. No permission,
no browse, what?


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

Hi apologies for the delay in replying to this. Other things took priority, i.e. decorating. :wink:

If you look in my original post, you will see that I did include permissions for /Data
just under the ls -ld for /tmp, i.e.

k8-fx60-s1:/etc/samba # ls -ld /Data
drwxrwxr-x 9 admin users 4096 Mar 23 13:14 /Data

The ownership of the directory (mount point) is that of the user I am attempting
to browse it with under samba. i.e. the user admin.

As stated, I can under a bash shell, logged in as the user, do anything I like under that
directory, so Linux ownership permissions are not an issue.

But as mentioned previously, when I try to browse the directory using windows on another
PC, I cannot (i.e. I can see the directory, but not move(cd) into it) and I also cannot use
the samba tools under Linux to do that also. i.e. see my first post.

I showed /tmp information as I thought it useful to know that other aspects of my samba setup
are working.

Also, the user “admin” on the Samba side was created using smbpasswd, so that isn’t an issue.

Hope that makes things a little clearer.

Thank You

On 2012-04-24 16:46, evan almighty wrote:

> I showed /tmp information as I thought it useful to know that other
> aspects of my samba setup
> are working.
>
> Hope that makes things a little clearer.

Mmm.

Do an experiment: define the same settings for the data directory as for
the tmp directory. If it works, start changing settings one at a time. If
it doesn’t, then samba has a problem with external disks.


Cheers / Saludos,

Carlos E. R.
(from 11.4 x86_64 “Celadon” at Telcontar)

That’s not unusual in a Workgroup (actually should be 20 min IIRC). Proper solution should be to implement Domain security or modify settings on every machine but one to never be eligible to be a Browse Master.

Also, should be noted how unreliable it is to configure access to removable media, would then require removable media to be dismounted properly and gracefully with every shutdown or the underlying path can change. Considering the many ways removable media can be mounted and identified, any dirty dismount would almost certainly break configurations to that media.

IMO and aahth,
TS