Score:2

cifs mount gone after reboot laptop

mg flag

I've got a cifs share to a laptop mounted in /etc/fstab. This is ubuntu 20.4.

//lt2345/share /mnt/test/lt12345 cifs _netdev,noserverino,nocase,rw,cred=/etc/cifspasswd,vers=3.11 0 0

it works fine until the laptop is rebooted. Then the mount is gone.

It turns out that the ip address of the laptop changes and the linux machine still has the old ip address. Only

 sudo systemd-resolve --flush-caches

then umount and mount -a and it works again

But I dont want to manually flush dns and remount every time the laptop is started of course. How can we fix that a CIFS mount stays "connected" even after the ip address changes?

It seems that a common solution is to create a timer/cronjob that does exactly that, flush cache, umount and mount but I cant believe there is no software handled automatic solution.

waltinator avatar
it flag
When the IP address changes, you're a different computer. You could adjust the DHCP server (where you get your IP address) to always assign the same IP address to your MAC address.
Serve Laurijssen avatar
mg flag
this is in a realm where clients connect over VPN, I cant control that
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.