2009-10-12 09:36:19 -07:00
|
|
|
{ config, pkgs, ... }:
|
2006-12-23 17:07:28 -08:00
|
|
|
|
2009-03-06 04:27:28 -08:00
|
|
|
{
|
2006-12-23 17:07:28 -08:00
|
|
|
|
2009-10-12 09:36:19 -07:00
|
|
|
###### implementation
|
2009-03-06 04:27:28 -08:00
|
|
|
|
2009-10-12 09:36:19 -07:00
|
|
|
config = {
|
2009-03-06 04:27:28 -08:00
|
|
|
|
2009-10-12 11:09:34 -07:00
|
|
|
jobs.lvm =
|
2009-11-06 11:20:09 -08:00
|
|
|
{ startOn = "started udev or new-devices";
|
2009-10-12 09:36:19 -07:00
|
|
|
|
|
|
|
script =
|
|
|
|
''
|
2009-03-06 04:27:28 -08:00
|
|
|
# Load the device mapper.
|
2009-10-12 09:36:19 -07:00
|
|
|
${config.system.sbin.modprobe}/sbin/modprobe dm_mod || true
|
2009-03-06 04:27:28 -08:00
|
|
|
|
2010-01-07 08:14:50 -08:00
|
|
|
${pkgs.lvm2}/sbin/dmsetup mknodes
|
2010-01-07 07:55:05 -08:00
|
|
|
|
2009-03-06 04:27:28 -08: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 13:38:40 -08:00
|
|
|
initctl emit -n new-devices
|
2009-10-12 09:36:19 -07:00
|
|
|
'';
|
|
|
|
|
|
|
|
task = true;
|
|
|
|
};
|
|
|
|
|
2010-01-07 08:14:50 -08:00
|
|
|
environment.systemPackages = [ pkgs.lvm2 ];
|
2010-01-07 07:55:05 -08:00
|
|
|
|
2009-03-06 04:27:28 -08:00
|
|
|
};
|
2009-10-12 09:36:19 -07:00
|
|
|
|
2006-12-23 17:07:28 -08:00
|
|
|
}
|