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 4C50B138825 for ; Wed, 12 Nov 2014 09:53:41 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3E157E09A8; Wed, 12 Nov 2014 09:53:35 +0000 (UTC) Received: from mail-wi0-f179.google.com (mail-wi0-f179.google.com [209.85.212.179]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 70BD2E0973 for ; Wed, 12 Nov 2014 09:53:04 +0000 (UTC) Received: by mail-wi0-f179.google.com with SMTP id h11so4251343wiw.6 for ; Wed, 12 Nov 2014 01:53:01 -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=gIp0rMQ2N5CImPdQ0MDvEvbn8sWs06UHv+Hn6radA1M=; b=c7ms6NkiJTuyg1Qu9+SL5ZYdry3RG1lm5DR4hwCzEdtm/lLOfcN8HSEP7dhsm+iwRu WnA7j/ZC9HIyLD7AICDIvwjpxz0+8TKQd+6PoEHPvc6R0Ts1hkHAhgOz/jjCGqWv6Z80 Bb9Wtqha0qo3qrWIr4p6bCN/bxJ9UvHyx2HJjZZg0R46h8dU/hiCPzBWkXf6J8sHcHkS 57Ojvg6qT7oPNpw0nHDQ35Qq+33+KefECYo2zofXYJoru37UpuhiYT9D4gTvgml7gQxN 03G8sp4xLKfahTWf6cMxau4H0T96x5PuqUQdA2hyml6A9IfOenpeoj/XZvpr7A4YIzTO CUXQ== X-Received: by 10.194.94.132 with SMTP id dc4mr63504769wjb.56.1415785981000; Wed, 12 Nov 2014 01:53:01 -0800 (PST) Received: from getafix ([188.21.154.66]) by mx.google.com with ESMTPSA id w10sm30746964wje.10.2014.11.12.01.53.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Nov 2014 01:53:00 -0800 (PST) Date: Wed, 12 Nov 2014 10:47:58 +0100 From: Michael Mair-Keimberger To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] difficulties with lvm2+systemd+grub2 Message-ID: <20141112094758.GE25089@getafix> References: <20141111205608.GA7473@asterix> <27392.1415743996@ccs.covici.com> 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="ni93GHxFvA+th69W" Content-Disposition: inline In-Reply-To: <27392.1415743996@ccs.covici.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Archives-Salt: 18376168-f373-40f9-b07a-b465fb6c8e0b X-Archives-Hash: df2a335cf7a7971455a08ca83dd73e3a --ni93GHxFvA+th69W Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 11, 2014 at 05:13:16PM -0500, covici@ccs.covici.com wrote: > Michael Mair-Keimberger wrote: >=20 > > Hi List, > >=20 > > Today I've started to play around with systemd but so far I couldn't get > > it to boot. I've followed the how to from the gentoo wiki [1], but I > > stuck somehow. > >=20 > > My configuration: > > rootfs is on lvm2 (no encryption or raid). I just use it for being able > > creating snapshot/backups of the running system. > > Grub is on /dev/sda2 which is a simple ext2 partition with a custom > > grub.cfg. A Grub entry looks like that: > >=20 > > ### > > menuentry 'gentoo amd64 gnome' { > > linux /gentoo-3.16.5-n lvm=3Dgentoo_amd64_gnome > > initrd /initrd.cpio.gz > > } > > ### > >=20 > > Don't get confused about the "lvm" flag. This just get passed to my very > > simple custom initramfs which looks like this: > >=20 > > ### > > #!/bin/busybox sh > >=20 > > cmdline() { > > local value > > value=3D" $(cat /proc/cmdline) " > > value=3D"${value##* $1=3D}" > > value=3D"${value%% *}" > > [ "$value" !=3D "" ] && echo "$value" > > } > > # Mount the /proc and /sys filesystems. > > mount -t proc none /proc > > mount -t sysfs none /sys > > mount -t devtmpfs none /dev > >=20 > > lvm vgscan > > lvm vgchange -ay vg0 > > lvm vgscan --mknodes > >=20 > > # Mount the root filesystem. > > mount -o ro /dev/mapper/vg0-$(cmdline lvm) /mnt/root > >=20 > > # Clean up. > > umount /proc > > umount /sys > > umount /dev > >=20 > > # Boot the real thing. > > exec switch_root /mnt/root /sbin/init > > ### > >=20 > > So far this works great for me. However, with systemd I had some > > difficulties how to correctly configure the system and grub2 in order to > > boot with systemd. > >=20 > > This is what i did so far: > >=20 > > For systemd i've created a new initramfs with genkernel and changed the > > grub config like the following entry: > >=20 > > ### > > menuentry 'gentoo amd64 gnome systemd' { > > linux /gentoo-3.16.5-n root=3DUUID=3D1eb94a2b-40d7-4556-9102-03= 20efd04adc init=3D/usr/lib/systemd/systemd > > initrd /initramfs-genkernel-x86_64-3.16.5-gentoo > > } > > ### > >=20 > > Systemd installation went without problems (it's a base system without > > any wm's installed atm), but even though the grub2 changes were quite > > easy and I've used the genkernel initramfs instead of mine I still get a > > kernel panic on boot (have a look at the attached picture). > > I've also checked the kernel config for having the required systemd > > configurations enabled. > >=20 > > Anyone has some ideas what might be wrong? > >=20 > > Furthermore I've also have some questions about lvm2+systemd. Hope > > someone can give me some answers :) > >=20 > > First of all, with systemd installed I can't install lvm2 with the > > static use flag anymore, which is mandatory for being able using it for > > a initramfs. Why isn't that possible? How can I use the lvm binaries for > > my initramfs? > >=20 > > This lead me to my second question. At the wiki, the only way to create > > an initramfs for systemd was with genkernel (genkernel --udev --lvm). > > While the command itself is pretty useless (it's `genkernel --udev --lvm > > initramfs` if you want to create the initramfs -> is this a bug??) i > > also would like to use my own initramfs. > > What changes do i have to make in my own initramfs for being able > > booting systemd from it? >=20 > I would use dracut to generate the initramfs and use rd.lvm.vg=3D to > activate your volume group and specify the init as the exact location > of the systemd binary -- then you don't need static or anything, dracut > will automatically put in the appropriate libraries, and also check the > file systems upon boot. Much better if you need to use systemd. >=20 > Hope this helps. Dracut was already mentioned. I'll give it a try later that day. Regarding = your "rd.lvm.vg=3D" flag. I guess should be put into the grub2 entry, shouldn't it? Anyway, thanks for sharing :) >=20 > --=20 > Your life is like a penny. You're going to lose it. The question is: > How do > you spend it? >=20 > John Covici > covici@ccs.covici.com >=20 --=20 greetings Michael Mair-Keimberger --ni93GHxFvA+th69W Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJUYyzNAAoJEEle3Ga+Q7MDoyEP/i/9rS4oO7E+Se7KfGWZfOC4 wqZyhTxIDyaIzpv8WiI6sA5UZ1z7JKaGNK6qUGbZDYkYupfdJx18oFW+sdJWf7Uw 7I+z0J7CFk1aoKY7ludtPVxibmlOTeTV1OI33wfheJTCKR5FvaLk3QUCGKTtZ108 fkQPFU9SX/sf52EnJjkbubsZh5rZp7sD4T9QHJV+1s2bugyaRuByKq7G7LGZA4eU F24Ng8XK43/9ALIEz2iE4/ylmrgwEbnMlWiTajIwl3P3MixBGbVOx2dBRjMG8c8J +UyPlS46/jEnPxho8trEIvGC7Upf2I7tf/mGiX6EJXN3PATIWAHsC94rELxWtVN/ /LLcqwYeuh82kwS9O6ninZhi7rKJFC65yyQ+hgdDvpREhft280eh7Js7JBrMK0rQ YTVwycVkhbg3JAB6KUYCjZz1T9Hc1jVQ3qCcEaG2+MROzlz7MhrJ4ULMray+K686 Ge8PB4Mu/nUuoqfdexE+YszBbJ5CC/4gPLKPe5sX1NcIhwG4gMgkPVQq+Wy75o+t pvJbHv5Aguj6r7QkOQAXT7Jv6Rmeq4CM2UX34p8zylX3M38pjtuJ3w0z1lOt1p3i qdykHQaMBXxkpgYmK9s3gkEydhs03KsqcdgKXY0pOyGUTTXMt36oL2nbGE4K73sC TUmzuQ1A0feQdpLxOo0K =ilzI -----END PGP SIGNATURE----- --ni93GHxFvA+th69W--