![]() |
Using DD to erase a flash drive
Flash memory commonly has 0xFF as the erased state of its memory bytes. I can use dd to erase to 0x00 thus: dd if=/dev/zero of=/dev/sdX. How can I write all 0xFF characters to the device?
|
tbh i would use dd if=/dev/urandom of=/dev/sdX then format it.
|
Thanks for the urandom hint but I'd still like to know if there's a way to write 0xFF
|
You can use dc3dd (available in many distro's repositories) to write any pattern you want to a file. Assuming your flash drive is /dev/sdb:
Code:
dc3dd pattern=FF of=/dev/sdb |
Many thanks - just what I want
|
Instead of installing a new software for every task, you can also combine existing tools
Code:
tr '\000' '\377' < /dev/zero | dd ... |
Pretty sure there is a way to force an exact stream to a device with dd.
|
| All times are GMT -5. The time now is 02:40 AM. |