1 |
Peter Stuge posted on Sun, 12 Aug 2012 02:12:38 +0200 as excerpted: |
2 |
|
3 |
> vivo75@×××××.com wrote: |
4 |
>> First problem udev/SD has is that it can't see all the file system |
5 |
>> labels, for some reason it only see sda and sdb so it's able to partly |
6 |
>> proceed in the boot sequence, mount / (root) but can't mount anything |
7 |
>> else. |
8 |
> |
9 |
> What software parses the filesystem labels when you boot with openrc? |
10 |
> |
11 |
> (I ask because I never use labels myself.) |
12 |
|
13 |
Short answer, mount and udev, and the kernel directly when fed that |
14 |
information for root= on the kernel commandline. Openrc has basically |
15 |
nothing to do with it. As such, I don't know what systemd's doing, but |
16 |
if it indeed is a systemd bug, it's obviously doing /something/ rather |
17 |
different... probably interacting in some unpredicted way with udev now |
18 |
that they're integrating it. |
19 |
|
20 |
Slightly more detail, quoting the mount (8) manpage: |
21 |
|
22 |
>>>>> |
23 |
It is possible to indicate a block special device using its volume LABEL |
24 |
or UUID (see the -L and -U options below). |
25 |
|
26 |
The recommended setup is to use LABEL=<label> or UUID=<uuid> tags rather |
27 |
than /dev/disk/by-{label,uuid} udev symlinks in the /etc/fstab file. |
28 |
The tags are more readable, robust and portable. The mount(8) command |
29 |
internally uses udev symlinks, so use the symlinks in /etc/fstab has no |
30 |
advantage over LABEL=/UUID=. For more details see libblkid(3). |
31 |
|
32 |
Note that mount(8) uses UUIDs as strings. The UUIDs from command line or |
33 |
fstab(5) are not converted to internal binary representation. The string |
34 |
representation of the UUID should be based on lower case characters. |
35 |
|
36 |
<<<<< |
37 |
|
38 |
The implication of the "as strings, not converted to binary" in the last |
39 |
paragraph is that mount's simply doing a dumb string match against the |
40 |
appropriate /dev/disk/by-* symlink names and dereferencing the symlink |
41 |
after which it can proceed as usual if there's a match. It's udev (and |
42 |
thus now systemd, since they're combining) that's actually doing the |
43 |
work, exposing the /dev/disk/by-* symlinks with the correct references. |
44 |
|
45 |
As such, mount basically supports anything found in that location, |
46 |
including device hardware ID (combined with partition number where |
47 |
appropriate, listed in /dev/disk/by-id), the already mentioned filesystem |
48 |
LABEL (/dev/disk/by-label), PARTLABEL (GPT partitions have a partition |
49 |
label that's similar in function to the filesystem label, but set at gdisk |
50 |
time, not mkfs time, obviously this doesn't apply to legacy MBR |
51 |
partitioning), PARTUID, PATH (bus path, tho like traditional /dev/[hs]dX, |
52 |
this can be dynamic and the bus paths are longer and more obtuse for |
53 |
humans so there's generally little practical use for this one), and (as |
54 |
the manpage mentions, partition) UUID. |
55 |
|
56 |
It is however worth noting that PARTLABEL at least is new enough that at |
57 |
least as of a couple months ago when I looked at it for my md/raid setup, |
58 |
while udev passed thru the PARTLABEL for physical devices, it was NOT |
59 |
doing so for partitioned md/raid devices. (That mobo died and I don't |
60 |
have md/raid on the new system so I can't verify current kernel 3.6-rc1+ |
61 |
and udev-187-r3 PARTLABEL-on-md/raid behavior.) So while people could |
62 |
setup their md/raid gpt partitions with partition-labels using gptfdisk |
63 |
(aka gdisk) or whatever, and I did so, only the ones on the physical |
64 |
disks showed up in udev, and at the time I was looking at it, I was |
65 |
running md/raid on virtually everything, so the feature was about useless |
66 |
for me. |
67 |
|
68 |
But that does mean that if mdev or whatever creates similar /dev/disk/by- |
69 |
*, that mount and friends should use it just as they would with udev, |
70 |
since all they're doing is a dumb string match and symlink deref. |
71 |
|
72 |
It'a also worth noting that the kernel's root= line can take a number of |
73 |
these (I'm not sure if it can take them all), including partlabel, |
74 |
according to information someone posted on the btrfs list (which I was |
75 |
following at the time, before I decided btrfs was too unstable still and |
76 |
that I'd wait until next year to try again). I was going to try it, but |
77 |
lost interest when I found I couldn't use it with fstab for my mdraid- |
78 |
based gpt partitions anyway. So all I can say is that it was reported to |
79 |
work on the btrfs list, and no one contradicted it, so... |
80 |
|
81 |
>> a) SD does not re-calculate it's deptree/services when exiting from |
82 |
>> rescue shell, it still try to start the "virtual" services as fstab |
83 |
>> would have never modified, a reboot is needed |
84 |
> |
85 |
> systemctl --system daemon-reload ? |
86 |
|
87 |
I've not tried systemd yet nor have I yet researched it (I have the |
88 |
research vaguely scheduled for next year, sometime), but thanks to both |
89 |
of you for these details. Based on past experience, I expect I'm |
90 |
collecting the pieces even tho I don't have context to assemble them in, |
91 |
but as a result, when I /do/ research it and get that context, the pieces |
92 |
I already have thanks to discussions like this, will fall into place, and |
93 |
it'll be far easier to get upto speed than it would have been had I tried |
94 |
going into it "cold turkey". |
95 |
|
96 |
So while I could guess, I'll just shutup and listen for this part. |
97 |
|
98 |
> I just work with the files on disk. The only time I use tools is if |
99 |
> systemd is running and needs to get told about updates. I don't think |
100 |
> there are any files that are not plain text, so I don't think any tools |
101 |
> are actually required. |
102 |
|
103 |
Useful to know. =:^) |
104 |
|
105 |
> If there's a way to boot into a shell prompt, even if it is just bash |
106 |
> running as pid 1, then any system can be fixed. It requires knowing a |
107 |
> lot about how the system works though, so a lot about systemd if the |
108 |
> system uses systemd. Ie. knowing what files to change how in order to |
109 |
> accomplish desired results. |
110 |
|
111 |
FWIW, I actually have a set of grub2 menu entries with init=/bin/bash, |
112 |
for troubleshooting. =:^) |
113 |
|
114 |
But I think his point (valid or not) was that systemd's closing this |
115 |
avenue off as it's simply too monolithic to get information out of or to |
116 |
trial-start individual services even when not run as init, as is possible |
117 |
with openrc, for instance. |
118 |
|
119 |
With openrc, if you boot with init=/bin/bash, then try to start an openrc |
120 |
initscript, it'll protest that it's not init and that results may not be |
121 |
as intended due to lack of dependency tracking, etc, but it'll let you |
122 |
override and try anyway, you just have to manage the service deps |
123 |
manually or deal with the fallout if you screw it up. |
124 |
|
125 |
He appears to be saying that this doesn't work with systemd. If it's not |
126 |
init, it refuses to do /anything/ with its unit-file initscript |
127 |
substitutes. That /does/ sound like just the sort of complaint (of |
128 |
serveral) I've seen about systemd, but is it accurate? |
129 |
|
130 |
If it is, then yes, booting to init=/bin/bash (or from live-rescue media) |
131 |
and troubleshooting systemd problems from there *IS* going to be more |
132 |
difficult than doing the same thing from openrc, because openrc has the |
133 |
ability to override and one-off, while if this is correct, openrc doesn't. |
134 |
|
135 |
> I don't understand this at all. Even if we go with what you write, then |
136 |
> I expect that some providers will start to offer an ecosystem of |
137 |
> systemd-optimized experiences for those who want it - but I do not |
138 |
> believe for a second that those would somehow be exclusive to other |
139 |
> systems. |
140 |
|
141 |
In all these systemd threads, someone posted a link to gregkh's take on |
142 |
gentoo as posted on google+. In the comments that followed, Ted T'so and |
143 |
Kay S. had a rather interesting ping-pong in which one of them mentioned |
144 |
the concern that Red Hat and an init implementor for them had about all |
145 |
of this at the enterprise level. For those interested in such things, |
146 |
it's worth going back and looking at that if you skipped it (either find |
147 |
the link here or just go back and look at gregkh's G+ from ~April). I |
148 |
knew there were enterprise implications, but that was the first time I |
149 |
realized that RH wasn't necessarily 100% onboard with the full systemd |
150 |
thing, addressing it "upstream" since AFAIK Lennart is a RH employee as |
151 |
well. |
152 |
|
153 |
From that, it looks like they're more or less waiting for things to |
154 |
settle down as well, and they plan on some perhaps major patches being |
155 |
necessary for the first few RH releases with systemd. Of course, even |
156 |
assuming those patches eventually make it upstream, Red Hat's release |
157 |
cycle is long enough and their paying customers generally conservative |
158 |
enough, that it may be some time before they actually have to worry about |
159 |
supporting systemd in a deployed release. |
160 |
|
161 |
And of course, Ubuntu's continuing to stick to upstart for the time |
162 |
being, AFAIK. And CentOS and ScientificLinux being RH offshoots, they'll |
163 |
follow RH. |
164 |
|
165 |
In practice, I think that means that remote-hosted servers shouldn't have |
166 |
to worry about systemd issues for another couple years, anyway, gentoo or |
167 |
not. Of course if they run fedora, it might be a problem rather sooner. |
168 |
But people running fedora should be used to dealing with such leading |
169 |
edge issues, so no big deal for them either, really. |
170 |
|
171 |
And given enterprise support terms, I guess we're looking at something |
172 |
approaching a decade before folks are actually FORCED to systemd, by |
173 |
falling off the end of the support train. |
174 |
|
175 |
Meanwhile, that gives plenty of time for other "entrprisish" parties to |
176 |
wait for redhat to decide what it's doing, then come up with their own |
177 |
solutions once a bit more about the ultimate target is known. And until |
178 |
then, except for those choosing to run fedora or the like, the existing |
179 |
live-media-style remote rescue solutions should continue to work as they |
180 |
have. |
181 |
|
182 |
And in particular for gentoo users with remote hosts to worry about, |
183 |
since it's already clear that for at least the near term (say a year or |
184 |
two), gentoo's going to continue to default to openrc, there shouldn't be |
185 |
a problem for at least /that/ long. And by the time any such problem |
186 |
/were/ to appear, it's very likely that solutions for it will be |
187 |
available as well... or given the day jobs of various gentoo devs, |
188 |
there'd certainly be sufficient interest in continuing systemd- |
189 |
alternative gentoo support, since they have similar issues themselves. |
190 |
|
191 |
-- |
192 |
Duncan - List replies preferred. No HTML msgs. |
193 |
"Every nonfree program has a lord, a master -- |
194 |
and if you use the program, he is your master." Richard Stallman |