On Sun, Oct 11, 2015 at 07:17:59AM -0400, Daniel J Walsh wrote: > On 10/10/2015 05:07 AM, Suvayu Ali wrote: > > On Sat, Oct 10, 2015 at 12:31:59PM +0530, Rejy M Cyriac wrote: > > > >> The following would have retained the SELinux contexts > >> > >> rsync with the --xattrs option > >> tar with the --selinux or --xattrs option > > Thanks a lot! I'll remember this for the future. Is there any simple > > way to restore the contexts now, after the fact? If not, maybe > > something like the command below? > > > > # cd /old && find . -exec chcon --reference=\{\} /var/\{\} \; > > > If you are moving content around you should reset the default labeling. > In this case you could do something like > > # semanage fcontext -a -e /var /old > # restorecon -R -v /old > > Which would make your labels survive a relabel Thanks a lot Dan. Seems to have worked, presuming the warnings can be ignored: # semanage fcontext -a -e /var /mnt # restorecon -R -v /mnt restorecon: Warning no default label for /mnt/lib/nfs/rpc_pipefs restorecon: Warning no default label for /mnt/spool/cron/user Cheers, -- Suvayu Open source is the future. It sets us free. -- users mailing list users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines Have a question? Ask away: http://ask.fedoraproject.org