1833589 Members
4178 Online
110061 Solutions
New Discussion

Disk maintenance

 
Dale Barnes
Advisor

Disk maintenance

Is there a way on HP-UX to find which file a particular block belongs to.
E.g., I sometimes get messages during fsck that a particular block cannot be read.
If that block is part of a file, it would be nice to know which file.
"I try to avoid experience; most experience is bad." - Wilde
7 REPLIES 7
Antoanetta Naghiu
Esteemed Contributor

Re: Disk maintenance

How do you get the Forum? Via Unix?
Just play with edit commands (copy and past).
If you have CDE via Exeed into PC, play with the right button of the mouse->edit.
For xstart, it is the same highlight and copy and to past it you can use Past Special...
But, it is another easy way, doesn't matter what you use: redirect the output to a file #command >file. Attach the file direct to the forum or email it to yourself...
Stefan Farrelly
Honored Contributor

Re: Disk maintenance


Ive never heard of a way of finding out which file a particular block belongs to on HP-UX, but you could do it the other way around. For each file on a filesystem dd it to /dev/null and if that file is on a block which cant be read you will get an I/O error when accessing it. eg;

cd /tmp
for i in `find . -print`
do
echo $i
dd if=$i of=/dev/null bs=64k
done
Im from Palmerston North, New Zealand, but somehow ended up in London...
John Palmer
Honored Contributor

Re: Disk maintenance

fsdb the filesystem debugger
man fsdb
man fsdb_hfs
man fsdb_vxfs

would be able to give you the information but only if you know what you are doing!
Antoanetta Naghiu
Esteemed Contributor

Re: Disk maintenance

Sorry, I mixed up posts.
Dale Barnes
Advisor

Re: Disk maintenance

I understand that there was once a utility called icheck (on Sun OS I believe), which was able to take a block address and find the file, if one existed, that owned the block. It seems that such a utility would not be that difficult to write, if one understood the inode structure. Just thought I would offer that as background for my question.
"I try to avoid experience; most experience is bad." - Wilde
Antoanetta Naghiu
Esteemed Contributor

Re: Disk maintenance

Interesting question. Knowing the fs layout (vxfs and hfs), see man inode and man ncheck.
ncheck it is suppose to give you a list of the path names from inode numbers. You might get it.
Good luck
Anthony deRito
Respected Contributor

Re: Disk maintenance

Paul, check out the man page for ncheck, ncheck_vxfs and ncheck_hfs. It seems there are ways to do this using ncheck. You can print filenames by specifying block numbers if you know them using the "-o b" option on a vxfs filesystem.

Tony