[Samba] Use metadata files in Samba

Guenter Kukkukk linux at kukkukk.com
Tue May 29 02:25:49 GMT 2007


Am Sonntag, 27. Mai 2007 09:24 schrieb Thomas Bley:
> Hello,
> 
> Often people (or applications) want to store additional information
> about a file. E.g. history, approval state, search tags, etc. Some
> file formats offer to integrate these metadata, some not (e.g. exif-
> headers, id3, etc.).
> My idea would be to create an additional <filename.xyz>.meta file next
> to a <filename.xyz> in the same folder. If the <filename.xyz> gets
> renamed/deleted/moved, the <filename.xyz>.meta file should be also
> renamed/deleted/moved in case it exists.
> 
> Is this possible with Samba or are there better ways to do handle
> metadata ?
> 
> Regards
> Thomas
> 
> 

Hi Thomas,

Samba is accessed from a lot of different clients.
Many of them support meta file information
  - OS/2 extended attributes
  - windows alternate data streams and EAs
  - *nix xattr
  - ....

Samba3 does support most of those meta file/dir information,
but not 'alternate data streams'.

Under linux have a look at 'man setxattr' how to cope with that.
(see also cmds like setfattr, getfattr, ...)

Samba3 itself uses VFS_* wrappers to convert the smb xattr calls
into corresponding calls of the underlying operating system.

File systems support different max. summed up sizes for all xattr, e.g.
  - ext2 / ext3     ~3.9KB
  - reiserfs/XFS    N * 64KB
  - JFS             128KB

Have a look at the end of
http://samba.org/ftp/unpacked/samba4/howto.txt
It's from samba4, but explains some basic requirements for xattr support.

http://www.suse.de/~agruen/acl/linux-acls/online/
is a bit outdated, but does also mention 'extended attributes'.
As the article claims, some care must be taken during backup / restore,
when EAs or ACLs have been used.

Your 2 file approach is not supported bei samba - and imho is always a bad idea.

Cheers, Guenter


More information about the samba mailing list