Operating System - HP-UX
1833083 Members
2878 Online
110050 Solutions
New Discussion

Re: rmdir: Cannot remove mountable directory

 
David_246
Trusted Contributor

Re: rmdir: Cannot remove mountable directory

HI,

Looks like this directory has been mounted on /robby which does not excist anymore.

You can try re-create a directory /robby again and see how /bkp will start behaving. By moving /etc/mnttab you already had an option to work around it, as this even did not work it seems like there is no current solution. Maybe stopping an starting nfs gives you some more info about /robby, however this should have been in the /robby fs already. I don't think it would be very stupid to run an fsck on your filesystem. "fsck -y" does give you an overview of your filesystems.
It looks like for once a reboot can be the final answer.

Good luck.

Regs David
@yourservice
David_246
Trusted Contributor

Re: rmdir: Cannot remove mountable directory


Snip -->
some more info about /robby, however this should have been in the /robby fs already
<--

Please read :

some more info about /robby, however this should have been in the /etc/mnttab already

Regs David
@yourservice
Robert Bissett
Advisor

Re: rmdir: Cannot remove mountable directory

Hi,
this could be a red herring. If I do lsof on any directory or file, this message appears at the top....

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

I recreated the dir /robby to see what happens and the error goes away but /bkp is still stubbornly refusing to go.

$ mkdir robby
$ /tmp/lsof_4.68 /export
$ /tmp/lsof_4.68 /bkp
$
Todd McDaniel_1
Honored Contributor

Re: rmdir: Cannot remove mountable directory

Okay, im gonna start throwing out weird questions...

__________________________
1) IS this a tape/CD mount point? If so, does the device still have the media stuck in it?

__________________________
2) Is this a local mount point or a remote NFS one? I might stop and restart the nfsd...

__________________________
3) Also, I have seen this before as well. It is possible that your /etc/fstab is corrupted...You may have to restore it from a backup or saved OLD version or recreate it manually, DONT copy from the current one...

How many copies of /etc/fstab* do you have in the /etc directory??? I would rm or mv any extra backup copies of /etc/fstab out of /etc...

__________________________
4) Also, I believe you might have hidden chars in the dir name... try ls -i and then:

rm /dir
umount /dir

Unix, the other white meat.
john korterman
Honored Contributor

Re: rmdir: Cannot remove mountable directory

Hi again Robert,

please post the output of this, which tries to determine whether /bkp is a mount point or not:
# cd /bkp
# ls -ldi .

By the way, what has /bkp been used for? How was it established?

regards,
John K.
it would be nice if you always got a second chance
V. Nyga
Honored Contributor

Re: rmdir: Cannot remove mountable directory

Hi Robert,

what does bdf shows from your root directory?
# bdf

Volkmar
*** Say 'Thanks' with Kudos ***
Robert Bissett
Advisor

Re: rmdir: Cannot remove mountable directory

Hi,
thanks again for suggestions. Answers to questions and results of suggestions below....
Robby.

Todds Questions:
1. No
2. Can I kill nfskd ?
3. Can I recreate fstab without affecting system running ?
4. ls -i /bkp gives nothing

cd /bkp
/bkp $ ls -ldi .
2 drwxr-xr-x 2 root root 4096 Sep 17 14:06 .

/bkp was possibly a mounted filesystem at one point and there was another directory that had a symbolic link to it, this is now gone. That's all we know.


$ bdf
Filesystem kbytes used avail %used Mounted on
/dev/vg00/lvol3 204800 99192 104800 49% /
/dev/vg00/lvol1 298928 107576 161456 40% /stand
/dev/vg00/lvol8 4710400 430392 4246664 9% /var
/dev/vg00/lvol7 1466368 992536 470184 68% /usr
/dev/vg01/lvu04 17408000 2234568 14936484 13% /u04
/dev/vg01/lvu03 17408000 4193800 13007736 24% /u03
/dev/vg01/lvu02 17408000 11394908 5919204 66% /u02
/dev/vg01/lvu01 17653760 6090000 11202512 35% /u01
/dev/vg00/lvol4 204800 147256 57544 72% /tmp
/dev/vg01/lvstats 53248 4520 45729 9% /stats
/dev/vg00/lvol6 1114112 961760 151184 86% /opt
/dev/vg00/lvol5 24576 11024 13496 45% /home
/dev/vg00/lvprod 524288 297974 212208 58% /prod
/dev/vg01/lvrobby 204800 99192 104800 49% /robby
/dev/vg00/lvexport 2048000 16703 1904363 1% /export
john korterman
Honored Contributor

