I have a new hard drive connected to my machine (CentOS 7.6), 1TB in size.
fdiskTo create a new primary partition there in size of 500 GB, type "8e" (Linux LVM).
Then I marked it as a physical volume LVM:
pvcreate / dev /
After that I created a group of volumes and added the partition:
vgcreate vg1 / dev /
In addition to that, I created a logical volume that used all the space available in the volume group:
lvcreate -n lv1 -l 100% FREE vg1
Then I converted this logical volume to the LUKS format:
cryptsetup luksFormat / dev / vg1 / lv1
Finally on top of that I added an ext4 file system:
mkfs.ext4 / dev / vg1 / lv1
It worked quite well and, using the password phrase set in LUKS format and with some
/ etc / fstab Y
/ etc / crypttab Magic, I could mount it permanently in
/ mnt / my_new_data.
Everything is fine, except an interesting problem. The command
df -hT It shows me something like this:
Type of file system Size used Leveraging% mounted on // .................. // .................. / dev / mapper / vg1-lv1 ext4 493G 73M 467G 1% / mnt / my_new_data
How is it saying 493 GB instead of 500 GB? Also (the most important): why are there only 467 GB available? I have not added any files in that directory yet. Since when is 467GB + 73MB = 493GB?
Keep that in mind:
pvsReports 500GB as size for physical volume.
vgsreports 500 GB as size for the volume group
lvsreports 500GB as szie for the logical volume
lsblkreports 500GB as size for that partition
Each tool says that my disk should have a size of 500 GB. Except apparently I only have 467GB available.
What am I missing?
Could the LUKS encryption have something to do with that?