I just bought a new hard drive, and I would like to use LVM on it. I created therefore a new physical volume with
pvcreate, accepting the default settings (which is probably the wisest thing to do).
As result, I've got my phiscal size all together, and no physical extent size, as shown by
PV Size 931.51 GiB Allocatable yes PE Size 0
After that I used
vgcreate to create my volume group. Again with default settings. What I obtained was not exactly what I expected, because of that
33.71 MiB wasted:
PV Size 931.51 GiB / not usable 33.71 MiB Allocatable yes PE Size 4.00 MiB
By using the
--units B option ov
pvdisplay I was able to obtain the actual physical volume size, that is
size = 1000204885504 bytes. Some fast calculations tell me that if we divide it by blocks of
4 MiB we obtain...
size / (4 * mib) 238467.42761
With a wasted area of
size - (4 * mib * 238467) 1793536
Which is much more reasonable.
I tried to create different sized volume groups by changing the
-s flag. Eventually I tried with
4 KiB, obtained a 100% utilization of my physical volume:
PV Size 931.51 GiB / not usable 0 Allocatable yes PE Size 4.00 KiB
So, my questions are:
Why did I get
33.71 MiBflagged as
not usablewhen the reasonable amount would have been
Is it advisable to maintain a very small physical extent size in order to minimize the wasted space? I read on the Internet that a large physical extent reduces the effects of external fragmentation. What is in your opinion a good compromise?
Thanks in advance for any kind answer.