Can't delete a directory that WAS a mount point
Hi
I'm sure this is something stupid, but I can't figure out what I'm doing wrong. This is occuring on a Solaris 8 SPARC system:
sunnw: ls -l /mnt
total 6
dr-xr-xr-x1 rootroot1 Jan 13 13:37 dakota11-1a
dr-xr-xr-x1 rootroot1 Jan 13 13:37 dakota11-1b
dr-xr-xr-x1 rootroot1 Jan 13 13:37 dakota2a
dr-xr-xr-x1 rootroot1 Jan 13 13:37 dakota2b
dr-xr-xr-x1 rootroot1 Jan 13 13:37 newdaka
dr-xr-xr-x1 rootroot1 Jan 13 13:37 newdakb
sunnw: rm /mnt/dakota11-1a
rm: /mnt/dakota11-1a is a directory
sunnw: rm -r /mnt/dakota11-1a
rm: cannot read directory /mnt/dakota11-1a: Permission denied
sunnw: rmdir /mnt/dakota11-1a
rmdir: directory "/mnt/dakota11-1a": Directory is a mount point or in use
sunnw: mount
/ on /dev/dsk/c0t0d0s0 read/write/setuid/intr/largefiles/onerror=panic/dev=80007
8 on Mon Jan 13 13:36:51 2003
/proc on /proc read/write/setuid/dev=3a00000 on Mon Jan 13 13:36:50 2003
/dev/fd on fd read/write/setuid/dev=3ac0000 on Mon Jan 13 13:36:52 2003
/etc/mnttab on mnttab read/write/setuid/dev=3bc0000 on Mon Jan 13 13:37:28 2003
/var/run on swap read/write/setuid/dev=1 on Mon Jan 13 13:37:28 2003
/tmp on swap read/write/setuid/dev=2 on Mon Jan 13 13:37:31 2003
/database on /dev/dsk/c0t1d0s0 read/write/setuid/intr/largefiles/onerror=panic/d
ev=800080 on Mon Jan 13 13:37:31 2003
sunnw: cat /etc/vfstab
#device device mountFSfsckmountmount
#to mountto fsck pointtypepassat boot options
#
#/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs1yes-
fd-/dev/fd fd-no-
/proc-/procproc-no-
#/dev/dsk/c0t0d0s1--swap-no-
/dev/dsk/c0t0d0s0/dev/rdsk/c0t0d0s0/ufs1no
-
swap-/tmptmpfs-yes-
/dev/dsk/c0t1d0s0/dev/rdsk/c0t1d0s0/databaseufs1
yes-
/database/swap/swapfile1--swap-no-
sunnw:
Thanks!
tl
[1947 byte] By [
tlemons] at [2007-11-25 23:18:22]

# 2
sunnw: ls -l /mnt
total 12
drwxr-xr-x4 rootroot 512 Jan 13 16:56 cham2bd1
drwxr-xr-x3 rootroot 512 Jan 14 09:15 cham2bd2
drwxr-xr-x2 rootother512 Jan 14 17:53 cham2bd3
dr-xr-xr-x1 rootroot1 Jan 14 20:05 dakota11-1a
dr-xr-xr-x1 rootroot1 Jan 14 20:05 dakota11-1b
dr-xr-xr-x1 rootroot1 Jan 14 20:05 dakota2a
dr-xr-xr-x1 rootroot1 Jan 14 20:05 dakota2b
dr-xr-xr-x1 rootroot1 Jan 14 20:05 newdaka
dr-xr-xr-x1 rootroot1 Jan 14 20:05 newdakb
sunnw: rm -rf /mnt/dakota11-1a
rm: cannot read directory /mnt/dakota11-1a: Permission denied
sunnw: chmod 777 /mnt/dakota11-1a
chmod: WARNING: can't change /mnt/dakota11-1a
sunnw:
Thanks for the suggestions, but they don't work.
Thanks!
tl
# 4
>You are root, not sudo, right?
Right:
sunnw: su
Password:
sunnw: whoami
root
sunnw:
>What's the output of ls -la /mount/dakota11-1a?
sunnw: ls -la /mnt/dakota11-1a
/mnt/dakota11-1a: Permission denied
total 1
sunnw:
>Was the mount point /mount/dakota11-1a, or /mnt?
/mnt/dakota11-1a
>What's the output of mount with no options?
/ on /dev/dsk/c0t0d0s0 read/write/setuid/intr/largefiles/onerror=panic/dev=80007
8 on Fri Jan 17 16:44:56 2003
/proc on /proc read/write/setuid/dev=3a00000 on Fri Jan 17 16:44:00 2003
/dev/fd on fd read/write/setuid/dev=3b00000 on Fri Jan 17 16:44:57 2003
/etc/mnttab on mnttab read/write/setuid/dev=3bc0000 on Fri Jan 17 16:45:36 2003
/var/run on swap read/write/setuid/dev=1 on Fri Jan 17 16:45:36 2003
/tmp on swap read/write/setuid/dev=2 on Fri Jan 17 16:45:40 2003
/database on /dev/dsk/c0t1d0s0 read/write/setuid/intr/largefiles/onerror=panic/d
ev=800080 on Fri Jan 17 16:45:40 2003
/mnt/cham2bd1 on /dev/dsk/c5t0d0s2 read/write/setuid/intr/largefiles/onerror=pan
ic/dev=80025a on Fri Jan 17 16:45:40 2003
/mnt/cham2bd2 on /dev/dsk/c5t0d1s2 read/write/setuid/intr/largefiles/onerror=pan
ic/dev=80034a on Fri Jan 17 16:45:40 2003
sunnw:
>What's the output of umount <directory>? umount -f <directory>?
Well, that's wierd: a 'umount /mnt/dakota11-1a' succeeded. And, following this, a 'rm /mnt/dakota11-1a' succeeded as well.
So, even though 'mount' showed that the mount point wasn't in use, and no entry for this mount point existed in /etc/vfstab, there was still a phantom mount in the system.
I'm all set now; thanks for the help!
tl