FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 07-19-2008, 09:46 AM
Jan Willem Stumpel
 
Default Switch-off problem

Recently my computer devolped a new problem: it sometimes does not
switch itself off when I do shutdown -h now. It hangs somewhere
during the shutdown procedure, and has to be switched off by means
of the mains switch at the back. Fortunately the filesystem is
ext3, so at the next boot it starts again without problems.

I /think/ the problem may be related to nfs. I recently converted
my wife's computer to Linux. A usb disk connected to my wife's
computer contains media files which we both can use. This common
usb disk used to be shared by means of samba/smbfs, but now it is
exported by means of nfs.

Now my theory is that the switch-off problem occurs after the
following events:

1 - I mount the remote usb drive.
2 - my wife switches off her computer.
3 - I try to umount the remote usb drive -- this cannot be done.

I suppose the shutdown program also tries to umount nfs mounts,
but fails, and then instead of skipping this step, just hangs.
Does this make sense? If so, is there a way to solve this problem?

Regards, Jan





--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-19-2008, 04:29 PM
Ron Johnson
 
Default Switch-off problem

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 07/19/08 04:46, Jan Willem Stumpel wrote:
> Recently my computer devolped a new problem: it sometimes does not
> switch itself off when I do shutdown -h now. It hangs somewhere
> during the shutdown procedure, and has to be switched off by means
> of the mains switch at the back. Fortunately the filesystem is
> ext3, so at the next boot it starts again without problems.
>
> I /think/ the problem may be related to nfs. I recently converted
> my wife's computer to Linux. A usb disk connected to my wife's
> computer contains media files which we both can use. This common
> usb disk used to be shared by means of samba/smbfs, but now it is
> exported by means of nfs.
>
> Now my theory is that the switch-off problem occurs after the
> following events:
>
> 1 - I mount the remote usb drive.
> 2 - my wife switches off her computer.
> 3 - I try to umount the remote usb drive -- this cannot be done.
>
> I suppose the shutdown program also tries to umount nfs mounts,
> but fails, and then instead of skipping this step, just hangs.
> Does this make sense? If so, is there a way to solve this problem?

Manually "umount -l" the remote drive before you shutdown?

- --
Ron Johnson, Jr.
Jefferson LA USA

"Kittens give Morbo gas. In lighter news, the city of New New
York is doomed."
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkiCFnkACgkQS9HxQb37XmfTxgCfaOKbYhRtGg 7E0DNPv+jfBN51
4hsAoJRHmpK26RgCNfqAFudjhlxzD2OW
=1SeB
-----END PGP SIGNATURE-----


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-20-2008, 10:47 AM
Jan Willem Stumpel
 
Default Switch-off problem

Ron Johnson wrote:

> On 07/19/08 04:46, Jan Willem Stumpel wrote:[..]

>> Now my theory is that the switch-off problem occurs after the
>> following events:
>>
>> 1 - I mount the remote usb drive.
>> 2 - my wife switches off her computer.
>> 3 - I try to umount the remote usb drive -- this cannot be
>> done.
>>
>> I suppose the shutdown program also tries to umount nfs
>> mounts, but fails, and then instead of skipping this step,
>> just hangs. Does this make sense? If so, is there a way to
>> solve this problem?
>
> Manually "umount -l" the remote drive before you shutdown?

This does not work. Manually umounting the nfs drive (after the
computer which hosts the nfs drive is switched off) just leads to
a hang, whether the "lazy" switch is applied or not. In fact I
cannot even type the umount command entirely: the system hangs
immediately after typing the first 3 characters (including the
leading /) of the mount point.

Anyway it seems (from /etc/init.d/umountnfs.sh) that the -l
switch, as well as the -f switch, is already applied by default.
Running Sid; kernel is a stock Debian one:

2.6.25-2-686 #1 SMP Wed May 14 16:42:03 UTC 2008 i686 GNU/Linux

