Gentoo Archives: gentoo-amd64

From: Steven Lembark <lembark@×××××××.com>
To: "gentoo-amd64@l.g.o" <gentoo-amd64@l.g.o>
Cc: lembark@×××××××.com
Subject: [gentoo-amd64] Sanity check: systemd works with LVM2 root volume?
Date: Mon, 30 Nov 2015 17:23:00
Message-Id: 20151130112452.3de0ce15.lembark@wrkhors.com
1 Assuing the kernel has anything required to start up built in (i.e.,
2 no modules are required to boot, mount the root, switch root, or
3 mount any volumes described in /etc/fstab, access any resources
4 used for anything started via openrc or systemd), lvm.conf includes
5 "use_lvmetad = 1" in both the initrd and vg00/root.
6
7 I've tried tracing the logic produced by dracut to see why it failed,
8 but at over 1000 lines I do not have time to verify its logic and see
9 where it failed; ditto genkernel: there is too much logic to ignore
10 checking modules that don't exist because they are in the kernel.
11
12 Looking at:
13
14 <https://wiki.gentoo.org/wiki/Systemd>
15
16 I've verified that the options are set (including choosing systemd
17 as the init), /run is there, /mtab is what is should be, GRUB is
18 updated.
19
20 The example below works perfectly with openrc, fails with systemd
21 (along with dracut results).
22
23 Q: What are the minimum steps/configuration required to set up and
24 switch_root to systemd?
25
26 thanks
27
28 #!/bin/busybox sh
29
30 root='/mnt/root';
31 init='/sbin/init';
32
33 /bin/busybox --install -s;
34
35 mount /sys;
36 mount /proc;
37
38 lvm vgscan -v;
39 lvm vgchange -v -a y;
40
41 mount /dev/vg00/root $root;
42
43 for i in $root/$init $root/usr $root/usr/bin
44 do
45 # drop to shell if the root filesystem is botched.
46
47 [ -e $i ] || exec /bin/busybox sh;
48 done
49
50 # seems bootable: init is there and /usr is mounted.
51
52 exec switch_root $root $init;
53
54 --
55 Steven Lembark 3646 Flora Pl
56 Workhorse Computing St Louis, MO 63110
57 lembark@×××××××.com +1 888 359 3508

Replies