Operating System - HP-UX
1832961 Members
3356 Online
110048 Solutions
New Discussion

Re: Problem removing dir, device busy...

 
SOLVED
Go to solution
boje
Regular Advisor

Problem removing dir, device busy...

Hi!

I need help to remove a dir. I suspect this dit was mounted by NFS or maybe a link. Any way, when i try to do umount:
umount: cannot find DVEBMGS70 in /etc/mnttab
cannot unmount DVEBMGS70

When i try rm -rf /DVEBMGS70:
rm: directory DVEBMGS70 not removed. Cannot remove mountable directory

And i try to mount anything on this dir, it says: Device busy.

Now, i have downloaded lsof, and this is the output:
lsof DVEBMGS70/
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
sh 7826 root cwd DIR 64,0x2e000e 1024 2 DVEBMGS70
glance 21868 root cwd DIR 64,0x2e000e 1024 2 DVEBMGS70

Can i kill the sh process? This is a production server and can not be rebooted.

Please help...

Br
Patrik

12 REPLIES 12
unixguy_1
Regular Advisor

Re: Problem removing dir, device busy...


Hi Boje,

check is it mounted permently,and checked the fstab file.

if it's mounted permently thattime it's showing like that or sometime some users using that mount point ,that time you are not able to remove directory,it will show like that error message.

so check and revert back.

Regards,
Unixguy.

boje
Regular Advisor

Re: Problem removing dir, device busy...

Hi!

I was nod able to get rid of the glance and sh process that accessed the dir. But it´s still the same problem. I have checked the mnttab and fstab. The dir does not exists neither of them. I have searched the forum and trie the automounter thingy. But i do not have the /etc/auto_mount config file.

Br
Patrik
Ganesan R
Honored Contributor
Solution

Re: Problem removing dir, device busy...

Hi boje,

Try this,

Goto that directory and give "bdf ." it will give which lv that directory belongs. so you should know, it is a just directory or mount point.

#cd /DVEBMGS70
#bdf .

If it is a directory created on some filesystem use fuser to kill the processes using this directory.

#fuser -ku -c /DVEBMGS70

#fuser -cu /DVEBMGS70 -->to confirm still any process is using

Now remove the directory.

#rm -rf /DVEBMGS70
Best wishes,

Ganesh.
boje
Regular Advisor

Re: Problem removing dir, device busy...

Hi Ganesan!

It´s a nice try. But i get this message:
bdf .
bdf: could not find the mount point for .

I think i found the filesystem my machine think is mounted on my dir i can not remove. I have /dev/v01_vg10/DVEBMGS mounted on /usr/sap/V01/DVEBMGS70. And if if i try to mount that to /oracle/V01/V01/DVEBMGS70 is says:
mount /dev/v01_vg10/DVEBMGS /oracle/V01/V01/DVEBMGS70/
mount: /dev/v01_vg10/DVEBMGS is already mounted on /oracle/V01/V01/DVEBMGS70/

Any suggestions?

Br
Patrik

Ganesan R
Honored Contributor

Re: Problem removing dir, device busy...

Hi Boje,

Now I got little confused.

Which directory you are trying to remove? /DVEBMGS70 ? or /usr/sap/V01/DVEBMGS70 ?

>>>mount /dev/v01_vg10/DVEBMGS /oracle/V01/V01/DVEBMGS70/
mount: /dev/v01_vg10/DVEBMGS is already mounted on /oracle/V01/V01/DVEBMGS70/ <<<<

Nothing wrong in the above message. It says you are trying to mount a lv which is already mounted.

Could you provide the current issue which you are facing ?
Best wishes,

Ganesh.
boje
Regular Advisor

Re: Problem removing dir, device busy...

Hi!

Sorry for confusion. The dir /oracle/V01/V01/DVEBMGS70 is the one that i is trying to remove. But it is not mounted. The lv is mounted to /usr/sap/V01/DVEBMGS70.

The /oracle/V01/V01/DVEBMGS70 is empty.

Br
Patrik
Ganesan R
Honored Contributor

Re: Problem removing dir, device busy...

Hi,

Could you provide the following outputs?

#bdf |grep -i DVEBMGS70

#bdf |grep -i /dev/v01_vg10/DVEBMGS

#grep -i /dev/v01_vg10/DVEBMGS /etc/fstab

#cd /oracle/V01/V01/DVEBMGS70
#bdf .

#bdf

#cat /etc/mnttab

#mount -v

Best wishes,

Ganesh.
boje
Regular Advisor

Re: Problem removing dir, device busy...

#bdf |grep -i DVEBMGS70
7176192 288288 6484628 4% /usr/sap/V01/DVEBMGS70

#bdf |grep -i /dev/v01_vg10/DVEBMGS
/dev/v01_vg10/DVEBMGS

#grep -i /dev/v01_vg10/DVEBMGS /etc/fstab
:

#cd /oracle/V01/V01/DVEBMGS70
#bdf .
bdf: could not find the mount point for .

#bdf
/dev/v01_vg10/DVEBMGS
7176192 288288 6484628 4% /usr/sap/V01/DVEBMGS70

#cat /etc/mnttab
/dev/v01_vg10/DVEBMGS /usr/sap/V01/DVEBMGS70 vxfs ioerror=mwdisable,delaylog,nodatainlog,dev=402e000e 0 0 1204526533

#mount -v
what does it do?
Ganesan R
Honored Contributor

Re: Problem removing dir, device busy...

Hi Boje,

It looks you have temperoryly mounted /dev/v01_vg10/DVEBMGS on /usr/sap/V01/DVEBMGS70 since /etc/fstab does not have the entry.

So where this /oracle/V01/V01/DVEBMGS70 comes? I suspect some mismatch in /etc/mnttab.

Try this.

# mv /etc/mnttab /etc/mnttab.old
# mount -a
Best wishes,

Ganesh.
Ganesan R
Honored Contributor

Re: Problem removing dir, device busy...

After running the above commands try to remove the directory /oracle/V01/V01/DVEBMGS70.

Best wishes,

Ganesh.
Ashish Parashar
Frequent Advisor

Re: Problem removing dir, device busy...

Boje ;

If its a NFS ..then do following things ...

fuser -ku mountpoint

check if some process are still using the mount point by

fuser -cu moount point ...if still process are there then try to kill them manually.

if its not work then ...

restart the nfs client

/sbin/init.d/nfs.client stop
/sbin/init.d/nfs.client start

now check continue with removing....

cheers

Ashish
boje
Regular Advisor

Re: Problem removing dir, device busy...

Hi!
Thx for your replies.

But i do not think i can solve the problem with removing the mnttab and then mount -a. Because this is a cluster machine. There is nothing in fstab, only system disks.
fuser does not show anything, it only says: fuser: could not find file system mounted at /oracle/V01/V01/DVEBMGS70

And i can not restart the nfs client. Then i will loose all other nfs mounts?

It is hopeless when something happens whit nfs mounts.

Br
Patrik