Gentoo Archives: gentoo-user

From: walt <w41ter@×××××.com>
To: gentoo-user@l.g.o
Subject: [gentoo-user] [systemd] lvm.service running too early?
Date: Sat, 07 Dec 2013 18:40:00
Message-Id: l7vq0j$nq9$1@ger.gmane.org
1 Just updated my stable amd64 machine to use systemd and all is working
2 okay except for the lvm.service.
3
4 The lvm.service starts with no errors, but OTOH it finds no physical or
5 logical volumes. I suspect this happens because the drive using lvm2
6 is in a usb3 external dock instead of attached to the mobo.
7
8 When I run 'systemctl restart lvm' manually, the usb3 disk is activated
9 and mounted successfully. Thus I think the lvm.service runs too early
10 during boot.
11
12 Here is my lvm.service (which I copied from another distro, IIRC):
13
14 #cat /etc/systemd/system/lvm.service
15
16 [Unit]
17 Description=LVM
18 DefaultDependencies=no
19 Requires=systemd-udev-settle.service
20 Before=shutdown.target local-fs.target
21
22 [Service]
23 Type=oneshot
24 RemainAfterExit=yes
25 ExecStart=/sbin/pvscan --ignorelockingfailure
26 ExecStart=/sbin/vgscan --mknodes --ignorelockingfailure
27 ExecStart=/sbin/vgchange --sysinit -a ly
28 ExecStop=/sbin/lvchange --sysinit -a ln $(/sbin/vgs -o vg_name --noheadings --nosuffix)
29 ExecStop=/sbin/lvchange --sysinit -a ln
30 ExecStop=/sbin/vgchange --sysinit -a ln
31
32 [Install]
33 WantedBy=sysinit.target
34
35 Is there an elegant way to fix the problem as opposed to a hack?
36
37 Thanks for any clues.

Replies

Subject Author
Re: [gentoo-user] [systemd] lvm.service running too early? "Canek Peláez Valdés" <caneko@×××××.com>