Recover a destroyed account from an archive

Asked by John Winterton

UBUNTU 10.4 current to today's updates including the new kernel 2.6.32-23-Generic (2.6.32-23.37)

I accidentally deleted an account on my machine, including its home directory. By chance, I have a current archive of the home directory on my backup. I tried recreating the account then copying all the files from the archive to the new home directory (of the same name) and when I tried to log on to the account, I got the old wallpaper, but all the panels were missing, and none of the stuff that was in the original Desktop directory appeared. The system stayed in some kind of busy loop trying to do something that never terminated.

Now, I can rebuild this account from scratch, but it will be a job over several days which I would like to avoid. If I can delete and re-create the account with the exact parameters of the original (I'll have to guess), can I then expand the archive or must I avoid merging/replacing some critical files that are created. I am an old computer sweat, but very new to UBUNTU. My main O/S experience with this type of system is with UNIX BSD 7, which was something like 30 years ago, and running on a set of VAXen.

I am confused by the fact that this system seems to do a lot more for you than the old one ever did.

Question information

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

You may need to chown the restored data to the username. The name may be different but the name is representative of a UID which may NOT be the same. To (maybe) fix run:

cd /home; sudo chown -R foo:foo ./foo

replace foo with your username. E.g.

cd /home; sudo chown -R andy:andy ./andy

This will help.

Revision history for this message
John Winterton (jwinterton) said :
#2

I tried that. What I think happened is that I clobbered some of the dot files when I did the copy that should have been left alone. I have to get some of them because the account uses wine, but when it asks if the shell control files should be replaced, this time I'll say no.

As a matter of interest, I do all this from the root account. Typing sudo all the time is a bit of a nuisance, and it is easier to do all this from root, no matter what risks you think may be there. I am not green with operating systems, just a little out of date.

So, I have recreated the account, and am going to log in on it, and try my luck with selectively copying the archive stuff over. Instead of a shotgun, I will use a stiletto. We'll kill this beast eventually.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

Loging on as root is really dumb and a massive security risk.

Revision history for this message
John Winterton (jwinterton) said :
#4

Yes, I know all about that. I was once a trained security specialist. However, this is a "very" private machine, so I am willing to take the chance. I don't tend to fumble finger anything after 48 years of being both a system administrator and an O/S programmer.

BTW, I didn't quite get it. Something is inhibiting the desktop display and all the .wine files don't seem to be there.

I give up. I am going to rebuild the account manually. I've spent a whole day on this, and could have built the account in a couple of hours. It only goes to show that stopping hitting your head against a wall is sometimes smart.