# fstab tries to mount CIFS shares before net comes up

## doralsoral

I have a cifs share listed in fstab that should be mounted on boot. However it looks like it tries to mount it before my nic comes up so it never gets mounted. I am using systemd and i havent been able to find much about how to tell it to wait until the network comes up before mounting it that is specific to gentoo. is this possible?Last edited by doralsoral on Mon Dec 30, 2019 11:29 am; edited 2 times in total

----------

## eccerr0r

Found something like this:

# systemctl enable systemd-networkd-wait-online.service

This supposedly serializes mounting after network is brought up...

But from https://flexion.org/posts/2014-07-nfs-and-cifs-mounts-with-systemd.html,

It looks like you can tag you fstab with options x-systemd.automount,_netdev so that systemd won't mount until net is up and accessed...

See if this works... this looks pretty interesting if it works, then systemd can parallelize non-network mounts and serialize network-required mounts...

----------

## doralsoral

adding x-systemd,automount seems to work, I remember having to do this in archlinux now but it didnt turn up in my search. Thanks!

----------

## Hu

For completeness, the mount option _netdev is the traditional way to achieve this on non-systemd systems.

----------

## doralsoral

 *Hu wrote:*   

> For completeness, the mount option _netdev is the traditional way to achieve this on non-systemd systems.

 

I just tried this and it still did not work. Do i still need to edit /etc/conf.d/netmount?

----------

## Hu

No.  Please show the /etc/fstab entry that you tried to use.

----------

