From owner-freebsd-geom@FreeBSD.ORG Sun May 4 23:21:04 2014 Return-Path: Delivered-To: freebsd-geom@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id A02B7F82 for ; Sun, 4 May 2014 23:21:04 +0000 (UTC) Received: from wonkity.com (wonkity.com [67.158.26.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "wonkity.com", Issuer "wonkity.com" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 554C61C6E for ; Sun, 4 May 2014 23:21:04 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.8/8.14.8) with ESMTP id s44NL2nF009387 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 4 May 2014 17:21:02 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.8/8.14.8/Submit) with ESMTP id s44NL2AA009384; Sun, 4 May 2014 17:21:02 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sun, 4 May 2014 17:21:02 -0600 (MDT) From: Warren Block To: Andrew Berg Subject: Re: Recreating a GPT In-Reply-To: <5366CC63.4000001@my.hennepintech.edu> Message-ID: References: <5366CC63.4000001@my.hennepintech.edu> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Sun, 04 May 2014 17:21:03 -0600 (MDT) Cc: freebsd-geom@freebsd.org X-BeenThere: freebsd-geom@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: GEOM-specific discussions and implementations List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 May 2014 23:21:04 -0000 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.