You are not logged in.

#1 2015-01-31 14:55:44

MilanKnizek
Member
Registered: 2005-12-13
Posts: 88

[SOLVED] Force systemd to re-read fstab and create automount units?

Anybody has a clue how to do that without rebooting the computer?

systemd.mount wrote:

"Mounts listed in /etc/fstab will be converted into native units dynamically at boot and when the configuration of the system manager is reloaded."

P.S. If the latter means issueing "systemctl reload-daemon", it does not work. I guess the "and" does not really mean "reboot & reload", that'd be crazy.

cheers!
Milan

Last edited by MilanKnizek (2015-05-05 19:41:47)


--
Milan Knizek
http://knizek.net

Offline

#2 2015-01-31 16:08:32

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 12,327
Website

Re: [SOLVED] Force systemd to re-read fstab and create automount units?

I imagine (not tested) that you can just re-run /usr/lib/systemd/system-generators/systemd-fstab-generator

See

man systemd-fstab-generator

Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2015-01-31 16:30:06

MilanKnizek
Member
Registered: 2005-12-13
Posts: 88

Re: [SOLVED] Force systemd to re-read fstab and create automount units?

Thanks for pointing to that. I tried it already before, though. No new automount unit was created (checked with "systemctl list-units --all"). Tested on new samba entry in /etc/fstab.

Last edited by MilanKnizek (2015-01-31 16:39:03)


--
Milan Knizek
http://knizek.net

Offline

#4 2015-01-31 17:32:02

Spider.007
Member
Registered: 2004-06-20
Posts: 1,175

Re: [SOLVED] Force systemd to re-read fstab and create automount units?

I have tried this and failed. It doesn't seem to be possible. I resorted to a manual loop over the fstab; checking for each path if it's mounted already

Offline

#5 2015-02-08 17:16:36

starfry
Member
From: Surrey, UK
Registered: 2010-08-18
Posts: 232

Re: [SOLVED] Force systemd to re-read fstab and create automount units?

If you run the generator as described above, it writes to /tmp which is not what you want. You need to give it 3 arguments:

/usr/lib/systemd/system-generators/systemd-fstab-generator /run/systemd/generator '' ''

works for me. You will see errors for all existing generated units; you can ignore these. You don't need to do systemctl daemon-reload.

Last edited by starfry (2015-02-09 10:07:05)

Offline

#6 2015-02-09 19:39:42

MilanKnizek
Member
Registered: 2005-12-13
Posts: 88

Re: [SOLVED] Force systemd to re-read fstab and create automount units?

@starfry: thanks for the info.

P.S. Interestingly google did not help much, systemd still seems to fall short on tutorials. I'll report a bug on that to systemd.


--
Milan Knizek
http://knizek.net

Offline

#7 2015-03-30 04:54:21

edacval
Member
From: .LT
Registered: 2008-10-23
Posts: 94

Re: [SOLVED] Force systemd to re-read fstab and create automount units?

First:

# systemctl daemon-reload

followed by:

# systemctl restart remote-fs.target

or

# systemctl restart local-fs.target

depending on filesystem type

Offline

#8 2015-05-05 19:41:25

MilanKnizek
Member
Registered: 2005-12-13
Posts: 88

Re: [SOLVED] Force systemd to re-read fstab and create automount units?

edacval wrote:

First:

# systemctl daemon-reload

followed by:

# systemctl restart remote-fs.target

or

# systemctl restart local-fs.target

depending on filesystem type

Thanks, that was it!


--
Milan Knizek
http://knizek.net

Offline

#9 2016-01-20 01:05:19

millerl
Member
Registered: 2008-03-20
Posts: 12

Re: [SOLVED] Force systemd to re-read fstab and create automount units?

Thank you edacval!

I can't believe this was so easy to address and yet so hard to find.

Offline

Board footer

Powered by FluxBB