Reformat USB stick with a CD ISO9660 FS

Daniel Mons daniel.mons at iinet.net.au
Thu Jun 12 13:25:35 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Bevin Watson wrote:
> delete the files from it.  It seems the simplest thing is to just
> reformat the whole device.  However, I'm getting a little out of my
> league thinking about partitions versus the whole device.  fdisk etc.
> seem to be partition-based.  Should I just "dd" all over it?
> nb: The USB stick shows up as /dev/scd1 (ISO 9660) and /dev/sdd1 (vfat)

I'd zero the device with dd.   Find out the device using "sudo fdisk -l"
to print out all partitions and physical devices.  If it turns up as
/dev/sdd, for example, use the following dd command to wipe it:

sudo dd if=/dev/zero of=/dev/sdd

This will give no output until the dd operation is complete.  It will
simply write zeros (as in binary zeros, not the ASCII charcter "0") to
the physical device, destroying all partitions in the process.  (Again,
I cannot stress how important it is to check and ensure you are wiping
the right disk - do this to your system or data disks and you can kiss
their contents goodbye).

Once done, eject/remove the device, re-insert it, and type "sudo fdisk
- -l" once again.  The device should show up all on it's own with no valid
partition information attached.

- From here, partition and format it in whatever way you feel comfortable
(fdisk, gparted, whatever).

On a semi-related note, those who want to securely wipe hard disks can
use a similar method with alternating passes of /dev/zero and
/dev/urandom.  I do this as standard when decomissioning desktops and
laptops if they are to be donated, re-imaged, or eBay'ed somewhere.
Servers and machines carrying highly sensitive data get a more severe
dose of DoD 5220.22-M via "Darik's Boot and Nuke" (Google it for details).

- -Dan
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFIURW+eFJDv0P9Qb8RArskAJ9W+jkCkrMO4RWLt3pNzlzJ+6rb+QCeIHK1
F6WDYyuC7BmjqLH+Kw7BgZ4=
=0UZq
-----END PGP SIGNATURE-----



More information about the ubuntu-au mailing list