linux 稀疏文件
Sparse files are common in Linux/Unix and are also supported by Windows (e.g. NTFS) and macOSes (e.g. HFS+). Sparse files uses storage efficiently when the files have a lot of holes (contiguous ranges of bytes having the value of zero) by storing only metadata for the holes instead of using real disk blocks. They are especially in case like allocating VM images.
稀疏文件在Linux / Unix中很常见,并且Windows(例如NTFS)和macOS(例如HFS +)也支持它们。 当文件中有很多空洞(字节的连续范围为零)时,稀疏文件通过仅存储空洞的元数据而不使用实际磁盘块来有效地使用存储。 它们尤其是在分配VM映像的情况下。
The following image illustrate the structure of a sparse file (image by: User:Sven on Wikimedia).
下图说明了稀疏文件的结构(图片来自:Wikimedia上的User:Sven )。
In this post, we will discuss some common tools and libraries for handling sparse files in Linux environments.
在本文中,我们将讨论一些用于在Linux环境中处理稀疏文件的常用工具和库。