1

I'm running CentOS 6.5 in a VirtualBox VM. Recently, I ran out of space for my virtual hard disk. To remedy this, I decided to create a second hard disk for the /usr directory. I mounted that and copied over files as root with rsync -a /usr.bak /usr. This seemed to have preserved all file ownership and permissions.

However, now I'm getting weird permission issues. While I can boot the system just fine, various things don't work, like:

  1. The network adapter doesn't work sudo service network restart fails while "Determining IP information for eth0."
  2. Doing an ACPI shutdown no-longer pops up the same dialog in Gnome.
  3. I see some "/usr/bin/logger: Permission denied" errors.

I had disabled SELinux earlier, so I don't think this is interfering. I also tried to fix permissions by running this as root, but the problem persists:

for i in `rpm -qa`;do rpm --setperms $i;done

What could have been messed up in my copying files using rsync to this new mount point? Anything I can do to repair things? Note that this is a development sandbox, so I'm not super concerned if a fix would involve a non-ideal security setup.

1

rsync works as below.

rsync options source destination

But what you have done is,

rsync -a /usr.bak /usr

Shouldn't be the other way around?

As far as I see, you have messed the permissions with assigning the permissions of /usr.bak to /usr. Change the rsync command after restoring the original permissions in /usr directory and then if you reboot the system the issue should be resolved. The restart is just to be sure, though not required.

Sometimes, the permissions might be messed up because of rpm packages too. You can find a discussion related to that issue here.

These files are created by rpm if it tries to update an exiting file which it can't change because of "chattr +i /usr/bin/write". i've done that ages ago after i removed the setuid-flag. strange thing, is that the +i was gone on write and chsh and the setuid was back.

  • I renamed the original /usr to /usr.bak, mounted the new /usr, then ran that command. /usr.bak is the source. – Jacob Apr 25 '14 at 23:10
  • So /usr/bin/logger should be read from /usr.bak/bin/logger now, instead? – Ramesh Apr 25 '14 at 23:14
  • No. I copied the files that were previously in /usr (/usr.bak) to the new /usr directory. – Jacob Apr 25 '14 at 23:30
  • @Jacob, I think the issue might be with rpm as pointed out in the forum that I had provided. However, I am not sure if there could be some other issues other than this. – Ramesh Apr 25 '14 at 23:42

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.