O.K.  I've done a bad, baaaad, thing and I really need help.

I am running a dual boot with windows 98 and RedHat 7.3, which
was an upgrade from 7.2 rather than a straight workstation
install.  The old 7.2 was stable for a long time, and I've done
bad things that I know caused this problem, so I don't think it
is due to the upgrade step.  I am the only user.

The problem in short is that one of my windows vfat partitions
won't unmount, not even if I try unmount after su-ing to root.
It complains that the device is busy.  There really should be
nothing else using that device (I mean, I'm not running any
services that ought to be looking there).

I can unmount the drive if I log out and log back in again (even
without doing any kind of restart or shut down).  But if I then
remount the device, I can't unmount it without repeating the
logout/in.

I believe there is old information of a mount request stuck
somewhere in the system and it won't let it go.  Some hopefully
helpful output from the system is at the end of this message
below the -----.  Further details of how I directly messed
everything up follow immediately below.


I tried to set up autofs to automount my windows partitions.
Being a newbie, I specified the same mount points in my
/etc/auto.misc file as I did in /etc/fstab.  Then I typed a mount
command for the drive (why! could have just let it automount -
don't ask) and it mounted, of course.  It was probably also
mounted by autofs on the same mount point and things got gummed
up.

Well, I figured out that this wasn't a good idea and changed the
mount point for the automounter from /mnt/winc to /automount/winc
for drive hda5 (and likewise for my other windows vfat
partitions).  In my mind the details are now fuzzy, but I tried
to restart the automounter (can't remember if I tried stopping it
and started it, or whether I just restarted it). Whatever I did,
the winc drive was mounted and I couldn't unmount it.

Regrettably, I then did all sorts of stupid stuff.  It seemed I
had two copies of the autofs daemon running, so I tried killing
the old one.  It wouldn't shut off by typing '/etc/init.d/autofs
stop' no matter how many times I typed it (i.e. to kill the
current one and then the old one) so I had to use kill.  I don't
remember if I used -HUP or -9 to kill it, although I would have
tried -HUP first.

Well the drive still wouldn't unmount, and /etc/mtab was listing
two copies of automount and two mounts of winc at the same mount
point.  So I made the fatal error of assuming root and removing
the two offending lines from /etc/mtab (meaning the older ones).

It seems like that when I mounted it twice at the same time on
the same mount point, that some leftover junk from the automount
is lying around in the system somewhere.  A cold restart is no
better than logging out and logging back in in terms of dealing
with the problem.

Any ideas of where to look to fix this, or useful tools, or any
kind of documentation?  The man pages for mount/unmount and
documentation for autofs don't really go into this much depth.
Although any bonehead should know better than to do what I've
done, I'm having trouble finding a way out.

Thanks for any suggestions,

Rob

Helpful, I hope: ---------------------------

$cat /etc/fstab
LABEL=/                 /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
none                    /dev/pts                devpts  gid=5,mode=620  0 0
LABEL=/home             /home                   ext3    defaults        1 2
none                    /proc                   proc    defaults        0 0
none                    /dev/shm                tmpfs   defaults        0 0
/dev/hda8               swap                    swap    defaults        0 0
/dev/cdrom              /mnt/cdrom              iso9660
noauto,user,exec,kudzu,ro 0 0
/dev/fd0                /mnt/floppy             auto    noauto,user,kudzu 0 0
/dev/hda1               /mnt/winc               vfat    owner,user,noauto 0 0
/dev/hda5               /mnt/wind               vfat    owner,user,noauto 0 0
/dev/hda6               /mnt/winaux             vfat    owner,user,noauto 0 0
/dev/hdb4               /mnt/zip100.0           auto    noauto,owner,user,kudzu
0 0
/dev/sda1               /mnt/camera             vfat    noauto,owner,user, 0 0
/dev/hda1               /automount/winc         vfat    noauto,owner,user 0 0
/dev/hda5               /automount/wind         vfat    noauto,owner,user 0 0
/dev/hda6               /automount/winaux       vfat    noauto,owner,user 0 0


The following is with nothing mounted - successfully unmounted the winc
drive from /mnt.

$ cat /etc/mtab
/dev/hda3 / ext3 rw 0 0
none /proc proc rw 0 0
usbdevfs /proc/bus/usb usbdevfs rw 0 0
/dev/hda7 /boot ext3 rw 0 0
none /dev/pts devpts rw,gid=5,mode=620 0 0
/dev/hda4 /home ext3 rw 0 0
none /dev/shm tmpfs rw 0 0

$ cat /etc/auto.master
# $Id: auto.master,v 1.2 1997/10/06 21:52:03 hpa Exp $
# Sample auto.master file
# Format of this file:
# mountpoint map options
# For details of the format look at autofs(8).
# /misc	/etc/auto.misc	--timeout=60
/automount /etc/auto.misc --timeout=60

$cat /etc/auto.misc
# $Id: auto.misc,v 1.2 1997/10/06 21:52:04 hpa Exp $
# This is an automounter map and it has the following format
# key [ -mount-options-separated-by-comma ] location
# Details may be found in the autofs(5) manpage

winc            -fstype=vfat,rw,nosuid,noexec,noauto,user      :/dev/hda1
wind            -fstype=vfat,rw,nosuid,noexec,noauto,user      :/dev/hda5
winaux          -fstype=vfat,rw,nosuid,noexec,noauto,user      :/dev/hda6

---hoping maybe that one of these locks is the culprit, although I'm not
  sure that could possibly be clear from the following:

$cat /proc/locks
1: POSIX  ADVISORY  READ  1877 03:03:133268 4 4 c7c023a0 c02c5508 c7c02234
 00000000 c7c023ac
2: POSIX  ADVISORY  WRITE 1228 03:04:376882 0 EOF c7c02230 c7c023a4 c7c0217c
 00000000 c7c0223c
3: POSIX  ADVISORY  WRITE 1228 03:04:376845 0 EOF c7c02178 c7c02234 c7c021d8
 00000000 c7c02184
4: POSIX  ADVISORY  WRITE 1020 03:03:133259 0 EOF c7c021d4 c7c0217c c7c02120
 00000000 c7c021e0
5: FLOCK  ADVISORY  WRITE 931 03:03:133254 0 EOF c7c0211c c7c021d8 c02c5508
 00000000 c7c02128