You are not logged in.
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
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
What exactly is "<options>"? x-systemd.automount?
Offline
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
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