Is it possible to backup certain directories and contents with there selinux context?

Solution Verified - Updated -

Issue

  • Need to take backup of a directory using tar.
  • The directory contains lots of files which has SELinux Contexts associated with them, is it possible to retain the SELinux Contexts in the backed up copy so that it can be used to restore on SELinux Enabled systems without relabling them?

Environment

  • Red Hat Enterprise Linux 5/6/7

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.