[systemd-devel] Setting mount option `sync` for root parition in fstab causes umount to fail during shutdown

Isaac Nickaein nickaein.i at gmail.com
Wed Aug 8 05:19:08 UTC 2018


I have enabled the `sync` option in `/etc/fstab` for the root
partition among other options. During boot systemd correctly re-mounts
the partition with given options, but cannot umount it during
shutdown.
However, it complains that `sync` is unrecognized:

...
systemd-shutdown[1]: Unmounting file systems.
systemd-shutdown[1]: Remounting '/' read-only with options 'sync,data=ordered'.
EXT4-fs (mmcblk2p1): Unrecognized mount option "sync" or missing value
systemd-shutdown[1]: Remounting '/' read-only with options 'sync,data=ordered'.
EXT4-fs (mmcblk2p1): Unrecognized mount option "sync" or missing value
systemd-shutdown[1]: Failed to remount '/' read-only: Invalid argument
systemd-shutdown[1]: Not all file systems unmounted, 1 left.
...

The two other partitions that I mount with same options are umounted correctly.
Here is my fstab:

# <device>           <dir>               <type>      <options>
                             <dump> <fsck>

/dev/root            /                    auto
defaults,sync,data=ordered,barrier=1,noatime    1      1
/dev/mmcblk2p3       /opt/samim/config    auto
defaults,sync,data=ordered,barrier=1,noatime    0      1
/dev/mmcblk2p4       /opt/samim/data      auto
defaults,sync,data=ordered,barrier=1,noatime    0      1
proc                 /proc                proc       defaults
                              0      0
devpts               /dev/pts             devpts     mode=0620,gid=5
                              0      0
tmpfs                /run                 tmpfs
mode=0755,nodev,nosuid,strictatime              0      0
tmpfs                /var/volatile        tmpfs      defaults
                              0      0


And here is the output of findmnt:

TARGET                           SOURCE         FSTYPE   OPTIONS
/                                /dev/mmcblk2p1 ext4
rw,noatime,sync,data=ordered
|-/dev                           devtmpfs       devtmpfs
rw,relatime,size=183896k,nr_inodes=45974,mode=755
| |-/dev/shm                     tmpfs          tmpfs    rw,nosuid,nodev
| |-/dev/pts                     devpts         devpts
rw,relatime,gid=5,mode=620,ptmxmode=000
| `-/dev/mqueue                  mqueue         mqueue   rw,relatime
|-/sys                           sysfs          sysfs
rw,nosuid,nodev,noexec,relatime
| |-/sys/fs/cgroup               tmpfs          tmpfs
ro,nosuid,nodev,noexec,mode=755
| | |-/sys/fs/cgroup/unified     cgroup         cgroup2
rw,nosuid,nodev,noexec,relatime
| | |-/sys/fs/cgroup/systemd     cgroup         cgroup
rw,nosuid,nodev,noexec,relatime,xattr,name=systemd
| | |-/sys/fs/cgroup/freezer     cgroup         cgroup
rw,nosuid,nodev,noexec,relatime,freezer
| | `-/sys/fs/cgroup/cpu,cpuacct cgroup         cgroup
rw,nosuid,nodev,noexec,relatime,cpu,cpuacct
| |-/sys/kernel/debug            debugfs        debugfs  rw,relatime
| |-/sys/fs/fuse/connections     fusectl        fusectl  rw,relatime
| `-/sys/kernel/config           configfs       configfs rw,relatime
|-/proc                          proc           proc     rw,relatime
|-/run                           tmpfs          tmpfs
rw,nosuid,nodev,mode=755
|-/tmp                           tmpfs          tmpfs    rw,nosuid,nodev
|-/var/volatile                  tmpfs          tmpfs    rw,relatime
|-/opt/samim/config              /dev/mmcblk2p3 ext4
rw,noatime,sync,data=ordered
`-/opt/samim/data                /dev/mmcblk2p4 ext4
rw,noatime,sync,data=ordered


If I remove the `sync` option, the root partitoin is umounted correctly.

systemd-shutdown[1]: Unmounting file systems.
systemd-shutdown[1]: Remounting '/' read-only with options 'data=ordered'.
EXT4-fs (mmcblk2p1): re-mounted. Opts: data=ordered
systemd-shutdown[1]: Remounting '/' read-only with options 'data=ordered'.
EXT4-fs (mmcblk2p1): re-mounted. Opts: data=ordered
systemd-shutdown[1]: All filesystems unmounted.


I am on kernel 4.14.24 and systemd ver234.


More information about the systemd-devel mailing list