I just did a bunch of reading and I found out that, and I quote, "The badblocks -wvs command will run four wipes on the drive, writing the patterns 0xaa, 0x55, 0xff, and 0x00 across the entire disk, respectively. It also performs a read test after each full write." It looks like my 1TB HDD will take 6 to 8 hours to complete that test. Meanwhile, you can choose what DBAN does, from a totally unreasonable 35-pass paranoia test that will take days to complete, to just a single pass of writing zeroes which will finish relatively quickly.
The man page for badblocks is here
I also found this
page, in which it is suggested to run badblocks and then the SMART long (extended) test. I did find occasional posts complaining that badblocks found bad sectors while SMART long test didn't, and vice versa, so it would seem to make sense to run both on a new drive.
So the process I'm working through now is:
1. Make a Parted Magic boot disk, and boot your PC with it.
2. Double-click "Disk Health", which opens GSmartControl, and it will be made as clear as it can be which drive is which. In my example, the drive on which I want to run read/write tests (which destroys all data!) is /dev/sdb, while the drives that have data that I don't want to lose are /dev/sda and /dev/sdc.
3. While still in GSmartControl, double-click the drive you want to test, then select the Attributes tab. Make note of the raw values of "Reallocated Sector Count" and "Current Pending Sector Count" (both are zero in my example).
4. Close GSmartControl and click the ROXTerm icon on the taskbar on the bottom to get a command line. Type
lshw -C disk
and you will get a list of the disks with info about each one, where you can confirm that you know which drive you want to do the test on by looking at the logical name.
5. Now for the badblocks command, which will take many hours. If you want to do a destructive read/write test on a new (or blank) drive with no data on (for example) the /dev/sdb drive, type
badblocks -wvs /dev/sdb
If you want to do a non-destructive read/write test on (for example) the /dev/sdc drive with data you don't want to lose, type
badblocks -nvs /dev/sdc
6. When it's done, go back to Drive Health (GSmartControl), double-click the drive you just ran badblocks on, select the Attributes tab and check the raw values of "Reallocated Sector Count" and "Current Pending Sector Count" to see if they have changed from before.
7. Click the Perform Tests tab and choose to perform the Extended Self-test, which should take several hours, and again check the Attributes to see if they have changed.