summaryrefslogtreecommitdiff
path: root/content/devops/mount_ordering_jessie.rst
blob: c7e92fcc7aab0502133fadf98b200a2a8b8da852 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
Ordering mount points in Jessie (systemd < 220)
###############################################

:date: 2015-12-14 22:26
:slug: ordering_mount_in_jessie
:author: copyninja
:tags: debian, systemd, mount, fstab
:summary: Describes on how to achieve mount ordering in Jessie where
	  x-systemd.requires is not present.

In the previous `post
<https://copyninja.info/blog/systemd_automount_entry.html>`_ I had
mentioned that I didn't figure out how to add dependency on mount
points so as to achieve correct ordering of mount points. After a lot
of search today I finally figured it out thanks to the `bug report
<https://bugzilla.redhat.com/show_bug.cgi?id=812826>`_ and the `patch
<http://lists.freedesktop.org/archives/systemd-devel/2015-May/031932.html>`_
which adds *x-systemd.requires* and other option to systemd.

So basically you can add additional ordering information to the
*.mount* files generated by *systemd-fstab-generator* by adding a
*ordering.conf* file to path
*/etc/systemd/system/usr-local-bin.mount.d/* path with following
contents.

.. code-block:: ini

   [Unit]
   After=home.mount

And that is it, now *usr-local-bin.mount* will be mounted after
*home.mount* is activated.

I couldn't find this information directly in related manpages like
*systemd.mount* or *systemd.automount*. Also this information is not
directly available in search results!.