On Mon, 2 Sep 2013, 15:10, James Harper wrote:

} > 
} > What is the best way to wash a disk?
} > 
} > I tried this but it is taking forever.
} > 
} > dd if=/dev/zero of=/dev/sdg1
} > 
} 
} Someone else suggested a tool to do it, but just fyi dd's default block 
} size is pretty small (is it 1 byte?) which will be terrible for 
} performance. Add bs=1M or something to improve the speed.

According to Wikipedia..:)

Default block size is 512 bytes.


[ https://en.wikipedia.org/wiki/Dd_%28Unix%29#Block_size ]
--
Block size

A block is a unit measuring the number of bytes that are read, written, or 
converted at one time. Command line options can specify a different block 
size for input/reading (ibs) compared to output/writing (obs), though the 
block size (bs) option will override both ibs and obs. The default value 
for both input and output block sizes is 512 bytes (the block size of Unix 
block devices)
--

For the 'disk wipe' example (below) a 4k block size is used to illustrate 
a faster operation than the default of 512b. (I am wondering at this point 
if there are any downsides to using a much higher block size like 1M or 
2M..).


[ https://en.wikipedia.org/wiki/Dd_%28Unix%29#Disk_wipe ]

--
Disk wipe

For security reasons, it is necessary to have a disk wipe of the discarded 
device.

To check to see if a drive has data on it, send the output to standard 
out.

dd if=/dev/sda

To wipe a disk by writing zeros:

dd if=/dev/zero of=/dev/sda bs=4k conv=notrunc

The bs=4k option makes dd read and write 4 kilobytes at a time. This makes 
the whole process a lot faster on any relatively modern system. Note that 
filling the drive with random data will always take a lot longer than 
zeroing the drive, because the random data must be rendered by the CPU 
first. On most relatively modern drives, zeroing the drive will render any 
data it contains permanently irrecoverable.[5]

Zeroing the drive will render any data it contains irrecoverable by 
software. Note that it still may be recoverable by special laboratory 
techniques; read about data remanence.

--


Incidentally, if you want to check the progress of 'dd', you can send its 
process ID number the USR1 signal, ie.

 kill -USR1 <PID>

T.


_______________________________________________
luv-main mailing list
[email protected]
http://lists.luv.asn.au/listinfo/luv-main

Reply via email to