• 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. phar Command Examples in Linux
  2. cryptsetup: command not found
  3. 3 Ways of Increasing Swap Space on Linux
  4. dirb: command not found
  5. How to Troubleshoot Performance Issues on Linux – Beginners Guide
  6. ping not working on a Newly Built CentOS/RHEL server
  7. raspistill: command not found
  8. How to delete unused kernels and keep only the running kernel in CentOS/RHEL
  9. useradd Command Examples in Linux
  10. xz Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • pw-cat Command Examples in Linux
  • pvs: command not found
  • pulseaudio: command not found
  • pulseaudio Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright