systemd mount units fail during boot, while file system is correctly mounted
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
Ubuntu Pro | Status tracked in 18.04 | |||||
18.04 |
Fix Released
|
High
|
Heitor Alves de Siqueira | |||
systemd |
New
|
Unknown
|
||||
linux (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | |||
Bionic |
Won't Fix
|
Undecided
|
Unassigned | |||
Focal |
Fix Released
|
High
|
Heitor Alves de Siqueira | |||
Jammy |
Fix Released
|
Undecided
|
Unassigned | |||
systemd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | |||
Bionic |
Won't Fix
|
Undecided
|
Heitor Alves de Siqueira | |||
Focal |
Fix Released
|
High
|
Heitor Alves de Siqueira | |||
Jammy |
Fix Released
|
Undecided
|
Heitor Alves de Siqueira |
Bug Description
[Impact]
systemd mount units fail during boot, and the system boots into emergency mode
[Test Plan]
This issue seems to happen randomly, and doesn't seem related to a specific mount unit.
We've used a test script with good results during investigation to reproduce similar mount failures in a running system, and have seen a strong correlation between the script failures and the boot time mount failures.
The attached 'rep-tmpfs.sh' script should be used to validate that mount points are working correctly under stress. One can run through the different variants as below:
# ./rep-tmpfs.sh --variant-0
# ./rep-tmpfs.sh --variant-1
# ./rep-tmpfs.sh --variant-2
# ./rep-tmpfs.sh --variant-3
# ./rep-tmpfs.sh --variant-4
All of these should run successfully without any reported errors.
[Where problems could occur]
The patches change the way systemd tracks and handles mount points in general, so potential regressions could affect other mount units. We should keep an eye out for any issues with mounting file systems, as well as rapid mount/unmount operations. Successful test runs with the reproducer script should increase reliability in having no new regressions.
[Other Info]
This has been tackled upstream with several attempts, which have resulted in the final patch from 2022:
01400460ae16 core/mount: adjust deserialized state based on /proc/self/
For Bionic, systemd requires several dependency patches as below:
6a1d4d9fa6b9 core: properly reset all ExecStatus structures when entering a new unit cycle
7eba1463dedc mount: flush out cycle state on DEAD→MOUNTED only, not the other way round
350804867dbc mount: rescan /proc/self/
1d086a6e5972 mount: mark an existing "mounting" unit from /proc/self/
Additionally, the kernel also requires the following patches:
28ca0d6d39ab list: introduce list_for_
9f6c61f96f2d proc/mounts: add cursor
[Original Description]
In Ubuntu 18.04 at least, we sometimes get a random server in emergency mode with a failed mount unit (ext4 file system), while the corresponding file system is in fact correctly mounted. It happens roughly once every 1000 reboots.
It seems to be related with this bug : https:/
Is it possible to apply the fix (https:/
Thanks in advance.
Related branches
- Lukas Märdian: Approve
-
Diff: 391 lines (+345/-0)7 files modifieddebian/changelog (+24/-0)
debian/patches/lp1837227-core-mount-adjust-deserialized-state-based-on-proc-self-m.patch (+119/-0)
debian/patches/lp1969365-Fall-back-to-kexec-when-no-kexec-binary-exists.patch (+28/-0)
debian/patches/lp2024009-dns-query-bump-CNAME_MAX-to-16.patch (+24/-0)
debian/patches/lp2029352-test-ignore-LXC-filesystem-when-checking-for-writable-loc.patch (+29/-0)
debian/patches/lp2037281-core-device-ignore-DEVICE_FOUND_UDEV-bit-on-switching-roo.patch (+116/-0)
debian/patches/series (+5/-0)
CVE References
Changed in systemd: | |
status: | Unknown → New |
Changed in systemd (Ubuntu Focal): | |
status: | New → In Progress |
importance: | Undecided → High |
assignee: | nobody → Heitor Alves de Siqueira (halves) |
Changed in systemd (Ubuntu Jammy): | |
assignee: | nobody → Heitor Alves de Siqueira (halves) |
status: | New → In Progress |
tags: |
added: se-sponsor-halves removed: ddstreet |
summary: |
- Random mount units sometimes fail, while file system is correctly - mounted + Mount units sometimes fail, while file system is correctly mounted |
summary: |
- Mount units sometimes fail, while file system is correctly mounted + systemd mount units fail during boot, while file system is correctly + mounted |
description: | updated |
tags: | added: systemd-sru-next |
Changed in systemd (Ubuntu Focal): | |
status: | In Progress → Fix Committed |
Changed in linux (Ubuntu Bionic): | |
status: | New → Won't Fix |
Changed in linux (Ubuntu Focal): | |
assignee: | nobody → Heitor Alves de Siqueira (halves) |
importance: | Undecided → Medium |
status: | New → Fix Committed |
importance: | Medium → High |
Changed in systemd (Ubuntu Focal): | |
status: | Fix Committed → In Progress |
Changed in linux (Ubuntu): | |
status: | New → Fix Released |
Changed in linux (Ubuntu Jammy): | |
status: | New → Fix Released |
tags: | added: foundations-todo |
Hello,
from reading the upstream bug, it's unclear if the systemd commit actually did fix this; it seems like a kernel and/or util-linux patch is needed.
From your description, it sounds like you're not able to reliably reproduce this (only randomly), right? Have you tried the upstream reproducer? It would help a lot if we had a reliable way to reproduce and verify this. /github. com/systemd/ systemd/ issues/ 10872#issuecomm ent-523399087
https:/