From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 86F5D1389F5 for ; Mon, 17 Nov 2014 20:39:37 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9C278E091B; Mon, 17 Nov 2014 20:39:30 +0000 (UTC) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1D437E084B for ; Mon, 17 Nov 2014 20:39:28 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id h11so7034017wiw.7 for ; Mon, 17 Nov 2014 12:39:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=okb7zY+/pCCbB6fnXPdxNiuuIkVNePYNoazVv1Uta0Q=; b=LH+14T9rCdjhRhRqOjBI1V3VY4URUzXmBeVoMUErOc8WsIPX7MhFpy4szv7+NNJ5hO Ti9v56XMI9K8QpF40CM77N5ybtzhUBUozUZglW76XKqK3FWjqqygjIakY43U5+mh4JKJ eJyJXKcTDWtAJ7eSDDUmOuhmNrI6J8nui8MX8cUO7ThZZdnprST9mxyWWiVxq2AwE513 AFhHQDUXPI1JEYN02IHQ5cJdX9MnMXKthhbcXJqOKRhPoEB6f2EY3O9k+2eA5Ljg+EH2 aUWVgZIOCpywmkKJ8cstR5Yg1wVOFHmQIlo6uKRFX3Avg3VoirS5R5PIAtAEIo8AOMP+ OG7A== X-Received: by 10.180.72.33 with SMTP id a1mr33668553wiv.18.1416256767772; Mon, 17 Nov 2014 12:39:27 -0800 (PST) Received: from asterix ([91.233.13.188]) by mx.google.com with ESMTPSA id h2sm5668464wix.5.2014.11.17.12.39.25 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Nov 2014 12:39:26 -0800 (PST) Date: Mon, 17 Nov 2014 21:39:44 +0100 From: Michael Mair-Keimberger To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] difficulties with lvm2+systemd+grub2 Message-ID: <20141117203944.GA2580@asterix> References: <20141111205608.GA7473@asterix> <20141112010303.GA14293@nemesis> <20141112094228.GD25089@getafix> <20141112100747.GB11108@cerberus.civica.com.au> <54633485.1060801@xunil.at> <20141114184318.GA5943@asterix> <20141116012136.GA23269@nemesis> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="sm4nu43k4a2Rpi4c" Content-Disposition: inline In-Reply-To: <20141116012136.GA23269@nemesis> User-Agent: Mutt/1.5.23 (2014-03-12) X-Archives-Salt: 896d4176-4b83-47b9-b60f-54344c18f9af X-Archives-Hash: 81fc65a74c91520cd27c3d659c48e74f --sm4nu43k4a2Rpi4c Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Nov 16, 2014 at 12:21:37PM +1100, wraeth wrote: > On Fri, Nov 14, 2014 at 07:43:18PM +0100, Michael Mair-Keimberger wrote: > > Basically my changes in my grub config were already correct, however I > > completely forgot, that, since I wrote my own init script, arg's like > > "root" and "init" simply weren't used by my script... > > If you look at my script, I only check the cmdline for "lvm", so > > setting "init" or "root" haven't any effect at all :D >=20 > Glad you got this part of it sorted! I know how both relieving and > frustrating it can be to find such a simple thing as the solution - it > took me two weeks to realise I was calling 'mpc' and not 'mpd' in my > startup script, explaining why MPD was never running... :-/ >=20 Thanks! Yeah, it can be really frustration, but it's worth the relieving feeling when you found the bug :) > > Regarding dracut: Even though I got it to work, it also just bootet > > openrc and not systemd. Don't know why and I didn't digged further after > > it worked with my own script. >=20 > You could try inspecting dmesg to try and determine why it isn't loading > your chosen init. It could be something as simple as a typo, or if the > filesystem (if you have /usr on a separate partition) isn't available at > the time it's trying to launch init. Pretty sure! However, honestly I didn't look further into dracut for now (maybe another day - if I want to know how they work with lvm). BTW, with `dracut --print-cmdline` it prints you an example grub entry for your system, however it's doesn't set "init" and I think (otherwise I guess it would have work here) as long as you didn't already boot into=20 systemd it wouldn't use it too... >=20 > > Regarding LVM: > > As mentioned systemd can't mount my lvm partitions from fstab. Those lvm > > partitions should be mounted by UUID, but it seems like systemd can't > > find them, even though there are available afterwards (under > > /dev/vg0/...). >=20 > I've found dracut initrd's can be a little finicky with LVM volumes. > With that in mind, here's the kernel cmdline for one of my systems wich > uses LUKS->LVM->EXT4 for it's root partition. Note that it has explicit > arguments for *all* LV's and not just root. >=20 > BOOT_IMAGE=3D/vmlinuz-3.17.1-gentoo-r1 root=3D/dev/mapper/vg1-root ro > rd.luks.uuid=3Dluks-3f93b8aa-cf8b-4312-85d6-d45cffa59780 > rd.lvm.lv=3Dvg1/swap rd.lvm.lv=3Dvg1/root resume=3D/dev/mapper/vg1-swap > rootflags=3Drw,noatime,data=3Dordered rootfstype=3Dext4 quiet >=20 Thanks for sharing. =46rom dracut's manual (man dracut.cmdline), rd.lvm.lv only activates given logical volumes, which should be the same like `vgchange -a y` (however i didn't look what exactly dracut does here). Since I'm already doing `vgchange -a y` in my init script, these logical volumes should be available for systemd. I've also checked for systemd's lvm service (lvm2-lvmetad.service) to make sure it's enabled and starts on boot, but it didn't changed anything. However, for now I just read-only mount these lv's directly via my init script and remount them write-able via /etc/local.d/*.start script's (glad to see systemd can make use of these scripts :) ) > > If I comment them out in /etc/fstab (they are not important) systemd > > boots just fine. I've also set "use_lvmetad =3D 1" in /etc/lvm/lvm.conf= as > > mentioned at the systemd wiki. >=20 > This is a dracut-ism, in that if a static filesystem (as denoted by it's > presence in /etc/fstab) is unmountable, it will assume there are > problems and will drop to recovery. The idea of recovery is to identify > your root partition with a symlink to the device node, after which you > *should* be able to continue. >=20 > ln -s /dev/ /dev/root >=20 > See [1] for more. That being said, it may continue to drop to recovery - > I've found the dracut recovery console to be a little temperamental with > things like that... >=20 > [1]: http://fedoraproject.org/wiki/How_to_debug_Dracut_problems Hmm, not sure about that. I think you misunderstood me ;) I wasn't drop into dracut's (or in this case in my initramfs) rescue shell (if you meant that). I was drop into systemd maintaince mode, which means after it couldn't mount these other lv's it stops all services, keep / read only and ask for the root password. Done that I was still able to remount / and all other partitions... It seems like fstab's static filesystem are mandatory for systemd ;) >=20 > Cheers; > --=20 > wraeth > GnuPG Key: B2D9F759 --=20 greetings Michael Mair-Keimberger --sm4nu43k4a2Rpi4c Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUal0QAAoJEEle3Ga+Q7MDEUAP/16EPpcv5Qbq5tARjfwN31FQ aySjfYqWX+NuxVhMDeoHPxnaoFwOK7r4uiVOpiMz+2mCrJB2L+jd8s0YEDbjL6Oe y16f5fevDNglaMXAFpE84Z2zB3Bj36SaabaMlvDyP4phoARbiW5Rbhq+2YGzSATk KMK+TAdBHtvN5XkTjZvUFhbUIWqGuTWvR9YqVIDDaM0r5uUcnR2FEiPdoyPb0P+u tOIybLIeDpriUdWsBTbbalYXA11xqIQ6BfVqlPR47T202ANpX2XQU9CZRcH+AlKJ md1HVweg8mk+BpVb+s9QlqQMFo2T404iDdNCc/cpFDjBfwLykBD1D/dTNY52kw5a A5mLfpmqSjT9mEmlyRdJJoOaj9lQegcQVuuns7VSwubj/8FzT2x8BfAfB+XOBR0A Gj3mE0egP+dV9U7i3kzlROAmRK/jj1LU9VqmzAoheuQcSL7qXDNFrs18fEhNVws+ dGbmL0FR+yFumv0mQPhpOGKi60qnEuhrU2akm4P/1MBE97ovYql2JaV4Vmyr1LEv o6SIdj/DCO0ht+C7H/H5d9Wa8tHUkP1RS/kabpZmC+y4gzAdyOicU0EkGCg6kHVT 8X1yuOpBcpy9+VuCM4Wz0+X6R+7FHeFwUPgkaQEWXTxYoyObaU1Mq3KlbR+PYbGY Jvy9FVoqIh7Y98CMMgej =aHIg -----END PGP SIGNATURE----- --sm4nu43k4a2Rpi4c--