Ubuntu – My home folder is owned by root, how can I fix this


I put my home folder on its own partition following the instructions in the Ubuntu Documentation Partitioning/Home/Moving wiki.

Now I'm not the owner of my own home folder. How can I fix this? I can't use Wine because it says I have to be the owner of my home folder. When I use sudo nautilus then try to change permissions, it reverts to root every time I select myself or any other group. Is there a command I can use to make myself the owner of my home folder?

I have already tried the following commands:

    sudo chown -R username /home/username

• This one wouldn't work, it replied: chown: cannot access '/home/aaron/.gvfs': Permission denied

sudo chown -hvR username:username /home/username  

• This one output all of my files' names telling me that their ownership was changed, but when I went and checked it still said root.

Best Answer

I have faced this problem and solved by using a trick. You are getting chown: cannot access 'home/aaron/.gvfs': Permission denied error because .gvfs directory is in use.

What I suggest you to do.

  • Restart your system in Recovery Mode and follow these steps.

    • First chose the option Grub from the Menu listed there, accept yes. It will mount your file system in read/write mode. After updating it will exit from the Grub and will come back to Menu. Then chose root.

    • Now you execute all your commands that have you tried above again.

    • It would successfully change the permission. Then run following command to reboot your system.

      # reboot
  • 2nd way is little tricky. But you can give it a try. Hope it works for you also, it worked for me.

    • Press CTRL+ALT+F1 to go to tty1 and login with your username.
    • Execute following command:

      sudo pgrep $ | sudo xargs kill
    • It will display some message and wait for your next instruction. Do nothing just just press CTRL+ALT+F2 to go to tty2 and again login.
    • Here you have to run your commands to that you have already tried to make change your permission of your home.
    • Then go back to previous tty1 CTRL+ALT+F1 and press CTRL+Z or CTRL+C.

    • Press CTRL+ALT+F7 or CTRL+ALT+F8 to get your display back. you can also use ALT+ -> continuous to get your display back.

Hope it will work for you. Reply if something goes wrong.

Related Question