Post

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

MethodSpeedSecurity LevelUse Case
/dev/zeroFastBasic (recoverable in some cases)Casual erasure, general use cases
/dev/urandomSlowHigh (difficult to recover)Secure data destruction, compliance required
This post is licensed under CC BY 4.0 by the author.