How to restore a USB drive converted to bootable

Polytropon freebsd at
Sat May 2 05:50:37 UTC 2015

On Fri, 01 May 2015 17:20:10 -0453, William A. Mahaffey III wrote:
> 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 ?

This is quite simple: Just erase the first few MBs (which
is already overkill) of the USB drive. You can do this with
on-board means (no need to install anything):

	# dd if=/dev/zero of=/dev/da0 bs=1m count=1

Make _definitely_ sure that da0 is your USB drive before
you enter the command.

This will wipe the partition table and boot sector, so the
drive appears as non-formatted. If you wish, you can then
add a FAT partition, bsdlabel-style partitions, a UFS file
system, or "raw" tar data, whatever you need.

Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...

More information about the freebsd-questions mailing list