Operating System - HP-UX
1833059 Members
2843 Online
110049 Solutions
New Discussion

Re: rmdir: Cannot remove mountable directory

 
Robert Bissett
Advisor

rmdir: Cannot remove mountable directory

Hi,
on a HPUX 11i server running vpars, I'm trying to remove an directory using rmdir but get the following reply :
rmdir /bkp
rmdir: /bkp: Cannot remove mountable directory
So I do the following:
umount /bkp
umount: cannot find /bkp in /etc/mnttab
cannot unmount /bkp

I try mount it:
mount /bkp
mount: /bkp was either ignored or not found in /etc/fstab
It's not listed in SAM under LVs or Filesystems. It's not mentioned in /etc/mnttab or /etc/fstab. Also, there are no device files for it in either /dev/vg00 or /dev/vg01 - the 2 volume groups I have.

Perhaps another file is linked to it ?
The output of ls -ail is as follows :
2 drwxr-xr-x 2 root root 4096 Sep 16 17:45 bkp

I'm stumped - any ideas ?
Robert Bissett
39 REPLIES 39
Sundar_7
Honored Contributor

Re: rmdir: Cannot remove mountable directory

Not very positive on what can be the cause

but did u check if automounter/autofs has been configured to mount on this dir..
Learn What to do ,How to do and more importantly When to do ?
Sridhar Bhaskarla
Honored Contributor

Re: rmdir: Cannot remove mountable directory

Hi Robert,

Try this -

mv /etc/mnttab /etc/mnttab.old

mount -a

umount /bkp

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Sundar_7
Honored Contributor

Re: rmdir: Cannot remove mountable directory


I just reproduced the error in one of my test machines. The prob is that automounter has been configured to mount to the directory.

# ps -ef | grep auto

# kill

# vi /etc/auto_master
remove the ref

# /usr/lib/netsvc/fs/automount/automount -f /etc/auto_master

# rmdir /bkp
Learn What to do ,How to do and more importantly When to do ?
Sundar_7
Honored Contributor

Re: rmdir: Cannot remove mountable directory

Is it HP-UX 11.X ?. If you are using autofs then u dont have to kill the process. Autofs can read the configuration file on the fly.
Learn What to do ,How to do and more importantly When to do ?
Robert Bissett
Advisor

Re: rmdir: Cannot remove mountable directory

Hi,
thanks for your replies, however problem still exists. It's not the automounter.....

ps -ef | grep auto
root 5396 5326 0 07:04:05 pts/ta 0:00 grep auto

Also, renaming /etc/mnttab didnt work.....

$ mv /etc/mnttab /etc/mnttab.old
$ ls /etc/mnt*
/etc/mnttab.old
mount -a
$ umount /bkp
umount: cannot find /bkp in /etc/mnttab
cannot unmount /bkp
$ rmdir /bkp
rmdir: /bkp: Cannot remove mountable directory

Any other ideas ?
T G Manikandan
Honored Contributor

Re: rmdir: Cannot remove mountable directory

#ls -ali

check if u could find any links inside.
Any similar inodes!!
john korterman
Honored Contributor

Re: rmdir: Cannot remove mountable directory

Hi,

just a stupid question: do you have any other mount points that use /bkp ?

regards,
John K.
it would be nice if you always got a second chance
Robert-Jan Goossens
Honored Contributor

Re: rmdir: Cannot remove mountable directory

Robert,

Take a look at next link, bit old but look very mutch like you problem.

http://aa11.cjb.net/hpux_admin/1997/0100.html

Regards,

Robert-Jan
Mark Grant
Honored Contributor

Re: rmdir: Cannot remove mountable directory

I can reproduce the problem by doing this.

# mkdir /delete
# cd /delete
# rmdir /delete
rmdir: /delete: Cannot remove mountable directory

You don't happen to be in the directory you are trying to delete do you?
Never preceed any demonstration with anything more predictive than "watch this"
Mark Grant
Honored Contributor

Re: rmdir: Cannot remove mountable directory

I got this off the linux kernel mailing list and is a quite from Andrea Arcangeli

"If the directory is the root directory or the current working directory
of any process, it is unspecified whether the function succeeds, or
whether it fails and sets errno to [EBUSY]."

Looks like it could be a bug/feature in HPUX too
Never preceed any demonstration with anything more predictive than "watch this"
Robert Bissett
Advisor

Re: rmdir: Cannot remove mountable directory

Hi,
I tried ls -ali initially. Here is a portion of the output (with dates and times removed for ease of viewing)....showing all directories with the same inode number i.e. 2, as is normal I think.

Also, I'm not in the directory while trying to remove.
Robby.

