You are not logged in.

#1 2013-04-12 23:25:16

Mykander
Member
Registered: 2012-03-30
Posts: 18

fstab load order

Is there any way to force a mount in fstab to be loaded last when starting up a system?  Or is there an alternative to rc.local with systemd so I can run "mount -a" during startup before any user has logged in?

Offline

#2 2013-04-12 23:43:59

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,883
Website

Re: fstab load order

I would assume that the entry at the bottom of fstab is the last one to be mounted. If not (due to systemd parallelization), consider writing a systemd .mount unit for the mount, and make use of the dependency resolution logic.


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 2013-04-13 00:05:13

Mykander
Member
Registered: 2012-03-30
Posts: 18

Re: fstab load order

WorMzy wrote:

I would assume that the entry at the bottom of fstab is the last one to be mounted. If not (due to systemd parallelization), consider writing a systemd .mount unit for the mount, and make use of the dependency resolution logic.

I looked into that, but unless I missed something in the process it won't work for me.  As far as I've been able to dig up there is no way to set an explicit dependency, it's simply a case of /a will be mounted before /a/b since /a/b is dependent upon /a being mounted.  I need folders in /media mounted before I mount /storage, and they're listed that way in /etc/fstab, but /storage is always loaded before all /media or just after the first /media entry.

Offline

#4 2013-04-13 01:08:18

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: fstab load order

As you have observed, the only ordering systemd imposes on mounts is that parents are mounted before their children (and mounts are possibly also ordered after their source, but haven't checked how that works in detail).

Could you explain why you need /storage to be mounted after your folders in /media?

Offline

#5 2013-04-13 01:10:10

tomegun
Developer
From: France
Registered: 2010-05-28
Posts: 661

Re: fstab load order

By the way, all the ordering information for .mount units can be seen by doing e.g. "systemctl show storage.mount". If there are no "Before=" or "After=" entries it will be mounted as early as possible.

Offline

#6 2013-04-13 01:14:16

Mykander
Member
Registered: 2012-03-30
Posts: 18

Re: fstab load order

tomegun wrote:

As you have observed, the only ordering systemd imposes on mounts is that parents are mounted before their children (and mounts are possibly also ordered after their source, but haven't checked how that works in detail).

Could you explain why you need /storage to be mounted after your folders in /media?

I'm using aufs to mount /media/disk1 /media/disk2 and /media/disk3 as a pool mounted as /storage.

Offline

#7 2013-04-13 11:18:48

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,949

Re: fstab load order

you could try writing your own servicefile to run mount -a .

https://aur.archlinux.org/packages/rade … t-service/ is an example of running a command before the display manager is started.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB