I am playing around with systemd. I use LVM and the vg is enabled using an initramfs built by genkernel. Systemd starts but hangs waiting for a job to mount /var. When I get the emergency prompt I can see from lvs the vg is active but only the root partition (on an LV) is mounted. At this point the boot hangs of course. I found an lvm.service file on the Gentoo wiki:

Thre is a LVM started mesage in the journal so why do the volumes not get mounted? Have I missed some customisation?

TIA and Happy New Year!_________________"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling

I have been researching this for the last three days but have found nothing. If you include "mount -a" in the unit the partitions get mounted but the lvm.service still fails and this messes up the rest of the dependency chain. One thing I have found is that despite the partitions getting created under /dev/mapper, udev no nothing about them:

Code:

# udevadm info -p /dev/mapper/vg00-rootfs -q all
syspath not found

Does this give anyone a clue?_________________"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling

Thanks, I will try the lvm ebuild patch tomorrow._________________"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling

I applied the patch, re-emerged lvm, set LVMETAD=1 in lvm.conf, build a new ramdisk and rebooted using OpenRC. That seemed to work OK, although there were less messages at the start of the boot. I then rebooted using systemd as the init and the result was the same as before: no LVs mounted (except root as usual). Did I miss something?_________________"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling

I seem to have all those dm rules. I don't think there is any point using dracut to build the ramdisk, the genkernel one works perfectly well, it creates all the /dev/dm-* devices, systemd just doesn't mount them._________________"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling

No. I am loosing interest. _________________"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling

The second one has been closed recently so it may be important to re-check with the last version.

I have already tried the LVMETAD route as noted above, and it did not help. Last weekend I noticed there is now a system-lvmetad service, so I enabled that and *still* no change. Let's OpenRC is around for a long time!_________________"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling

Me too i've tried almost anything. When logged in emerg. console just mount -a does the job which means that lvm has already been activated.

I also see that. You can of course modify the LVM service unit to include a "mount -a" command but I have always assumed that since the mount jobs have not completed there would be problems._________________"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling

I have tried dracut but that completely fails to mount the VG! All things systemd seem doomed to fail (see)._________________"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling

- First of all you have to prove the prerequisite, for example some installations have both, which is due to changing Gentoo policy but is plainly is wrong:
/lib/udev or /usr/lib/udev (respective /lib/systemd or /usr/lib/systemd)
I mean it is some double step you want to take, but the first step is to verify a proper systemd installation.

- Are you aware of the subtle difference in the CMDLINE between
PARAMETER - and - rd.PARAMETER
The later is meant for initrd consumption

- default is init=/usr/lib/systemd/systemd
also there lives a symlink at /usr/bin/systemd. I don't know what dracut makes of it, does it only copy the symlink without the real executable? Set the dracut generate loglevel high and lsinitrd to prove ...
(exists there in the initrd /usr/lib/udev/rules.d/69-dm-lvm-metad.rules)

That link is hardly very encouraging! My systemd set up is as installed by Gentoo and works if you nurse it a little. The genkernel route mounts the root file system and then times-out on the mounts and drops to the emergency console. Issuing "mount -a" and "systemctl default" gets you a functioning system. Booting via dracut doesn't mount anything, it doesn't even activate the VG. I will try the "rd.lvm.lv=" parameters and see what they do._________________"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling

dracut-032
==========
- add parameter --print-cmdline
This prints the kernel command line parameters for the current disk layout.
$ dracut --print-cmdline
rd.luks.uuid=luks-e68c8906-6542-4a26-83c4-91b4dd9f0471 rd.lvm.lv=debian/root rd.lvm.lv=debian/usr root=/dev/mapper/debian-root rootflags=rw,relatime,errors=remount-ro,user_xattr,barrier=1,data=ordered rootfstype=ext4
- dracut.sh: add --persistent-policy option and persistent_policy conf option
--persistent-policy <policy>:
Use <policy> to address disks and partitions.
<policy> can be any directory name found in /dev/disk.
E.g. "by-uuid", "by-label"
- dracut now creates the initramfs without udevadm
that means the udev database does not have to populated
and the initramfs can be built in a chroot with
/sys /dev /proc mounted
- if $libdirs is unset, fall back to ld.so.cache paths
- always assemble /usr device in initramfs
- bash module added (disable it, if you really want dash)
- continue to boot, if the main loop times out, in systemd mode
...

You'll better wait arriving this version in Gentoo? Perhaps you got caught by some timeout? The cmdline example in front might help you regarding rd.lvm ..._________________fun2gen2

I tried the rd.lvm.lv parameters and of course they made absolutely no difference. However, sitting at the emergency prompt, I entered a vgscan+vgchange and everything sprung into life. I also got a lot of messages:

The link /dev/vg00/rootfs should had been created by udev but it was not found. Falling back to direct link creation.
The link /dev/vg00/home should had been created by udev but it was not found. Falling back to direct link creation.
The link /dev/vg00/var should had been created by udev but it was not found. Falling back to direct link creation.

