Blank A Storage Device (CLI Method):
The below steps show how to blank a hard drive, or SSD, from the commandline on Debian 8. All data on the drive will be gone, so make sure you blank the correct drive! These steps require you to substitute some values in the commands. The substitutions are noted below the command.
2. Login as Root. If your machine boots in text-only mode you can do this directly. If your machine boots in GUI mode you may need to login as a regular user and use SU to login as Root:
2. Check to see if any partitions on the drive are currently mounted. If your output is empty then none are mounted:
mount -l | grep -a "sdc"
Substitute "sdc" for the hard drive in question. If you aren't sure which drive, use "parted -l" to see a list of drives.
3. Now that you know which partitions are mounted (if any), unmount any partitions on the drive that are currently mounted:
Substitute "sdc1" for a partition that is currently mounted, and repeat for each partition. If no partitions are currently mounted you can skip this step.
4. Blank the drive:
sgdisk --zap-all /dev/sdc
Substitute "sdc" for the device you are blanking. Triple-check you've entered the correct device!
5. Logout of the Root account. If you used SU to login as Root you will need to use EXIT to get out of Root:
- Step #1 "Reboot" was placed in these instructions specifically for the OP. To other's who may stumble upon these steps in future, you only need to reboot if you're having issues with the drive being busy (despite having unmounted all partitions).
- These steps are written for Debian 8.
- These steps were tested using Debian 8.0 AMD64.
- These steps don't zero the drive. If your goal is to prevent data recovery you will need to take additional steps.
Edited by hollowface, 09 April 2016 - 03:42 PM.