Before repair data, you must first create a snapshot of the disk partitions lost data, and then try to repair the snapshot is created. If problems occur during the repair process, you can restore the data to its state before the disk repair snapshot rollback.
Prerequisites
Before repair data, you must first create a snapshot of the disk partitions lost data, and then try to repair the snapshot is created. If problems occur during the repair process, you can restore the data to its state before the disk repair snapshot rollback.
Tool Description
In instances where Linux, you can choose any of the following tools to repair the disk partition and restore the data:
- fdisk: Linux system default partitioning tool installation.
- testdisk: mainly used for data recovery disk partition or Linux systems. Linux system is not installed by default, you will need to install their own software, for example, in the CentOS system, you can run yum install -y testdisk online installation.
- partprobe: Linux default installation tool. Make kernel without rebooting the system is mainly used when re-read the partition.
Linux System disk partition data loss and data recovery approach
In instances where Linux, when you restart the system, the problem might drive partition data loss or data loss occurs. This may be because you are not in the etc / fstab file settings automatically mount. At this point, you may want to manually mount the disk partition data. If the Times manually mount the partition table is lost, you can try the following three options for processing: by fdisk partition recovery , by testdisk recovery partition or recover data directly through testdisk .
-
Recovery partition by fdisk
When data on the disk partition, disk partition start and end sector generally use the default value, so you can first try to directly use the new fdisk partition recovery. Specific operation, refer to the Linux and mount formatted data disk .
If that does not work, you can use the tool to attempt to repair testdisk.
-
By testdisk recovery partition
It is assumed that the disk device called cloud / dev / xvdb. Testdisk use the recovery partition by following these steps:
- Run testdisk / dev / xvdb (replacement apparatus according to the actual name), and then select the the Proceed (default) and press Enter.
- Select the partition table type to scan: General Select Intel (default). If your data using GPT disk partition, select EFI GPT .
- Select Analyse press Enter.
- If you do not see no partition information, select the Quick Search After a quick search and press Enter.
Partition information is displayed, as shown below in the returned result.
- When selected partition, press the Enter key.
- Select Write to save the partition.
If not, you need to explain the partition, you can choose Deeper Search to continue searching.
- Press the Y key to confirm the save partition.
- Run partprobe / dev / xvdb (alternative apparatus according to the actual name) manually refresh the partition table.
- Remount the partition, view the data in the data disk situation.
-
Data recovery directly through testdisk
In some cases, you can use testdisk scans the disk partition, but you can not save the partition, this time, you can try to recover files directly. Specific steps are as follows:
- Press recovery partition by testdisk step 1 to find partitions described in Step 4.
- Press the P key to list files. Return results below.
- Select the file you want to restore, and press C the key.
- Select the target directory. In the present example to restore / home Example.
If you see a
Copy done! 1 ok, 0 failed
description copied successfully. As shown below. - Switch to the / home directory view. If you can see the file description file recovery success.