A case study of the GPT partitioned table structure used in Linux for generating evaluation

Source: Internet
Author: User
Tags md5 md5 hash

Objective: To generate a large number of cases of simulating broken GPT partition structure, and to generate a unique method for the evaluation of the post-repair.

Failure: On a full GPT partition disk, the GPT Primary partition table is missing or the partition table is backed up.


1, using Winhex manual method, repair the partition structure of the given image file.

2. Do not make any changes to the existing primary partition table or backup partition table.

3, do not use Winhex GPT partition template for reference repair.

4. After repairing, the MD5 hash value of the entire image file is generated.

Experiment Sample Generation Process:

#!/bin/sh# Delete Head do 50 x  for ((i=1;i<=50;i++));d o r1=$ (($i +200))  qemu-img create -f  raw  $i .img  "$r 1" m losetup /dev/loop0  $i .img parted -s /dev/loop0  mklabel gpt parted -s /dev/loop0 mkpart -s primary ext3 128s  100% dd if=/dev/loop0 2>/dev/null |md5sum -b|tr a-z A-Z 1> >md5.txt dd if=/dev/loop0 of=head "$i". img bs=512 count=64 dd if=/dev/ Zero of=/dev/loop0 bs=512 seek=1 count=2048 dd if=/dev/loop0 of=f "$i". img  tar -zcvf f "$i". Tar.gz f "$i". Img rm f "$i". Img losetup -d rm   $i. imgdone# Delete the tail to do 50 for ((i=51;i<=100;i++));d o r1=$ (($i +200))  r2=$ (($r 1*2048-64))   qemu-img create -f raw  $i .img  "$r 1" m losetup /dev/loop0  $i .img  Parted -s /dev/loop0 mklabel gpt parted -s /dev/loop0 mkpart -s primary ext3 128s  100% dd if=/dev/loop0 2>/dev/null |md5sum -b|tr a-z A-Z 1> >md5.txt dd if=/dev/loop0 of=tail "$i". img skipk= $r 2 bs=512 dd if=/dev/ zero of=/dev/loop0 bs=512 seek= $r 2 dd if=/dev/loop0 of=f "$i". img tar - Zcvf f "$i". Tar.gz f "$i". Img rm f "$i" .img losetup -d rm  $i. Imgdone

This article is from the "Zhang Yu (Data Recovery)" blog, please be sure to keep this source http://zhangyu.blog.51cto.com/197148/1940719

A case study of the GPT partitioned table structure used in Linux for generating evaluation

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.