Understanding File slack
To understand file slack, one first needs to understand how disks are organized at the lowest level.
As can be seen in the diagram below, disks are subdivided into a set of tracks.
- These tracks are further subdivided into a set of sectors and collection of sectors form together to make a cluster.
- If you write a 1 KB file that has a cluster size of 4 KB, the last 3 KB is wasted.
This unused space between the logical end‐of‐file and the physical end‐of‐file is known as slack space.
The perhaps somewhat unexpected consequence from this is that the file slack contains whatever data was on the disk before the cluster was allocated, such as data from previously deleted files. Using file slack, it would be possible not only to recover previously discarded (and potentially sensitive information) information, but also to effectively hide data. The ability to hide data arises because the operating system does not modify data within a cluster once it has been allocated. This means that any data that is stored in the slack is safe (provided the files size does not change).