2 drwxr-xr-x 32 root root 8192 .
2 drwxr-xr-x 32 root root 8192 ..
1909 drw------- 5 root sys 8192 .netscape
1068 -r--r--r-- 1 bin bin 965 .profile
2145 -rw------- 1 root sys 3622 .sh_history
1067 drwxr-xr-x 5 root sys 96 .sw
1916 drwxr-xr-x 2 root sys 96 SD_CDROM
2458 dr-xr-xr-x 2 root sys 96 backup
1224 lr-xr-xr-t 1 root sys 8 bin -> /usr/bin
2 drwxr-xr-x 2 root root 4096 bkp
1032 drwxrwxrwx 2 root sys 8192 brs
1066 dr-xr-xr-x 2 root root 96 tmp_mnt
2 drwxr-xr-x 5 oracle dba 96 u01
2 drwxr-xr-x 4 oracle dba 96 u02
2 drwxr-xr-x 4 oracle dba 96 u03
2 drwxr-xr-x 5 oracle dba 96 u04
2438 -rw-rw-rw- 1 root sys 04 umodem.log
2 dr-xr-xr-x 25 bin bin 8192 usr
2 dr-xr-xr-x 27 bin bin 8192 var
1981 -rw-rw-rw- 1 root sys 43226 wlm.txt
T G Manikandan
Honored Contributor

Re: rmdir: Cannot remove mountable directory

Do that inside the /bkp dir?
Zigor Buruaga
Esteemed Contributor

Re: rmdir: Cannot remove mountable directory

Hi,

Does "fuser" show anything?
Try:
#fuser -c /bkp
and
#fuser -f /bkp

Kind regards,
Zigor
Zigor Buruaga
Esteemed Contributor

Re: rmdir: Cannot remove mountable directory

Hi,

Look also at "/etc/exports".

Hope this helps.
Kind regards,
Zigor
Robert Bissett
Advisor

Re: rmdir: Cannot remove mountable directory

Hi,
no, nothing in /etc/exports and fuser shows nothing using the dir.
Robert Bissett
Advisor

Re: rmdir: Cannot remove mountable directory

Hi,
in case I didnt mention the /bkp directory is empty.
Robby.
john korterman
Honored Contributor

Re: rmdir: Cannot remove mountable directory

Hi,

Does this show nothing:
# ls /bkp | cat -v

what does
# file /bkp
show?

regards,
John K.
it would be nice if you always got a second chance
Robert Bissett
Advisor

Re: rmdir: Cannot remove mountable directory

Results...

$ ls /bkp | cat -v
$ file /bkp
/bkp: directory

i.e. empty directory.

Zigor Buruaga
Esteemed Contributor

Re: rmdir: Cannot remove mountable directory

Hi,

My stupid suggestion, let's try with other commands to see if the result is the same:

Try to move with "mv /bkp /bkp.old"
and if it works, try again to delete "/bkp.old"
What happens?

Kind regards,
Zigor
Robert Bissett
Advisor

Re: rmdir: Cannot remove mountable directory

Hi,
tried already. Output is...

$ mv /bkp /bkp.old
mv: /bkp.old: rename: Device busy


Regards,
Robby.
Sridhar Bhaskarla
Honored Contributor

Re: rmdir: Cannot remove mountable directory

Hi Robert,

I guess at this time you will need to use "lsof" to find out the processes attached to this directory. lsof is much elegant than fuser. Once it is installed, run lsof /bkp and see what processes are using this directory. It could be a soft nfs mount etc., which can be easily found through the processes working on this directory.

You can search this site for pointers to get lsof 64bit version. Even someone posted the actual binary.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Chuck Sims
Advisor

Re: rmdir: Cannot remove mountable directory

Aloha Robert,

This may be a bit heavy-handed (and perhaps you've already tried it), but do you get the same results in single-user mode? If something is "using" /bkp, dropping to single-user mode ought to fix that little problem.

Good Luck,
Chuck
"I feel like I'm diagonally parked in a parallel universe."
john korterman
Honored Contributor

Re: rmdir: Cannot remove mountable directory

Hi again,

forgot to ask about the mount point; what is the output of:

# cd /bkp
# bdf .

regards,
John K.
it would be nice if you always got a second chance
Robert Bissett
Advisor

Re: rmdir: Cannot remove mountable directory

Hi Guys,
thanks again for all the suggestions. Here are the outputs of each - the lsof ouput looks weird, perhaps there was a link at some point which doesn't exist now ?

$ /tmp/lsof_4.68 /bkp
lsof_4.68: WARNING: can't stat() vxfs file system /robby
Output information may be incomplete.

Unfortunately I can't bring the server down to single user mode as it's production. I'm also worried I would have problems rebooting.

Here is the output of the bdf suggestion within the directory.

/bkp $ bdf .
bdf: could not find the mount point for .

It looks like lsof has hinted at something - anyone any ideas what though ?
Thanks,
Robby.