• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

CentOS/RHEL: Mount Command Fails With “mount: does not contain SELinux labels”

by admin

The Problem

Getting below error message when trying to mount a filesystem:

# mount /dev/mapper/vg-lv /mnt
mount: /mnt does not contain SELinux labels.
     You just mounted an file system that supports labels which does not
     contain labels, onto an SELinux box. It is likely that confined
     applications will generate AVC messages and not be allowed access to
     this file system. For more details see restorecon(8) and mount(8).
mount: /dev/mapper/vg-lv mounted on /mnt.

Even though the output shows the device was mounted, it was actually not, which can be confirmed with commands such as df or mount.

The Solution

The partition’s SELinux context is incorrect. The correct context needs to be set in order to be able to mount the partition.

Relabel the filesystem by creating /.autorelabel followed by a reboot or perform restorecon on the filesystem:

# touch /.autorelabel
# reboot

or

# restorecon -Rv /

Filed Under: Linux

Some more articles you might also be interested in …

  1. poweroff Command Examples in Linux
  2. CentOS / RHEL : How to find RPM installation date and time
  3. Troubleshooting slow network communication or Connection Timeouts in Linux
  4. CentOS / RHEL 7 : How to disable all tty consoles and enable only 1
  5. rbash – Set Restricted shell in Linux
  6. Understanding The sysfs File System (/sys) in Linux
  7. gunzip Command Examples in Linux
  8. How to disable the default apache “Welcome Page” in CentOS/RHEL 7
  9. How to check failed or bad login attempts in Linux
  10. Basic “ls” Command examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • grpck command – Remove corrupt or duplicate entries in the /etc/group and /etc/gshadow files.
  • xxd command – Expressed in hexadecimal form
  • sesearch: command not found
  • macof: command not found

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright