0
Follow
0
View

retrieve sparse file from tar created without -S flag

dx0218jay 注册会员
2023-01-25 08:49

Sparsity information is kind of redundant. You can determine whether some parts of a file should be sparse by checking whether those parts only contain zeros.

head -c $(( 1024 * 1024 )) /dev/urandom  > foo
head -c $(( 1024 * 1024 )) /dev/zero  >> foo
head -c $(( 1024 * 1024 )) /dev/urandom  >> foo
stat foo
    Size: 3145728  Blocks: 6144
fallocate --dig-holes foo
stat foo
    Size: 3145728  Blocks: 4096

As you can see from the block count, making it sparse was successful, and all those block that were completely zeroed out have been successfully removed.

About the Author

Question Info

Publish Time
2023-01-25 08:49
Update Time
2023-01-25 08:49

Related Question

docekrfile遇到问题,这些红色+号啥意思,为什么会这样?

SQLFilestream连接SQL类或SqlConnection

java.nio.file.InvalidPathException:非法字符<:> at index 4 [intellij错误][已关闭]

Infinity Files python

参数——extra files是必需的

VS Code运行程序时显示fatal error: 'stdio.h' file not found

如何测试FileReader读取json文件与Jest?

filestar1.2.2

关于vue3中使用element-plus,import type { FormInstance } from 'element-plus'标红的问题

合并csv文件并添加filename作为新变量