I'm trying to write a free space zeroizer using open(2)
, lssek[64](2)
, and write(2)
. I am trying to determine of a disk sector is in use.
I have took a look at dd(1)
from coreutils, but the utility is not performing similar checks. In the Windows world, I could call DeviceIoControl with FSCTL_GET_VOLUME_BITMAP.
Given a raw sector, is there a system call which allows me to determine if the sector is in use?