systemd mount files and /etc/fstab
This question is purely out of curiosity as I dig through wider aspects of systemd and really relates to 'best practice' approach, more than any kind of technical issue I am interested in solving.
systemd supports the use of mount unit files to mount filesystems, but in RHEL7 the traditional /etc/fstab is still used. I can understand this if it is to 'ease migration' but what has piqued my curiosity is the following paragraph from the systemd man pages
Mount units may either be configured via unit files, or via /etc/fstab
(see fstab(5) for details). Mounts listed in /etc/fstab will be
converted into native units dynamically at boot and when the
configuration of the system manager is reloaded. In general,
configuring mount points through /etc/fstab is the preferred approach.
What I am looking for feedback on is the last sentence, specifically why is using /etc/fstab still the preferred approach? It seems strange that the preferred approach is to use a 'legacy' configuration file that is converted into the newer style mount unit files. Is there a technical reason for why /etc/fstab is still preferred? (eg. legacy applications?)
Does this preference hold true when creating additional (non-system) mounts?
Responses
Given how early in its enterprise-adoption lifecycle EL7 is (hell, the STIGs only recently reached the "open for comments" state), I know that my customers would prefer fstab-managed mounts: pretty much all of their SAs would be completely dumbfounded to log into an EL7 system, see a half dozen mounted filesystems but find nothing in fstab. By the time EL8 is being deployed, you'll probably have more admins who won't be so dumbfounded, so, perhaps by then the "preferred" note will be dropped.
That said, writing the unit files by hand is kind of painful. It's a lot more typing and structure to mount a single partition than the equivalent fstab entry. When I was first dicking around with it, I found an EL7-included tool to convert things for me (Google is failing me, at the moment), but the results of that conversion were far more verbose than they seemed to need to be.
While I'm a fan of what systemd-managed mounts can bring me, I'm super-lazy when it comes to having to type things out. Factor in that 90% of the people I'd turn a system so configured over to would be lost, and fstab remains preferred for me. ;)
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
