SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2013-02-22 15:28:14

Zill
#! CrunchBanger
From: Lincolnshire, UK
Registered: 2009-10-25
Posts: 161

Reboot (and sometimes shutdown) hangs if nfs mounted.

I have found a repeatable problem with Waldorf (20130119) running on my Acer Aspire One D260-A netbook.  I have a couple of NFS shares configured in the /etc/fstab file that mount and run fine.  However, on requesting reboot (and sometimes shutdown) the netbook hangs and I then need to either use the magic SysRq keys of rseiub or hold the power button down!  Fortunately, the netbook seems to recover OK after this "aggressive" shutdown. wink

Note that this reboot/shutdown problem occurs when logged in via both the GUI and directly into a TTY.

I have found that, if I umount the NFS shares manually first, then the netbook reboots/shutsdown correctly.  This problem may be related to Debian Bug report #539773, which seems to be inconclusive.

My workaround is to "comment-out" the NFS mounts in /etc/fstab and then install autofs.  After configuring autofs with my NFS mounts, both reboot and shutdown appear to work correctly with both GUI and TTY .

ps. When this netbook had Statler installed there were no problems with shutdown when NFS was mounted.  As I rarely rebooted it, I cannot recall if this problem ever occurred then!

Last edited by Zill (2013-02-23 20:56:32)

Offline

Help fund CrunchBang, donate to the project!

#2 2013-02-22 19:43:38

RitterSport
#! Member
Registered: 2013-02-18
Posts: 58

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

I'm having the same exact problem with Waldorf on a Eeepc 701.  I accidentally posted my thread in the stable section of this forum (I thought Waldorf was the stable version).  Can you go into more detail on how you fixed this using autofs?  I can find my way around linux systems, but I'm no expert.

Offline

#3 2013-02-22 20:28:13

Zill
#! CrunchBanger
From: Lincolnshire, UK
Registered: 2009-10-25
Posts: 161

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

RitterSport:
Open (as root) the existing /etc/fstab file eg.

sudo nano /etc/fstab

"comment-out" your existing NFS mount(s) by adding a "#" at the start of the line(s) and then save the file with Ctrl-o and exit with Ctrl-x.

Unmount the existing NFS mounts:

sudo umount -a

Install autofs eg.

sudo apt-get install autofs

Open (as root) new file /etc/auto.master eg.

sudo nano /etc/auto.master

Assuming that you want the mounted directories under /mnt, add the following line at the end:

/mnt	/etc/auto.misc	--timeout  60	--ghost

Note that you can change the mount directory to one of your choice.  The "ghost" option ensures that even unmounted directories are always visible.  Remove this if you prefer to only see the directory when you enter the path to the mounted directory.
Save the file with Ctrl-o and exit with Ctrl-x.

Open (as root) new file /etc/auto.misc eg.

sudo nano /etc/auto.misc

Add line(s) at the end for your mount directories in a similar format to your /etc/fstab file eg:

client_mount_directory_1	-fstype=nfs,rsize=8192,wsize=8192,nosuid,soft	server_1:dir_to_be_shared_1
client_mount_directory_2	-fstype=nfs,rsize=8192,wsize=8192,nosuid,soft	server_2:dir_to_be_shared_2

Adjust the mount options to suit your requirements.
Save the file with Ctrl-o and exit with Ctrl-x.

Start the autofs service:

sudo service autofs restart

Autofs should now be running and if the PC is shutdown or restarted this service should start automatically.  Your NFS mounts should be visible and will show the contents when accessed either via a terminal or via the Thunar GUI file manager.  Hopefully, the PC will now shutdown and/or restart without hanging. wink

Last edited by Zill (2013-02-23 12:13:04)

Offline

#4 2013-02-23 00:04:03

RitterSport
#! Member
Registered: 2013-02-18
Posts: 58

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

That was very detailed.  Thanks!

The mount doesn't seem to be working.  The share is there in the /mnt directory, and it looks like a directory (the permissions are dr-xr-xr-x), but when I try to cd there, it tells me no such file or directory.

Here's what I put into auto.misc (the first line is the commented out line that I got from fstab, and the second is my attempt to format it for auto.misc):

#//192.168.1.13/share /mnt/Terasaur cifs auto,iocharset=utf8,nobr1,username=,password=,_netdev,uid=,gid= 0 0
Terasaur	-fstype=nfs,rsize=8192,wsize=8192,nosuid,soft	192.168.1.13:share

I'm sure I did something wrong.  Any ideas?

Offline

#5 2013-02-23 12:08:13

Zill
#! CrunchBanger
From: Lincolnshire, UK
Registered: 2009-10-25
Posts: 161

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

RitterSport:  From your fstab line it looks like you are sharing via CIFS, not NFS.  AIUI, CIFS is primarily a Microsoft protocol, whereas NFS is primarily a Linux protocol.  I only use Linux systems here and so have no knowledge of configuring CIFS.