It seems that nfs on the remote computer fails to send a command
(before shutting itself down) to the computers to which it
exports, telling them to umount. This may be a bug, or, much more
likely, a failure on my part to understand the nfs export system.
Anyway, I never had this trouble while samba was used for sharing,
rather than nfs.

Regards, Jan


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-20-2008, 07:39 PM
Daniel Burrows
 
Default Switch-off problem

On Sat, Jul 19, 2008 at 11:46:16AM +0200, Jan Willem Stumpel <jstumpel@planet.nl> was heard to say:
> Recently my computer devolped a new problem: it sometimes does not
> switch itself off when I do shutdown -h now. It hangs somewhere
> during the shutdown procedure, and has to be switched off by means
> of the mains switch at the back. Fortunately the filesystem is
> ext3, so at the next boot it starts again without problems.
>
> I /think/ the problem may be related to nfs. I recently converted
> my wife's computer to Linux. A usb disk connected to my wife's
> computer contains media files which we both can use. This common
> usb disk used to be shared by means of samba/smbfs, but now it is
> exported by means of nfs.
>
> Now my theory is that the switch-off problem occurs after the
> following events:
>
> 1 - I mount the remote usb drive.
> 2 - my wife switches off her computer.
> 3 - I try to umount the remote usb drive -- this cannot be done.
>
> I suppose the shutdown program also tries to umount nfs mounts,
> but fails, and then instead of skipping this step, just hangs.
> Does this make sense? If so, is there a way to solve this problem?

You could try switching to a soft mount. This can cause silent data
loss when a server goes down, but I don't think that should be an issue
if this is a read-only mount. Just add "soft" to the mount options. (I
haven't tried soft-mounting for this particular case, so I don't know
for sure that it will help)

Daniel


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-21-2008, 10:32 AM
Jan Willem Stumpel
 
Default Switch-off problem

Daniel Burrows wrote:
> On Sat, Jul 19, 2008 at 11:46:16AM +0200, Jan Willem Stumpel
> <jstumpel@planet.nl> was heard to say:

>> Now my theory is that the switch-off problem occurs after the
>> following events:
>>
>> 1 - I mount the remote usb drive.
>> 2 - my wife switches off her computer.
>> 3 - I try to umount the remote usb drive -- this cannot be
>> done.
>>
>> I suppose the shutdown program also tries to umount nfs
>> mounts, but fails, and then instead of skipping this step,
>> just hangs. Does this make sense? If so, is there a way to
>> solve this problem?

> You could try switching to a soft mount. This can cause silent
> data loss when a server goes down, but I don't think that
> should be an issue if this is a read-only mount. Just add
> "soft" to the mount options. (I haven't tried soft-mounting
> for this particular case, so I don't know for sure that it will
> help)

Thanks much for pointing me to the "soft" option (which I did not
know about). Then by Googling I also found the "intr" option which
is said to be an alternative. But unfortunately neither option
cures the problem of shutdown hanging on the client when the nfs
server has gone off-line. Strange. This situation cannot be
uncommon in Linux home networking.

Regards, Jan


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
 
Old 07-21-2008, 03:37 PM
Bob McGowan
 
Default Switch-off problem

Jan Willem Stumpel wrote:

Ron Johnson wrote:


On 07/19/08 04:46, Jan Willem Stumpel wrote:[..]



Now my theory is that the switch-off problem occurs after the
following events:

1 - I mount the remote usb drive.
2 - my wife switches off her computer.
3 - I try to umount the remote usb drive -- this cannot be
done.

I suppose the shutdown program also tries to umount nfs
mounts, but fails, and then instead of skipping this step,
just hangs. Does this make sense? If so, is there a way to
solve this problem?

Manually "umount -l" the remote drive before you shutdown?


