Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Dd (Unix)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Disk wipe === {{Main|Data erasure}} For security reasons, it is sometimes necessary to have a [[disk wipe]] of a discarded device. This can be achieved by a "data transfer" from the Unix special files. * To write ''zeros'' to a disk, use <code>dd if=[[/dev/zero]] of=[[/dev/sda]] bs=16M</code>. * To write ''random data'' to a disk, use <code>dd if=[[/dev/urandom]] of=[[/dev/sda]] bs=16M</code>. When compared to the data modification example [[#Data modification|above]], {{code|notrunc}} conversion option is not required as it has no effect when the output file is a block device.<ref>{{cite web |url=https://stackoverflow.com/questions/20526198/why-using-conv-notrunc-when-cloning-a-disk-with-dd |title=linux - Why using conv=notrunc when cloning a disk with dd? |publisher=Stack Overflow |date=2013-12-11 |access-date=2014-03-24 |archive-date=2014-03-24 |archive-url=https://web.archive.org/web/20140324201126/http://stackoverflow.com/questions/20526198/why-using-conv-notrunc-when-cloning-a-disk-with-dd |url-status=live }}</ref> Option {{code|bs{{=}}16M}} makes dd read and write 16 [[mebibytes]] at a time. For modern systems, an even greater block size may be faster. Note that filling the drive with random data may take longer than zeroing the drive, because the random data must be created by the CPU, while creating zeroes is very fast. On modern hard-disk drives, zeroing the drive will render most data it contains permanently irrecoverable.<ref>{{cite conference | last1 = Wright | first1 = Craig S. | last2 = Kleiman | first2 = Dave | last3 = S. | first3 = Shyaam Sundhar R. | editor1-last = Sekar | editor1-first = R. | editor2-last = Pujari | editor2-first = Arun K. | contribution = Overwriting Hard Drive Data: The Great Wiping Controversy | doi = 10.1007/978-3-540-89862-7_21 | pages = 243β257 | publisher = Springer | series = Lecture Notes in Computer Science | title = Information Systems Security, 4th International Conference, ICISS 2008, Hyderabad, India, December 16-20, 2008. Proceedings | volume = 5352 | year = 2008}}</ref> However, with other kinds of drives such as flash memories, much data may still be recoverable by [[data remanence]]. Modern [[hard disk drive]]s contain a [[Secure Erase]] command designed to permanently and securely erase every accessible and inaccessible portion of a drive. It may also work for some [[solid-state drive]]s (flash drives). As of 2017, it does not work on [[USB flash drive]]s nor on [[Secure Digital]] flash memories.{{citation needed|date=August 2017}} When available, this is both faster than using dd, and more secure.{{citation needed|date=August 2017}} On [[Linux]] machines it is accessible via the [[hdparm]] command's {{code|--security-erase-enhanced}} option. The [[shred (Unix)|shred]] program offers multiple overwrites, as well as more secure deletion of individual files.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)