Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 480066 - =sys-fs/lvm2-2.02.99-r1 - lvm2-activation-early.service fails with systemd
Summary: =sys-fs/lvm2-2.02.99-r1 - lvm2-activation-early.service fails with systemd
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: gnome-3.8-stable
  Show dependency tree
 
Reported: 2013-08-07 11:43 UTC by Mehmet Giritli
Modified: 2013-10-05 14:35 UTC (History)
8 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ls -R /usr/lib/systemd/system (tmp,4.88 KB, text/plain)
2013-08-07 12:57 UTC, Mehmet Giritli
Details
ls -R /etc/systemd/system (tmp,576 bytes, text/plain)
2013-08-07 12:59 UTC, Mehmet Giritli
Details
lvm2-2.02.99-lvm2-activation-net-fix-order.patch (lvm2-2.02.99-lvm2-activation-net-fix-order.patch,622 bytes, patch)
2013-08-18 13:47 UTC, Alexander Tsoy
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mehmet Giritli 2013-08-07 11:43:57 UTC
I get the service lvm2-activation-early.service in failed state all the time. However, my lvm volumes are working perfectly fine. When I investigated the problem I discovered that there are two lvm processes started by systemd one of them failing with this:
 
device-mapper: create ioctl on donkey-downloads failed: Device or resource busy

and the other one successfully setting up volumes. But perhaps because of the error above I still get a failed service. Perhaps somehow two lvm processes are started where as it shouldn't? And this is causing one of the lvm processses to give the above error? Just a theory...

I have 1 vg and 1 lv in it. I mount it through fstab like this:

/dev/donkey/downloads           /mnt/media/donkey/      ext4    noatime    0 1

Im using sys-fs/lvm2-2.02.99-r1.

emerge --info:

Portage 2.1.12.2 (default/linux/amd64/13.0, gcc-4.6.3, glibc-2.15-r3, 3.8.13-gentoo-smeagol.giritli.eu x86_64)
=================================================================
System uname: Linux-3.8.13-gentoo-smeagol.giritli.eu-x86_64-AMD_Sempron-tm-_140_Processor-with-gentoo-2.2
KiB Mem:      764204 total,     21084 free
KiB Swap:    2113660 total,   2113588 free
Timestamp of tree: Mon, 05 Aug 2013 10:00:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
distcc 3.1 x86_64-pc-linux-gnu [enabled]
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45
dev-lang/python:          2.7.5, 3.2.5-r1
dev-util/ccache:          3.1.9
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.69
sys-devel/automake:       1.11.6, 1.12.6
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.3
sys-devel/gcc-config:     1.7.3
sys-devel/libtool:        2.4-r1
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.6 (virtual/os-headers)
sys-libs/glibc:           2.15-r3
Repositories: gentoo x-portage
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=amdfam10"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/distfiles"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distcc distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.linux.org.tr/gentoo/ http://gentoo.virginmedia.com/"
LANG="en_GB.UTF-8"
LC_ALL="en_GB.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext 3dnowprefetch acl acpi amd64 apache2 berkdb bzip2 cli cracklib crypt cxx dri fortran ftp gdbm geoip gnutls gudev iconv iproute2 ipv6 ithreads logrotate mhash mmx mmxext modules mudflap multilib ncurses nls nptl ocamlopt offensive openid openmp openssl pam pch pcre php png readline samba sasl session spamassassin sse sse2 sse4a ssl syslog systemd tcpd threads unicode vhosts zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="actions alias auth_basic auth_digest authn_anon authn_dbd authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock dbd deflate dir disk_cache env expires ext_filter file_cache filter headers ident imagemap include info log_config logio mem_cache mime mime_magic negotiation proxy proxy_ajp proxy_balancer proxy_connect proxy_http rewrite setenvif so speling status unique_id userdir usertrack vhost_alias cgi cgid" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en tr" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-4" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON


Reproducible: Always
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2013-08-07 11:56:22 UTC
Are you using systemd-love overlay?
Do you have duplicate .service/.socket files from the overlay that would conflict with the ones installed by sys-fs/lvm2 since version 2.02.99-r1?
Comment 2 Mehmet Giritli 2013-08-07 12:57:18 UTC
(In reply to Samuli Suominen from comment #1)
> Are you using systemd-love overlay?
> Do you have duplicate .service/.socket files from the overlay that would
> conflict with the ones installed by sys-fs/lvm2 since version 2.02.99-r1?

No, I've never used an overlay. This was a system with running lvm and openrc and recently migrated to systemd. In terms of lvm all I did was to update to .99-r1 of lvm2 package. Thats it...

But in any case I'm attqaching the output of ls -R /usr/lib/systemd/system
Comment 3 Mehmet Giritli 2013-08-07 12:57:48 UTC
Created attachment 355308 [details]
ls -R /usr/lib/systemd/system
Comment 4 Mehmet Giritli 2013-08-07 12:59:04 UTC
Created attachment 355310 [details]
ls -R /etc/systemd/system
Comment 5 Alexander Tsoy 2013-08-15 12:11:40 UTC
Please attach the output of this command
journalctl -n 50 -u lvm2-activation-early.service
Comment 6 Mehmet Giritli 2013-08-15 12:14:31 UTC
Here is the output:

-- Logs begin at Tue 2013-08-13 23:15:04 EEST, end at Thu 2013-08-15 18:12:16 EEST. --
Aug 13 23:15:05 smeagol systemd[1]: Starting Activation of LVM2 logical volumes...
Aug 13 23:15:06 smeagol lvm[99]: device-mapper: create ioctl on backup-library failed: Device or resource busy
Aug 13 23:15:06 smeagol lvm[99]: 1 logical volume(s) in volume group "backup" now active
Aug 13 23:15:06 smeagol lvm[99]: 1 logical volume(s) in volume group "donkey" now active
Aug 13 23:15:07 smeagol systemd[1]: lvm2-activation-early.service: main process exited, code=exited, status=5/NOTINSSTALLED
Aug 13 23:15:07 smeagol systemd[1]: Failed to start Activation of LVM2 logical volumes.
Aug 13 23:15:07 smeagol systemd[1]: Unit lvm2-activation-early.service entered failed state.
Comment 7 Alexander Tsoy 2013-08-15 15:30:32 UTC
(In reply to Mehmet Giritli from comment #0)
> device-mapper: create ioctl on donkey-downloads failed: Device or resource busy
...
> I have 1 vg and 1 lv in it.

(In reply to Mehmet Giritli from comment #6)
> Aug 13 23:15:06 smeagol lvm[99]: device-mapper: create ioctl on backup-library failed: Device or resource busy
> Aug 13 23:15:06 smeagol lvm[99]: 1 logical volume(s) in volume group
> "backup" now active
> Aug 13 23:15:06 smeagol lvm[99]: 1 logical volume(s) in volume group
> "donkey" now active

So you have 2 VGs with 1 LV in each of them? Sometimes backup/library fails and sometimes donkey/downloads fails? Do you use initramfs?
Comment 8 Mehmet Giritli 2013-08-16 12:41:38 UTC
(In reply to Alexander Tsoy from comment #7)
> (In reply to Mehmet Giritli from comment #0)
> > device-mapper: create ioctl on donkey-downloads failed: Device or resource busy
> ...
> > I have 1 vg and 1 lv in it.
> 
> (In reply to Mehmet Giritli from comment #6)
> > Aug 13 23:15:06 smeagol lvm[99]: device-mapper: create ioctl on backup-library failed: Device or resource busy
> > Aug 13 23:15:06 smeagol lvm[99]: 1 logical volume(s) in volume group
> > "backup" now active
> > Aug 13 23:15:06 smeagol lvm[99]: 1 logical volume(s) in volume group
> > "donkey" now active
> 
> So you have 2 VGs with 1 LV in each of them? Sometimes backup/library fails
> and sometimes donkey/downloads fails? Do you use initramfs?

Yes, I added a vg with a lv in it since I reported the bug....

None of them fail to get created. They are set up properly and used without any problems. The only problem is the failed state of the service which is because of the above error. Why am I getting this error even though everything is functioning properly?

I do not use initramfs.
Comment 9 Alexander Tsoy 2013-08-16 23:41:21 UTC
I also managed to reproduce this. But in my case it is different unit, that fails: lvm2-activation-net.service.

$ sudo journalctl --no-pager -l -u lvm2-activation-net.service
-- Logs begin at Пн. 2013-02-04 20:27:35 MSK, end at Сб. 2013-08-17 02:58:53 MSK. --
авг. 17 02:55:00 home.puleglot lvm[626]: device-mapper: create ioctl on vg_user-home failed: Устройство или ресурс занято
авг. 17 02:55:00 home.puleglot lvm[626]: 2 logical volume(s) in volume group "vg_user" now active
авг. 17 02:55:00 home.puleglot lvm[626]: 4 logical volume(s) in volume group "vg_system" now active
авг. 17 02:55:01 home.puleglot systemd[1]: lvm2-activation-net.service: main process exited, code=exited, status=5/NOTINSSTALLED
авг. 17 02:55:01 home.puleglot systemd[1]: Failed to start Activation of LVM2 logical volumes.
авг. 17 02:55:01 home.puleglot systemd[1]: Unit lvm2-activation-net.service entered failed state.
Comment 10 Alexander Tsoy 2013-08-16 23:43:06 UTC
(In reply to Mehmet Giritli from comment #8)
> Why am I getting this error even though
> everything is functioning properly?

lvm2-activation-generator generates 3 units:

lvm2-activation-early.service
lvm2-activation-net.service
lvm2-activation.service

All of them execute the same command: "lvm vgchange -aay --sysinit".

lvm2-activation.service is always started after lvm2-activation-early.service, because it has "After=lvm2-activation-early.service". So there are no problems here.

But there are no dependencies between lvm2-activation-net.service and other two units, so it may interfere with them. It seems that on our systems it is started in parralel with lvm2-activation-early.service (a little later on my system and a little earlier on your system).
Comment 11 Alexander Tsoy 2013-08-16 23:49:06 UTC
Offtop:

I recommend you start using lvmetad:
"use_lvmetad = 1" in /etc/lvm/lvm.conf
systemctl enable lvm2-lvmetad.service

lvm2-activation-generator do nothing if lvmetad is enabled.
Comment 12 Alexander Tsoy 2013-08-18 13:47:04 UTC
Created attachment 356372 [details, diff]
lvm2-2.02.99-lvm2-activation-net-fix-order.patch

This patch fixes the problem for me. But I'm not sure that in all configurations lvm2-activation-net.service should be started after lvm2-activation-early.service.
Comment 13 Stefan G. Weichinger 2013-08-28 05:26:16 UTC
I see similar issues here and will try the suggested patch.
Unsure if I need/want lvmetad ... btw
Comment 14 Stefan G. Weichinger 2013-08-28 06:27:36 UTC
(In reply to Stefan G. Weichinger from comment #13)
> I see similar issues here and will try the suggested patch.
> Unsure if I need/want lvmetad ... btw

patch works fine here as well
Comment 15 Pacho Ramos gentoo-dev 2013-09-11 11:23:40 UTC
(In reply to Alexander Tsoy from comment #12)
> Created attachment 356372 [details, diff] [details, diff]
> lvm2-2.02.99-lvm2-activation-net-fix-order.patch
> 
> This patch fixes the problem for me. But I'm not sure that in all
> configurations lvm2-activation-net.service should be started after
> lvm2-activation-early.service.

Can you forward the patch to lvm2 upstream? (since we are now supplying upstream unit files)

Thanks!
Comment 16 Samuli Suominen (RETIRED) gentoo-dev 2013-09-12 20:57:59 UTC
2.02.100 is now in Portage, if I'm not looking wrong, this looks to be fixed already (just a bit differently)
Can someone verify?
Comment 17 Stefan G. Weichinger 2013-09-13 12:12:28 UTC
(In reply to Samuli Suominen from comment #16)
> 2.02.100 is now in Portage, if I'm not looking wrong, this looks to be fixed
> already (just a bit differently)
> Can someone verify?


Sorry, not so good.

My LVs were not activated after booting.

# journalctl -b -u lvm2-activation-early.service
-- Logs begin at So 2013-09-01 21:23:55 CEST, end at Fr 2013-09-13 14:10:01 CEST. --
Sep 13 14:04:06 hiro.oops.intern systemd[1]: Starting Activation of LVM2 logical volumes...
Sep 13 14:04:06 hiro.oops.intern systemd[1]: lvm2-activation-early.service: main process exited, code=exited, status=203/EXEC
Sep 13 14:04:06 hiro.oops.intern systemd[1]: Failed to start Activation of LVM2 logical volumes.
Sep 13 14:04:06 hiro.oops.intern systemd[1]: Unit lvm2-activation-early.service entered failed state.

PV is an mdadm-raid (ugly name md127, but OK so far):

# pvs
  PV         VG   Fmt  Attr PSize   PFree 
  /dev/md127 VG03 lvm2 a--  595,05g 48,05g

# cat /proc/mdstat 
Personalities : [raid1] 
md4 : active raid1 sdb3[0] sda6[2]
      52395904 blocks super 1.2 [2/2] [UU]
      
md127 : active raid1 sdb6[0] sda3[1]
      623963072 blocks [2/2] [UU]
      
unused devices: <none>

needed a manual "vgchange -ay"
Comment 18 Alexander Tsoy 2013-09-13 12:45:31 UTC
(In reply to Stefan G. Weichinger from comment #17)
> (In reply to Samuli Suominen from comment #16)
> > 2.02.100 is now in Portage, if I'm not looking wrong, this looks to be fixed
> > already (just a bit differently)
> > Can someone verify?
> 
> 
> Sorry, not so good.
> 
> My LVs were not activated after booting.

This is a bug 484752
Comment 19 Fabio Erculiani (RETIRED) gentoo-dev 2013-09-13 12:46:02 UTC
In order to use lvm with systemd you either need to:
- not use an initramfs
- use an initramfs that activates lvm volumes using udev (and not mdev).

The latter requires you to use genkernel-next to generate the initramfs (running genkernel with the --udev flag).
Comment 20 Alexander Tsoy 2013-09-13 12:51:37 UTC
(In reply to Fabio Erculiani from comment #19)
> In order to use lvm with systemd you either need to:
> - not use an initramfs
> - use an initramfs that activates lvm volumes using udev (and not mdev).
> 
> The latter requires you to use genkernel-next to generate the initramfs
> (running genkernel with the --udev flag).

It is another problem, not related to this bug.
Comment 21 Stefan G. Weichinger 2013-09-13 12:52:48 UTC
(In reply to Alexander Tsoy from comment #20)
> (In reply to Fabio Erculiani from comment #19)
> > In order to use lvm with systemd you either need to:
> > - not use an initramfs
> > - use an initramfs that activates lvm volumes using udev (and not mdev).
> > 
> > The latter requires you to use genkernel-next to generate the initramfs
> > (running genkernel with the --udev flag).
> 
> It is another problem, not related to this bug.

sorry for mixing that up, thanks for the pointer.
Comment 22 Alexander Tsoy 2013-09-13 12:55:24 UTC
(In reply to Pacho Ramos from comment #15)
> (In reply to Alexander Tsoy from comment #12)
> > Created attachment 356372 [details, diff] [details, diff] [details, diff]
> > lvm2-2.02.99-lvm2-activation-net-fix-order.patch
> > 
> > This patch fixes the problem for me. But I'm not sure that in all
> > configurations lvm2-activation-net.service should be started after
> > lvm2-activation-early.service.
> 
> Can you forward the patch to lvm2 upstream? (since we are now supplying
> upstream unit files)
> 
> Thanks!

Yes, but after we get lvm2-2.02.100 with working lvm2-activation-generator in the tree and after somebody test it. :)
Comment 23 Alexander Tsoy 2013-09-13 21:29:15 UTC
(In reply to Samuli Suominen from comment #16)
> 2.02.100 is now in Portage, if I'm not looking wrong, this looks to be fixed
> already (just a bit differently)
> Can someone verify?

No, it's not fixed. I'm going to send my patch to upstream.
Comment 25 Pacho Ramos gentoo-dev 2013-09-28 09:29:16 UTC
*lvm2-2.02.102 (27 Sep 2013)

  27 Sep 2013; Samuli Suominen <ssuominen@gentoo.org> +files/lvm2-2.02.102-do-no
  t-install-separate-command-symlink-for-lvm-devtypes.patch,
  +lvm2-2.02.102.ebuild:
  Version bump.