On Sun, May 03, 2015 at 09:59:53PM +0200, Ludovic Courtès wrote: >Sorry for the delay. Sorry for all the delays :) > >Tomáš Čech 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? Yes. >[...] > >>>> (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!). Good. >Could you send an updated patch? It sounds like we’re almost there, >I guess. Not there yet. Now I need to make some changes with mounting order to help non-root filesystems on LVM volume. Right now it seems it tries to: 1] mount all filesystems 2] run udev But I need to make it: 1] mount /dev 2] run udev service (with the `udevadm settle' in the end) 3] mount the rest of filesystems It seems that /sys and /proc is mounted already from initrd phase using mount-essential-file-systems. Is there reason not to put /dev there as well? I see none so I'll try to add /dev filesystem mounting there (and to move-essential-file-systems) and remove it from %base-file-systems. Best regards, S_W