You are not logged in.

#1 2012-07-19 12:30:59

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Umount when server is not present?

Can anyone tell me how to reliably unmount a filesystem from a remote server, when the server has lost its network connection (i.e. been closed down)?

For example: Mount a filesystem to /mnt/laptop, shutdown the laptop, then unmount the filesystem.

sudo umount -f /mnt/laptop does not seem to work, although I would have thought that it should have.

Thanks

Andrew

Offline

#2 2012-07-21 09:40:53

johnislarry
Member
From: Seattle, WA, USA
Registered: 2010-08-18
Posts: 19
Website

Re: Umount when server is not present?

Does the command you mentioned give an error message, or does it just not unmount the filesystem?  I'm not sure I completely understand the question either.  Are you looking for a way to unmount a given filesystem automatically when a computer is being turned off?  Like what happens to filesystems specified in /etc/fstab?

Offline

#3 2012-07-21 13:24:19

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: Umount when server is not present?

OK, let me explain.

I use a main computer in the study and a laptop elsewhere. I keep a backup of the main computers files on the laptop.

So I start the laptop and leave it running. Then from the main computer I mount the laptop disk on /mnt and backup my files.

Then, sometimes, the laptop is switched off, but the disk is still mounted. This causes all sorts of problems on the main computer, so I need to un-mount the laptop disk.

# umount -f should have done exactly this, but it just sits there blinking at me.

Is there another way of forcing the umount?

Thanks

Andrew

Offline

#4 2012-07-21 16:23:42

syngin
Member
From: Melbourne
Registered: 2011-03-29
Posts: 39

Re: Umount when server is not present?

Have you tried a lazy umount?

umount -l /mnt/foo

or fuser?

fuser -km /mnt/foo

Offline

#5 2012-07-21 16:34:09

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: Umount when server is not present?

Thanks - I will try them and let you know

Andrew

Offline

#6 2012-07-21 23:02:09

Pres
Member
Registered: 2011-09-12
Posts: 423

Re: Umount when server is not present?

How is the laptop disk shared with your main computer? Samba? NFS?

I've run into this problem before with Samba, but just simply using `umount` unmounts the filesystem fine.

Offline

#7 2012-07-22 07:35:13

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: Umount when server is not present?

NFS

Andrew

Offline

#8 2012-07-23 13:29:21

fdservices
Member
From: France
Registered: 2012-02-06
Posts: 413

Re: Umount when server is not present?

None of these work, they all just time out  sad

Cheers

Andrew

Offline

#9 2012-07-26 14:18:31

zenlord
Member
From: Belgium
Registered: 2006-05-24
Posts: 1,229
Website

Re: Umount when server is not present?

If you're using networkmanager to make the connection, you should look into the dispatcher scripts. They make it possible to only try to connect to a certain network drive if a specific connection is established and subsequently umount it if the connection is closed down.

I use this setup to connect to my office NFS-share when I'm at the office and to connect to my personal server when I'm at home. No connection attempts fail because a certain server is not present.

Now I'm writing this, I 'm not sure it will solve your problem, but it is relevant either way wink

Offline

Board footer

Powered by FluxBB