Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lvcreate is demanding 4 PE/ 16 MiB extra #133

Closed
say-paul opened this issue Nov 29, 2023 · 1 comment
Closed

lvcreate is demanding 4 PE/ 16 MiB extra #133

say-paul opened this issue Nov 29, 2023 · 1 comment

Comments

@say-paul
Copy link

I am trying to build an raw image using Image builder where I specify the LV's , the PV is computed correctly with a 1 MiB padding for metadata, but lvcreate complaining 4 PE short, adding that in the PV I get no error, but cannot find any logical reason for the extra space demanded by lvcreate.

the PR I am working on for error details

@zkabelac
Copy link
Contributor

Not sure where is the problem on lvm2 side here.
pvcreate by design currently aligns metadata area on 1MiB.
vgcreate by default uses 4MiB extent size - so the LV can by allocated in 4MiB steps/units.
All of these settings are fully configurable by options - and user can select values in range of 512B to 4GiB in range.

The only 'limiting' factor can be the 'maximal' volume size size the size is expressed as num_of_extents (32bit) * extent_size(32bit) -> final_size (64bit)

So 4MiB extent size limits users to maximal VG size of 16PiB.
4KiB extent size -> 16TiB.

Final note - drives often come with various internal alignment rules - i.e. 512KiB is typical SSD/NVMe allocation unit so it's good idea to keep things aligned here as well.

So i.e. if you know max VG size will be 1TiB - you can use 'vgcreate -s 4k /dev/xxxx' and you can likely use all the PV space. Though if you will 1MiB alignment on PV header you can probably stay at 1MiB extent size as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants