-1

The logical volume(aka LV), centos-home is created automatically when installing CentOS 7 by default, but I didn't use it manually.

Now, I have mounted an empty directory, work to centos-home.

/home/anselmo/work ==> /dev/mapper/centos-home

The following are the results of df -h after mount.

[anselmo@anselmo-centos7 ~]$ df -h
Filesystem                                Size  Used Avail Use% Mounted on
/dev/mapper/centos_anselmo--centos7-root   50G   45G  5.2G  90% /
devtmpfs                                   63G     0   63G   0% /dev
tmpfs                                      63G  302M   63G   1% /dev/shm
tmpfs                                      63G   43M   63G   1% /run
tmpfs                                      63G     0   63G   0% /sys/fs/cgroup
/dev/sdb3                                1014M  358M  657M  36% /boot
/dev/sdc1                                 200M   12M  189M   6% /boot/efi
/dev/mapper/centos_anselmo--centos7-home  2.6T  1.7T  948G  65% /home
tmpfs                                      13G   92K   13G   1% /run/user/1000
/dev/mapper/centos-home                    65G  8.8G   56G  14% /home/anselmo/work

Though I mounted an empty directory, the LV had already used space 8.8G.

How can I find what uses this space?

  • What filesystem you use for this LV? – Romeo Ninov Mar 4 at 7:00
  • What is the output of the following commands: ls -Rabl /home/anselmo/work and du -kx /home/anselmo/work ? – telcoM Mar 4 at 10:35
  • @RomeoNinov I'm using LVM2 and xfs. – Anselmo Park Mar 5 at 7:26
  • @telcoM It has another "anselmo" directory. It looks like my home directory at old time. Does it mean it is an used disk? I thought that I removed all partitions of the disk when I installed my OS, but the result seems that it is my misunderstanding. – Anselmo Park Mar 5 at 7:30
  • When you installed CentOS 7, it auto-created that LV as you said. It also created a home directory for any regular user(s) specified during the installation, and populated the home directory (or directories) with the contents of /etc/skel. That plus the preallocation feature described by @RomeoNinov probably explain it all. – telcoM Mar 5 at 9:25
1

According to this Q/A this is preallocated diskspace and it is related to "XFS Dynamic Speculative EOF Preallocation"

This is a move to reduce file fragmentation during streaming writes by speculatively allocating space as file sizes increase. The amount of space preallocated per file is dynamic and is primarily a function of the free space available on the filesystem (to preclude running out of space entirely).

It follows this schedule:

freespace max prealloc size

5% full extent (8GB)
4-5% 2GB (8GB >> 2)
3-4% 1GB (8GB >> 3)
2-3% 512MB (8GB >> 4)
1-2% 256MB (8GB >> 5)
<1% 128MB (8GB >> 6)

This is an interesting addition to the filesystem as it may help with some of the massively fragmented files I deal with.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.