Recreating a GPT

Andrew Berg aberg010 at my.hennepintech.edu
Sun May 4 22:50:49 UTC 2014


Sorry if this is the wrong list; I have seen discussions regarding gpart in
the archives for this list while doing some searching for answers to my problem.

I destroyed a GPT ('gpart destroy -F ada0') and then ended up needing the data
on it (the lesson here is to make many backups of important files, not just
think you have one somewhere). Anyway, I don't have an actual backup of the
partition layout (as created by 'gpart backup'), but I know the partition
sizes and sector sizes, and I happen to have another disk that, AFAICT, is the
exact same size:

ada0: <TOSHIBA DT01ACA100 MS2OA750> ATA-8 SATA 3.x device
ada0: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada0: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C)

ada2: <WDC WD10EACS-00D6B1 01.01A01> ATA-8 SATA 2.x device
ada2: 300.000MB/s transfers (SATA 2.x, UDMA6, PIO 8192bytes)
ada2: 953869MB (1953525168 512 byte sectors: 16H 63S/T 16383C)

ada0 being the disk I want to recover. My question is, knowing the exact
commands given to create the GPT, how should I go about creating a file that
will restore the GPT on ada0 without damaging the data on the partitions
themselves? I suppose I could create a new GPT on the scratch disk and use the
output of 'gpart backup' from that, but I'm not sure it would be 100% correct
and I'd have to clone the original disk over it again, which would take hours
since it's a TB and dd isn't exactly the fastest way of copying data (even
with large blocksizes). I'm very hesitant to write *anything* to the original
disk.


More information about the freebsd-geom mailing list