0

I have a project that requires knowing where the physical portions of disk are marked as free (and thus can be overwritten without consequence). Is that possible?

1
  • You could find out which blocks are unused by the file system at that moment. This does not guarantee that you can write to those blocks "without consequence". The file system may allocate the blocks for its own use even before you start writing to them. The only way to guarantee the blocks are not overwritten is to create a new file and write to it. Jan 6, 2020 at 9:06

1 Answer 1

1

What is it that you are actually trying to do? That makes it much easier to answer such questions. It may be that there is already a mechanism for doing what you want, but it is hard to know since you are already discussing a "solution" (doing something mysterious with "free" blocks), rather than posing a question. The safest way to "write to free space" would be to just create a file and write to it...

1
  • For fun, I want to try to hide data in the free space of a hard drive. Error correcting when a bit of free space gets overwritten, and recovering the data at a later time. This hinges on the ability to tell which areas of disk are marked free.
    – Daffy
    Jan 8, 2020 at 0:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .