Hi,
I'm writing a bit of code to image disk contents REGARDLESS OF THE FILESYSTEM(s) contained thereon.
This doesn't have to be "ideal" (defined as "effortless", "minimal image size", etc.) but should be pretty close.
It is not intended to be performed often -- "write once, read multiple" (i.e., RESTORE *far* more often than IMAGE).
The challenge comes in the filesystem(s) neutral aspect. E.g., I should be able to image a disk containing FAT32, NTFS, FFSv1/2, QFS, individual RAID* volumes, little/BIG endian, etc. -- with the same executable!
A naive approach to this would be to plumb dd to a compressor -- running both OUTSIDE the native OS. But, for large/dirty volumes, this gives you an unacceptably large resulting image -- because you end up having to store "discarded data" which could potentially be HUGE (consider a large volume that has seen lots of write/delete cycles) esp in comparison with the actual precious data!
[I'd like to be able to store the image on a (set of) optical media and/or an unused "partition" somewhere]I.e., without knowledge of the specific filesystem(s) involved, you don't know how to recognize live data from deleted data.
The *hack* that I am currently evaluating is to invoke a trivial executable UNDER THE NATIVE OS that simply creates large "blank" (i.e., highly compressible) files until the volume is "full", then unlinks them all. Doing this while the system is reasonably quiescent isn't guaranteed to "vacuum" all available space but would make a big dent in it (if the system is brought down shortly thereafter).
[Yes, I understand privilege constraints in various OS's, quotas, etc. Those are all easy to work around...]Then, dd | compress (on bare iron).
Again, not ideal but probably the best bang for the least buck?