Re: rmdir: Cannot remove mountable directory

Hi again Robert,

the leftmost "2" of the output from the -ldi command:
2 drwxr-xr-x 2 root root 4096 Sep 17 14:06 .
indicates (to me, at least) that /bkp is a mount point and that it is still mounted.
I therefore suspect that there is something wrong in your /etc/fstab. Have you looked into that?

regards,
John K.
it would be nice if you always got a second chance
Mark Grant
Honored Contributor

Re: rmdir: Cannot remove mountable directory

If you are sure that no process is holding that directory open or has an open file in that directory (remember the file might not actually have a name if it has been removed) or that no process regularly tries to traverse the /bkp directory then my guess is that the directory doesn't actually exist but that there is still an entry for it in the / directory entry for some reason. However, I personally am not confident enough to start editing / myself so I guess an fsck of / is in order.

By the way, there is no problem updating fstab within a live system unless your production applications run "mount" for some reason. Same is true of NFS though if it doesn't come back up again you might be in trouble.
Never preceed any demonstration with anything more predictive than "watch this"
Todd McDaniel_1
Honored Contributor

Re: rmdir: Cannot remove mountable directory

I agree it seems to be more and more like /etc/fstab...


I might try one other thing just to see what it gives...

#mount -p

This will show you what hte mount options are on each filesystem. Probably show null for /bkp.

_________________________________
Yes you can recreate the fstab... Just do it some where else... and mv it into place!

cp /etc/fstab /root/fstab.old
vi /tmp/fstab
mv /etc/fstab* /some/other/dir/
mv /tmp/fstab /etc/fstab

*****One other thing move any and all versions of /etc/fstab to some other directory...********

I know it shouldnt matter but I would do it just to be clean in /etc... I would grep for bkp in any old fstabs in /etc...
Unix, the other white meat.
Robert Bissett
Advisor

Re: rmdir: Cannot remove mountable directory

Guys,
I'll try these suggestions on monday. Thanks,
Robby

btw - I've assigned points a couple of times to the last few posts but they havn't appeared ?
Balakumar M
Frequent Advisor

Re: rmdir: Cannot remove mountable directory

Hi,
Try with fuser -cu /bkp and kill the listed process, if the process is not listed then check for the filesystem which was mounted on /bkp e.g. fuser -cu /dev/vg02/lovl1, if any process uses this mount point, kill the process. I think this will do.

Regards,
-Bala
Life is a continues learning process
Gary Cooper_1
Esteemed Contributor

Re: rmdir: Cannot remove mountable directory

I dont know if you managed to fix this (guess by now you managed to work around it anyway), but I've been having a similar problem.

What I've been doing is relocating the source of an automounted (autofs) nfs directory. The directory that I couldn't delete was actually the destination (auto)mount point.

I had switched off the automounting of this directory, but I think I had done it before the automount had expired and had unmounted.

Anyway the way that I eventually got rid of it was to issue the 'automount' command on the offending system (i.e. the one with the directory that wouldn't delete)... and hey presto! the directory was gone! - I didn't even have to delete it!

Anyway, I hope this helps anyone else that may encounter the same problem.

Regards,

Gary Cooper
Suresh Patoria
Super Advisor

Re: rmdir: Cannot remove mountable directory

hi

use rm -rf /bkp command

thanx & regards,
suresh patoria
Todd McDaniel_1
Honored Contributor

Re: rmdir: Cannot remove mountable directory

no points here please.


Gary... I might have started a new thread so yours wont get lost in this looong thread.

just a friendly suggestion.


I sometimes post answers that I have found instead of asking questions as you did here, just incase some browsing the forums might need it.

Unix, the other white meat.