[CentOS] Urgent help on replacing /var

Fri Aug 3 15:25:17 UTC 2012
Lamar Owen <lowen at pari.edu>

On Friday, August 03, 2012 06:24:46 AM Emmanuel Noobadmin wrote:
> In a moment of epic stupidity, having ran out of space on the root
> partition of a server due to /var chewing up the space, I added a
> separate drive for the purpose of mounting it as /var
...

This sort of things pops up from time to time.... from a thread back in April.....

On Wednesday, April 11, 2012 05:38:13 PM Jason Pyeron wrote:
> > -----Original Message-----
> > From: centos-bounces at centos.org 
> > [mailto:centos-bounces at centos.org] On Behalf Of Alexander Dalloz
> > Sent: Wednesday, April 11, 2012 17:12
> > To: CentOS mailing list
> > Subject: Re: [CentOS] How to fix a chown oops...
> > 
> > Am 11.04.2012 23:02, schrieb Jason Pyeron:
> > > chown -R 7.0 /sbin/
> > > chown -R 98.98 //
> > > 
> > > Is there a rpm way fix all the permissions of files managed by rpms?
> > 
> > http://wiki.centos.org/TipsAndTricks/YumAndRPM#head-20a3ecce3d
> > 0762b9cdd3307ef2632e0c274a2bfd
> 
> rpm -qa | while read line; do echo $line && rpm --setperms $line; done
> 

...

By extension:


rpm -qa | while read line; do echo $line && rpm --setugids $line; done

should handle ownerships.  Then, reenable selinux in permissive mode, and set it to relabel on the next boot.