What is a "sparse file", and can they be identified?
Issue
- The file size is inconsistent between
ls
anddf
for a file. -
This file reports a large size (128Gb) but the filesystem isn't even that big. How is this possible?
# ls -lah datafile -rw------- 1 root root 137438953440 May 28 10:05 datafile # df -h Filesystem Size Used Avail Use% Mounted on /dev/sda 20G 9.8G 9.0G 53% /
Environment
- Red Hat Enterprise Linux 5, 6, 7, 8, and 9
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.