Is there an easy way to read all selected clusters of a given file using python? Regular python read (), apparently, only allows me to read to the logical size of the file (which, of course, is reasonable), but I want to read all the clusters, including free space.
For example, I have a file called "test.bin" with a size of 1234 bytes in a logical size, but since my file system uses a cluster of 4096 bytes in size, the file has a physical size of 4096 bytes on disk. Ie, There are 2862 bytes in the file waiting space.
I'm not sure where to even start with this problem ... I know that I can read the raw disk from / dev / sda, but I'm not sure how to find the clusters of interest to you ... of course that is the whole point of having a file system (so combine file names with sectors on the disk), but I don’t know enough about how python interacts with the file system to understand this ... else .. any help or pointers to links would be greatly appreciated.
source
share