Share a folder on a second drive

I have a PC running Linux Suse (about which I know little!!). I managed to share a folder using Samba from within my home area, but I also want to share a folder that is on another hard drive. From the root I can see the folder and update the permissions, but if I click on read and write, it ignores this.

Any idea how I can get RW access from some windows PCs on a network to folders on other than the base Suse drive

Thanks

On 09/12/2012 06:56 PM, denwheels wrote:
>
> I have a PC running Linux Suse (about which I know little!!). I managed
> to share a folder using Samba from within my home area, but I also want
> to share a folder that is on another hard drive. From the root I can
> see the folder and update the permissions, but if I click on read and
> write, it ignores this.
>
> Any idea how I can get RW access from some windows PCs on a network to
> folders on other than the base Suse drive
>
> Thanks
>
>

The direction we take hinges on whether the filesystem on the second
drive is NTFS or Linux (e.g. ext4, ext3 etc).

If it’s linux you simply chown the folder to be owned by your username
and group. If it’s NTFS you make a similar adjustment in the line in
fstab that mounts the partition.

So please tell me, is it NTFS or Linux (and if it’s Linux, what
filesystem). Then I will give you exact details.

That’s part one. Part two is to share the folder. Let’s use an example.
Suppose your username is fred and the path to the folder that you want
to share is /some_path/foldername. Then put this code in the file
smb.conf and it will be shared properly:


[ShareName]
path = /some_path/foldername
guiest ok = yes
read only = no
force user = fred

But first: what is the filesystem?

Regards
swerdna

Hi Swerdna,
I see this thread is open ended, and as it seems to fit my needs, I’d like to continue it (waste not want not).

I am using OpenSuse 13.2 installed entirely to a 160GB drive (SDA) (/ = BtrFS, /home = XFS, Swap = Swap).
I have put a second 2TB drive (SDB) into this machine and wish to share parts of it’s contents.

SDB is formatted to NTFS and it’s entry in /etc/fstab is;

UUID=0D2E3B186B54C6F1 /mnt/archive/ ntfs-3g    quiet,defaults,locale=en_US.utf8,uid=1000,gid=100,umask=0002    0 0

My samba config file (/etc/samba/smb.conf) is;

[global]
  workgroup = WORKGROUP
#  netbios name = SAMBA_2
  passdb backend = tdbsam
  name resolve order = bcast host lmhosts wins
  server string = ""
  printing = cups
  printcap name = cups
  printcap cache time = 750
  cups options = raw
  use client driver = yes
  map to guest = Bad User
  local master = yes
  os level = 65
  usershare allow guests = Yes
  usershare max shares = 100
  usershare owner only = False

[homes]
  comment = Home Directories
  valid users = %S, %D%w%S
  browseable = No
  read only = No
  inherit acls = Yes

[printers]
  comment = All Printers
  path = /var/tmp
  printable = Yes
  create mask = 0700
  browseable = No
  guest OK = Yes

[print$]
  comment = Printer Drivers
  path = /var/lib/samba/drivers
  write list = @ntadmin root
  force group = ntadmin
  create mask = 0664
  directory mask = 0775

[Backup]
    path = /mnt/archive/Backup
    inherit acls = Yes
    guest ok = No
    valid users = @users
    create mode = 0660
    directory mode = 0770
#  profile acls = Yes
#  use sendfile = Yes
#  write list = backup, iso_admin, michael

The folder is shared and visible to clients, but when accessing smb://linux-samba/Backup/ (even at the server), group access is read only, so logging in as the samba user “michael” (uid=1000) is required to gain write access; however the folder locally /mnt/archive/backup has rw enabled for group, and the other samba users are members of the users group (gid=100);

michael@linux-samba:~> ls -ld /mnt/archive/Backup
drwxrwxr-x 1 michael users 0 Sep 14 17:09 /mnt/archive/Backup

How can I achieve rw access to this share for members of the users group, over samba. I will have other shares that allow rw access to just michael and iso_admin, but I have yet to set these up.

