Common problems in data loss disk partition under Linux system and corresponding processing method

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:

      1. Run  testdisk / dev / xvdb (replacement apparatus according to the actual name), and then select  the the Proceed (default) and press Enter.

      2. Select the partition table type to scan: General Select  Intel (default). If your data using GPT disk partition, select  EFI GPT .

      3. Select  Analyse  press Enter.

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


      5. When selected partition, press the Enter key.
      6. Select  Write  to save the partition.
         
        If not, you need to explain the partition, you can choose  Deeper Search  to continue searching.

      7. Press the  Y key to confirm the save partition.

      8. Run  partprobe / dev / xvdb (alternative apparatus according to the actual name) manually refresh the partition table.
      9. 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:

      1. Press  recovery partition by testdisk  step 1 to find partitions described in Step 4.
      2. Press the  P key to list files. Return results below.

      3. Select the file you want to restore, and press  C the key.
      4. 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.



      5. Switch to the  / home directory view. If you can see the file description file recovery success.

Guess you like

Origin www.cnblogs.com/kcxg/p/10929287.html