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 56774138825 for ; Tue, 11 Nov 2014 22:13:27 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id C94B8E08ED; Tue, 11 Nov 2014 22:13:20 +0000 (UTC) Received: from mail0200.smtp25.com (mail0200.smtp25.com [174.37.170.200]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 88D6DE089B for ; Tue, 11 Nov 2014 22:13:19 +0000 (UTC) Received: from ccs.covici.com (d-out-001.smtp25.com [67.228.158.174]) by s-out-001.smtp25.com (8.14.2/8.14.2) with ESMTP id sABMDH9l026897 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Tue, 11 Nov 2014 17:13:17 -0500 Received: from ccs.covici.com (localhost [127.0.0.1]) by ccs.covici.com (8.14.9/8.14.8) with ESMTP id sABMDG16027394 for ; Tue, 11 Nov 2014 17:13:16 -0500 From: covici@ccs.covici.com To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] difficulties with lvm2+systemd+grub2 In-reply-to: <20141111205608.GA7473@asterix> References: <20141111205608.GA7473@asterix> Comments: In-reply-to Michael Mair-Keimberger message dated "Tue, 11 Nov 2014 21:56:09 +0100." X-Mailer: MH-E 8.6; nmh 1.6; GNU Emacs 24.4.1 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: text/plain; charset="us-ascii" Content-ID: <27391.1415743996.1@ccs.covici.com> Content-Transfer-Encoding: quoted-printable Date: Tue, 11 Nov 2014 17:13:16 -0500 Message-ID: <27392.1415743996@ccs.covici.com> X-SpamH-OriginatingIP: 70.109.53.110 X-SpamH-Filter: s-out-001.smtp25.com-sABMDH9l026897 X-Archives-Salt: 68775ee9-b501-4519-9673-5a62118605de X-Archives-Hash: bd08ebec34bf98d445749bb52a0e5af7 Michael Mair-Keimberger wrote: > Hi List, > = > 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. > = > 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: > = > ### > menuentry 'gentoo amd64 gnome' { > linux /gentoo-3.16.5-n lvm=3Dgentoo_amd64_gnome > initrd /initrd.cpio.gz > } > ### > = > Don't get confused about the "lvm" flag. This just get passed to my very > simple custom initramfs which looks like this: > = > ### > #!/bin/busybox sh > = > 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 > = > lvm vgscan > lvm vgchange -ay vg0 > lvm vgscan --mknodes > = > # Mount the root filesystem. > mount -o ro /dev/mapper/vg0-$(cmdline lvm) /mnt/root > = > # Clean up. > umount /proc > umount /sys > umount /dev > = > # Boot the real thing. > exec switch_root /mnt/root /sbin/init > ### > = > 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. > = > This is what i did so far: > = > For systemd i've created a new initramfs with genkernel and changed the > grub config like the following entry: > = > ### > menuentry 'gentoo amd64 gnome systemd' { > linux /gentoo-3.16.5-n root=3DUUID=3D1eb94a2b-40d7-4556-9102-032= 0efd04adc init=3D/usr/lib/systemd/systemd > initrd /initramfs-genkernel-x86_64-3.16.5-gentoo > } > ### > = > 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. > = > Anyone has some ideas what might be wrong? > = > Furthermore I've also have some questions about lvm2+systemd. Hope > someone can give me some answers :) > = > 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? > = > 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? 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. Hope this helps. -- = Your life is like a penny. You're going to lose it. The question is: How do you spend it? John Covici covici@ccs.covici.com