Ubuntu – Deleted home directory. Please help

nautilus

Firstly just want to say that my issue I have is a result of being pretty stupid when it comes to computers and I'm sorry to take up people's time but if anyone could help I would very much appreciate it. My laptop runs Nautilus – Though I was left this computer by someone so I don't really know how to work it.

Anyway, what I wanted to do is change the user name in the log in settings. I thought it was just be pretty simple and straight forward but it wasn't and then what I have actually ended up doing is deleting the home directory that had the old name so now when I start up the computer it no longer starts up properly and I can't log in properly to even try and fix it.

I made a new home folder in the new name and transferred the contents there and then it said 'do you want to delete the old folder – it is ok to do so if you have made a copy in the new folder' or something like that. So I did. (I thought this would just change the name – that's all I wanted to do) Then everything was gone in the original home directory/folder (for instance when I clicked on any files or pictures on the desktop anywhere it said 'not found') and I got really worried all my stuff was gone but then I found a new folder in the new name that I had created somewhere and that had all my stuff in so I know it is still there. I thought then at least I still have my stuff.

Anyway, this was until I turned the laptop off. Now when I try and turn it on I get the following error pop ups in this order:

Could not update. ICEauthorityfile/home/username.ICEauthority

/usr/lib/libgconf2-4/gconf-sanity-check-2 was exited with status 256

Then it says these folders don't exist /home/username/desktop,/home/username/.nautilus You need to create the folders or set permissions or something.

Then it is just a blank background and I can't do anything at all. I can only log out, lock the session, shut down, restart etc. But there is just nothing else there.

Basically, I know this is probably a really stupid problem but I honestly don't know how to work this system so if anyone can help I would be so grateful. I just need to know how I can get back into the computer to get my stuff. I presume I need to recreate the deleted home folder with the old name. Or maybe create the the new folders with the new name?

I honestly don't know. This all probably didn't make any sense. Anyway if anyone can help please let me know.

Thank you so much!

Best Answer

The home directory must be recreated, and with the right permissions. This requires that you boot your computer into recovery mode (aka safe mode) when the starts press and hold the left Shift key and select Ubuntu, blah (recovery mode) from the list.

Once you're into the recovery mode in the system you'll see a menu, select "Root - Drop into a root shell prompt". you'll need to use some commands typed in to recover the system so write them down:

mkdir /home/username
chown username:username /home/username

Replace username with the username you need. To confirm that this is the directory you need and that it will work do:

cd ~username

And that's it, type reboot to get out and reboot the computer. Once you're back in your computer's user's desktop, you can go looking for your files; hopefully they've not been deleted as your description makes it sound like they've just been moved somewhere else. Find them and move them back using Nautilus, or if you don't have permission to move the files then use gksu nautilus to give yourself god like powers (be careful!)