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
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?
(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
Created attachment 355308 [details] ls -R /usr/lib/systemd/system
Created attachment 355310 [details] ls -R /etc/systemd/system
Please attach the output of this command journalctl -n 50 -u lvm2-activation-early.service
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.
(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?
(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.
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.
(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).
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.
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.
I see similar issues here and will try the suggested patch. Unsure if I need/want lvmetad ... btw
(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
(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!
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?
(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"
(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
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).
(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.
(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.
(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. :)
(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.
Upstream commit: https://git.fedorahosted.org/cgit/lvm2.git/commit/?id=9742c5192e8871ebde12856170dae70ee861ef40
*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.