[Nix-dev] LVM2 support in nixos systemd

Lluís Batlle i Rossell viric at viric.name
Fri Sep 20 12:05:13 CEST 2013


Hello,

I noticed that systemd didn't know how to mount (by-label) my lvm raid1. I had a
lvm raid1 setup before, but it was mounted at stage1 just fine, with the proper
dozen of modules in initrd.

The nixos systemd didn't have any units distributed with lvm2. I pushed changes
to make a new systemd derivation in nixpkgs, under the name "systemd_with_lvm2".
You can use them in nixos, by using:

  systemd.package = pkgs.systemd_with_lvm2;
  systemd.packages = [ pkgs.lvm2 ];

This made my systemd mount fine the lvm2 raid1 lv. Nevertheless, there is still
a unit that fails to work. All ends up working, it boots well, and all mounted,
though.

I've no idea why it fails, and its consequences. Here is what 'status' tells me.
If anyone knows anything about it, feel free to comment:

--------------------------
lvm2-activation-net.service - Activation of LVM2 logical volumes
   Loaded: loaded (/etc/lvm/lvm.conf)
   Active: failed (Result: exit-code) since dv 2013-09-20 11:42:52 CEST; 19min ago
     Docs: man:lvm(8)
           man:vgchange(8)
  Process: 1441 ExecStart=/nix/store/q1i64p99bvr6jh67k3cfahcighc1psh2-lvm2-2.02.100/sbin/lvm vgchange -aay --sysinit (code=exited, status=5)
  Process: 1340 ExecStartPre=/nix/store/n9yvgrp6i1fh3jzpbw1cyfvdil0n9j1r-systemd-203/bin/udevadm settle (code=exited, status=0/SUCCESS)

set 20 11:42:52 atom systemd[1]: lvm2-activation-net.service: main process exited, code=exited, status=5/NOTINSSTALLED
set 20 11:42:52 atom systemd[1]: Failed to start Activation of LVM2 logical volumes.
set 20 11:42:52 atom systemd[1]: Unit lvm2-activation-net.service entered failed state.
Warning: Journal has been rotated since unit was started. Log output is incomplete or unavailable.

Warning: Unit file changed on disk, 'systemctl --system daemon-reload' recommended.
--------------------------

Regards,
Lluís.


More information about the nix-dev mailing list