New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
systemd tries to mount automatically when LVM volumes in /etc/fstab activated after the boot. #6066
Comments
Are you using |
Hi, The environment doesn't use
To make those volumes mounted at boot time, I don't want to use |
If you don't want file systems to be mounted automatically, then use the "noauto" mount option. Otherwise, they will mounted as they show up. Note that on today's systems there's no distinction between "startup" and "runtime" phase really, as file systems may take any time they want to show up, and systemd will act on that as necessary, and instantly in order to fulfill the configured configuration so that the systemd can be booted up entirely. Hence, please just add "noauto" to these lines, and you should get the behaviour you want. I hope that makes sense. Closing. |
Hello, @poettering Thank you for your comment. I'm afraid that you might miss something in my issue report. For example,
Let us think above configuration. Users expect that
So, there is no choice to use 'noauto' option because they expect to mount the filesystem at system boot. In worst case, current systemd behavior will cause the data corruption due to mount the filesystem from different systems unintentionally. In the past SysV behavior, the LVM volume wasn't mounted automatically after its activation in the use case above. Many system administrators doesn't have knowledge of the current systemd behavior because this behavior is not documented as difference from SysV. |
There is no distinction between boot time and other time any more on today's systems as devices can show up any time they want taking any time they want. There's simply no point in time anymore where "all devices have shown up", as devices might take an unbounded time to do so. On today's systems it's all about "having enough devices to fulfill the dependencies of something" before doing something. sysv pretended there was a time where everything showed up, then mounted everything and then proceeded with booting. This is not compatible with today's hardware though, it just doesn't work that way. |
Thank you for your detailed explanation. I understand that the current systemd behavior is expected. And I found that this behavior sometimes failed in the particular case. I'll file a new issue later. |
I'm curious about performing LVM-related activities in such a scenario. It seems that the admin needs to know to edit /etc/fstab and comment out those mounts that are undergoing maintenance, so that auto-generated systemd mount activities don't run. Is that right? I think the paradigm of 'things that happen at boot time' is still quite strong in many environments. I also don't think that downstream relationships (mounting a fs because a VG was activated) are necessarily expected. |
It is not enough. You also need to restart systemd. See also https://lists.freedesktop.org/archives/systemd-devel/2017-June/039054.html |
Automounting filesystems during maintenance may be dangerous; even in "today's systems". Isn't multi-user.target good point do distinguish between pre and post boot period? Why not to add global systemd parameter to enable/disable automounting of /etc/fstab filesystems after multi-user.target is reached and/or mount option to allow to configure it individually for filesystems in /etc/fstab? Workaround that works for us now: find unit name (i.e. mnt1a.mount) for FS (i.e. /mnt1a) that need maintenance and mask it
and unmask it after maintenance
|
Submission type
systemd version the issue has been seen with
systemd-231-15.fc25
Used distribution
Fedora 25
In case of bug report: Expected behaviour you didn't see
systemd should not automatically mount LVM volumes in /etc/fstab when the LVM volumes are activated after system boot process completed.
This automatic mount feature will cause filesystem corruption in the worst case because user might not intend this behaviour.
systemd should mount all filesystem which listed at boot time according to the specified option. But systemd should not care the mount status after system boot process completed.
In case of bug report: Unexpected behaviour you saw
Currently, systemd will try to mount LVM volumes in /etc/fstab when the LVM volumes are activated after system boot process completed.
In case of bug report: Steps to reproduce the problem
Create LVM volumes.
Write /etc/fstab entries for the LVM volumes to mount them at boot time.
Reboot the system.
Confirm these volumes are mounted.
The text was updated successfully, but these errors were encountered: