diff --git a/man/systemd-fsck@.service.xml b/man/systemd-fsck@.service.xml
index e934352f191..17bd1c027b8 100644
--- a/man/systemd-fsck@.service.xml
+++ b/man/systemd-fsck@.service.xml
@@ -62,7 +62,8 @@
system
check. systemd-fsck-root.service is
responsible for file system checks on the root
- file system.
+ file system. The root file system check is performed
+ before the other file systems.
systemd-fsck will
forward file system checking progress to the
diff --git a/man/systemd-fstab-generator.xml b/man/systemd-fstab-generator.xml
index 9ca16c7ea14..740db8fddb7 100644
--- a/man/systemd-fstab-generator.xml
+++ b/man/systemd-fstab-generator.xml
@@ -61,6 +61,11 @@
reloaded. This will instantiate mount and swap units
as necessary.
+ The passno field
+ is treated like a simlpe boolean, and the ordering information
+ is discarded. However, the root filesystem is checked
+ before all the other filesystems.
+
See
systemd.mount5
and
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index a7536f8f7e5..77247dee5e7 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -209,17 +209,30 @@ static int add_mount(
"Before=%s\n",
post);
+ if (passno > 0) {
+ _cleanup_free_ char *fsck = NULL;
+
+ fsck = unit_name_from_path_instance("systemd-fsck", what, ".service");
+ if (!fsck)
+ return log_oom();
+
+ fprintf(f,
+ "Requires=%s\n"
+ "After=%s\n",
+ fsck,
+ fsck);
+ }
+
+
fprintf(f,
"\n"
"[Mount]\n"
"What=%s\n"
"Where=%s\n"
- "Type=%s\n"
- "FsckPassNo=%i\n",
+ "Type=%s\n",
what,
where,
- type,
- passno);
+ type);
if (!isempty(opts) &&
!streq(opts, "defaults"))
diff --git a/units/systemd-fsck@.service.in b/units/systemd-fsck@.service.in
index e229cdcb83e..c12efa8e760 100644
--- a/units/systemd-fsck@.service.in
+++ b/units/systemd-fsck@.service.in
@@ -10,7 +10,7 @@ Description=File System Check on %f
Documentation=man:systemd-fsck@.service(8)
DefaultDependencies=no
BindsTo=%i.device
-After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device
+After=systemd-readahead-collect.service systemd-readahead-replay.service %i.device systemd-fsck-root.service
Before=shutdown.target
[Service]