- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: identifying files on a specific disk
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-13-2004 09:10 AM
тАО11-13-2004 09:10 AM
I understand that I can use 2 tools to get the location of a file on a disk within an lvol that contains multiple disks
fsdb - allows you to pass the inode number of the file to retrieve the first direct extent (1k blocksize) of the file into the logical volume
ncheck - similar to the above, gives you the sectors in KB, translating to offsets etc
If I have a filesystem that is 143gb, that is currently 40% full.
A disk 17gb disk that has 4339 LE's of which reside between LE numbers 16725 and 21064, starting at 67gb ending at 84gb within the lvol
From this, if I prealloc a 20gb file I know that the space occupied by this file will reside on my 17gb disk, sorted.
However,
Without picking random files and using either fsdb or ncheck how can I check the list of files that reside on a particular disk ?
Thanks in advance
Steve
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-13-2004 10:19 PM
тАО11-13-2004 10:19 PM
Re: identifying files on a specific disk
I do not now of a tool or a command that could provide you the info, but may be a
dd if=20gbfile of=/dev/null bs=1024k
sar -d
when the server is idle could give you an idea.
Regards,
Gideon
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2004 06:04 AM
тАО11-14-2004 06:04 AM
Re: identifying files on a specific disk
I have covered that with my description in the original post
steve
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2004 01:54 PM
тАО11-14-2004 01:54 PM
SolutionHey Steve,
I'm not entirely sure I get what you want, but perhaps the following (and attached) perl script will to the job. Here is a sample run:
$ perl pv_to_file.p /dev/vg_infa/infa > x
$ more x
dsk/c4t6d0 /infa.ipf.7.1.tar.gz
dsk/c7t6d0 /infa.ipf.7.1.tar.gz
dsk/c4t6d0 /infa.ipf.tgz
dsk/c4t6d0 /informatica/pc/.
:
You can then grep or grep -c for a particular disk or file.
In this first example all files lived on one pv, except for one large one, which had extends on both disks in the volume group.
In the next example I had extent based striping, so just about every other file was on alternating disks:
dsk/c73t0d2 /hein/.
dsk/c73t0d1 /sar/.
dsk/c73t0d2 /ora92/.
dsk/c73t0d1 /project_changes.txt
dsk/c73t0d1 /depot/ssh_3_61_11.11.depot
dsk/c73t0d1 /depot/ssh_3_71_11.23.depot
dsk/c73t0d2 /depot/QPK1123_11.23.depot
Close?
The script first examines lvdisplay -v output to create an extent to pv table.
It then uses ncheck to get blocks to filename data. It divides the blocks by PE size to lookup in the le table which pv it is mapped to.
hth,
Hein.
$lv = shift @ARGV;
die "Please provide an lv name" unless $lv;
### cerate an array mapping LE numbers to disks
#LV Size (Mbytes) 130000
#Current LE 8125
#Allocated PE 8125
# LE PV1 PE1 Status 1
# 00000 /dev/dsk/c4t6d0 00000 current
foreach $_ (`/usr/sbin/lvdisplay -v $lv`) {
$size = int($1) if (/^LV Size \(Mbytes\)\s+(\w+)/);
$PE = 1024 * $size/int($1) if (/Allo.* PE\s+(\w+)/);
if (/(\d+) \/dev\/(\S+)\s+(\d+)/){
$disk = $disk_name_to_num{$2};
if (!$disk) {
$disk = keys %disk_name_to_num;
$disk_name_to_num{$2} = ++$disk;
$disk_num_to_name[$disk] = $2;
}
$le[$1]=$disk;
}
}
#name indx inode indx inode blocks name
#UNNAMED 999 42 - - 988864-989327 /informatica/repositoryserver/pm_r_EN.cat
foreach $_ (`ncheck -F vxfs -oblock=- $lv`) {
if (/(\d+)\s+-\s+- (\d+)-(\d+) (\/.*$)/){
$inode=$1;
$beg= int( $2 / $PE);
$end= int( $3 / $PE);
$name=$4;
for ($i = $beg; $i <= $end; $i++ ){
$disk = $le[$i];
#debug print "PE=$PE, beg=$beg, end=$end, i=$i, disk=$disk, name=$name\n";
print "$disk_num_to_name[$disk] $name\n" unless ($seen{$name." ".$disk}++);
}
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-14-2004 02:07 PM
тАО11-14-2004 02:07 PM
Re: identifying files on a specific disk
deserves 50 points I reckon
Thanks Heine
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО11-15-2004 01:00 AM
тАО11-15-2004 01:00 AM
Re: identifying files on a specific disk
Some notes:
- Be patient.. the ncheck may take minutes before getting to file entries.
- I haven't thought through what the metadata records (the inodes themselve) mean in the context of you proble.
- I report the disk/file combo's only once, and as seen as I see them. It would be only a minor twea to just maintain this 'seen' array and then report later sorted by disk or array, and including the number of fragments seen.
- It is also a straightforward change to just report a selected disk, or to augment the script with an outer vgdisplay loop to process all the LV's a given PV might be part of.
Cheers,
Hein (no i, z, e, or enken in the end of my name :-).