[GTALUG] File larger than partition? (Docker-related)

Lennart Sorensen lsorense at csclub.uwaterloo.ca
Mon Nov 20 13:58:25 EST 2017


On Mon, Nov 20, 2017 at 05:25:16PM +0000, Giles Orr via talk wrote:
> I ran a backup today and noticed one file because it took so long to back
> up.  I'm using FC25 on this machine, and used the OS packages of Docker.  I
> seem to have a 100G file on a 12G partition:
> 
> root at toshi7:/var/lib/docker/devicemapper/devicemapper# ls -lh
> total 34M
> -rw------- 1 root root 100G Oct 25 22:02 data
> -rw------- 1 root root 2.0G Oct 25 22:02 metadata

Try ls -lhs

For example:

~> dd if=/dev/zero bs=1M count=1 seek=1000 of=testfile
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.00203937 s, 514 MB/s
~> ls -lhs testfile 
1.0M -rw-r--r-- 1 lsorensen users 1001M Nov 20 13:56 testfile

So 1MB allocated out of 1001MB file size.  The first 1000MB are a 'hole'
in the file that isn't allocated yet.

The -s option to ls makes it show the allocated space in the first column.

-- 
Len Sorensen


More information about the talk mailing list