Date: Sun, 3 May 2015 00:24:20 +0200 From: Polytropon <freebsd@edvax.de> To: freebsd-questions@freebsd.org Cc: "William A. Mahaffey III" <wam@hiwaay.net> Subject: Re: How to restore a USB drive converted to bootable Message-ID: <20150503002420.fdcc9310.freebsd@edvax.de> In-Reply-To: <55454CDA.3020209@hiwaay.net> References: <5543FAA3.7050907@hiwaay.net> <441tiz3wrx.fsf@lowell-desk.lan> <5544DBA2.1030102@hiwaay.net> <20150502233854.c80bc5ae.freebsd@edvax.de> <55454CDA.3020209@hiwaay.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, 02 May 2015 17:23:13 -0453, William A. Mahaffey III wrote: > On 05/02/15 16:45, 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" <wam@hiwaay.net> 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. > > *Aaaaaaaaaaaaaaahhhhh*, I wasn't sure about that (zero the whole drive), > thanks :-) .... There are only few significant "data zones" on the USB drive. The boot sector and partition table are located at the beginning, and _maybe_ GPT metadata at the end. Removing both makes the remaining bits and bytes practically useless (except when you take it to forensics, but you don't want to recover things anyway, so the result should work for you). However, if you want a USB drive "new" (as in "I just bought it from the shop, it's fresh out of the package!"), then you have to write a MSDOS (FAT) file system, install some crapware, some ridiculous "drivers", and "value added" software, maybe with some spying tools, malware, nagware, and non-working "encryption" tools. Add several partitions and make them smaller than the real size of the drive. And add a "Facebook" link. :-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20150503002420.fdcc9310.freebsd>