Wednesday, October 27, 2010

mount/Unmount a partition in Linux

I was trying to umount a partition, it gave me error saying the device is busy and un mount was not working. I then started to troubleshoot this and came to the conclusion that something was still accessing the partition and hence the Linux was not allowing me to unmount it. So what do you do to know what process is using this? There are couple of command utilities that can assist you in this. One is lsof and the other one is fuser,  so how do you use this? lets see that below.

# lsof /dev/sda2

 or
 
# fuser -m /dev/sda2

it will list you the process that is using that partition, either stop the process or kill it and then you can umount it. Hope it helps ;)

No comments:

Post a Comment