linux 稀疏文件_在Linux上处理稀疏文件

本文介绍了Linux中处理稀疏文件的工具和编程方法,包括使用`truncate`和`dd`创建稀疏文件,利用内核支持高效处理,以及C库函数如`fallocate`进行编程处理。
摘要由CSDN通过智能技术生成

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环境中处理稀疏文件的常用工具和库。

用于处理稀疏文件的命令行工具 (

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值