tencent cloud

Feedback

Recovering Data on Linux CVMs

Last updated: 2022-04-13 11:01:52

    Overview

    This document uses a CVM instance on CentOS 8.0 as an example to describe how to use the open-source tool Extundelete to recover accidentally deleted data.
    Extundelete can recover accidentally deleted files in EXT3 and EXT4 file systems, but the specific level of recovery is subject to various factors such as whether files are overwritten by writes after deletion and whether metadata is stored in the journal. If the file system to be recovered is on the system disk, and there are always business or system processes writing files, the possibility of recovery is low.

    Note

    Tencent Cloud also offers snapshots, custom images and Cloud Object Storage to store data. We recommend that you regularly back up data to enhance data security.

    Preparations

    Before recovering the data, complete the following preparations:

    • Back up your data by referring to Creating Snapshots and Creating Custom Images.
    • Stop writing data to the file system. If you need to recover a data disk, run umount to detach the disk from the CVM instance first.

    Directions

    1. Install Extundelete in the following two ways:
      1. Run the following command to directly download the compiled binary program.
        wget https://github.com/curu/extundelete/releases/download/v1.0/extundelete
        
      2. Run the following command to grant file permissions.
        chmod a+x extundelete
        
    2. Run the following command to try recovering the data.
      ./extundelete  --restore-all  /dev/corresponding disk
      

    The recovered files are located in the RECOVERED_FILES folder at the same directory level. Check whether there are the needed files.

    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support