1

After a forced reboot a particular folder in my home directory is owned by nobody. I am trying to change that to root but I get the following

chown: cannot read directory ‘databases/’: Permission denied.

This is the command I sudo chown -R root databases/ and this is the permission of the folder:

drwxrwx--x 36 nobody nobody 4096 Jul 9 08:10 databases

How can change the ownership?

  • 1
    Can you please provide the output of mount | grep home? This will allow use to check the filesystem type as well as confirm it's not mounted read-only. – mjturner Jul 10 '15 at 11:05
1

It depends on the file system in which your folder resides. It could be that your file system either does not support Linux permissions/ownerships (e.g. NTFS) or that something corrupted when you forced the reboot. This might be a silly suggestion, but have you tried also with chown -R root:root databases/ (either with sudo or directly as root)?

0

Check if the attributes for the folder are proper. Do this:

lsattr

It should give some output like this:

----i--------e-- ./databases

Now, if the i attribute is present, it means that the folder is not editable. So, you should remove that attribute and keep only the e attribute. To do this, do:

sudo chattr =e databases/

After this, you can now change the ownership.

  • 1
    I tried run lsattr but I have lsattr: Permission denied While reading flags on ./databases. I also tried with sudo but with the same resuts – salvador Jul 10 '15 at 9:27

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.