I have a windows share on a windows2003 server (WINJOE) which I want to back up to a Linux machine (LINUXJOE) that is properly joined to the domain. My goal is to backup shared folders of WINJOE to LINUXJOE while keeping windows permissions/owners. After reading the relevant literature, I am under the impression that this is not possible...
Anyway, in an ideal world, I would like to mount a win share (as read-only), e.g. \\WINJOE\important_folder, on LINUXJOE and run rsync from there to the backup directory.
What I have so far:
\\WINJOE\important_folder -> shared folder to be backup up
LINUXJOE: /mnt/important -> mount point of \\WINJOE\important_folder on LINUXJOE
LINUXJOE: /backup/$DATE-important -> backup target directory
At the moment I am able to login using my windows domain account to LINUXJOE, and if I create files on LINUXJOE's filesystem, they show the owner as "somewinuser "domain users"", so user mapping from windows to linux works ok. When I mount \\WINJOE\important_folder using the following command:
linuxjoe# mount.cifs //WINJOE/important_folder /mnt/important \
-o ro,user=backitup,dom=TODOMAIN,cifsacl,nounix --verbose
I get:
ls -latrh
linuxjoe# ls -latrh /mnt/important
total 518M
-r-xr-xr-x 0 root root 518M Sep 28 01:19 test.mkv
-rwxr-xr-x 0 root root 0 Oct 25 19:04 testlalala
-rwxr-xr-x 0 root root 0 Oct 25 19:05 testkoko
drwxrwxrwx 1 root domain users 0 Oct 25 19:05 .
drwxr-xr-x 5 root root 4.0K Oct 29 16:29 ..
getcifsacl
linuxjoe# getcifsacl /mnt/important/test.mkv
REVISION:0x1
CONTROL:0x8404
OWNER:BUILTIN\Administrators
GROUP:TODOMAIN\Domain Users
ACL:Everyone:ALLOWED/I/FULL
ACL:NT AUTHORITY\SYSTEM:ALLOWED/I/FULL
ACL:BUILTIN\Administrators:ALLOWED/I/FULL
ACL:TODOMAIN\lukeskywalker:ALLOWED/I/FULL
rsyncing:
linuxjoe# rsync -apvXAgo /mnt/important/koko.mkv /root/test/
linuxjoe# ls -latrh /root/test/
total 518M
-rwxrwxrwx 1 root domain users 518M Sep 28 01:19 test.mkv
drwx------ 8 root root 4.0K Oct 29 18:29 ..
drwxr-xr-x 2 root root 4.0K Oct 29 18:29 .
Is it in any way possible, to view the proper owner of files on windows shares, and keep that owner along with all windows security attributes when I rsync from a windows share to my linux backup box?
smb.conf
[global]
workgroup = TODOMAIN
realm=SOMEOFFICE.SOMEWHERE.GR
server string = %h server
wins support = no
security = ads
encrypt passwords = yes
obey pam restrictions = yes
template shell = /bin/bash
template homedir = /home/%D/%U
password server=winjoe.someoffice.somewhere.gr
domain master = no
local master = no
prefered master = no
idmap config * : backend = rid
idmap config * : range = 5000-3000000000
idmap config * : base_rid = 0
idmap config TODOMAIN : backend = rid
idmap config TODOMAIN : range = 5000-3000000000
idmap cache time = 900
algorithmic rid base = 5000
client schannel = no
disable spoolss=yes
winbind separator=+
winbind use default domain=yes
winbind nested groups=yes
winbind enum users=yes
winbind enum groups=yes
winbind cache time= 300
winbind refresh tickets = yes
inherit acls = Yes
map acl inherit = Yes
acl group control = yes