Re: Switch-off problem

2008-07-21 Thread Thomas Preud'homme
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".
>
>
>
> <>
>
> > Regards, Jan



-- 
Thomas Preud'homme

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


signature.asc
Description: This is a digitally signed message part.


Re: Switch-off problem

2008-07-21 Thread Bob McGowan

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".






<>



Regards, Jan




--
Bob McGowan


smime.p7s
Description: S/MIME Cryptographic Signature


Re: Switch-off problem

2008-07-21 Thread Jan Willem Stumpel
Daniel Burrows wrote:
> On Sat, Jul 19, 2008 at 11:46:16AM +0200, Jan Willem Stumpel
> <[EMAIL PROTECTED]> 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 [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Switch-off problem

2008-07-20 Thread Daniel Burrows
On Sat, Jul 19, 2008 at 11:46:16AM +0200, Jan Willem Stumpel <[EMAIL 
PROTECTED]> 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 [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Re: Switch-off problem

2008-07-20 Thread Jan Willem Stumpel
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 [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: Switch-off problem

2008-07-19 Thread Ron Johnson
-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)

iEYEARECAAYFAkiCFnkACgkQS9HxQb37XmfTxgCfaOKbYhRtGg7E0DNPv+jfBN51
4hsAoJRHmpK26RgCNfqAFudjhlxzD2OW
=1SeB
-END PGP SIGNATURE-


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED] 
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]