-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
bib: improve the "/" size calculation for LVM
This commit improves the rootfs size calculation on LVM. The issue is that when a user creates a disk customization that adds LVM to e.g. add swap or a custom partition then the "/" partition will also be moved to LVM. However the disk library will not automatically calculate a size for "/" unless it gets the `RequiredMinSizes` parameter (see gh#748). This leads to a "0B" root partition. The naive fix was to just include a hardcoded: ``` requiredDirectorySizes = map[string]uint64{ "/": 1 * datasizes.GiB, "/usr": 2 * datasizes.GiB, } ``` but of course that is not ideal because we calculate the size of disk based on 2x the container size. We set this for the rootfs so the entire disk is big enough. However because LVM does not automatically expand "/" we still end up with a potentially too small "/". This commit tweaks the calculcation so that it sets the requiredDirectorySizes for "/" to 2x container when LVM is used and no "/" is defined. This should be sufficient because the other cases are: 1. non-LVM is used, "/" is expanded automatically 2. LVM is used ensure "/" is at least rootfsMinSize Note that a custom "/usr" is not supported in image mode so splitting rootfsMinSize between / and /usr is not a concern.
- Loading branch information
Showing
2 changed files
with
67 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters