I made a mistake in changing ownership of files and folders. Help please T_T

Asked by izzy martin roxas maxino

I ran:

sudo chown -R <user>:<user> /

i should have ran:

sudo chown -R <user>:<user> ./

I carelessly changed the ownership of my root "/" directory to my user and I don't know how to reverse it. T_T

i tried using

sudo chown -R root:root: /

but it returns "Operation not permitted." for each file and directory.

can I reverse this aside from completely formatting my whole drive and install it again?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

oh boy you have reall knackered your system dude, this will take an age of digging. / is the lowest file location so you just replaced ownership of everything on your system, not all folders outside of $HOME are owned by root.

I suggest you boot to livecd and mount the partition to chown back to root then chown your home folder(s) back t their users in a chroot

This is a huge mess.

Revision history for this message
Michael Mulqueen (michael.mulqueen) said :
#2

Try
It without sudo at the front. Since you own it now, you should be able to change it with your user. Then after that you'll have to chown ~/ back to yourself.

Let me know how this goes. You do it at your own risk. Next stop is trying to fix it with the LiveCD.

Revision history for this message
Rohan Kapoor (rohankapoor) said :
#3

Michael's advice is spot-on. You've really made a complete mess of your current install. My recommendation would be to just wipe the drive and start again after backing up any needed files using the LiveCd. It actually might have less effort and work.

Good Luck!

Can you help with this problem?

Provide an answer of your own, or ask izzy martin roxas maxino for more information if necessary.

To post a message you must log in.