[systemd-devel] mounting the root file system using systemd unit file

Mikhail Kasimov mikhail.kasimov at gmail.com
Sun May 15 13:08:38 UTC 2016


Hello!

/etc/systemd/system/root.mount change to /etc/systemd/system/-.mount

As I remember, unit naming depends on path, where partition is to be 
mounted. So, schema is: /home -> home.mount; /my/mountpoint/ -> 
my-mountpoint.mount; / -> -.mount and so on.


UPD: man systemd.mount:
=====
Mount units must be named after the mount point directories they
control. Example: the mount point /home/lennart must be configured in a
unit file home-lennart.mount. For details about the escaping logic used
to convert a file system path to a unit name, see systemd.unit(5).
=====

15.05.2016 15:28, fb.dev.gen пишет:
> Hi all,
>
> What should be the way to mount the root file system using systemd unit
> file (i.e: without any `/etc/fstab` configuration file)?
>
> Could it be right to do it like that:
>
> ```
> # cat > /etc/systemd/system/root.mount << EOF
> [Unit]
> Description = Root file system mount point controlled and supervised by
> systemd
>
> [Mount]
> What = /dev/root
> Where = /
> Type = ext4
> Options = default,discard,noatime 0 0
>
> [Install]
> WantedBy = multi-user.target
> EOF
>
> ```
>
> ...or is there a better "systemd way" to do it?
>
>
> -- Ben
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel



More information about the systemd-devel mailing list