You are not logged in.

#1 2023-12-05 07:29:53

theramatrix
Member
Registered: 2023-11-25
Posts: 22

CIFS mount + network interface change issues

Hello all,
  I have a laptop running Arch as well as a docking station that provides a wired ethernet connection for the machine. I also have a Samba share on my LAN and appropriate entries in /etc/fstab to mount them.
  The issue is thus: If the laptop is connected to the dock (more importantly, the ethernet) mount would choose to route the connection via that interface, but since laptops are mobile it does mean that sometimes I would unplug it and the ethernet connection would be lost.
  Now the laptop and my LAN have WiFi and I'm actually still connected to the same network, just via a different interface, but it seems mount lacks a handler to automatically reroute the mount, causing the filesystem to hang trying to acess the (really shouldn't be) inaccessible share.
  Unfortunately I have a program or two that can't handle smb:// protocols on its own so mounting the drive is something I can't budge on, so what would be the best way forward?
    1. Create a cron job to listen to ethernet status and unmount the drive when it's down - need to use lazy unmount, so possibility of causing fie corruption
    2. Somhow force mount to always route over WiFi even when ethernet is available - does not seem to be a flag to do this, also would result in slower speed and latency and defeat the point of having ethernet
    3. Some other solution I don't know about

Any help is appreciated!

Last edited by theramatrix (2023-12-05 17:25:17)

Offline

#2 2023-12-05 08:04:03

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: CIFS mount + network interface change issues

mount doesn't route anything.

Post the outputs of

ip a; ip r

on either connection and also your /etc/fstab

Offline

#3 2023-12-05 17:24:34

theramatrix
Member
Registered: 2023-11-25
Posts: 22

Re: CIFS mount + network interface change issues

ip a; ip r

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host noprefixroute 
       valid_lft forever preferred_lft forever
2: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether 3c:55:76:20:75:a1 brd ff:ff:ff:ff:ff:ff
    inet 10.44.66.190/24 brd 10.44.66.255 scope global dynamic noprefixroute wlan0
       valid_lft 85909sec preferred_lft 85909sec
7: enp4s0f3u1u1u3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:e0:4c:68:01:bc brd ff:ff:ff:ff:ff:ff
    inet 10.44.66.210/24 brd 10.44.66.255 scope global dynamic noprefixroute enp4s0f3u1u1u3
       valid_lft 86141sec preferred_lft 86141sec
    inet6 fe80::927e:8e:c500:58b6/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
default via 10.10.10.8 dev enp4s0f3u1u1u3 proto dhcp src 10.10.10.210 metric 100 
default via 10.10.10.8 dev wlan0 proto dhcp src 10.10.10.190 metric 600 
10.10.10.0/24 dev enp4s0f3u1u1u3 proto kernel scope link src 10.10.10.210 metric 100 
10.10.10.0/24 dev wlan0 proto kernel scope link src 10.10.10.190 metric 600

/etc/fstab

# Static information about the filesystems.
# See fstab(5) for details.

# <file system> <dir> <type> <options> <dump> <pass>
# /dev/mapper/ainstnvme0n1p2
UUID=8a2e3156-xxxx-xxxx-xxxx-xxxxxxxxxxxx       /               btrfs           rw,relatime,ssd,space_cache=v2,subvolid=256,subvol=/@   0 0

# /dev/nvme0n1p1
UUID=D668-2DFD          /boot           vfat            rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro   0 2

# /dev/mapper/ainstnvme0n1p2
UUID=8a2e3156-xxxx-xxxx-xxxx-xxxxxxxxxxxx       /.snapshots     btrfs           rw,relatime,ssd,space_cache=v2,subvolid=260,subvol=/@.snapshots 0 0

# /dev/mapper/ainstnvme0n1p2
UUID=8a2e3156-xxxx-xxxx-xxxx-xxxxxxxxxxxx       /home           btrfs           rw,relatime,ssd,space_cache=v2,subvolid=257,subvol=/@home       0 0

# /dev/mapper/ainstnvme0n1p2
UUID=8a2e3156-xxxx-xxxx-xxxx-xxxxxxxxxxxx       /var/cache/pacman/pkg   btrfs           rw,relatime,ssd,space_cache=v2,subvolid=259,subvol=/@pkg        0 0

# /dev/mapper/ainstnvme0n1p2
UUID=8a2e3156-xxxx-xxxx-xxxx-xxxxxxxxxxxx      /var/log        btrfs           rw,relatime,ssd,space_cache=v2,subvolid=258,subvol=/@log        0 0

# NAS - Samba
//10.10.10.102/home                         /mnt/Personal      cifs    credentials=/etc/.smb,user,rw,noauto,nofail,noatime,mfsymlinks,_netdev   0 0
//10.10.10.102/music                        /mnt/music         cifs    credentials=/etc/.smb,user,rw,noauto,nofail,noatime,mfsymlinks,_netdev   0 0
//10.10.10.102/video                        /mnt/video         cifs    credentials=/etc/.smb,user,rw,noauto,nofail,noatime,mfsymlinks,_netdev   0 0

Offline

#4 2023-12-05 17:31:52

theramatrix
Member
Registered: 2023-11-25
Posts: 22

Re: CIFS mount + network interface change issues

Okay, so I did some testing and found out it doesn't freeze freeze, it just takes a really long ass time before $COMPONENT_NAME reroutes.

Last edited by theramatrix (2023-12-05 17:40:41)

Offline

#5 2023-12-05 18:59:18

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: CIFS mount + network interface change issues

What abotu NIC  3-6?
You've two parallel leases in the same segment 10.44.66.0/24 but the gateway for both (10.10.10.8) is in a different (private) segment, with also different sources (10.10.10.210,190) and that's also where the CIFS server is.

1. How does that work at all?
2. How/with what services do you supposingly configure your network?
3. Please post the output of

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

4. What are the missing NICs? Docker? Bonding? Bridges?

Offline

#6 2023-12-10 08:56:42

theramatrix
Member
Registered: 2023-11-25
Posts: 22

Re: CIFS mount + network interface change issues

seth wrote:

1. How does that work at all?

Whoops, sorry about that - I was trying to research & problem-solve this on my own and reset my router. Ignore the seemingly mismatched subnets; they're actually the same.

seth wrote:

2. How/with what services do you supposingly configure your network?

I just rely on systemd's NetworkManager to auto-handle it for me.

seth wrote:

3. Please post the output of

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f
acpid.service                            | multi-user.target.wants
bluetooth.service                        | bluetooth.target.wants
dbus-org.bluez.service                   | system
dbus-org.freedesktop.nm-dispatcher.service | system
dbus-org.freedesktop.oom1.service        | system
dbus-org.freedesktop.timesync1.service   | system
display-manager.service                  | system
fstrim.timer                             | timers.target.wants
gcr-ssh-agent.socket                     | sockets.target.wants
getty@tty1.service                       | getty.target.wants
NetworkManager.service                   | multi-user.target.wants
NetworkManager-wait-online.service       | network-online.target.wants
p11-kit-server.socket                    | sockets.target.wants
pipewire-pulse.socket                    | sockets.target.wants
pipewire-session-manager.service         | user
pipewire.socket                          | sockets.target.wants
portmaster.service                       | multi-user.target.wants
portmaster.service                       | system
remote-fs.target                         | multi-user.target.wants
rmthumbs.timer                           | multi-user.target.wants
sshd.service                             | multi-user.target.wants
systemd-oomd.service                     | multi-user.target.wants
systemd-timesyncd.service                | sysinit.target.wants
tlp.service                              | multi-user.target.wants
wireplumber.service                      | pipewire.service.wants
xdg-user-dirs-update.service             | default.target.wants
seth wrote:

4. What are the missing NICs? Docker? Bonding? Bridges?

it seems like every time I unplug and re-plug the Thunderbolt cable the number ticks up by one.

Offline

#7 2023-12-10 09:55:40

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,048

Re: CIFS mount + network interface change issues

Whoops, sorry about that - I was trying to research & problem-solve this on my own and reset my router. Ignore the seemingly mismatched subnets; they're actually the same.

Ok, but that still doesn't show the actual states w/ either connection.

For a generic solution, use https://wiki.archlinux.org/title/Fstab# … ic_unmount to automount the share on access and automatically lose it on idle or use a NM dispatcher script to explcitily un/mount the share: https://wiki.archlinux.org/title/Networ … SMB_shares

Offline

Board footer

Powered by FluxBB