[parted-devel] More info regarding 1st partition destruction

David Cantrell dcantrell at redhat.com
Fri Apr 28 17:22:17 UTC 2006


It's taken me a while (different time zones).  I have someone in our Tokyo
office that's able to recreate the problem.  He's grabbed different sectors
of the disk at different stages.  Here are the commands he ran:

   dd if=/dev/zero of=/dev/sdb bs=512 count=512
   
   parted /dev/sdb mklabel gpt
   dd if=/dev/sdb of=sdb.48sector.01 bs=512 count=48
   
   parted /dev/sdb mkpart primary 0 100
   dd if=/dev/sdb of=sdb.48sector.02 bs=512 count=48
   dd if=/dev/sdb1 of=sdb1.14sector.02 bs=512 count=14
   
   parted /dev/sdb mkfs 1 fat16
   dd if=/dev/sdb of=sdb.48sector.03 bs=512 count=48
   dd if=/dev/sdb1 of=sdb1.14sector.03 bs=512 count=14
   
   mount /dev/sdb1 /mnt
   dd if=/dev/sdb of=sdb.48sector.04 bs=512 count=48
   dd if=/dev/sdb1 of=sdb1.14sector.04 bs=512 count=14
   
   parted /dev/sdb
   (parted) p
   
   # other terminal
   # dd if=/dev/sdb of=sdb.48sector.05 bs=512 count=48
   # dd if=/dev/sdb1 of=sdb1.14sector.05 bs=512 count=14
   # mkdir /mnt/testdir
   # sync
   # dd if=/dev/sdb of=sdb.48sector.06 bs=512 count=48
   # dd if=/dev/sdb1 of=sdb1.14sector.06 bs=512 count=14
   
   (parted) mkpart primary 100 200
   
   # dd if=/dev/sdb of=sdb.48sector.07 bs=512 count=48
   # dd if=/dev/sdb1 of=sdb1.14sector.07 bs=512 count=14
   
   (parted) q
   dd if=/dev/sdb of=sdb.48sector.08 bs=512 count=48
   dd if=/dev/sdb1 of=sdb1.14sector.08 bs=512 count=14
   
   
   umount /mnt
   dd if=/dev/sdb of=sdb.48sector.09 bs=512 count=48
   dd if=/dev/sdb1 of=sdb1.14sector.09 bs=512 count=14
   
   mount /dev/sdb1 /mnt
   dd if=/dev/sdb of=sdb.48sector.10 bs=512 count=48
   dd if=/dev/sdb1 of=sdb1.14sector.10 bs=512 count=14
   
   ls -l /mnt
   dd if=/dev/sdb of=sdb.48sector.11 bs=512 count=48
   dd if=/dev/sdb1 of=sdb1.14sector.11 bs=512 count=14
   
   umount /mnt
   dd if=/dev/sdb of=sdb.48sector.12 bs=512 count=48
   dd if=/dev/sdb1 of=sdb1.14sector.12 bs=512 count=14

You can download these files from:

   http://people.redhat.com/dcantrel/parted/diskimage.tar.gz

He also indicated that creating other partitions (say, a third or
fourth) will also destroy the first partition on the disk.

-- 
David Cantrell
Red Hat / Westford, MA



More information about the parted-devel mailing list