10 machine.succeed("vgcreate test_vg /dev/vdb /dev/vdc")
11 machine.succeed("lvcreate -L 512M --type raid0 test_vg -n test_lv")
15 machine.succeed("vgcreate test_vg /dev/vdb")
16 machine.succeed("lvcreate -L 512M -T test_vg/test_thin_pool")
17 machine.succeed("lvcreate -n test_lv -V 16G --thinpool test_thin_pool test_vg")
21 machine.succeed("vgcreate test_vg /dev/vdb")
22 machine.succeed("lvcreate --type vdo -n test_lv -L 6G -V 12G test_vg/vdo_pool_lv")
30 boot.initrd.kernelModules = [
38 boot.thin.enable = true;
39 dmeventd.enable = true;
45 boot.vdo.enable = true;
46 dmeventd.enable = true;
55 "test_lv" in machine.succeed("lvs --select segtype=raid0")
59 "test_lv" in machine.succeed("lvs --select segtype=thin-pool")
63 "test_lv" in machine.succeed("lvs --select segtype=vdo")
69 import ../make-test-python.nix (
72 name = "lvm2-${flavour}-systemd-stage-1";
73 meta.maintainers = lib.teams.helsinki-systems.members;
78 imports = [ extraConfig ];
87 # To boot off the LVM disk, we need to have a init script which comes from the Nix store.
88 mountHostNixStore = true;
90 boot.loader.systemd-boot.enable = true;
91 boot.loader.efi.canTouchEfiVariables = true;
93 environment.systemPackages = with pkgs; [ xfsprogs ];
97 emergencyAccess = true;
99 initrd.services.lvm.enable = true;
100 kernelPackages = lib.mkIf (kernelPackages != null) kernelPackages;
103 specialisation.boot-lvm.configuration.virtualisation = {
104 useDefaultFilesystems = false;
107 device = "/dev/test_vg/test_lv";
112 rootDevice = "/dev/test_vg/test_lv";
117 machine.wait_for_unit("multi-user.target")
118 # Create a VG for the root
120 machine.succeed("mkfs.xfs ${mkXfsFlags} /dev/test_vg/test_lv")
121 machine.succeed("mkdir -p /mnt && mount /dev/test_vg/test_lv /mnt && echo hello > /mnt/test && umount /mnt")
124 machine.succeed("bootctl set-default nixos-generation-1-specialisation-boot-lvm.conf")
125 machine.succeed("sync")
127 machine.wait_for_unit("multi-user.target")
129 # Ensure we have successfully booted from LVM
130 assert "(initrd)" in machine.succeed("systemd-analyze") # booted with systemd in stage 1
131 assert "/dev/mapper/test_vg-test_lv on / type xfs" in machine.succeed("mount")
132 assert "hello" in machine.succeed("cat /test")