From owner-freebsd-questions@FreeBSD.ORG Sat May 2 15:29:32 2015 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 93ABD419 for ; Sat, 2 May 2015 15:29:32 +0000 (UTC) Received: from be-well.ilk.org (be-well.ilk.org [23.30.133.173]) by mx1.freebsd.org (Postfix) with ESMTP id 6C1BD1438 for ; Sat, 2 May 2015 15:29:32 +0000 (UTC) Received: from lowell-desk.lan (lowell-desk.lan [172.30.250.41]) by be-well.ilk.org (Postfix) with ESMTP id 5461733C1E; Sat, 2 May 2015 11:29:26 -0400 (EDT) Received: by lowell-desk.lan (Postfix, from userid 1147) id 8332339814; Sat, 2 May 2015 11:29:25 -0400 (EDT) From: Lowell Gilbert To: "William A. Mahaffey III" Cc: "FreeBSD Questions !!!!" Subject: Re: How to restore a USB drive converted to bootable References: <5543FAA3.7050907@hiwaay.net> <441tiz3wrx.fsf@lowell-desk.lan> <5544DBA2.1030102@hiwaay.net> Date: Sat, 02 May 2015 11:29:25 -0400 In-Reply-To: <5544DBA2.1030102@hiwaay.net> (William A. Mahaffey, III's message of "Sat, 02 May 2015 09:20:09 -0453") Message-ID: <44wq0r2e22.fsf@lowell-desk.lan> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain 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: Sat, 02 May 2015 15:29:32 -0000 "William A. Mahaffey III" writes: > 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. [TL;DR version: do newfs_msdos -F 32 /dev/da{x} and you'll probably be happy. ] That's still not very specific. Thumb drives come from the factory with a number of different configurations. If you want the one your specific device started with, you need to back it up (dd(1) will do fine) before writing over it. Otherwise, it's just like any other disk; format it any way you like. If you want an MBR, use fdisk(8); if you want a GPT table, use gpart(8); if you don't need either, stick with the raw device. Create a new filesystem. If you want it to be FAT32, you can do that with newfs_msdos(8). I don't remember offhand how to do VFAT, but that's an option if you want. If you're only going to use the drive with BSD systems, I'd recommend you use newfs(8) rather than FAT filesystems -- this won't match anything you might have gotten from a store, but you won't notice any difference (aside from better performance).