How to exclude a path from reassign selinux context when using /.autorelabel?

Solution Verified - Updated -

Issue

During installation we move data from /var, /tmp and /home to a /SHARED mounted logical volume and use bind mounts to have /var, /tmp and /home linked to that. When we trigger an autorelabel of the selinux contexts, using touch /.autorelabel, all files in /SHARED gets relabelled to default_t

 # ll -Z /var/log/lastlog 
-rw-r--r--. root root system_u:object_r:default_t:s0   /var/log/lastlog

The issue is if a "autorelabel" is triggered again the selinux contexts for the "SHARED/nnnn" filesystems will be reset.
Is there a way to handle this?

Environment

Red Hat Enterprise Linux 6

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