Thanks in advance for your help with this problem.

Michael

On 2015-09-15 15:16, miclac wrote:
> SDB is formatted to NTFS and it’s entry in /etc/fstab is;

This means that Linux can not store permissions on it.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Hi Carlos,
Thanks for your reply. Sorry for my difficulty explaining my problem.

I’m not concerned that the permissions aren’t stored on SDB. I need access (read & write) over SAMBA for members of the users group.

Presently when using SAMBA I have read only access for group members, and read/write access just for the owner (owner is specified in /etc/fstab as UID=1000). But what confuses me is that this is not the case for local access which has read/write access for both group members and the owner.

I had tried using the "write list = " line to control access, but while this worked on an older set-up, it doesn’t seem to work here so it is commented out.

Thanks.

Michael

It would realy have been better to start a new thread of your own because:

  • not many people will st ill be subscribed to an old thread like this;
  • most people will check new threads for subjects where they can possibly help and thus they will never see this;
  • the version of the software you use will definitely be different from that used in 2012;
  • your problem is most likely different from the original one and thus there may be confusion on the what is used/done/experienced.

Remember that you want help, the best help. Thus it is you that must advertise your problem in the best way: a new thread in the correct forums with a good title that contains the keywords to draw the attention of the people best able to help you.

On 2015-09-15 16:16, miclac wrote:
>
> robin_listas;2728261 Wrote:
>> On 2015-09-15 15:16, miclac wrote:
>>> SDB is formatted to NTFS and it’s entry in /etc/fstab is;
>>
>> This means that Linux can not store permissions on it.

> Hi Carlos,
> Thanks for your reply. Sorry for my difficulty explaining my problem.
>
> I’m not concerned that the permissions aren’t stored on SDB. I need
> access (read & write) over SAMBA for members of the users group.

But Samba can not write permissions on it.

As the disk is attached to a Linux box, why not format it with something
native to Linux? :-?

> Presently when using SAMBA I have read only access for group members,
> and read/write access just for the owner (owner is specified in
> /etc/fstab as UID=1000).

Define also the GID.

> But what confuses me is that this is not the
> case for local access which has read/write access for both group members
> and the owner.

Samba must be using another group for access.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

For all network shares,

  • There is the network share permissions on top which is often “Windows Shares” in Windows or “Samba” when the CIFS shares are managed on Linux.
  • There is the filesystem permissions below which are managed only in the context of that file system.

So,
In your system you seem to have managed your “upper level” network share permissions but are stymied by the underlying file system permissions, and in your particular case the file system is a Windows fs (NTFS but the same would apply to others like FAT32)… because the net result permissions is a combination of both the upper level and lower level permissions.

As a general practice, I have addressed the problem you describe by accessing the disk in a Windows system and resetting the permissions to permit everything by everyone (yes, you’d never find this enabled by default anywhere by Windows natively… Typically only Windows User Accounts are given write/execute permissions). Once that has been set, <then> you can attach the drive to a non-Windows Linux system and permissions would be managed <only> by the upper level SAMBA permissions.

HTH,
TSU

Hi,
Thank you both for your input.

I got waylaid yesterday but I seem to have resolved my issue this morning.

I have changed my /etc/fstab entry from;

UUID=0D2E3B186B54C6F1 /mnt/archive/ ntfs-3g    quiet,defaults,locale=en_US.utf8,uid=1001,gid=100,umask=0002    0 0

to;

UUID=0D2E3B186B54C6F1 /mnt/archive/ ntfs-3g    defaults,noatime    0 0

I have also returned the share entry in /etc/samba/smb.conf to;

[Backup]
    path = /mnt/archive/Backup
    inherit acls = Yes
    guest ok = No
    profile acls = Yes
    use sendfile = Yes
    write list = backup, iso_admin, michael

This will allow me to control user access to certain shares depending on the samba user.

Thanks again

Michael