[SOLVED] Help! How to restore deleted home directory?

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
dalexunil

[SOLVED] Help! How to restore deleted home directory?

Post by dalexunil »

At 11pm last night, way after I should have been in bed, in my only half-awake state, I did something really stupid.

I opened Virtual Box and tried to create a new virtual machine. This error message came up: "Directory for virtualbox-vms = /home/bimmer/dale. Cannot be accessed." I could not see any bimmer directory, only /home/dale. I created a directory /home/bimmer, then tried again. Got the same message. Did the command "del -m bimmer". Needless to say, there is no now directory under /home. Evidently, where I was seeing /home/dale, the system was seeing /home/bimmer/dale.

So.... Is there anyway to restore the dale directory and its contents?

TIA!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Help! How to restore deleted home directory?

Post by Flemur »

You could copy these basic login/bash files:

Code: Select all

$ ls -al /etc/skel 
...
-rw-r--r--   1 root root   220 Aug 31  2015 .bash_logout
-rw-r--r--   1 root root  4000 May 17  2016 .bashrc
-rw-r--r--   1 root root   655 Nov 21  2016 .profile
then check them for username, etc. But that might not be enough for a desktop environment.

OR! Create a new user, then copy the files from there.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
dalexunil

Re: Help! How to restore deleted home directory?

Post by dalexunil »

Thanks Flemur for your quick reply!

After creating new user, it copied the /etc/skel/ files over to the new user but how do I find the files under my orig user name to restore them?
Cosmo.
Level 24
Level 24
Posts: 22968
Joined: Sat Dec 06, 2014 7:34 am

Re: Help! How to restore deleted home directory?

Post by Cosmo. »

What is your username for the system? I assume dale. If there is no directory /home/dale anymore, it has been deleted and likely you did it - half awakened - inside of the terminal. This means, that the deleted files are not in any trash bin and the only chance to get them back is either your backup or the try to restore them with testdisk - to be found in the repositories.
MintBean

Re: Help! How to restore deleted home directory?

Post by MintBean »

Asumming /home/dale was your home directory, there's no way just creating a /home/bimmer directory could move /home/dale to /home/bimmer/dale.
dalexunil

Re: Help! How to restore deleted home directory?

Post by dalexunil »

Thanks guys for your replies!

So, what I did was simply create a new user and password and at least, I have my desktop back and have used a fairly old 'Back in Time' backup on a thumb drive to restore some files I needed. One VALUABLE lesson for me here is, I MUST spend some time learning my way around the terminal much better than my current level. Not being what some might consider a 'geek', I'm simply a guy that got fed up with the MS OS several years ago and opted to go with the Linux OS. I've never looked back with any sort of pie in the sky longings to go back!

My goal now is to upgrade to LM 18 and then life will be 'wonderful' since I'm under the impression that it will play nicely with my iPhone :)

Dale
User avatar
Moem
Level 22
Level 22
Posts: 16229
Joined: Tue Nov 17, 2015 9:14 am
Location: The Netherlands
Contact:

Re: Help! How to restore deleted home directory?

Post by Moem »

dalexunil wrote: One VALUABLE lesson for me here is, I MUST spend some time learning my way around the terminal much better than my current level.
That's a good one, and what about 'I need to make backups more often'?
Image

If your issue is solved, kindly indicate that by editing the first post in the topic, and adding [SOLVED] to the title. Thanks!
User avatar
JerryF
Level 16
Level 16
Posts: 6570
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: [SOLVED] Help! How to restore deleted home directory?

Post by JerryF »

I think another lesson is---use the GUI to create and delete/trash directories.
dalexunil

Re: [SOLVED] Help! How to restore deleted home directory?

Post by dalexunil »

JerryF wrote:I think another lesson is---use the GUI to create and delete/trash directories.
Could you expand your thoughts on this one? I do not understand what you are meaning.

Dale
User avatar
JerryF
Level 16
Level 16
Posts: 6570
Joined: Mon Jun 08, 2015 1:23 pm
Location: Rhode Island, USA

Re: [SOLVED] Help! How to restore deleted home directory?

Post by JerryF »

Instead of using the Terminal to run commands (such as del, in your case), use your file manager. With deleting, you can put it in Trash. That way, if you somehow delete the wrong directory, you can always retrieve it.
Locked

Return to “Other topics”