Gentoo Archives: gentoo-dev

From: Joshua Kinard <kumba@g.o>
To: gentoo-dev@l.g.o
Subject: Re: [gentoo-dev] separate /usr without initramfs
Date: Sun, 27 Oct 2019 09:38:56
Message-Id: 780e3cc6-d54c-41fa-239e-f2a552e49bfa@gentoo.org
In Reply to: [gentoo-dev] separate /usr without initramfs by William Hubbs
1 On 10/25/2019 14:14, William Hubbs wrote:
2 > Hey all,
3 >
4 > I have been advised to bring this topic back to the list before taking
5 > any action, so here it is.
6 >
7 > First, I need to clarify what I'm *NOT* talking about.
8 >
9 > This discussion has nothing to do with whether or not you have the
10 > split-usr use flag turned on; all of us officially have that on because
11 > /bin, /lib* and /sbin are directories in the official Gentoo setup. In
12 > other words, I am *not* talking about forcing the /usr merge.
13 >
14 > Unfortunately, the concept of separate usr has gotten wrapped up in the
15 > split-usr use flag and doesn't have to be. For the record, I mean something
16 > very specific when I say "separate usr". I am talking about the situation
17 > where /usr is a mount point separate from /, so in this thread, let's stick
18 > to "separate usr" for that situation. I am *not* even saying that using
19 > separate usr is wrong or unsupported. You can even run separate usr with
20 > split-usr turned off if you would like to do so.
21 >
22 > Now for the use case I want to talk about, and that is using separate
23 > /usr without using an initramfs to boot your system and pre-mount /usr.
24 >
25 > If you do this, many things are broken, and this is why the binary
26 > distros all use an initramfs if you do this. This configuration is also
27 > unsupported officially in Gentoo [1] [2], and it is not shown as the
28 > example setup in our handbook.
29 >
30 > I want to hear from people who have / and /usr on separate partitions
31 > and who are not using an initramfs.
32 >
33 > If you are in this group, I have a very specific question. Why aren't
34 > you using an initramfs?
35 >
36 > Thanks,
37 >
38 > William
39
40
41 I use this approach. /usr is its own partition (usually /dev/sda6 in my
42 buildouts), and it mounts a few seconds after init is started. I've been
43 doing it this way on multiple architectures (x86, amd64, sparc64, mips)
44 since pretty much 2003, when I first started experimenting w/ Gentoo and
45 later went on to become a developer. None of my existing Gentoo installs
46 have *ever* needed an initramfs to boot with /usr on a separate partition.
47 Yes, there's a small bit in OpenRC that whines apparently, but I have not
48 seen any ill effects.
49
50 My hardware layout is fairly static. amd64 box uses hardware RAID5
51 (LSI/3Ware 9750), and LILO as bootloader, and the SGI machines use MD-RAID
52 in either RAID1 or RAID5 mode, and they all netboot (manually). Maybe it's
53 because I stick to very simplistic builds, that I've avoided problems. ::
54 shrug ::
55
56 Why do I not like an initramfs, though? Well, for one, it complicates the
57 kernel compiles (and it makes them bigger, something which is an issue on
58 the old SGI systems at times). Two, it's another layer that I have to
59 maintain. Three, it violates, in my mind, the simplicity of keeping the
60 kernel and userland separated (e.g., kernel does kernel-y things, userland
61 does userland-y things).
62
63 Put simply, the kernel's single purpose, as nothing more than a
64 hyper-complex while loop, is to get the hardware up into a usable state and
65 then hand off to userland, then sit and service userland's needs as called
66 upon. The kernel should have all of the subsystems loaded into it necessary
67 to accomplish this task. The fact that the userland, in the current
68 ill-conceived case, cannot get itself up and running simply because /usr is
69 on a yet-to-be-mounted partition is not a concern of the kernel's. Thus,
70 the loading of an initramfs into the kernel to solve this issue is, in
71 principle, a violation (and a Cthulhu-awful hack).
72
73 Maybe I'm just a old codger who refuses to accept change. I'm fine with
74 that description. I like things to remain somewhat simple, and my view of
75 Linux, both kernel and userland, over the last few years is one of growing
76 dismay due to the constant introduction of subsystem layer atop subsystem
77 layer for very little gain. How much longer until we need a kernel to boot
78 the kernel to mount the userland that mounts the userland (yo dawg)?
79
80 And there's that tiny, tiny issue of some kiddos from another, commercial,
81 distribution that just up and declared one day that the idea of
82 /usr-on-another-partition was "broken", and they then used their market
83 position to effectively force all other distributions to bow to their
84 belief. I took, and still to this day, take, great umbrage at that. I'll
85 probably never get over it. Surely, if it works for me on multiple systems
86 *today*, it can't be broken, right? It certainly was *not* broken back
87 then. So why change it? Why completely reinstall all of my systems because
88 non-Gentoo developers said something I did was wrong? No, I don't play that
89 game.
90
91 Oh, and for a technical reason, I like setting mount flags on partitions
92 like /usr, /var, and /tmp for security. It's really as simple as that. All
93 of the fluff above is just the philosophical pudding that I use to justify
94 my obstinance.
95
96 ---
97
98 That all said, I've fallen madly in love with ZFS. I've got two network
99 appliances and an old laptop running FreeBSD 12.0-RELEASE with ZFS, and the
100 things I can do with ZFS eliminate the need to have multiple physical
101 partitions on the disks in those systems (outside of FreeBSD's needed boot
102 and swap partitions). I get separate datasets mounted at /usr, /var, /tmp,
103 and quite a few others, and each can have its own mount properties set that
104 also achieve the security aims I cherish. I can even replicate VM-like
105 snapshot capabilities where I can break part of the install with some dumb
106 idea (like testing 12.1-RC2 out last weekend), then switch boot environments
107 back to the working one and the system comes back up as if nothing happened.
108
109 So lately, I've been messing around w/ ZFS On Linux using a crappy old ~2012
110 2.5" 5400rpm drive in my dev box, attached to the LSI 9750. And with ZFS,
111 that little drive *screams*. It's virtually faster than the RAID5 array on
112 the other three 9750 ports running XFS. If that drive was a heavy metal
113 singer, it'd take over Bruce Dickinson's day job.
114
115 As such, I am contemplating switching to ZFS Root soon on that machine, once
116 I work out some minor details (like can I still use LILO, because GRUB is
117 meh). If that happens, well, that's one machine that won't ever have to
118 worry about the /usr-on-a-sep-partition mess again (even though the juvenile
119 logic behind the no-separate-/usr movement is completely wrong, but I
120 digress in a troll-like fashion).
121
122 Of course, this leaves my poor SGI systems in a questionable state. ZFS is
123 completely reliant on checksums, and ARC needs gobs upon gobs of RAM. So
124 that right there means ZFS might not be viable on those old systems (at
125 least w/ SHA checksumming -- fletcher4 might be fine). And that's assuming
126 ZFS even compiles for a mips64 target and runs without turning a disk into a
127 large pool of entropic bit slop.
128
129 Well, we'll just cross that bridge when we get there...
130
131 --
132 Joshua Kinard
133 Gentoo/MIPS
134 kumba@g.o
135 rsa6144/5C63F4E3F5C6C943 2015-04-27
136 177C 1972 1FB8 F254 BAD0 3E72 5C63 F4E3 F5C6 C943
137
138 "The past tempts us, the present confuses us, the future frightens us. And
139 our lives slip away, moment by moment, lost in that vast, terrible in-between."
140
141 --Emperor Turhan, Centauri Republic

Replies

Subject Author
Re: [gentoo-dev] separate /usr without initramfs James Le Cuirot <chewi@g.o>
Re: [gentoo-dev] separate /usr without initramfs Benda Xu <heroxbd@g.o>