Sorry for the delay. Tomáš Čech <sleep_wal...@gnu.org> skribis:
> On Tue, Apr 21, 2015 at 05:52:33PM +0200, Ludovic Courtès wrote: [...] >>So I would declare >> >> (mapped-device >> (source "/dev/sda") >> (target "volume_group_name-logical_volume_name") >> (kind lvm-device-mapping)) >> >>and that would give me >>/dev/mapper/volume_group_name-logical_volume_name, right? > > Volume group can be on multiple block devices. For now I rely on autodetect > abilities of LVM. > > So you would declare: > > (mapped-device > (source "") ; irrelevant for LVM > (target "volume_group_name") > (type lvm-mapping)) > > and that would give you > /dev/mapper/volume_group_name-some_volume > /dev/mapper/volume_group_name-other_volume > ... > > and more conveniently > /dev/volume_group_name/some_volume > /dev/volume_group_name/other_volume > ... OK. So the ‘source’ is irrelevant because ‘vgscan’ magically creates the device nodes for volumes such that users don’t have to know what the underlying block devices are, right? [...] >>> (boot-system #:mounts '#$(map file-system->spec file-systems) >>> #:pre-mount (lambda () >>> - (and #$@device-mapping-commands)) >>> + (and #$@device-mapping-commands >>> + ;; If we activated any volume >>> group, we >>> + ;; need to ensure that device >>> nodes are >>> + ;; created. Add code here to >>> call it >>> + ;; once for all activations. >>> + #$(when (lvm-mapping-used? >>> mapped-devices) >>> + #~(zero? >>> + (system* (string-append >>> + #$lvm2/static >>> + >>> "/sbin/lvm.static") >>> + "vgscan" >>> + "--mknodes"))))) >> >>So ‘lvm vgchange --activate y’ does not create /dev nodes? > > Right. > >>Would it be possible to change the command returned by >>‘logical-volume-group-activate’ to somehow create the nodes? That would >>be ideal. > > There are two actions needed to be taken: > 1] volume group activation > 2] creation of nodes > > This design choice does as many 1] as needed and 2] once in the end. > > I could do always 1] and 2] for every volume group, but I didn't find it nice, > since previous 2] calls are useless only slowing down the process. Do you > really think I should change it? No, you’re right, what you did makes a lot of sense (thanks for bearing with me!). Could you send an updated patch? It sounds like we’re almost there, I guess. Thanks, Ludo’.