Is there a way to failover mount.cifs to new ip address recorded in the DNS?

2

Is there a way to failover mount.cifs to new ip address recorded in the DNS?

Consider this scenario:

  1. mount.cifs -o user=test //fileserver/share1 /mnt
  2. move "fileserver" to second server with new IP
  3. update DNS record for file server
  4. Access to the mount fails:

    ls /mnt

    ls: cannot access /mnt: Host is down

Kirill

Posted 2016-01-20T12:16:36.873

Reputation: 21

Answers

0

You can do a second mount on top of the first one, and new accesses will succeed. However, the old mount is still there and can't be unmounted. (Typically, umount hangs, or it may say the volume is busy.) And any processes that had files or directories open on the old mount will be 'stuck' in an uninterruptible state (status D in ps) and can't be killed. The only full solution is a reboot, but if you don't mind leaving those processes sitting around, you can keep working. However, if those stuck processes have ports open that you need to have something listening on (eg Apache) then a reboot is actually required.

The problem is in the CIFS drivers in the kernel, and I don't think there's a solution for this yet.

Sorry not to have better news for you. The answer to your question is 'no' :-)

Neil Mayhew

Posted 2016-01-20T12:16:36.873

Reputation: 776