What's the easiest way to write over a hard disk (such that you could give it to a friend, etc.) on elementary OS?
1 Answer
- Run
sudo fdisk -l
to determine which/dev/sdX
drive you will rewrite. (The drives are listed in an order:sda
for your main drive,sdb
,sdc
, etc. for your remaining drives.) Use that path in place ofsdX
in the next command: - Run
sudo dd if=/dev/zero of=/dev/sdX status=progress
to write zeros to your disk. (status=progress
is a recent addition to see the process's status—it might not work on your system.)
If you'd prefer to use a GUI, gdiskdump
is relatively straightforward, but I think the above is easier than installing software for a single operation. To install, run sudo apt install gdiskdump
.