2008/06/14

WMU-6500FS - lsof 4.78





Build results: [binary] [files list]

In the Web UI there is a possibility to create/delete/resize/format individual disk partitions (WebUI/Storage configuration/Disk utility) however sometimes it is not possible, e.g. format operation fails with error "Device is busy".
It seems there is some process using the drive (holding some file handles or so). The lsof command (meaning "LiSt Open Files") is a tool which can be used to determine what files are being held by which processes.

Info sources: [Device is busy error] [lsof tool] [Vic Abell's Home Page]

Build sequence:
Download and extract:
dev# wget ftp://ftp.cert.dfn.de/pub/tools/admin/lsof/lsof_4.78.tar.gz
dev# tar xzvf lsof_4.78.tar.gz
dev# cd lsof_4.78
dev# tar xvf lsof_4.78_src.tar
dev# cd lsof_4.78_src
Configure settings
(I left all default values, it is here just for you to see what the possible settings are).
dev# ./Configure linux
Do you want to take inventory (y|n) [y]? y
Do you want to customize (y|n) [y]? y
Customizing ...
Enable HASSECURITY (y|n) [n]?
Disable WARNINGSTATE? (y|n) [n]?
Enable HASKERNIDCK (y|n) [n]?
Do you want to rename machine.h to machine.h.old and replace it with
new_machine.h (y|n) [y]? y
dev# make
In order to find what processes hold a file on the C partition, you can use the following command:
box# lsof | grep mnt/C

No comments: