0. Internet 1. Text 2. Graphics 3. System 4. File 5. Misc 6. Palm 7. OS X |
Securely wiping floppy disks under OS X in Terminal # Faced with several dozen floppy disks that needed wiping, Disk Utility.app was looking a bit cumbersome: Disk Utility > click floppy drive > Erase > Security Options... > Zero Out Data > OK > Erase... > Erase I decided to give sudo dd if=/dev/zero of=/dev/fd0 a go: dd: /dev/fd0: Operation not supported. Ah! Perhaps OS X does not use fd0: $ ls /dev/fd0 ls: /dev/fd0: No such file or directory. In that case, let's have a look at what we've got: $ diskutil list /dev/disk0 #: TYPE NAME SIZE IDENTIFIER 0: GUID_partition_scheme *111.8 Gi disk0 1: EFI 200.0 Mi disk0s1 2: Apple_HFS MacBook HD 111.5 Gi disk0s2 /dev/disk1 #: TYPE NAME SIZE IDENTIFIER 0: TEST *1.4 Mi disk1OK, how about: $ sudo dd if=/dev/zero of=/dev/disk1 dd: /dev/disk1: Resource busyWhat if we unmount the floppy from the Finder and then try the same command? $ sudo dd if=/dev/zero of=/dev/disk1 dd: /dev/disk1: Operation not supportedA quick search turned up the answer - unmount from within diskutil, not the Finder: $ diskutil unmount /dev/disk1 Volume TEST on disk1 unmounted $ sudo dd if=/dev/zero of=/dev/disk1 dd: /dev/disk1: end of device 2881+0 records in 2880+0 records out 1474560 bytes transferred in 110.617912 secs (13330 bytes/sec)That worked beautifully, if slowly: it took almost two minutes to wipe a single floppy disk ( $ diskutil secureErase 0 /dev/disk1 Started erase on disk1 TEST Finished erase on disk1 TESTThis single-pass zero-fill erase took less than 30 seconds to complete. Wiping the floppies was now a breeze: $ diskutil unmount /dev/disk1 && diskutil secureErase 0 /dev/disk1 UPDATE: Rather than using /dev/disk1 (which is the block device, AKA buffered device or cooked device) I should've been using /dev/rdisk1 (the raw device). This made the dd process slightly faster than even diskutil when using block sizes of 1440k and 360k. Connected raw devices can be listed by issuing the ls /dev/rdisk? command. See Block device versus raw device performance for more information.For those who doubt the efficacy of zeroing a disk, see:
/mac | Oct 10, 2009 |
Categories
Blosxom Archive
2012: 5 4 3 2 1
2011: 12 11 10 9 8 7 6 5 4 3 2 1 2010: 12 11 10 9 8 7 6 5 4 3 2 1 2009: 12 11 10 9 8 7 6 5 4 3 2 1 2008: 12 11 10 9 8 7 6 5 4 3 2 1 2007: 12 11 10 9 8 7 6 5 4 3 2 1 2006: 12 11 10 9 8 7 6 5 4 3 2 1 2005: 12 11 10 Blogger Archive
Ezine Archive
|