2009-10-12 18:36:19 +02:00
|
|
|
{ config, pkgs, ... }:
|
2006-12-24 02:07:28 +01:00
|
|
|
|
2009-03-06 13:27:28 +01:00
|
|
|
{
|
2006-12-24 02:07:28 +01:00
|
|
|
|
2009-10-12 18:36:19 +02:00
|
|
|
###### implementation
|
2009-03-06 13:27:28 +01:00
|
|
|
|
2009-10-12 18:36:19 +02:00
|
|
|
config = {
|
2009-03-06 13:27:28 +01:00
|
|
|
|
2009-10-12 20:09:34 +02:00
|
|
|
jobs.lvm =
|
2009-11-06 20:20:09 +01:00
|
|
|
{ startOn = "started udev or new-devices";
|
2009-10-12 18:36:19 +02:00
|
|
|
|
|
|
|
script =
|
|
|
|
''
|
2009-03-06 13:27:28 +01:00
|
|
|
# Load the device mapper.
|
2009-10-12 18:36:19 +02:00
|
|
|
${config.system.sbin.modprobe}/sbin/modprobe dm_mod || true
|
2009-03-06 13:27:28 +01:00
|
|
|
|
2010-01-07 17:14:50 +01:00
|
|
|
${pkgs.lvm2}/sbin/dmsetup mknodes
|
2010-01-07 16:55:05 +01:00
|
|
|
|
2009-03-06 13:27:28 +01:00
|
|
|
# Scan for block devices that might contain LVM physical volumes
|
|
|
|
# and volume groups.
|
|
|
|
${pkgs.lvm2}/sbin/vgscan --mknodes
|
|
|
|
|
|
|
|
# Make all logical volumes on all volume groups available, i.e.,
|
|
|
|
# make them appear in /dev.
|
|
|
|
${pkgs.lvm2}/sbin/vgchange --available y
|
|
|
|
|
2009-11-06 22:38:40 +01:00
|
|
|
initctl emit -n new-devices
|
2009-10-12 18:36:19 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
task = true;
|
|
|
|
};
|
|
|
|
|
2010-01-07 17:14:50 +01:00
|
|
|
environment.systemPackages = [ pkgs.lvm2 ];
|
2010-01-07 16:55:05 +01:00
|
|
|
|
2009-03-06 13:27:28 +01:00
|
|
|
};
|
2009-10-12 18:36:19 +02:00
|
|
|
|
2006-12-24 02:07:28 +01:00
|
|
|
}
|