I am convinced this is the heart of the problem, I first posted about this three years ago but there was never a resolution. I have several Gentoo+LVM systems and they all produce these mesages during boot, and similar ones during shutdown. Get udev to create the nodes and the LVM problem will be solved!_________________"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling

Just to share how I have sort of circumvented the same problem... I have encrypted partition with root and several other lvm volumes made accessible by custom init script.

I circumvented the systemd - lvm problem by explicitly mounting all of my local filesystems (lvm volumes) in the initramfs init which launches systemd via busybox switch_root. I found that further commenting these volumes out of my normal /etc/fstab also eliminates the irritating systemd wait for "starting job..." to time out. Not sure if that leaves the system reliable?

Presently, since I'm just evaluating gnome-3.8.0 and still also have openRC init installed and available via secondary selection from grub menu, I have restored my original fstab, and I just wait out the systemd "starting job..." messages. Since all file systems are already mounted, when this times out (about a minute) it proceeds straight to a functioning system. Thus, I launch gnome-session via gdm enabled by systemd || or || i launch lxde via lxdm - depending on which grub menu entry I select upon boot.

Of cause udev! There is something wrong regarding:
/usr/lib/udev/rules.d/69-dm-lvm-metad.rules
Is it included in your dracut initrd?
(lsinitrd /boot/initrd|grep metad)

This is the output from dracut, it is skipping all the dm and lvm stuff, why?

Executing: /usr/bin/dracut -f
*** Including module: i18n ***
*** Including module: dm ***
Skipping udev rule: 64-device-mapper.rules
Skipping udev rule: 60-persistent-storage-dm.rules
Skipping udev rule: 55-dm.rules
*** Including module: dmraid ***
Skipping udev rule: 64-md-raid.rules
*** Including module: kernel-modules ***
Omitting driver i2o_scsi
*** Including module: lvm ***
Skipping udev rule: 64-device-mapper.rules
Skipping udev rule: 56-lvm.rules
Skipping udev rule: 60-persistent-storage-lvm.rules
*** Including module: resume ***
*** Including module: rootfs-block ***
*** Including module: terminfo ***
*** Including module: udev-rules ***
Skipping udev rule: 91-permissions.rules
Skipping program /lib/udev/create_floppy_devices as it cannot be found and is flagged to be optional
Skipping program /lib/udev/edd_id as it cannot be found and is flagged to be optional
Skipping program /lib/udev/firmware.sh as it cannot be found and is flagged to be optional
Skipping program /lib/udev/firmware as it cannot be found and is flagged to be optional
Skipping program /lib/udev/firmware.agent as it cannot be found and is flagged to be optional
Skipping program /lib/udev/hotplug.functions as it cannot be found and is flagged to be optional
Skipping program /lib/udev/fw_unit_symlinks.sh as it cannot be found and is flagged to be optional
Skipping program /lib/udev/path_id as it cannot be found and is flagged to be optional
Skipping program /lib/udev/input_id as it cannot be found and is flagged to be optional
Skipping program /lib/udev/usb_id as it cannot be found and is flagged to be optional
Skipping program /lib/udev/pcmcia-socket-startup as it cannot be found and is flagged to be optional
Skipping program /lib/udev/pcmcia-check-broken-cis as it cannot be found and is flagged to be optional
Skipping program /etc/pcmcia/config.opts as it cannot be found and is flagged to be optional
*** Including module: systemd ***
Skipping program /usr/lib/systemd/system/cryptsetup.target as it cannot be found and is flagged to be optional
Skipping program /usr/lib/systemd/system/systemd-ask-password-plymouth.path as it cannot be found and is flagged to be optional
Skipping program /usr/lib/systemd/system/systemd-ask-password-plymouth.service as it cannot be found and is flagged to be optional
Skipping program /usr/lib/systemd/system/systemd-random-seed-load.service as it cannot be found and is flagged to be optional
Skipping program /usr/lib/modules-load.d/*.conf as it cannot be found and is flagged to be optional
*** Including module: base ***
*** Including module: fs-lib ***
Skipping program xfs_db as it cannot be found and is flagged to be optional
Skipping program xfs_check as it cannot be found and is flagged to be optional
Skipping program xfs_repair as it cannot be found and is flagged to be optional
Skipping program xfs_metadump as it cannot be found and is flagged to be optional
Skipping program jfs_fsck as it cannot be found and is flagged to be optional
Skipping program btrfsck as it cannot be found and is flagged to be optional
*** Including module: shutdown ***
Skipping program kexec as it cannot be found and is flagged to be optional
*** Including modules done ***
*** Installing kernel module dependencies and firmware ***
*** Installing kernel module dependencies and firmware done ***
*** Pre-linking files ***
*** Pre-linking files done ***
*** Stripping files ***
*** Stripping files done ***
*** Creating image file ***
*** Creating image file done ***

_________________"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling

The lsinitrd showed some DM and LVM rules were in fact installed. I tried to make my own dracut-032 ebuild but there were problems. I shall have to wait for the official one._________________"Ship me somewheres east of Suez, where the best is like the worst,
Where there ain't no Ten Commandments an' a man can raise a thirst"
from "Mandalay" by Rudyard Kipling