-3

I'm working on a Linux mint virtualbox image hosted on Windows 10 where I accidentally deleted the /etc/share directory and subdirectories.

Now my Image can't boot and I have sensitive data that I want to recover.

How can I do so?

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Osama Radwan
  • 521
  • 1
  • 5
  • 17
  • 1
    Please don't fundamentally alter your question after you've received answers. I have rolled back your edit. If you want to ask a different question, create a new question. If you have asked too many low quality questions and are now question-banned, **improve** your existing questions, do not change them to an entirely different topic after they've been answered. – Mark Rotteveel Sep 04 '22 at 08:12
  • I was able to solve my problem following the first solution in the link below: https://unix.stackexchange.com/questions/624629/removed-etc-folder-how-do-i-keep-my-data-after-booting – Osama Radwan Sep 05 '22 at 08:17

1 Answers1

2

First - switch the VM off and don't turn it off.

If you made a backup or taken a snapshot of the VM's image just use it to restore the VM. Create a new Linux VM with the new disk, and use the copied image os the additional one from which you will be recovering data. Don't ever try to recover deleted files/folders to the same drive or even use it as a drive from which the system boots up. Here are some general tips of what to do and what do not when you loose the data.

Otherwise it's very hard to recover any data from that image - it all depends whether you made some other changes afterward or just switched the VM off (which would be the best option). If you made some changes (wrote some data to the disk after deleting /etc/share then you can still try to recover it but if you have the data stored in some other locations - don't waste your time.

I' won't be copying the exact process from other pages but here are some usefull links; the tool that's mostly used in such cases is called testdisk.

Wojtek_B
  • 4,245
  • 1
  • 7
  • 21
  • What I have done so far is that I created a new image with a fresh installation and mounted the lost virtual hard disk to it. I'm planning on copying the files I want to the new image. Is this considered best option? – Osama Radwan Dec 30 '21 at 15:08
  • If the copied drive is not the main one - then yes - you should always try to recove data from a copy. – Wojtek_B Dec 31 '21 at 06:55