On 12/07/2013 05:58 PM, gottl...@nyu.edu wrote:
> On Sat, Dec 07 2013, Canek Peláez Valdés wrote:
> 
>> On Dec 7, 2013 12:40 PM, "walt" <w41...@gmail.com> wrote:
>>>
>>> Just updated my stable amd64 machine to use systemd and all is working
>>> okay except for the lvm.service.
>>>
>>> The lvm.service starts with no errors, but OTOH it finds no physical or
>>> logical volumes.  I suspect this happens because the drive using lvm2
>>> is in a usb3 external dock instead of attached to the mobo.
>>>
>>> When I run 'systemctl restart lvm' manually, the usb3 disk is activated
>>> and mounted successfully.  Thus I think the lvm.service runs too early
>>> during boot.
>>>
>>> Here is my lvm.service (which I copied from another distro, IIRC):
>>>
>>> #cat /etc/systemd/system/lvm.service
>>>
>>> [Unit]
>>> Description=LVM
>>> DefaultDependencies=no
>>> Requires=systemd-udev-settle.service
>>> Before=shutdown.target local-fs.target
>>>
>>> [Service]
>>> Type=oneshot
>>> RemainAfterExit=yes
>>> ExecStart=/sbin/pvscan --ignorelockingfailure
>>> ExecStart=/sbin/vgscan --mknodes --ignorelockingfailure
>>> ExecStart=/sbin/vgchange --sysinit -a ly
>>> ExecStop=/sbin/lvchange --sysinit -a ln $(/sbin/vgs -o vg_name
>> --noheadings --nosuffix)
>>> ExecStop=/sbin/lvchange --sysinit -a ln
>>> ExecStop=/sbin/vgchange --sysinit -a ln
>>>
>>> [Install]
>>> WantedBy=sysinit.target
>>>
>>> Is there an elegant way to fix the problem as opposed to a hack?
>>
>> I believe that for recent enough versions of LVM2, it includes an official
>> lvm2.service unit file(s). Could you try that one and see if it works as
>> you expect?

It has the same problem.  I looked more carefully at the systemd logs and
found that lvm was running before the xhci kernel module was loaded, hence
the usb3 drive was not visible yet.

I "fixed" the problem by adding "After=basic" to the lvm.service file, and
now it works as expected. (Expected by me, anyway :)

> 
> I have the recent lvm2 (2.02.104) and the unit files in
> /usr/lib/systemd/system are called
> 
> lvm2-lvmetad.service
> lvm2-lvmetad.socket 
> lvm2-monitor.service
> lvm2-pvscan@.service

That last file must have been added for version .104.  I'll take a look,
thanks.

Reply via email to