From owner-freebsd-questions@FreeBSD.ORG Sun May 3 16:03:28 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 3E9F3786 for ; Sun, 3 May 2015 16:03:28 +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 E6E451BF0 for ; Sun, 3 May 2015 16:03:27 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.9/8.14.9) with ESMTP id t43G3FLo086332 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 3 May 2015 10:03:15 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.9/8.14.9/Submit) with ESMTP id t43G3F7k086329; Sun, 3 May 2015 10:03:15 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sun, 3 May 2015 10:03:15 -0600 (MDT) From: Warren Block To: Polytropon cc: "William A. Mahaffey III" , FreeBSD Questions !!!! Subject: Re: How to restore a USB drive converted to bootable In-Reply-To: <20150502233854.c80bc5ae.freebsd@edvax.de> Message-ID: References: <5543FAA3.7050907@hiwaay.net> <441tiz3wrx.fsf@lowell-desk.lan> <5544DBA2.1030102@hiwaay.net> <20150502233854.c80bc5ae.freebsd@edvax.de> 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]); Sun, 03 May 2015 10:03:16 -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: Sun, 03 May 2015 16:03:28 -0000 On Sat, 2 May 2015, Polytropon wrote: > On Sat, 02 May 2015 09:20:09 -0453, William A. Mahaffey III wrote: >> On 05/02/15 09:06, Lowell Gilbert wrote: >>> "William A. Mahaffey III" writes: >>> >>>> I am about to do some OS installs (NetBSD & OpenBSD, as it happens) on >>>> boxen under construction. I would also like to use UBCD on a flash >>>> drive to memcheck those boxen prior to installation. If I prep a USB >>>> thumb drive as either a bootable UBCD drive or an over-the-WWW >>>> installer, I wipe out the drive for its original use. Is there a way >>>> to restore the drive back to its original functionality if I wanted to >>> Is "wipe the drive and reformat" what you need to hear, or do you have >>> more requirements that you haven't made clear? >>> >> >> >> Wipe & reformat, preferably from CLI under FBSD 9.3R-p13 for >> convenience, is what I'm after. Clearly creating a bootable UBCD or >> installer will wipe out whatever was >> there before, so I just want to get back to 'virgin' USB drive. > > In that case, the command > > # dd if=/dev/zero of=/dev/da0 bs=1m count=1 > > should be fine. If there is any offending GPT metadata located > at the end of the USB drive, estimate the size and also erase > the last few MBs (use skip= to do so). There is no need to > actually zero out the _whole_ drive. It is easier to use gpart, and it will correctly remove whichever partitioning metadata is present: gpart destroy -F