Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I run Linux in a VM on a Windows host. When I'm in the office, my Windows host machine self registers it's DNS name and it's mymachine.myco.com. When I'm at home, it self registers as mymachine.local. In the Linux guest, I want to mount shares on mymachine. I do that in /etc/fstab:

//mymachine/development /home/ben/Development     cifs    credentials=/home/ben/.creds/alderaan,rw,user,noauto,iocharset=utf8,file_mode=0777,dir_mode=0777    0 0

This works in the office and at home if I type mount Development. However, once it's mounted, I can't then switch locations and have it still work. It appears that once mount has run it's tied to the IP address not the DNS name and if that changes it no longer works. Is there a way I can make it reconnect on timeout so that it switches over if the IP address changes?

Or at the very least is there a way so that I can easily unmount the directory? At the moment I just get mount point busy if I try to remount it and I can't even type ls on my home folder since it times out getting the attributes of the mount point.

share|improve this question
add comment

1 Answer 1

up vote 0 down vote accepted

Hmm, the answer appears to be to do a lazy unmount of all cifs mounts:

sudo umount -a -t cifs -l

And then remount them all:

sudo mount -a -t cifs
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.