Comment 6 for bug 1718966

Revision history for this message
Rafael David Tinoco (rafaeldtinoco) wrote :

Okay, so another quick workaround, now keeping the fsck enabled for the volumes:

Create a file called "/lib/systemd/upstart/systemd-fsck@.service" with:

----
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.

[Unit]
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
Before=shutdown.target

[Service]
Type=oneshot
RemainAfterExit=no
ExecStart=/lib/systemd/systemd-fsck %f
StandardOutput=journal+console
TimeoutSec=0
----

and then do:

$ sudo ln -s /lib/systemd/upstart/systemd-fsck@.service /lib/systemd/upstart/multi-user.target.wants/systemd-fsck@.service
$ sudo systemctl daemon-reload

This will allow the mount units to work using systemd in Trusty:

inaddy@trustylivepatch:~$ sudo systemctl start teste.mount
inaddy@trustylivepatch:~$ df -kh | grep teste
/dev/sdb2 976M 1.3M 908M 1% /teste
inaddy@trustylivepatch:~$ sudo systemctl stop teste.mount
inaddy@trustylivepatch:~$ cat /etc/fstab| grep teste
LABEL=TESTE /teste ext4 defaults 0 1

While still having fsck enabled in /etc/fstab.

I'll provide a SRU patch for systemd in Trusty and it shall solve this issue.