Bug 10610 - Samba DC dos not load vfs modules (eg: shadow_copy2)
Samba DC dos not load vfs modules (eg: shadow_copy2)
Status: NEEDINFO
Product: Samba 4.1 and newer
Classification: Unclassified
Component: VFS Modules
4.1.7
All All
: P3 normal
: ---
Assigned To: Samba QA Contact
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-05-16 00:21 UTC by alex.braunegg
Modified: 2014-05-28 10:24 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description alex.braunegg 2014-05-16 00:21:01 UTC
When running Samba 4.1.7 (and prior) in normal samba server mode, a share with the following configuration correctly presents 'Previous Version' file details to Windows systems:

        vfs objects = shadow_copy2
        shadow: sort = desc
        shadow: snapdir = .zfs/snapshot
        shadow: format = zfs-auto-snap_%Y-%m-%d-%H%M%S

When Samba AD / DC mode is configured, and when the same share is added to smb.conf the 'Previous Version' details now reports to Windows that there are no previous versions available.

Browsing to the share, the .zfs/snapshot directory is visible, the modified / previous files are able to be accessed without issue.

When enabling logging (level 9) nothing appears obvious as an error. Happy to do any legwork to provide any details required to further diagnose.
Comment 1 David Disseldorp 2014-05-16 08:32:41 UTC
Are you still using the smbd file server when Samba AD / DC mode is configured? The smbd file server is required, in order to support the vfs_shadow_copy2 module.
Comment 2 alex.braunegg 2014-05-16 22:13:57 UTC
Hi David,

Thanks for the response. How do I check for this?

I provision Samba AD via the following:

/usr/bin/samba-tool domain provision --domain=$netbiosDomain --realm=$dnsDomainName --server-role=$serverRole --adminpass=$administratorPassword --dns-backend=$dnsBackend --use-rfc2307 --use-ntvfs

Apart from adding in the share's manually that have known snapshots, the smb.conf that samba-tool generates is left intact.

If I attempt to start the smb service when the samba service (Samba AD) is running, the smb service fails to start.

If I attempt to run smbd manually (/usr/sbin/smbd -D), whilst samba is running the following gets logged in the log.smbd:

[2014/05/17 08:01:56.059546,  0] ../source3/smbd/server.c:1257(main)
  server role = 'active directory domain controller' not compatible with running smbd standalone. 
  You should start 'samba' instead, and it will control starting smbd if required

So .. the log is advising what you've mentioned as well.

Is there a configuration option that I am missing that allows 'samba' to control 'smbd' ?

smb.conf below:

[global]
        workgroup = LAB
        realm = localdomain.net
        netbios name = LAB-AD
        server role = active directory domain controller
        dns forwarder = 192.168.153.2
        server services = rpc, nbt, wrepl, ldap, cldap, kdc, drepl, winbind, ntp_signd, kcc, dnsupdate, dns, smb
        dcerpc endpoint servers = epmapper, wkssvc, rpcecho, samr, netlogon, lsarpc, spoolss, drsuapi, dssetup, unixinfo, browser, eventlog6, backupkey, dnsserver, winreg, srvsvc
        idmap_ldb:use rfc2307 = yes 
        posix:eadb = /var/lib/samba/eadb.tdb

        vfs objects = shadow_copy2
        shadow: sort = desc
        shadow: snapdir = .zfs/snapshot
        shadow: format = zfs-auto-snap_%Y-%m-%d-%H%M%S

        log level = 9

[netlogon]
        path = /var/lib/samba/sysvol/localdomain.net/scripts
        read only = No

[sysvol]
        path = /var/lib/samba/sysvol
        read only = No

[home]
        comment = User Home Directories
        path = /storage/samba/UserHomeDirectories
        hide files = /desktop.ini/$RECYCLE.BIN/
        read only = No
Comment 3 alex.braunegg 2014-05-28 05:40:48 UTC
In further diagnosis, this issue is caused by the --use-ntvfs switch.

Without the switch, Windows 'Previous Versions' works as expected when provisioning Samba AD in the following fashion:

/usr/bin/samba-tool domain provision --domain=$netbiosDomain
--realm=$dnsDomainName --server-role=$serverRole
--adminpass=$administratorPassword --dns-backend=$dnsBackend --use-rfc2307

Happy to close this issue out as not a bug, however could someone potentially enlighten me as to if Windows 'Previous Versions' should be working when the --use-ntvfs switch is used? If so, then this is potentially a bug?
Comment 4 Volker Lendecke 2014-05-28 10:24:26 UTC
(In reply to comment #3)
> Happy to close this issue out as not a bug, however could someone potentially
> enlighten me as to if Windows 'Previous Versions' should be working when the
> --use-ntvfs switch is used? If so, then this is potentially a bug?

It's unlikely that that will work with ntvfs. And it's more unlikely that this will be fixed, ntvfs is only around for historic reasons. smbd is the recommended solution for file serving these days.