E
E
Evgeny Vorobyov2020-10-13 14:33:17
Debian
Evgeny Vorobyov, 2020-10-13 14:33:17

The space occupied by LVM is less than the actual size of the files. How so?

There is a server with mail backups. It has an LVM volume from one disk, with a capacity of 1TB.
There are mail backups on it:
drwxr-xr-x 3 root root 4096 Oct 13 02:31 daily.0
drwxr-xr-x 3 root root 4096 Oct 12 02:31 daily.1
.....
drwxr-xr-x 3 root root 4096 Sep 22 02:33 weekly.2
drwxr-xr-x 3 root root 4096 Sep 15 02:35 weekly.3

If folders are stupidly copied to another partition, the total volume exceeds 700Gigs ... and even much more.
Although...
/dev/mapper/vmail--backup-lv1 916G 422G 448G 49% /vmail-backup

How so?
If you look at the volume occupied by individual folders, it turns out that they "weigh" 200+ gigs each .. at least the first 4 for sure, which already exceeds the 400 gigs shown above.

How so? The files in the first four folders are the same (at first glance).

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
Oleg Volkov, 2020-10-13
@voleg4u

Files are sparse (leaky). Simple example:
$ dd if=/dev/zero of=11g-file bs=1024k count=1 seek=10240
1+0 records in
1+0 records out
1048576 bytes (1.0 MB, 1.0 MiB) copied, 0.002087 s, 502 MB/s
$ ls -lh 11g-file
-rw-rw-r-- 1 voleg voleg 11G Oct 13 20:45 11g-file
$ du -hs 11g-file
1.0M 11g-file

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question