Operating System - HP-UX
1832439 Members
3250 Online
110042 Solutions
New Discussion

Where is physically located a file?

 
Angelito_1
Occasional Contributor

Where is physically located a file?

Hi,

I need to identify what are the disks and PE's that belong to a file. I only know the ckdisks script but i need more information. For example:

- File test.txt belongs to c2t0d0 disk, and it is physically located in PE's 23000-23500.

Is there any script or command?.

Thanks.
1 REPLY 1
James R. Ferguson
Acclaimed Contributor

Re: Where is physically located a file?

Hi Angelito:

Have a look at 'ncheck'.

Knowing the filesystem in which the file resides, look at the filesystem size with 'bdf'. Take the value of the filesystem size in 'kbytes' and subtract one from it to make it zero-relative. For example, I have a '/home' filesystem that is 20480 kbytes in size mounted on '/dev/vg00/lvol5'.

To find where in this filesystem a file named "jrf_file", lives, do:

# ncheck -F vxfs -S 0-20479 /dev/vg00/lvol5|grep jrf_file

In my case this returned:

UNNAMED 999 1762 3740-3742 /jrf_file
UNNAMED 999 1762 3718-3725 /jrf_file

See the manpages for 'ncheck' for more details. In the above, the inode number is 1762 and the file I sought resides in sectors 3740-3742 and 3718-3725. From this one should be able to map to a logical extent and then to a particular physical extent.

Regards!

...JRF...