The following error is generated when rsync is run with the -X option (preserve extended attributes)
rsync -axHAX --delete /. /tmp/selinux/.
rsync: rsync_xal_set: lsetxattr("selinux","security.selinux") failed: Permission denied (15)
rsync error: some files/attrs were not transferred (see previous errors) (code 31) at main.c(1039)
To resolve this error, filter the ‘/selinux’ filesystem from the command. Run rsync as below;
rsync -axHAX --delete --filter="- /selinux" /. /tmp/selinux/.
It is suggested to also excluded /var/run, /var/lock, /proc and /dev from rsync command.