Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 4 May 2014 17:21:02 -0600 (MDT)
From:      Warren Block <wblock@wonkity.com>
To:        Andrew Berg <aberg010@my.hennepintech.edu>
Cc:        freebsd-geom@freebsd.org
Subject:   Re: Recreating a GPT
Message-ID:  <alpine.BSF.2.00.1405041705540.9118@wonkity.com>
In-Reply-To: <5366CC63.4000001@my.hennepintech.edu>
References:  <5366CC63.4000001@my.hennepintech.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 4 May 2014, Andrew Berg wrote:

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

It will take a while to copy the disk with dd(1), but that's really the 
only safe way.  Make a copy, and write the partition tables to that.

gpart(8) only writes to the partition tables or bootcode, and should be 
safe for the data in the partitions, but the only way to guarantee that 
is on a copy, not the original.

gpart backup produces plain text that can be manually created.  I'd 
still rather let gpart deal with the disk directly by using gpart create 
and add commands.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.00.1405041705540.9118>