Sunday, August 27, 2017

lsof meaning ‘LiSt Open Files’

‘LiSt Open Files’ is used to find out which files are open by which process.


In this directory, we know all the process.

for example:

If you take the AWS provider:

1)  Attach the volume:

   /dev/xvdf

2)  df -h
    Make sure that, volume was in the list.

3)  Create a directory:
    Mkdir  example

4)  Format (Format to this filesystem type ext4)

    Mkfs.ext4  example

5)  Cross verify, the  filesystem was properly formatted to        the ext4 type:
    Mount -a.


6)  Successfully Mounted.

7)  When you unmount:
    unmount  
   


(Make sure, no process was running on that /example inorder to check that,we have to use following command).

8) lsof | grep example

   (we can stop the services, related to that process and kill them using kill -15).

9) And then we can unmount the disk.
   (And we can detach the volume and delete the volume).
  
  






















No comments:

Post a Comment