Recover accidentally deleted virtual server

i tried to backup virtualmin but no luck due to insufficient disk
i tried to delete unwanted virtual servers but one of them has a working database
that server was the first one I’m sure it has a temporary backup done before it says system disk is full
is there a way or temporary file i can check for that sql database, i deleted it couple of hours ago 3-4 hours?

i tried to use testdisk it says “Cannot establish connection to the host”

OS type and version CentOS Linux 7.9.2009
Webmin version 2.001
Virtualmin version 7.3

From memory, the backup process creates a backup of each virtual server in its home/.backup then uploads that (or copies it whatever you’ve selected), but there’s a chance you may find something in /tmp ?

Unfortunately no, the /tmp folder is almost empty

Ok. well if you deleted the virtual server, then the home directory is gone and with it the backup (partially maybe - but probably not, the backup code is elegant and pretty robust so it most likely cleaned up before it quit).

Either way, you’re kinda stuffed. There are options (despite what they tell you about ext4) to recovery deleted file, but its not reliable and is a bunch of effort. There are ‘tools’ like DDRescue or testdisk but they all should require you to shut it down, create a mirror of the volume then work on that mirror because they require a quiescent volume, and of course if they balls it up, you might wind up with a mount fail which isn’t fun to fix. If you’re looking for mysql databases, then target your deleted file restore on /var/lib/mysql/name of virtual server

I’m sorry you’re left with few options, but backup are… Good Luck.

if there wasn’t room to make the backup, then there wouldn’t be a backup. :man_shrugging:

There are tools that can sometimes recover deleted data from ext4 filesystems, but I don’t know if they’d work on SSDs. And, I haven’t had much luck with them even in the best of circumstances on spinning rust drives…“best of circumstances” would mean, “the data is plain text, easy to identify when you find it, and the disk hasn’t been written to since you deleted the files”. This is not the best of circumstances. Databases have a lot of expectation of file integrity, and if you lose parts of the file, it makes a mess. And, you’ve presumably been writing to the disk through all that time. The odds of all of those sectors not being re-allocated gets smaller every hour.

File recovery is not a thing, basically. Backups are the solution to this problem, it’s just unfortunate you didn’t get to the point of having a backup before you needed it.

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.