From owner-freebsd-questions@freebsd.org Fri Oct 2 21:26:04 2015 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 176BFA0EB71 for ; Fri, 2 Oct 2015 21:26:04 +0000 (UTC) (envelope-from wblock@wonkity.com) 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 CDE2F138B for ; Fri, 2 Oct 2015 21:26:03 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.15.2/8.15.2) with ESMTPS id t92LPthP022461 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 2 Oct 2015 15:25:55 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.15.2/8.15.2/Submit) with ESMTP id t92LPtUv022458; Fri, 2 Oct 2015 15:25:55 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Fri, 2 Oct 2015 15:25:55 -0600 (MDT) From: Warren Block To: "William A. Mahaffey III" cc: FreeBSD Questions !!!! Subject: Re: Geom question In-Reply-To: <560EEE5F.3080904@hiwaay.net> Message-ID: References: <560EDE45.3040605@hiwaay.net> <3D81C7BC-1A31-4046-88B7-50F25EA3B952@ccsys.com> <560EEE5F.3080904@hiwaay.net> User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (wonkity.com [127.0.0.1]); Fri, 02 Oct 2015 15:25:55 -0600 (MDT) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 02 Oct 2015 21:26:04 -0000 On Fri, 2 Oct 2015, William A. Mahaffey III wrote: > On 10/02/15 15:31, Chad J. Milios wrote: >>> On Oct 2, 2015, at 3:41 PM, William A. Mahaffey III >>> wrote: >>> >>> I am prepping to provision 2 boxen w/ FreeBSD 9.3R, preferably from a >>> thumb drive. I would like to add a 'utils' directory w/ some scripts I >>> wrote to automate the partitioning/slicing of the HDD's (2X on 1 box, 8X >>> on the other), & also accumulate output from the install process in case >>> questions arise. To that end, I am planning on partitioning/slicing a >>> thumb drive, prepping it to be bootable following examples on the gpart >>> man page, & copying verbatim stuff from the memstick.img for 9.3R that I >>> downloaded a while back, as well as adding my utils directory. Reading up >>> on gpart & geom raises 1 question: can I do all these preps on a disk >>> image file I create w/ dd, or do i do them in place on the target >>> memstick, then dd the results onto an on-disk image for safekeeping ? Put >>> another way, can a disk image created by dd be a 'geom' for gpart ? TIA & >>> have a good one. >>> >>> -- >>> >>> William A. Mahaffey III >> In a way, yes. `mdconfig -f filename` will make your file accessible as a >> virtual device. >> > > Then to be accessed as /dev/md0 ? Any other clues/gotchas :-) ? Thanks & TIA > & have a good one. GPT does not work well with that. If the target device is larger, the backup GPT that is supposed to go at the very end of the disk ends up someplace before that. If the target device is smaller, well, it won't work at all. Also, avoid using dd on SSDs. In general, it's better to use higher-level things that understand the metadata, like 'gpart backup'/'gpart restore' for the partitioning information and dump/restore or 'zfs send' for the filesystems. 'gpart restore' can correctly restore the partitioning scheme onto a larger device because it understands what that data means.