Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Undelete folders on openvz container ? URGENT HELP NEEDED
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.

Undelete folders on openvz container ? URGENT HELP NEEDED

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

  • jhjh Member

    have you checked the recycle bin?

  • agoldenbergagoldenberg Member, Host Rep

    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 ?

  • Go and cry? Setup backups while at it?

    Thanked by 2GCat TheKiller
  • @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.

  • agoldenbergagoldenberg Member, Host Rep

    @GCat said:
    Today we learned... Always backup your shit.

    Pretty much..... Might want to think about getting a github or bitbucket account...

    Thanked by 1GCat
  • GCatGCat Member
    edited January 2016

    @agoldenberg said:

    I'd say host your own bitbucket..... But you know OP...

  • does your host have a vzdump of your container?

    darknessends said: 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.

  • @GM2015 : it was hosted by my own containers. no - there is no vzdump right now as I see.

  • MunMun Member
    edited January 2016

    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.

    Thanked by 1GCat
  • 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...

  • @darknessends said:
    linuxthefish, no vz is not a separate partition.

    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...

  • ValdVald Member
    edited January 2016

    few minutes later some client... "bad experience, xxxxx host deleted my files"

    Hah, just a thought passing by

  • rincewindrincewind Member
    edited January 2016

    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.

Sign In or Register to comment.