LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-05-2004, 02:27 PM   #1
phlyersphan
Member
 
Registered: Jun 2004
Location: Chicago, IL USA
Distribution: Mandrake 10
Posts: 103

Rep: Reputation: 15
Help - Deleted home dir, can i restore?


Well, I really messed up this time.

I was doing some housekeeping in my Home directory, using the gui/konqueror. I was deleting files (highlight, hit delete key). I obviously wasn't paying attention to what I was deleting, and the next thing you know, I deleted the entire contents of my home dir. I hit cancel before it deleted EVERYTHING, but all i have now is the trash icon (even deleted the desktop folder), and when I try to view the trash, I get "Klauncher could not be reached via the DCOP."

My concern is that I had 2 programs installed that stored info there - primarily, evolution for my mail/contacts. Now I'm getting all kinds of errors about not being able to access folder (surprise, because I deleted them! )

Is there anything I can do to restore those files? (A command line tool perhaps?)

If not... any suggestions on "fixing" things?

My desktop icon for "Home" is gone too

Just when I was so glad to have switched over to linux.... my gut wants to run to the windows world where i know everything! It's hard to be a newb all over again...

Thanks all...
 
Old 07-05-2004, 02:32 PM   #2
brynjarh
Member
 
Registered: May 2004
Location: Iceland
Distribution: Ubuntu Dapper Drake
Posts: 172

Rep: Reputation: 30
I don't know how you could get your files back but I do know what I would do in this scenario, that is create a new account and delete the old one, then I would have a 'working' home directory again.

But that's maybe not an option for you?
 
Old 07-05-2004, 02:38 PM   #3
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
If you need something selfmade from your homedir, see an other discussion.

To just reinitialize your home directory, you can create a new user to your system and you have initial configuration again.
 
Old 07-05-2004, 02:41 PM   #4
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
This info is what the Gnome desktop does, but KDE is probably similar...

The trash can is just a "front end" for a hidden directory inside your home directory. Specifically: ~/.Trash

Now, you can log into a virtual terminal (Ctrl-Alt-Shift-F1) or with a terminal inside KDE (if you can open one without errors), and search for that directory or one like it. If you can't find it, then there probably is not much you can do to restore it. If it does exist, it's just a matter of copying the files in that directory back to their proper places. That, however, could be long, tedious, and difficult depending on whether the directory structure remained intact when the files were put in the trash can.

If you can't find the directory or it's mangled beyond recognition, then brynjarh and ToniT give good advice on creating a new account and copying it to use as a template to rebuild your stuff. Unfortunately though, that won't restore contact info, but it will get you running again.
 
Old 07-05-2004, 02:52 PM   #5
phlyersphan
Member
 
Registered: Jun 2004
Location: Chicago, IL USA
Distribution: Mandrake 10
Posts: 103

Original Poster
Rep: Reputation: 15
OK, seemingly good news here. In KDE, under my Desktop directory in home, there is a hidden Trash folder, and indeed all of my folders/files are still in it. I'm now trying to copy its contents back to my home directory.

Is there a "more correct" way to copy directories than using
cp -r ??

I'll let u know how it goes.... (yikes!!)
 
Old 07-05-2004, 03:01 PM   #6
phlyersphan
Member
 
Registered: Jun 2004
Location: Chicago, IL USA
Distribution: Mandrake 10
Posts: 103

Original Poster
Rep: Reputation: 15
OK, all files are back in place. I'm going to log out and back in and cross my fingers that this DCOP error stops - otherwise I imagine I must fix KDE somehow? With an update/reload off the CD perhaps?

/edit - Oh I am a happy happy girl

Logged out, back in - it went through the new user wizard as if my user account was brand new, and upon re-answering its various questions, it loaded me back into a working KDE (but somehow had saved most of my previous settings - application buttons in the toolbar, etc). In evolution, I had to re-setup my configuration settings for my email accounts, but all of my previously existing mail folders were there and contacts in-tact.

Happy happy joy joy, happy happy joy joy!!!

Thank you SO MUCH everyone for your immediate responses!! I am fully functional once again, and learned something in the process.

That is the best part of running linux, I think (well aside from stability, lack of bluescreens and viruses....) - the fact that there's actual accountability on the users. You have to actually know what the system is doing, how things work, etc. to operate it effectively. Yes, it's a learning curve for newbies, but the sense of accomplishment when you actually fix a problem without relying on some wizard to hold your hand - not much in computing can beat that feeling.

Day 5 of my life as a linux convert, and I'm doing just fine!

Thanks again !!!!!

Last edited by phlyersphan; 07-05-2004 at 03:17 PM.
 
Old 07-05-2004, 03:34 PM   #7
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
Glad you got it working again!

In case you're ready to try the "next step", there's a simple way to backup your home directory. Assuming your home dir is /home/shelly

[you@your_host]$ cd /home
[you@your_host]$ tar cvjf /tmp/shelly_home_backup.tar.bz2 shelly
lots of output
[you@your_host]$ mv /tmp/shelly_home_backup.tar.bz2 /path/to/some/safe/backup_directory

In fact, you could automate that easily with a script to run everytime you shotdown the computer, logout, or at a specific time each day/week/month/whatever.

Then, if something like this should ever happen again, you simply do the "reverse"

[you@your_host]$ cd /home
[you@your_host]$ rm -rf shelly
[you@your_host]$ tar xvjf /path/to/some/safe/backup_directory/shelly_home_backup.tar.bz2
lots of output

And that's it! You would restore your home directory back to the exact state it was in the last time you did a backup. Backups are a good thing
 
Old 07-05-2004, 09:15 PM   #8
phlyersphan
Member
 
Registered: Jun 2004
Location: Chicago, IL USA
Distribution: Mandrake 10
Posts: 103

Original Poster
Rep: Reputation: 15
Thanks, Dark_Helmet! I wrote a little bash script that creates a backup of my home directory and stores it on my separate data partition. Works like a charm

It made me realize that I need a better organizational scheme, as I probably don't need to back up all of this stuff!

Did I mention how much this forum rocks??

 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to restore deleted items in fluxbox piva.francesco Linux - Software 1 08-29-2005 05:46 AM
howto make a dir shared that is not in my home dir Schmurff Linux - Newbie 2 06-19-2004 07:54 PM
How to restore a deleted file satimis Linux - Newbie 1 09-12-2003 04:18 AM
how to restore deleted files ? ilyes Linux - General 3 08-01-2003 07:13 AM
restore back deleted file edreddy Linux - General 4 07-19-2002 06:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:00 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration