I need to wipe a hard drive before I give it away, but I want the ability to do so in portions so that I can stop and resume at various points in the middle. For instance, if it will take 24 hours to wipe the disk but I only have blocks of 6-8 hours each night available, I would like to plug the USB hard drive into my laptop to wipe overnight, unplug and take my laptop away in the morning, then resume the next night until it's completely done.
I am using dd from a Linux terminal e.g.
$ nohup dd if=/dev/zero of=/dev/sdX bs=1M &
I originally thought of simply monitoring its progress with kill -USR1 ${ddpid}, keeping track of it, and then resuming where I left off following interruptions. I was immediately not fond of this as I messed up on the math on the first attempt and lost time re-wiping an already-wiped area.
I'm now considering partitioning the drive in advance, and then wiping each partition one at a time or a couple at a time. Since it's a 4 TB disk, I couldn't reach past the 2-TB boundary using fdisk, so I used gdisk to create new partitions:
Device Start End Sectors Size Type
/dev/sdb1 2048 589826047 589824000 281.3G Linux filesystem
/dev/sdb2 589826048 1179650047 589824000 281.3G Linux filesystem
/dev/sdb3 1179650048 1769474047 589824000 281.3G Linux filesystem
/dev/sdb4 1769474048 2359298047 589824000 281.3G Linux filesystem
/dev/sdb5 2359298048 2949122047 589824000 281.3G Linux filesystem
/dev/sdb6 2949122048 3538946047 589824000 281.3G Linux filesystem
/dev/sdb7 3538946048 4128770047 589824000 281.3G Linux filesystem
/dev/sdb8 4128770048 4718594047 589824000 281.3G Linux filesystem
/dev/sdb9 4718594048 5308418047 589824000 281.3G Linux filesystem
/dev/sdb10 5308418048 5898242047 589824000 281.3G Linux filesystem
/dev/sdb11 5898242048 6488066047 589824000 281.3G Linux filesystem
/dev/sdb12 6488066048 7077890047 589824000 281.3G Linux filesystem
/dev/sdb13 7077890048 7667714047 589824000 281.3G Linux filesystem
/dev/sdb14 7667714048 7814037134 146323087 69.8G Linux filesystem
I'm running dd backwards from sdb14 down to sdb1 just so I can keep things straight.
As I complete each partition, I'm considering going back into fdisk/gdisk and deleting the partition even though the full disk isn't wiped.
Once I'm done with all the partitions, I'm planning to wipe the beginning of the disk as well:
$ dd if=/dev/zero of=/dev/sdX bs=1M count=512
(I understand 512 is a bit excessive; please feel free to provide a better number in the comments.)
Will this accomplish my goal of wiping the disk in full, pieces at a time, without leaving any missed gaps anywhere?