Re: [systemd-devel] How to use systemd-growfs* services with GPT automount
On Sat, Oct 28, 2023 at 5:40 PM Nils Kattenbeck wrote: > > On Wed, Oct 25, 2023, 13:29 Nils Kattenbeck wrote: >> >> Hi Lennart, >> >> thanks for the information. I finally found out the true cause, >> however, and it's just stupidity on my part. >> While Debian (my mkosi base) does ship systemd-growfs and the man >> pages for all the services, it does not ship the services themselves. >> So I guess that the auto-grow functionality can never be activated. > > > Even after switching to Fedora (and adding two to the cmdline) the growfs > functionality still does not work. The images are simply generated with > mkosi. Is there any part which I might be missing? > > Are there any mechanisms to debug this mechanism? Maybe something with the > generator files? I can also create a minimal example and provide you with the > image, or mkosi files, whichever you prefer if that would help. I had a look into the source of gpt-auto-generator. In add_root_mount the add_mount function is called with growfs set to false without considering any flags/options. This seems to negate the whole purpose of using the growfs flag in the first place?! Kind regards, Nils
Re: [systemd-devel] How to use systemd-growfs* services with GPT automount
On Wed, Oct 25, 2023, 13:29 Nils Kattenbeck wrote: > Hi Lennart, > > thanks for the information. I finally found out the true cause, > however, and it's just stupidity on my part. > While Debian (my mkosi base) does ship systemd-growfs and the man > pages for all the services, it does not ship the services themselves. > So I guess that the auto-grow functionality can never be activated. > Even after switching to Fedora (and adding two to the cmdline) the growfs functionality still does not work. The images are simply generated with mkosi. Is there any part which I might be missing? Are there any mechanisms to debug this mechanism? Maybe something with the generator files? I can also create a minimal example and provide you with the image, or mkosi files, whichever you prefer if that would help. Kind regards, Nils > >
Re: [systemd-devel] How to use systemd-growfs* services with GPT automount
> > ro/rw is a bit weird. Usually in our configuration model the settings > > on the kernel cmdline args take precedence over config in > > /etc/. But ro/rw is different for historical reasons: it only > > specifies the initial ro/rw state of the disks, expecting that > > /etc/fstab later changes things to the final setting. And if neither > > are specified we imply "ro". > > > > Hence, you have two choices: define an /etc/fstab (which of course is > > not what you want with gpt-auto) or just add "rw" to the kernel cmdline. > > > > Lennart I think this could be clarified on the man page for repart.d then. Currently it states: ReadOnly= defaults to on for Verity partition types, and off for all others. GrowFileSystem= defaults to on for all partition types that support it, except if the partition is marked read-only (and thus effectively, defaults to off for Verity partitions). Maybe something like "ReadOnly= defaults to the kernel default ..." (instead of implying that it default to off)
Re: [systemd-devel] How to use systemd-growfs* services with GPT automount
Hi Lennart, thanks for the information. I finally found out the true cause, however, and it's just stupidity on my part. While Debian (my mkosi base) does ship systemd-growfs and the man pages for all the services, it does not ship the services themselves. So I guess that the auto-grow functionality can never be activated. Do you happen to know if it just starts to work magically if I add those service files to the filesystem on my own? Or is this something which can be compiled out? King regards, Nils On Wed, Oct 25, 2023 at 9:57 AM Lennart Poettering wrote: > > On Di, 24.10.23 23:48, Nils Kattenbeck (nilskem...@gmail.com) wrote: > > > > On Mo, 23.10.23 02:00, Nils Kattenbeck (nilskem...@gmail.com) wrote: > > > > > > > Hello, > > > > > > > > I am not sure how to get systemd-growfs-root.service to work with > > > > automount. The partitions are configured via systemd-repart (and the > > > > image created using mkosi). While the partitions are correctly grown > > > > upon boot, the contained filesystem is not grown to match the > > > > partition even though GrowFileSystem defaults to true. Is there > > > > anything I am missing or an easy way to troubleshoot this and get more > > > > information? > > > > > > > > One thing I notice is that the generator.late/-.mount unit has a > > > > Options=ro which as per documentation prevents growing the filesystem. > > > > However, the filesystem is actually mounted read-write so I assume > > > > this is just an artifact of the initrd. Is it not possible to grow the > > > > filesystem from which the initrd starts? > > > > > > Do you have "ro" or "rw" on the kernel cmdline? > > > > I have neither set on the cmdline. > > if you add it, does it work? > > ro/rw is a bit weird. Usually in our configuration model the settings > on the kernel cmdline args take precedence over config in > /etc/. But ro/rw is different for historical reasons: it only > specifies the initial ro/rw state of the disks, expecting that > /etc/fstab later changes things to the final setting. And if neither > are specified we imply "ro". > > Hence, you have two choices: define an /etc/fstab (which of course is > not what you want with gpt-auto) or just add "rw" to the kernel cmdline. > > Lennart > > -- > Lennart Poettering, Berlin
Re: [systemd-devel] How to use systemd-growfs* services with GPT automount
On Di, 24.10.23 23:48, Nils Kattenbeck (nilskem...@gmail.com) wrote: > > On Mo, 23.10.23 02:00, Nils Kattenbeck (nilskem...@gmail.com) wrote: > > > > > Hello, > > > > > > I am not sure how to get systemd-growfs-root.service to work with > > > automount. The partitions are configured via systemd-repart (and the > > > image created using mkosi). While the partitions are correctly grown > > > upon boot, the contained filesystem is not grown to match the > > > partition even though GrowFileSystem defaults to true. Is there > > > anything I am missing or an easy way to troubleshoot this and get more > > > information? > > > > > > One thing I notice is that the generator.late/-.mount unit has a > > > Options=ro which as per documentation prevents growing the filesystem. > > > However, the filesystem is actually mounted read-write so I assume > > > this is just an artifact of the initrd. Is it not possible to grow the > > > filesystem from which the initrd starts? > > > > Do you have "ro" or "rw" on the kernel cmdline? > > I have neither set on the cmdline. if you add it, does it work? ro/rw is a bit weird. Usually in our configuration model the settings on the kernel cmdline args take precedence over config in /etc/. But ro/rw is different for historical reasons: it only specifies the initial ro/rw state of the disks, expecting that /etc/fstab later changes things to the final setting. And if neither are specified we imply "ro". Hence, you have two choices: define an /etc/fstab (which of course is not what you want with gpt-auto) or just add "rw" to the kernel cmdline. Lennart -- Lennart Poettering, Berlin
Re: [systemd-devel] How to use systemd-growfs* services with GPT automount
Hi, On Tue, Oct 24, 2023 at 1:33 PM Lennart Poettering wrote: > > On Mo, 23.10.23 02:00, Nils Kattenbeck (nilskem...@gmail.com) wrote: > > > Hello, > > > > I am not sure how to get systemd-growfs-root.service to work with > > automount. The partitions are configured via systemd-repart (and the > > image created using mkosi). While the partitions are correctly grown > > upon boot, the contained filesystem is not grown to match the > > partition even though GrowFileSystem defaults to true. Is there > > anything I am missing or an easy way to troubleshoot this and get more > > information? > > > > One thing I notice is that the generator.late/-.mount unit has a > > Options=ro which as per documentation prevents growing the filesystem. > > However, the filesystem is actually mounted read-write so I assume > > this is just an artifact of the initrd. Is it not possible to grow the > > filesystem from which the initrd starts? > > Do you have "ro" or "rw" on the kernel cmdline? I have neither set on the cmdline. Greetings, Nils
Re: [systemd-devel] How to use systemd-growfs* services with GPT automount
On Mo, 23.10.23 02:00, Nils Kattenbeck (nilskem...@gmail.com) wrote: > Hello, > > I am not sure how to get systemd-growfs-root.service to work with > automount. The partitions are configured via systemd-repart (and the > image created using mkosi). While the partitions are correctly grown > upon boot, the contained filesystem is not grown to match the > partition even though GrowFileSystem defaults to true. Is there > anything I am missing or an easy way to troubleshoot this and get more > information? > > One thing I notice is that the generator.late/-.mount unit has a > Options=ro which as per documentation prevents growing the filesystem. > However, the filesystem is actually mounted read-write so I assume > this is just an artifact of the initrd. Is it not possible to grow the > filesystem from which the initrd starts? Do you have "ro" or "rw" on the kernel cmdline? Lennart -- Lennart Poettering, Berlin
[systemd-devel] How to use systemd-growfs* services with GPT automount
Hello, I am not sure how to get systemd-growfs-root.service to work with automount. The partitions are configured via systemd-repart (and the image created using mkosi). While the partitions are correctly grown upon boot, the contained filesystem is not grown to match the partition even though GrowFileSystem defaults to true. Is there anything I am missing or an easy way to troubleshoot this and get more information? One thing I notice is that the generator.late/-.mount unit has a Options=ro which as per documentation prevents growing the filesystem. However, the filesystem is actually mounted read-write so I assume this is just an artifact of the initrd. Is it not possible to grow the filesystem from which the initrd starts? Kind regards, Nils