Sparse: Difference between revisions
From DWIKI
m (→Links) |
mNo edit summary |
||
(5 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
Related keywords: discard, thin provisioning, sparse. | |||
=Links= | =Links= | ||
*[https://wiki.archlinux.org/title/sparse_file Sparse file] | *[https://wiki.archlinux.org/title/sparse_file Sparse file] | ||
*[https://en.wikipedia.org/wiki/Sparse_file Sparse File] | *[https://en.wikipedia.org/wiki/Sparse_file Sparse File] | ||
[[Storage_full]] | [[Storage_full]] | ||
=File systems/storages supporting sparse= | |||
Pretty much all filesystems: BTRFS, NILFS, ZFS, NTFS, ext2, ext3, ext4, XFS, JFS, ReiserFS, Reiser4, UFS, Rock Ridge, UDF, ReFS, APFS, F2FS | |||
NFS: since 4.2, make sure to mount as '''vers=4.2''' | |||
qcow2 | |||
=HOWTO= | =HOWTO= | ||
Line 9: | Line 19: | ||
ls -lh myfile | ls -lh myfile | ||
du -sh myfile | du -sh myfile | ||
Or | |||
dd seek=10G if=/dev/zero of=sparsetest bs=1 count=1 status=none | |||
du --block-size=1 sparsetest | |||
8192 sparsetest | |||
du --block-size=1 --apparent sparsetest | |||
10737418241 sparsetest | |||
If these outputs are very different, sparse is supported :) | |||
==Copy sparse file== | ==Copy sparse file== | ||
rsync -S | rsync -S | ||
[[Category:Storage]] |
Latest revision as of 16:15, 6 October 2023
Related keywords: discard, thin provisioning, sparse.
Links
File systems/storages supporting sparse
Pretty much all filesystems: BTRFS, NILFS, ZFS, NTFS, ext2, ext3, ext4, XFS, JFS, ReiserFS, Reiser4, UFS, Rock Ridge, UDF, ReFS, APFS, F2FS
NFS: since 4.2, make sure to mount as vers=4.2
qcow2
HOWTO
Check sparse file
Compare:
ls -lh myfile du -sh myfile
Or
dd seek=10G if=/dev/zero of=sparsetest bs=1 count=1 status=none du --block-size=1 sparsetest
8192 sparsetest
du --block-size=1 --apparent sparsetest
10737418241 sparsetest
If these outputs are very different, sparse is supported :)
Copy sparse file
rsync -S