[systemd-devel] Antw: Re: help: unmounting iscsi xfs filesystem without using netdev in /etc/fstab

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Tue Aug 27 13:07:04 UTC 2019


>>> Michael Chapman <mike at very.puzzling.org> schrieb am 27.08.2019 um 11:33 in
Nachricht <alpine.LFD.2.21.1908271916080.3409 at beren.home>:
> On Tue, 27 Aug 2019, Tony Rodriguez wrote:
>> Managed to detect/mount iscsi devices without using _netdev keyword in
>> /etc/fstab.  Made changes within src/fstab‑generator/ftstab‑generator.c and
it
>> seems to work.  The only problem is during shutdown/reboot, my iscsi xfs
>> filesystem does not unmount cleanly before the network/iscs service/system

> is
>> shutdown.  When this happens I receive a xfs error/warning.
>> 
>> However this doesn't happen when _netdev is specified in /etc/fstab for my
>> iscsi device.  Seems _netdev handles management of mounts/unmounts before
>> killing things off.  How exactly does _netdev manage unmounting
filesystems
>> during a shutdown/reboot?
> 
> One of the "default dependencies" for a mount unit that systemd thinks is 
> a network filesystem is After=network.target. During shutdown, this 
> ensures the filesystem is unmounted before networking is brought down:
> 
>     
>
https://github.com/systemd/systemd/blob/fef40ceb5dfbb76d4733e579846a380a224ef

> d55/src/core/mount.c#L455‑L482
> 
> If you're not using the _netdev keyword, and systemd does not otherwise 
> think this is a remote filesystem, you will need to add this dependency 
> manually. You'll probably also want:
> 
>     Wants=network‑online.target
>     After=network‑online.target

I wonder: Shouldn't that be remote-fs-pre.target?
For example if the NFS client starts AFTER the network target is done, the
remote filesystem will start concurrently. In most cases it may work well, but
in general it won't.

> 
> to match the code linked above.
> 

[...]

Regards,
Ulrich



More information about the systemd-devel mailing list