You are not logged in.
Hey everyone,
with the latest release, systemd gained the ability to autodetect neccessary partitions to be mounted at boot time without the need for an fstab or root= kernel commandline. This all depends on DiscoverablePartitionsSpec and systemd-gpt-auto-generator.
Did anyone try setting this up on Arch? I fiddled around a bit, but couldn't really manage to get it working. Here's what I did:
Use gdisk to change the partition type of my / partition to 4f68bce3-e8cd-4db1-96e7-fbcaf984b709. (gdisk /dev/sda t 2 $GUID w q)
Manually remove fstab from my initramfs, as mkinitcpio always includes one or throws an error if it doesn't exist on the host
Remove all kernel commandline arguments except for initrd=
What else would I need to do? Include /usr/lib/systemd/system-generators/systemd-gpt-auto-generators in the initrd? What .service files would I need?
If anyone's wondering: I do have a systemd initramfs, i.e. no base hook.
Cheers,
gegenschall
Last edited by gegenschall (2014-04-01 12:33:15)
Offline
There's https://bugs.archlinux.org/task/39379 but I don't understand what is it about.
Edit: OK, now I get it: http://cgit.freedesktop.org/systemd/sys … ed5f1247c5
(the url to the commit posted in the bug report has two spaces you need to remove ;P)
Last edited by karol (2014-03-19 10:50:59)
Offline
You don't need to remove fstab, this will work with an empty fstab just the same. mkinitcpio does not add your fstab to the image by the way, it simply creates an empty one (this shouldn't be necessary anymore I think).
I think all should work once you add systemd-gpt-auto-generator to the initramfs.
Offline
Okay, I'll try and apply the patch, see if that works.
In the meantime, after using this patch on /usr/lib/initcpio/install/systemd
109,111d108
< # generate alls mounts from GPT
< add_file "/usr/lib/systemd/system-generators/systemd-gpt-auto-generator"
<
systemd at least uses the gpt-auto-generator to try and mount the disks but seems stuck in some weird loop while asking for the cryptsetup password, see this image. The password prompt gets repeated every 5 or so seconds. If I manage to type my password within the five seconds the prompt stops but nothing else happens.
edit: brain0 - I did remove my fstab from the initrd.
edit2: No, the patch didn't really help much.
Last edited by gegenschall (2014-03-19 11:57:54)
Offline
First of all, it should be add_binary, not add_file. Second, the generator should work (at least in systemd 211) for luks devices, too.
Offline
First of all, it should be add_binary, not add_file.
The Arch systemd hook uses add_file for systemd-fstab-generator. This should be fixed then...
Second, the generator should work (at least in systemd 211) for luks devices, too.
So do I need the sd-encrypt hook then?
Offline
How would I know what you need? Your screenshot suggests that you are using a LUKS device, so you'll need the sd-encrypt hook.
Offline
How would I know what you need? Your screenshot suggests that you are using a LUKS device, so you'll need the sd-encrypt hook.
Absolutely. I'm not sure why I asked that, I meant something else. Never mind. :-)
I did some more testing and I'm pretty sure there's a bug somewhere. I added the base hook to my initcpio to get an emergency shell and have a look at the logs but that didn't work. It tells me, that a shell is being opened but I don't see a prompt (that message is repeated for about 6-7 times). Well, I think I'm gonna put this to rest, seems too borked at the moment to be usable.
Offline
Did you take into account that it only detects the root partition when you use EFI and only on the same disk that your ESP is on?
Offline
Did you take into account that it only detects the root partition when you use EFI and only on the same disk that your ESP is on?
Yes, I did. Booting using gummiboot (the recommended way, I think) and using only one disk.
Offline
It's been a few days since I looked at the code, and from what I remember LUKS on the root partition cannot possibly work the way it is written. I'd need another close look to be sure.
I tested this without LUKS and it works.
Offline
The discoverable partition spec tells me it should be possible, or am I getting it wrong?
On a sidenote: Because I'm not able to drop to an emergency shell even with the base hook enabled (I don't know why...) it would be nice to have systemd log to the console instead of the journal. Any way to accomplish that?
Offline
it would be nice to have systemd log to the console instead of the journal. Any way to accomplish that?
Offline
gegenschall wrote:it would be nice to have systemd log to the console instead of the journal. Any way to accomplish that?
Couldn't get that to work inside the initrd. But anyways, I just read the current systemd TODO, which states:
* gpt-auto-generator:
- Support LUKS for root devices
So, sorry brain0 for doubting you. I'm marking this as WONTSOLVE. ;-)
Last edited by gegenschall (2014-04-01 12:38:03)
Offline