disk-handling: use 16G swap by default and limit VG names at 120

This commit is contained in:
steveej 2021-01-11 12:22:51 +01:00
parent 288313f70e
commit 05cb97c929
2 changed files with 3 additions and 2 deletions

View file

@ -113,7 +113,7 @@ in rec {
# LVM
sudo vgcreate ${ownLib.disk.volumeGroup diskId} ${ownLib.disk.lvmPv diskId encrypted}
sudo lvcreate ${ownLib.disk.volumeGroup diskId} -L 2G -n swap
sudo lvcreate ${ownLib.disk.volumeGroup diskId} -L 16G -n swap
sudo lvcreate ${ownLib.disk.volumeGroup diskId} -l 100%FREE -n root
# Filesystem

View file

@ -32,8 +32,9 @@
shortenGptPartlabel = partlabel: (builtins.substring 0 36 partlabel);
# LVM doesn't allow most characters in VG names
# Maximum length for VGs and LVs is 128, therefore the VG name must adhere to VG <= 128-LV.
# TODO: replace this with a whitelist for: [a-zA-Z0-9.-_+]
volumeGroup = diskId: builtins.replaceStrings [ ":" ] [ "" ] diskId;
volumeGroup = diskId: (builtins.substring 0 120 (builtins.replaceStrings [ ":" ] [ "" ] diskId));
# This is important at install-time
bootGrubDevice = diskId: "/dev/disk/by-id/" + diskId;