I suggest you search for info on configuring Autofs to use CIFS.  Some possibly helpful advice is given here.

Offline

#6 2013-02-23 12:24:30

RitterSport
#! Member
Registered: 2013-02-18
Posts: 58

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

Will do.  Thanks!

ETA:  That worked! Thanks!

For anyone following along, here's the line I used in auto.misc to connect to a CIFS share (mine doesn't have a user ID or pwd, but I had to add those in with blanks anyway:

MountName	-fstype=cifs,rw,username=,password=	://location/directory

Last edited by RitterSport (2013-02-23 12:51:34)

Offline

#7 2013-02-23 20:59:08

Zill
#! CrunchBanger
From: Lincolnshire, UK
Registered: 2009-10-25
Posts: 161

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

RitterSport:  I'm pleased you got it working. smile

Offline

#8 2013-02-24 15:24:56

Zill
#! CrunchBanger
From: Lincolnshire, UK
Registered: 2009-10-25
Posts: 161

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

As a follow-up I have established that reboot and shutdown works fine with NFS mounts via /etc/fstab if network-manager is not used.

Although my netbook hangs if NFS mounts are configured in fstab, this is when using the default network-manager applet v0.9.4.0-10.  When fstab is not used then the autofs workaround described above allows the netbook to work OK with the network-manager applet.

With the same release of Waldorf (20130119) running on a different PC which does not use the network-manager applet but, instead, has been configured manually via /etc/network/interfaces, reboot and shutdown work correctly with NFS mounted via fstab.

Debian bug #641894 (network-manager: Fails to shutdown when using nfs and wireless) seems to cover this problem but currently has a severity of "wishlist", which seems rather low IMHO!

Although I have some experience with the Launchpad (Ubuntu) bug tracking system, the Debian system seems a little more cryptic to me so I don't want to get too entangled trying to change things at present.  However, I would welcome any assistance by anyone here with more experience of the Debian bug tracking system to try to help escalate work on resolving this bug before Wheezy goes stable.

Offline

#9 2013-02-25 11:03:19

wizard10000
#! Member
Registered: 2013-02-24
Posts: 80

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

Zill wrote:

...Debian bug #641894 (network-manager: Fails to shutdown when using nfs and wireless) seems to cover this problem but currently has a severity of "wishlist", which seems rather low IMHO!

It's not just a bug with networkmanager; I had the same problem with wicd and NFS shares - the network disconnects before the shares are unmounted, causing the shutdown hang.  I got tired of the problem and just used ssh mounts.

Grumble.

smile

edit:  Forgot all about autofs, which solved my issue   cool

Last edited by wizard10000 (2013-03-02 22:35:44)


we see things not as they are, but as we are.
  -- anais nin

Offline

#10 2013-03-02 22:28:51

wizard10000
#! Member
Registered: 2013-02-24
Posts: 80

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

Zill wrote:

As a follow-up I have established that reboot and shutdown works fine with NFS mounts via /etc/fstab if network-manager is not used.

Although my netbook hangs if NFS mounts are configured in fstab, this is when using the default network-manager applet v0.9.4.0-10.  When fstab is not used then the autofs workaround described above allows the netbook to work OK with the network-manager applet.

With the same release of Waldorf (20130119) running on a different PC which does not use the network-manager applet but, instead, has been configured manually via /etc/network/interfaces, reboot and shutdown work correctly with NFS mounted via fstab.
...

There are reasons for all of this  smile

The reason the NFS mounts hang if configured in fstab but work with autofs is that your wireless connection isn't available until after the user logs on.  If you have NFS mounts configured in fstab the machine waits for the share to become available before proceeding; but since the wireless network is *not* available mount will hang until it times out.

The reason it works on the other machine is that configurations in /etc/network/interfaces don't wait for user logon  wink

Last edited by wizard10000 (2013-03-02 22:30:14)


we see things not as they are, but as we are.
  -- anais nin

Offline

#11 2013-03-03 03:27:40

Philippe1
Member
Registered: 2012-12-19
Posts: 37

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

I might be completely in error, but maybe this could help you:

I have a home network Linux/Windows and in my fstab, I mount the Windows drives (CIFS) with the option _netdev.
I don't have any problem with Reboot even if the drives are mounted.

It might be worth a try...

Offline

#12 2013-03-04 16:07:52

Zill
#! CrunchBanger
From: Lincolnshire, UK
Registered: 2009-10-25
Posts: 161

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

wizard10000:  Thanks for the info but I am puzzled that Wicd has shown you the same problem as Network Manager.  My experience, admittedly on different distros, is that Wicd starts and stops with boot, rather than login as with NM.  This is why I use Wicd for wifi connections for machines that backup when users are logged-out.  However, I haven't tried Wicd with a Waldorf system so don't know if this does hang shutdown/reboot in the same way as the NM does when NFS is mounted via fstab.

