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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content