This does not work. Manually umounting the nfs drive (after the
computer which hosts the nfs drive is switched off) just leads to
a hang, whether the "lazy" switch is applied or not. In fact I
cannot even type the umount command entirely: the system hangs
immediately after typing the first 3 characters (including the
leading /) of the mount point.


This hanging at "cannot even type the umount command entirely: the
system hangs immediately after typing the first 3 characters" sounds
very strange.


The NFS subsystem can't know that a umount has been entered until the
shell takes the full command line, forks a copy of itself and then execs
the new command. At least, that's how I understand things.


I'd suggest focusing on this, though I have no good suggestions for
debugging it. The only thing I can think of is to run a subshell under
strace, to a file, and try the umount in the subshell. Perhaps there'll
be something there to indicate what's going on.


I've never worked with strace and an interactive program like a shell,
so you may not get much from the above. You could force non-interactive
operation by using the shell '-c' argument:


strace -o nfs_hang.trace -f bash -c 'umount /...' &

By backgrounding the program, you should get a prompt from which you can
issue a 'kill' to the 'bash' process. If you can kill it, then strace
should print to and close the trace file "normally".






<<deleted NFS comments>>



Regards, Jan




--
Bob McGowan
 
Old 07-21-2008, 04:01 PM
Thomas Preud'homme
 
Default Switch-off problem

Le lundi 21 juillet 2008, Bob McGowan a écrit*:
> Jan Willem Stumpel wrote:
> > Ron Johnson wrote:
> >> On 07/19/08 04:46, Jan Willem Stumpel wrote:[..]
> >>
> >>> Now my theory is that the switch-off problem occurs after the
> >>> following events:
> >>>
> >>> 1 - I mount the remote usb drive.
> >>> 2 - my wife switches off her computer.
> >>> 3 - I try to umount the remote usb drive -- this cannot be
> >>> done.
> >>>
> >>> I suppose the shutdown program also tries to umount nfs
> >>> mounts, but fails, and then instead of skipping this step,
> >>> just hangs. Does this make sense? If so, is there a way to
> >>> solve this problem?
> >>
> >> Manually "umount -l" the remote drive before you shutdown?
> >
> > This does not work. Manually umounting the nfs drive (after the
> > computer which hosts the nfs drive is switched off) just leads to
> > a hang, whether the "lazy" switch is applied or not. In fact I
> > cannot even type the umount command entirely: the system hangs
> > immediately after typing the first 3 characters (including the
> > leading /) of the mount point.
>
> This hanging at "cannot even type the umount command entirely: the
> system hangs immediately after typing the first 3 characters" sounds
> very strange.
>
> The NFS subsystem can't know that a umount has been entered until the
> shell takes the full command line, forks a copy of itself and then
> execs the new command. At least, that's how I understand things.

It could be a tab completion. Personaly I always use tab completion for
umount. I don't know exactly what is done in the tab completion of
umount. If it is just mtab which is read then it's strange, if some
kind of ls in the directory is done then it is perfectly normal.

>
> I'd suggest focusing on this, though I have no good suggestions for
> debugging it. The only thing I can think of is to run a subshell
> under strace, to a file, and try the umount in the subshell. Perhaps
> there'll be something there to indicate what's going on.

You also can use the NFS client in gdb and sniff the network when the
NFS server goes down (to see if a broadcast is done to all client).

>
> I've never worked with strace and an interactive program like a
> shell, so you may not get much from the above. You could force
> non-interactive operation by using the shell '-c' argument:
>
> strace -o nfs_hang.trace -f bash -c 'umount /...' &
>
> By backgrounding the program, you should get a prompt from which you
> can issue a 'kill' to the 'bash' process. If you can kill it, then
> strace should print to and close the trace file "normally".
>
>
>
> <<deleted NFS comments>>
>
> > Regards, Jan



--
Thomas Preud'homme

Why Debian : http://www.debian.org/intro/why_debian
 

Thread Tools




All times are GMT. The time now is 12:57 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2007 - 2008, www.linux-archive.org