New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Undelete folders on openvz container ? URGENT HELP NEEDED
darknessends
Member
in Help
Hi,
I have deleted accidentally ( a software update somehow did ) some folders in my core files.
It contained lots of code which is now having no backups. I need to undelete these folders.
Please can you help ?
The partition is /dev/simfs and thus things like extundelete won't work.
Thanks
Comments
have you checked the recycle bin?
Dude if you did something along the lines of rm -rf filenamehere then the chances of getting it back are slim to none.
@jh, it is a openvz container. debian. is there a recycle bin ?
This might work: http://unix.stackexchange.com/questions/80270/unix-linux-undelete-recover-deleted-files
Go and cry? Setup backups while at it?
@agoldenberg - it is not rm -rf, It is done by some software accidently, I have no idea at all how it has happened. It is not done by me. I was updating a software called codiad and it just killed my directory full of codes.
Today we learned... Always backup your shit.
Pretty much..... Might want to think about getting a github or bitbucket account...
I'd say host your own bitbucket..... But you know OP...
does your host have a vzdump of your container?
@GM2015 : it was hosted by my own containers. no - there is no vzdump right now as I see.
Simply put, you are out of luck.
Next time take a backup or snapshot before doing upgrades.
Also, codaid doesn't delete files unless you specifically tell it to. I use it as well.
Ploop or simfs? Is vz a separate partition? If so remount as readonly and use testdisk to get the files back.
If it's Ploop then do same as above but mount the Ploop image as readonly with vz also readonly.
If you want to be safe do a hard power off and boot up in OS rescue mode which should mount everything as readonly.
Don't blame me if you break something else, but it's just what worked for me.
@linuxthefish : it is simfs.
@linuxthefish, no vz is not a separate partition.
http://unix.stackexchange.com/a/98700, if you hurry you can grab data by the contents hopefully. I did this recently for php code and saved a few hours rewriting it. Deleting files doesn't delete the data, only the inode meta data stating a file exists.
@pcfreak30 : Tried....
No fd found...
Then hard power off the node, boot into recovery kernel using grub which will mount the filesystem as read only. Don't mess around installing stuff or you will overwrite deleted files, else the inodes that were marked as un-used when you deleted the file will be overwritten!
If you have already installed a ton of stuff or moved files around then it might be time to re-write everything, but not before setting up a good backup system...
few minutes later some client... "bad experience, xxxxx host deleted my files"
Hah, just a thought passing by
Take a snapshot of your partition as soon as you can. Download it, and work offline on the image. Every attempt you make on a live partition will overwrite data.
Like others have mentioned, you have only lost metadata.
people use git for a reason. I hope you don't make the same mistake in the future
If extundelete is not working, you have probably written over backups of your filesystem journal. Don't work on the live FS. Use
dd
or any other snapshot feature, and work on that image.You can still extract the data by searching through the disk image for file content. If you want to recover binary files, search for a signature - typically the first few bytes of the file : List of signatures
For text files, you can do a grep on the image. For more details : Data recovery.
Worst case, you can do
strings
on the disk image and reassemble manually for text files.