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