Format ssd and hdd in linux
Find the drive or partition you want to format
1
lsblk
For SSD
1
sudo dd if=/dev/zero of=/dev/sda bs=1M status=progress
For HDD
1
sudo dd if=/dev/urandom of=/dev/sda bs=1M status=progress
Comparison: Zero vs. Urandom
Method | Speed | Security Level | Use Case |
---|---|---|---|
/dev/zero | Fast | Basic (recoverable in some cases) | Casual erasure, general use cases |
/dev/urandom | Slow | High (difficult to recover) | Secure data destruction, compliance required |
This post is licensed under CC BY 4.0 by the author.