How to use fio to wipe a drive?

992 views Asked by At

I would like to erase drives using fio (flexible I/O tester) instead of dd. Since fio is multi-threaded I believe it would do the wipe/randomized data faster.

sudo fio --filename=/dev/sdb1 --rw=randwrite --bs=4k --iodepth=32 --ioengin=libaio --direct=1 --name=randdrive

This doesn't work it takes longer than dd and I'm not sure why.

https://linux.die.net/man/1/fio

1

There are 1 answers

0
GhostCat On

The simple answer is: this doesn't make sense.

The limitation when wiping a drive is not how many threads are sending bytes to drive.

To the contrary: assume that you have 5 threads that sent requests in parallel to put data into different places of your drive. That means that your drive head is constantly moving. Compare that to a continuous stream of bytes, all going "one after the other". Maybe things are different for SSDs; but heck; when using SSDs, you have no control at all what the device is doing anyway.

In other words: image you are unloading boxes from a truck on some ramp; and there is one guy responsible for carrying the unloaded boxes into the building. Does the whole process get faster when you have 5 people putting boxes on each end of the ramp? Nope; because there is still only one guy picking up the boxes, and now he needs to walk more to get to all the boxes he is supposed to move into the building.