LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Not restoring Extended Attributes on Samba share (https://www.linuxquestions.org/questions/linux-server-73/not-restoring-extended-attributes-on-samba-share-4175733940/)

mfoley 02-16-2024 07:10 PM

Not restoring Extended Attributes on Samba share
 
I may have a serious problem. I have a Linux host Samba sharing a directory for use by Windows workstations. Relevant smb.conf:
Code:

[Users]
    path = /redirectedFolders/Users
    comment = user folders for redirection
    read only = No

THese folders all had extended attributes, signified by the '+':
Code:

drwxrwx---+  6 BUILTIN\administrators users 4096 2024-02-08 21:07 Administrator/
:
drwxr-xr-x+ 32 HPRS\mark              users 4096 2023-03-30 06:13 mark/
drwxrwx---+  5 HPRS\esi              users 4096 2022-05-04 18:13 esi/

I backed up this drive and restored it to a new computer. I also backed up attr's and facl's:
Code:

getfattr -dR /redirectedFolders /var/lib/samba/sysvol /var/lib/samba/share >/backupATTR.txt
getfacl -R /var/lib/samba/sysvol /var/lib/samba/share > /backupACL.txt

On the restored-to system, I restored these:
Code:

# cd /
# setfattr --restore=backupATTR.txt
# setfacl --restore=/backupACL.txt

I got no errors except on setfattr on e.g. "$RECYCLE.BIN: No such file or directory", because I didn't back up the $RECYCLE bins.

Problem: this did not set the attributes on the target files/directories:
Code:

drwxrwx---  6 BUILTIN\administrators users 4096 2024-02-08 21:07 Administrator/
:
drwxr-xr-x 31 HPRS\mark              users 4096 2023-03-30 06:13 mark/
drwxrwx---  5 HPRS\esi              users 4096 2022-05-04 18:13 esi/

What did I do wrong? How can I fix this? I still have access to the backup source files/directories if I need to redo something.

I need to figure out a solution before the workers get back on Monday or I'll have to put the old machine back online. :(

mfoley 02-16-2024 10:35 PM

Solved! As it turns out, I didn't back up the acls for that directory. When I looked at my backup script again I saw that the acl backup for redirectedFolders was commented out. I did that over a year ago because the Slackare 14.2, [get|set]facl 2.2.52 could not restore acls properly. I posted a thread on this back then: https://www.linuxquestions.org/quest...ent-4175721430. No one had a solution, so I commented out the acl backup until I found a fix.

The current [get|set]facl 2.3.1 works, so I snagged the acls off the original system, restored them on the new system and voila! All is well.


All times are GMT -5. The time now is 10:57 AM.