0

I'm operating a Ubuntu 18.04 server that mounts a CIFS/SMB share. The name of the server is provided in the form of a DNS record. The record points to one of several storage servers, allowing for maintenance and load balancing.

Consider a very basic /etc/fstab entry

//my-storage-server.somedomain.tld/some-path /mnt/storage cifs auto  0 0

What happens, if

  1. the DNS record changes, but the storage is still available
  2. the DNS record changes, and the storage is no longer available (i.e. server does not listen on port 445/TCP any longer and existing connections are dropped)

I'm pretty sure that for 1. the mount stays intact, as the server for sure only resolves the server name once, right? But what about 2.? Do the Linux kernel (CIFS VFS) or the userland tools (cifs-utils) try to re-resolve the server name? Is there a way to configure this?

I have no influence on the storage server. Is there any way to harden the connection for it to become more reliable? My initial idea was to setup a local HAProxy that is forced to resolve the DNS entry each time, or at least use a low TTL. But is there an easier way?

  • Server names are not supposed to change. Just use the IP address when you can. – Rui F Ribeiro Oct 22 '18 at 18:32
  • @RuiFRibeiro I am just consuming the storage, not operating it. And all I have is a DNS record that points to a currently active service. The whole point is about not using a single IP, as I do want the system to use another server if the previous one isn't available any longer (i.e. re-resolve the DNS name) – muffel Oct 22 '18 at 18:35
  • I suspect you are overthinking this. Anyway, the name resolution will only be done at mount time; you will have to (re)mount it if there is a change. – Rui F Ribeiro Oct 22 '18 at 18:37
  • @RuiFRibeiro then my question is how this can be automated. If the mount fails the requiring applications will crash, and I don't want to wait 24/7 for this to happen and to re-mount the share. – muffel Oct 30 '18 at 9:07
  • You monitor it and pray for the best. Normally you do not recover easily from such situations...maybe also together with a watchdog if you can afford to boot at random. Ultimately, you have to have a better burocratic interface with other teams and they are not supposed to make you walk in moving quick sand. You are asking for technological solutions for burocratic problems instead of trying to iron them out in your organization. – Rui F Ribeiro Oct 30 '18 at 11:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.