[systemd-devel] Get rid of /etc/fstab

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Sat Feb 2 07:50:59 PST 2013


On Sat, Feb 02, 2013 at 03:24:44PM +0100, Sébastien Luttringer wrote:
> Hello,
> 
> Looking forward to mount custom partitions I decided to use unit.mount
> files to define my new fs. Everything works perfectly, so I tried to
> do the same with all my mounted filesystems and removing /etc/fstab.
> 
> But unfortunatly, creating a -.mount file in
> /etc/systemd/system/local-fs.target.wants not work as I expected. I
> guess it's because generated file /run/systemd/generator/-.mount take
> precedence.
The file should go in /etc/systemd/system/-.mount. If you add
an section like

[Install]
WantedBy=multi-user.target

than it should be "installed" with 'systemctl enable -.mount', and
a symlink /etc/systemd/system/local-fs.target.wants -> /etc/systemd/system/-.mount
will be created. (Just a normal symlink, but it's nicer to use systemctl
to avoid typos).

The list of paths in order of priority is printed during
startup/reload at debug level. You can generate this list with
   kill -SIGRTMIN+22 1 && systemctl daemon-reload

> Is there any way of removing old fstab to full unit configuration?
If fstab is missing, the generator will immediately exit (returning 0).

Zbyszek


More information about the systemd-devel mailing list