3

I needed more space in the /var tree on a VM so I allocated some, booted in to runlevel 1 and copied over the folder to the new space. After changing the fstab entry for /var to reflect the new location I rebooted.

(you can see what's coming)

The boot process was pretty well mangled. I had to disable selinux to get anything working properly.

Given the nature of this system I would like to reenable selinux but I'm not clear how to get it all setup properly. Looking at the perms using ls -Z it all appears the same (as the original /var folder) but clearly something is amiss.

What step(s) did I miss?

EDIT: This is the (relevant) output of ls -alZ /:

drwxr-xr-x  root  root     ?                                var
drwxr-xr-x. root  root     system_u:object_r:var_t:s0       var.old

Looks like a promising avenue - though I note that /sys, /dev and /proc all have '?' there.

  • What are the permissions on the /var directory? This could be throwing selinux for a loop. When you mount a volume on a directory, it doesn't inherit the permissions of the directory, it has its own permissions. – Aaron Mason Sep 22 '13 at 23:57
6

Should be a pretty simple fix:

  1. Set SELinux to permissive. Edit /etc/sysconfig/selinux and set SELINUX=permissive. This should let you boot normally while still being able to use SELinux utilities.

  2. Reboot the system.

  3. Restore all the file contexts for the entire system.

    restorecon -r -v /
    
  4. Set SELinux to enforcing. Edit /etc/sysconfig/selinux and set SELINUX=enforcing.

  5. Reboot the system.

1

You'll need to apply the security settings to the /var mount point. Do you have any other mount points, say for /usr?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.