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 47C48138A1C for ; Wed, 12 Nov 2014 11:44:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7BA03E09CE; Wed, 12 Nov 2014 11:44:31 +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 328BEE09AB for ; Wed, 12 Nov 2014 11:44:29 +0000 (UTC) Received: from ccs.covici.com (s-out-001.smtp25.com [67.228.91.90]) by s-out-001.smtp25.com (8.14.2/8.14.2) with ESMTP id sACBiRc8030857 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL) for ; Wed, 12 Nov 2014 06:44:28 -0500 Received: from ccs.covici.com (localhost [127.0.0.1]) by ccs.covici.com (8.14.9/8.14.8) with ESMTP id sACBiRNk018643 for ; Wed, 12 Nov 2014 06:44:27 -0500 From: covici@ccs.covici.com To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] difficulties with lvm2+systemd+grub2 In-reply-to: <20141112094758.GE25089@getafix> References: <20141111205608.GA7473@asterix> <27392.1415743996@ccs.covici.com> <20141112094758.GE25089@getafix> Comments: In-reply-to Michael Mair-Keimberger message dated "Wed, 12 Nov 2014 10:47:58 +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: <18640.1415792666.1@ccs.covici.com> Content-Transfer-Encoding: quoted-printable Date: Wed, 12 Nov 2014 06:44:27 -0500 Message-ID: <18642.1415792667@ccs.covici.com> X-SpamH-OriginatingIP: 70.109.53.110 X-SpamH-Filter: s-out-001.smtp25.com-sACBiRc8030857 X-Archives-Salt: 5cea8f1b-a18a-424d-a448-1965b7bf741b X-Archives-Hash: ed0949ce8fe459d849bc58d3faf11d2a Michael Mair-Keimberger wrote: > On Tue, Nov 11, 2014 at 05:13:16PM -0500, covici@ccs.covici.com wrote: > > 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 a= ble > > > 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 orde= r 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= -0320efd04adc 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 witho= ut > > > any wm's installed atm), but even though the grub2 changes were quit= e > > > easy and I've used the genkernel initramfs instead of mine I still g= et 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 cre= ate > > > 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, drac= ut > > will automatically put in the appropriate libraries, and also check th= e > > file systems upon boot. Much better if you need to use systemd. > > = > > Hope this helps. > = > Dracut was already mentioned. I'll give it a try later that day. Regardi= ng your > "rd.lvm.vg=3D" flag. I guess should be put into the grub2 entry, shouldn= 't > it? > = > Anyway, thanks for sharing :) Yep, that is where it should go and it seems to work nicely. I had a lot of work to find that I needed that, otherwise the lvm volumes were not there and my root would not mount at all. -- = 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