You are not logged in.

#1 2020-02-17 18:56:05

Dante777
Member
Registered: 2016-07-12
Posts: 38
Website

[SOLVED] systemd-gpt-auto-generator issue.

Hi all.
I'm putting this here (in the newbie corner) since i can't think of a proper/better place in the forum.
Excuse my English, it's not my native language, so apologies from beforehand.
I've been running Arch for about 4 years now, and usually, whenever an issue shows up, i find all the answers i need in the man pages, Arch forum, or do some thorough googling.
This time though, is a bit different.
My issue is  this:
I'm having Arch installed in my laptop with an ssd drive.
While partitioning the drive (during installation process), i used "cgdisk" to create my partition table, setting the following:

1.  ESP Partition                        hex-code: ef00                 (1Gb)                      /dev/nvme0n1p1                mounted at            /boot
2.  Root Partition (x64)           hex-code: 8304                (40 Gb)                   /dev/nvme0n1p2                mounted at            /
3.  Home Partition                    hex-code: 8302                (80Gb)                    /dev/nvme0n1p3                mounted at            /home

And of course, i continued and finished with the rest of the installation.
I'm booting in EFI mode, as

 # ls /sys/firmware/efi/efivars 

lists all the entries.
I must say that my system is running perfectly.
Now, since i'm using a compatible bootloader (systemd-boot), and my partition SetUp is really simple, (according to this: https://jlk.fjfi.cvut.cz/arch/manpages/ … enerator.8 )
i should be able to take advantage of the "systemd-gpt-auto-generator" automation.

"systemd-gpt-auto-generator is useful for centralizing file system configuration in the partition table and making configuration in /etc/fstab unnecessary."  >  from Arch man pages.

So, i renamed my fstab into something else (because it always overrides the systemd-gpt-auto-generator)
and edited my arch systemd-boot entry, like this:

title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /initramfs-linux.img
options rw quiet

removing the  "root=" parameter from the "options" line    (which, before used to be based on PARTUUID)
as described here, in the Wiki  https://wiki.archlinux.org/index.php/sy … ng_loaders, which reads:

"options – command line options to pass to the EFI program or kernel parameters. Optional, but you will need at least root=dev if booting Linux. This parameter can be omitted if the root partition is assigned the correct Root Partition Type GUID as defined in Discoverable Partitions Specification, in which case it will be automatically selected."

Now, what burns my brain is this:
Here,  https://jlk.fjfi.cvut.cz/arch/manpages/ … MMAND_LINE it reads the following:

systemd-gpt-auto-generator understands the following kernel command line parameters:

systemd.gpt_auto, rd.systemd.gpt_auto
Those options take an optional boolean argument, and default to yes. The generator is enabled by default, and a negative value may be used to disable it.

root=
When used with the special value "gpt-auto", automatic discovery of the root partition based on the GPT partition type is enabled. Any other value disables this generator.

so, i don't have to add

systemd.gpt_auto OR rd.systemd.gpt_auto

to my arch.conf "options" line, since the default argument is YES.

Now, what drives me insane, is the next step, that instructs me to add the following parameter with the special value

root=gpt-auto

in order to activate the automatic discovery of the root partition based on the GPT partition.

IF i do that, systemd never detects my root partition, and my system hangs, as it finds no root  to continue with the mounting of the filesystems.

After spending hours experimenting, i made it work though...

I had to change my mkinitcpio.conf to this:

HOOKS=(systemd autodetect modconf block filesystems keyboard fsck)

so, basically replaced the "base" and "udev" hooks with the "systemd" one, and of course re-built my ramdisk.
I also had to remove the "root=gpt-auto" option, from my systemd-boot arch.conf.  (There's no "root=" anymore)
Only Now, it works.
Any ideas as of why it doesn't work out of the box, when i'm using "base" and "udev" hooks respectively, in my ramdisk?
Thank you!

Last edited by Dante777 (2020-02-18 18:57:19)

Offline

#2 2020-02-17 19:35:01

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,396

Re: [SOLVED] systemd-gpt-auto-generator issue.

systemd is what interprets that special value, so you need systemd to handle your initramfs, the rest of the "auto-config" can only happen once systemd is loaded, which is not yet the case in the default initramfs (it will be loaded later from the root partition but for that the value has to be a valid disk). Why you can't just let it be and have to actively remove it though, I have no clue.

Last edited by V1del (2020-02-17 19:49:30)

Offline

#3 2020-02-18 19:02:25

Dante777
Member
Registered: 2016-07-12
Posts: 38
Website

Re: [SOLVED] systemd-gpt-auto-generator issue.

Thank you V1del, i appreciate it.
I'll consider the issue resolved, since i found the way to make it work.
Will do more research though, and i'll update my post, if i come up with anything of interest.

Offline

Board footer

Powered by FluxBB