Sparse block devices

  • Øyvind Harboe
    Øyvind Harboe

    I believe coLinux does not implement are sparse block device images.

    Sparse block devices are useful because it is possible to define large block devices when Linux is installed under coLinux and then only have those block devices occupy the space actually used.

    I ran a quick test where I set the compression bit on the Debian 1gb block device file, and on the surface of it, the performance looked quite reasonable(not noticably different).

    I'm sure Windows implements some heuristics on how and when to compress file images.

    As with any open source project, development resources are stretched thin and it seems to me that adding support for sparse block devices would have to be justified with further performance tests, in the face of this simple test.
    yvind Harboe

    • I beleive that CoLinux interacts with the image file using normal W32 reads and writes. Basically it translates the Linux read sector x within the partition to a W32 read sector X within the file. That should mean that any W32 file attributes, sparse compression, ... should continue to function as expected. All that would be needed would be the creation of an image file with those attributes. Sparse files depend on not allocating space for blocks that were not used. If you created a huge sparse image, and did a media test or anything alse that tried to read or write all the blocks it would no longer be a sparse file and you would consume that amount of disk space.

    • eugenesan

      You could use NTFS4/5 Compressed function to compress free space on virtual partitions. I use it it's working perfect.

    • Paul Whittaker
      Paul Whittaker

      Use Bo Branten's mksparse.exe (  It worked perfectly for me.