|
|
Log in / Subscribe / Register

Poettering: Factory Reset, Stateless Systems, Reproducible Systems & Verifiable Systems

Poettering: Factory Reset, Stateless Systems, Reproducible Systems & Verifiable Systems

Posted Jun 19, 2014 9:32 UTC (Thu) by Chousuke (subscriber, #54562)
In reply to: Poettering: Factory Reset, Stateless Systems, Reproducible Systems & Verifiable Systems by rwmj
Parent article: Poettering: Factory Reset, Stateless Systems, Reproducible Systems & Verifiable Systems

You misunderstand how systemd works. *every* mount has a corresponding mount unit. Those can be defined natively as systemd unit files. However, for backwards compatibility, systemd generates mount units from fstab -- that's all. You can simply define all mounts as native units and delete fstab and nothing will break.


to post comments

Poettering: Factory Reset, Stateless Systems, Reproducible Systems & Verifiable Systems

Posted Jun 19, 2014 9:47 UTC (Thu) by rwmj (subscriber, #5474) [Link] (4 responses)

I'm thoroughly aware of how systemd works, thanks. However my local configuration is still going to need to go in /etc somewhere (and best of all in /etc/fstab), so creating .mount units is no solution.

Poettering: Factory Reset, Stateless Systems, Reproducible Systems & Verifiable Systems

Posted Jun 19, 2014 11:50 UTC (Thu) by Chousuke (subscriber, #54562) [Link] (2 responses)

Why would you need /etc? The question was about stateless systems, which by definition do not have local configuration. Also, again by definition, a factory reset wipes out any local configuration.

Still, even in the cases where you do want /etc, you can use native mount units instead of /etc/fstab. It is strictly unnecessary on systemd systems. Just put your mount units in /etc/systemd/system/.

Of course, using /etc/fstab with systemd is perfectly fine... I do so myself. The whole point is that systemd doesn't care about it at all. The helper tool "systemd-fstab-generator" reads it if it exists and creates mount units for you during early boot (under /run/systemd/generator/), but the actual mounting logic in systemd doesn't even know that the file exists.

The same approach is used for other "legacy" configuration files such as /etc/crypttab

Poettering: Factory Reset, Stateless Systems, Reproducible Systems & Verifiable Systems

Posted Jun 19, 2014 12:19 UTC (Thu) by rwmj (subscriber, #5474) [Link] (1 responses)

My original reply was about your assertion "/etc/fstab is unnecessary with systemd, so that's not a problem... Systemd merely generates native mount units from it for backwards compatibility."

Poettering: Factory Reset, Stateless Systems, Reproducible Systems & Verifiable Systems

Posted Jun 19, 2014 12:23 UTC (Thu) by Chousuke (subscriber, #54562) [Link]

But that is a statement of fact. /etc/fstab is completely unnecessary on a systemd system; useful and convenient, yes, but not necessary.

Poettering: Factory Reset, Stateless Systems, Reproducible Systems & Verifiable Systems

Posted Jun 19, 2014 13:04 UTC (Thu) by zlynx (guest, #2285) [Link]

If you have a system with local disks, which is what I think you're talking about, then one solution would be to write a udev rule. Detect a RAID controller, launch a script, probe the controller and its drives and create a mount unit for it at /raid or /var/data or whatever you like. That way systems with locally attached storage get it set up, but it doesn't interfere with other systems that just have a boot drive.

Or just do it with Puppet or whatever configuration tool you're using. A stateless system isn't very useful until it has grabbed itself some state after all. The configuration doesn't need to be in /etc, it can be on a network service.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds