- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- How to check BadBlock on 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
Forums
Discussions
Discussions
Discussions
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
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-04-2008 01:30 PM
11-04-2008 01:30 PM
- Is there a way to determine what files are affected of a bad block.
- How to determine a bad block in a logical volume.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2008 03:22 PM
11-04-2008 03:22 PM
Solutionlvdisplay -v / dev/vg01/lvol1 |grep -i stale
- Is there a way to determine what files are affected of a bad block.
maybe :-)
I haven't got a system with a failed disk but try this script:
#!/usr/bin/ksh
DIR="/yourdir"
for i in $(find $DIR -type f)
do
echo $i
dd if=$i of=/dev/null
if [ $? -ne 0 ]
then
echo "ERROR in $i" >> /tmp/errors
fi
done
The script will log errors to the file but on the other hand it might hang if it is waiting for a bad block. The you will again be back to the lvdisplay command.
I it is possible the mirror the faulted disk to another and remove the old.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2008 05:12 PM
11-04-2008 05:12 PM
Re: How to check BadBlock on disk
fsck cannot check for any disk defects. It is a directory structure tool and adjusts pointers and tables for consistency. If fsck reads a bad spot on the disk, the read fails with errno 5 (I/O error) and that cannot be fixed by fsck.
> Is there a way to determine what files are affected of a bad block.
Not without extensive knowledge of the VxFS filesystem structures and how to use fsdb.
> How to determine a bad block in a logical volume.
Yes, the dd command bypasses the filesystem and simply reads data. To look at /dev/vg00/lvol3, use this command:
dd if=/dev/vg00/rlvol3 of=/dev/null bs=1024k
This will read 1MB blocks and stop if a read failure occurs. Be sure to use the "r" device file (rlvol3) for faster performance.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2008 10:35 PM
11-04-2008 10:35 PM
Re: How to check BadBlock on disk
dd is the right command to find out the disk related problem for better knowledge please refer this doc.
Suraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2008 10:58 PM
11-04-2008 10:58 PM
Re: How to check BadBlock on disk
see the doc at...
http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad.pdf
Regards,
Asif Sharif
Asif Sharif
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-04-2008 11:16 PM
11-04-2008 11:16 PM
Re: How to check BadBlock on disk
http://docs.hp.com/en/5991-1236/When_Good_Disks_Go_Bad_WP.pdf
BTW, bad blocks are handled at disk firmware level, no longer at LVM level, see also
man lvchange
(relocate option)
Hope this helps!
Regards
Torsten.
__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.
__________________________________________________
No support by private messages. Please ask the forum!
If you feel this was helpful please click the KUDOS! thumb below!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2008 01:29 AM
11-05-2008 01:29 AM
Re: How to check BadBlock on disk
dd is the command to check if any media errors.
If you want to see the files affected by bad blocks you can try with tar.
Try to take the tar image of the filesystem in question. The file which is giving i/o error should be there in affected area of the disk.
Ex:
#tar -cvf /tmp/backup.tar /home
Ganesh.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-05-2008 01:52 AM
11-05-2008 01:52 AM
Re: How to check BadBlock on disk
If you are only going to test the reads, you might as well toss the output:
tar -cvf /dev/null /home
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2008 09:15 PM
11-08-2008 09:15 PM