public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
From: Michael Mair-Keimberger <m.mairkeimberger@gmail.com>
To: gentoo-user@lists.gentoo.org
Subject: Re: [gentoo-user] difficulties with lvm2+systemd+grub2
Date: Mon, 17 Nov 2014 21:39:44 +0100	[thread overview]
Message-ID: <20141117203944.GA2580@asterix> (raw)
In-Reply-To: <20141116012136.GA23269@nemesis>

[-- Attachment #1: Type: text/plain, Size: 4615 bytes --]

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
> 
> 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... :-/
> 

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.
> 
> 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 
systemd it wouldn't use it too...

> 
> > 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/...).
> 
> 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.
> 
>   BOOT_IMAGE=/vmlinuz-3.17.1-gentoo-r1 root=/dev/mapper/vg1-root ro
>   rd.luks.uuid=luks-3f93b8aa-cf8b-4312-85d6-d45cffa59780
>   rd.lvm.lv=vg1/swap rd.lvm.lv=vg1/root resume=/dev/mapper/vg1-swap
>   rootflags=rw,noatime,data=ordered rootfstype=ext4 quiet
> 
Thanks for sharing.
From 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 = 1" in /etc/lvm/lvm.conf as
> > mentioned at the systemd wiki.
> 
> 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.
> 
>   ln -s /dev/<root_device> /dev/root
> 
> 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...
> 
> [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 ;)
> 
> Cheers;
> -- 
> wraeth <wraeth@wraeth.id.au>
> GnuPG Key: B2D9F759

-- 
greetings
Michael Mair-Keimberger

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2014-11-17 20:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-11 20:56 [gentoo-user] difficulties with lvm2+systemd+grub2 Michael Mair-Keimberger
2014-11-11 21:44 ` Stefan G. Weichinger
2014-11-12  8:22   ` Michael Mair-Keimberger
2014-11-11 21:47 ` Jc García
2014-11-12  8:25   ` Michael Mair-Keimberger
2014-11-11 22:13 ` covici
2014-11-12  9:47   ` Michael Mair-Keimberger
2014-11-12 10:19     ` Stefan G. Weichinger
2014-11-12 11:44     ` covici
2014-11-12  1:03 ` wraeth
2014-11-12  9:42   ` Michael Mair-Keimberger
2014-11-12 10:07     ` Sam Jorna
2014-11-12 10:20       ` Stefan G. Weichinger
2014-11-14 18:43         ` Michael Mair-Keimberger
2014-11-16  1:21           ` wraeth
2014-11-17 20:39             ` Michael Mair-Keimberger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20141117203944.GA2580@asterix \
    --to=m.mairkeimberger@gmail.com \
    --cc=gentoo-user@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox