0

Today I'm configuring kickstart, and when I tried to set the LVM sizes, Anacond protests that there is no free space to create LVM with VG size. Well I could figure out that --grow option can continue the installation w/out prompt to solve this problem, but I need to know how I can calculate the correct VG size to group my LVMs? I just could see something related in AIX system but I thing that is not about my question, and no that isn't a bug.

Error: storage configuration failed: ('new lv is too large to fit in free space', 'vg00')

The wrong configuration:

part /boot --fstype="xfs" --ondisk=vda --size=500
part pv.01 --fstype="lvmpv" --ondisk=vda --size=9500 --grow
volgroup vg00 --pesize=4096 pv.01
logvol /  --fstype="xfs" --size=9000 --name=root --vgname=vg00
logvol swap --fstype="swap" --size=250 --name=swap --vgname=vg00
logvol /home  --fstype="xfs" --size=250 --name=home --vgname=vg00

The correct configuration:

part /boot --fstype="xfs" --ondisk=vda --size=500
part pv.100 --fstype="lvmpv" --ondisk=vda --size=9739
volgroup vg00 --pesize=4096 pv.100
logvol swap  --fstype="swap" --size=250 --name=swap --vgname=vg00
logvol /home  --fstype="xfs" --size=250 --name=home --vgname=vg00
logvol /  --fstype="xfs" --size=9000 --name=root --vgname=vg00

When I used the --grow option in partition, the kickstart create a anaconda-ks.cfg with that configuration above, I just can't understand how the size=14079 is calculated. The original-ks.cfg have the option --grow ;)

Could someone give a idea about LVM math?

Thx

2
  • Where does size=14079 come from. Can't see that in your config snippets.
    – Thomas
    Sep 23 '17 at 14:15
  • @Thomas When we use --grow option anaconda assume that, if is necessary grow up the size of VG to support LVM size, it can be do. When kickstart server are being using and we use some parameter that can anaconda installer changes something (e.g., --grow option in VG), the installer save the original file coming from the kickstart server in /root/original-ks.cfg and the modified parameters in /root/anaconda-ks.cfg. So, the size=14079 is because I use the grow option and anaconda did some calculate to know that size 14079 is the size necessary to support the logical volume size.
    – bugsam
    Sep 27 '17 at 12:04
0

I had a similar issue (How do I calculate Linux physical volume and volume group metadata overhead?) and the answer turned out to be surprisingly simple.

I was attempting to do manual partitioning without the use of the --grow flag anywhere and Anaconda incorrectly reported that I was short by over 700 MiB.

Using pvdisplay, I noticed that there was 4 MiB of unusable space on the partition, so I simply reduced the size of one of the Logical Volumes by 4 MiB. The installation succeeded after that.

-2
part pv.01 --fstype="lvmpv" --ondisk=vda --size=9500 --grow
# Size = 9500
volgroup vg00 --pesize=4096 pv.01
# Using 4096
logvol /  --fstype="xfs" --size=9000 --name=root --vgname=vg00

Technically you defined 9500 then reserved 4096 and then expected the size to be 9000.

If you reduced 9000 to (9500-4096) it would have worked, or if you specified (9500+4096) instead of 9500 it would have worked.

When you allowed anaconda to figure it out it came up with a number slightly more than (9500+4096) likely because some rounding up (conservative approach) or possibly due to the grow option.

1
  • This is wrong. --pesize=4096 tells LVM to use 4MB physical extents, it has nothing to do with the size of a volume group (maybe apart from rounding to last extent border).
    – Fiisch
    Jan 6 '21 at 10:13

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.