summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBaitinq <manuelpalenzuelamerino@gmail.com>2022-08-24 20:23:50 +0200
committerBaitinq <manuelpalenzuelamerino@gmail.com>2022-08-24 20:27:47 +0200
commit84214f3e3ca40d1b5db4022a313e741abc4ad7f1 (patch)
treecbe9468c7d5853670f23719ceb181b6df4595bbf /lib
parent7328d8b41ed25b515a7f66678b1bec84d071264e (diff)
Support logical volume sizing in logical extents units
This allows us to create a lv with size 100%FREE for all the availeable size of the VG, etc.
Diffstat (limited to 'lib')
-rw-r--r--lib/default.nix2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/default.nix b/lib/default.nix
index 3d86f28..64fc93d 100644
--- a/lib/default.nix
+++ b/lib/default.nix
@@ -82,7 +82,7 @@ let {
'';
create.lv = q: x: ''
- lvcreate -L ${x.size} -n ${q.name} ${q.vgname}
+ lvcreate ${if hasInfix "%" x.size then "-l" else "-L"} ${x.size} -n ${q.name} ${q.vgname}
${create-f { device = "/dev/mapper/${q.vgname}-${q.name}"; } x.content}
'';