You are not logged in.

#1 2021-04-15 13:35:07

indianahorst
Member
Registered: 2008-08-23
Posts: 127

Duplicate mountpoint in fstab

Hello,

I want to mount an external disk  on the same mountpoint, which is sometimes connected via USB and sometimes via network (cifs).

I already tried

//<ip address>/data	/media/data	cifs	noauto,<options> 	0 0

LABEL=data_seagate	/media/data	ext4      noauto,<options> 	0 0

but when the disk is connected  via USB and mounted, after some time systemd freaks out and changes the mount to readonly.

In the meantime I use another mountpoint and then "mount --bind /media/data_usb/ /media/data/" as a workaround, but is there a more elegant way to handle this problem?

Offline

#2 2021-04-15 15:21:28

d_fajardo
Member
Registered: 2017-07-28
Posts: 1,568

Re: Duplicate mountpoint in fstab

A long shot but perhaps instead of fstab, you can create a udev rule to run a script to mount to your mount point depending on what udev sees as connected.

EDIT: I'm not sure if udev will see a network connection.

Last edited by d_fajardo (2021-04-15 15:27:13)

Offline

#3 2021-04-15 15:45:27

seth
Member
Registered: 2012-09-03
Posts: 51,229

Re: Duplicate mountpoint in fstab

What exactly is "<options>"? x-systemd.automount?

Offline

#4 2021-04-15 16:48:29

indianahorst
Member
Registered: 2008-08-23
Posts: 127

Re: Duplicate mountpoint in fstab

seth wrote:

What exactly is "<options>"? x-systemd.automount?

No, I don't have x-systemd.automount in the options list.

Here is the full list of options:

//<ip address>/data	/media/data	cifs	noauto,nofail,users,cache=loose,actimeo=60,credentials=/path/to/.smbcredentials,_netdev  0 0

LABEL=data_seagate	/media/data	ext4      noauto,user,noatime,commit=300,nofail,comment=x-gvfs-show,x-gvfs-name=DataUSB,x-systemd.device-timeout=5 	0 0

Offline

#5 2021-04-15 20:45:07

seth
Member
Registered: 2012-09-03
Posts: 51,229

Re: Duplicate mountpoint in fstab

What if you
a) disable usb autosuspend? https://wiki.archlinux.org/index.php/Po … utosuspend (you can start w/ "usbcore.autosuspend=-1" but nb. that userspace powermanagement tools will likely alter that at runtime)
b) increase the device-timeout? (like: "a lot")

Offline

Board footer

Powered by FluxBB