I cannot recall seeing the shutdown/reboot problem with Statler running the same fstab NFS mounts with NM so my impression is that this problem was introduced with Wheezy.  Possibly the sequence of events with the NM and/or umount scripts is different to Squeeze.

Philippe1:  Thanks for the tip about the fstab option _netdev.  I thought that this would just relate to mounting, rather than unmounting, shares but I added it to my fstab NFS lines to see what would happen.  I disabled my autofs workaround temporarily, then rebooted and the NFS mounts came up correctly.  A couple of successful shutdowns and reboots then followed, so it looks like this option does appear to work.  smile

So, we now seem to have a couple of workarounds until this problem is fully resolved.  Thanks to all for your efforts.

Offline

#13 2013-03-04 17:05:59

Philippe1
Member
Registered: 2012-12-19
Posts: 37

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

Glad I could help!

Offline

#14 2013-03-04 18:19:00

wizard10000
#! Member
Registered: 2013-02-24
Posts: 80

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

Zill wrote:

wizard10000:  Thanks for the info but I am puzzled that Wicd has shown you the same problem as Network Manager.  My experience, admittedly on different distros, is that Wicd starts and stops with boot, rather than login as with NM.  This is why I use Wicd for wifi connections for machines that backup when users are logged-out.  However, I haven't tried Wicd with a Waldorf system so don't know if this does hang shutdown/reboot in the same way as the NM does when NFS is mounted via fstab.

The problem is with wpa_supplicant and shutdown scripts, not wicd or networkmanager.  My understanding of the problem is that shutdown scripts are pulling the plug on the wireless network before unmounting NFS shares, causing the hang.

edit:  It did start with Wheezy, but fairly recently (maybe a year ago?)

Hope this helps  smile

Last edited by wizard10000 (2013-03-04 18:30:59)


we see things not as they are, but as we are.
  -- anais nin

Offline

#15 2013-03-04 20:22:54

Zill
#! CrunchBanger
From: Lincolnshire, UK
Registered: 2009-10-25
Posts: 161

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

wizard10000 wrote:

The problem is with wpa_supplicant and shutdown scripts, not wicd or networkmanager.  My understanding of the problem is that shutdown scripts are pulling the plug on the wireless network before unmounting NFS shares, causing the hang...

That figures.  I'm not sure which particular package this will have a bug filed against.  Unfortunately, I am not sufficiently up-to-speed with the Debian bug tracking system to get too involved with resolving this one!  Volunteers would be very welcome. wink

wizard10000 wrote:

edit:  It did start with Wheezy, but fairly recently (maybe a year ago?)

I generally prefer stable releases so I was happily using Statler until a couple of weeks ago when I took the plunge into Waldorf!

Offline

#16 2013-03-17 18:27:54

DrakarNoir
#! CrunchBanger
From: just beyond the sign post
Registered: 2011-09-02
Posts: 132
Website

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

I had the same issue across three different machines (Waldorf 32bit and 64bit). After several other attempted work-arounds, including the autofs solution which did work but left my auto-mount not working(???), this is what I have done and it seems to be working (My network share is mounted as cifs in fstab), though I have no idea if this is the/a proper way to solve the problem. As a matter of fact, I have no idea what the command does as I discovered this work-around after spending weeks googling!

As root, create file unmount_nfs.sh in /etc/init.d/ with the following contents and make it executable.

    #!/bin/bash
    #script for automatic un-mounting of network shares on reboot and shutdown
    umount /mount/point
    exit

(/mount/point should be replaced by your mount point)

Then in terminal (also as root) run:

update-rc.d unmount_nfs.sh start 20 0 6 .

(including the period)

Last edited by DrakarNoir (2013-03-17 18:28:43)


"The nine most terrifying words in the English language are, 'I'm from the government and I'm here to help.'.”  ~Ronald Reagan

Offline

#17 2014-03-13 15:31:36

akustyk
New Member
Registered: 2014-03-13
Posts: 3

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

I ran into the same problem with my current installation and used the info in this thread to solve the hang-on-shutdown problem. Thanks!!!

One thing I had to do for my CIFS share was to add uid and gid, such that the share mounted with correct ownership. Otherwise, it used a default 1001 user and group and prevented me from rw in those mounted directories. So here's the code you need  in the auto.misc file:

MountName	-fstype=cifs,rw,username=,password=, uid=, gid=	://location/directory

And then just comment out the share in your fstab, and start using autofs from now on. It's a neat solution. However, I wish the bug had not been there in the first place. It doesn't happen on Ubuntu 13.10, for instance.

Offline

#18 2014-03-13 20:30:14

Zill
#! CrunchBanger
From: Lincolnshire, UK
Registered: 2009-10-25
Posts: 161

Re: Reboot (and sometimes shutdown) hangs if nfs mounted.

akustyk:  Thank you for the additional information.

...And welcome to CrunchBang forums.  Feel free to say hello and tell us about yourself in the Introductions section of the forums. smile

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo