- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: check hard disk for buffer I/O errors
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
08-30-2010 03:52 AM
08-30-2010 03:52 AM
Howto check a hard disk for buffer I/O errors and fix them using linux, without damaging OS?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2010 05:48 AM
08-31-2010 05:48 AM
Re: check hard disk for buffer I/O errors
Try using the fdisk command with "-l" option.
This lists the parition tables on the devices that are specified.
Lets see whether the fdisk command is able to read the parition tables properly
from the devices.
fdisk -
http://linux.about.com/od/commands/l/blcmdl8_fdisk.htm
Also, try and check the file systems that are currently present.
Use the fsck command without repair and check if any errors are logged.
fsck-
http://linux.about.com/od/commands/l/blcmdl8_fsck_.htm
Hope this helps.
Regards,
Murali
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2010 06:19 AM
08-31-2010 06:19 AM
SolutionIf you mean check out the disk hard drive platter(s) to see if there's an I/O write problem, a basic check would be to run data dump (dd) using 1k block size, and just see where the data breaks. However, that's really bad for the OS (you'd definitely crash it).
If you mean to check out the hard drive platter(s) to see if there's an I/O read error, you could use data dump (dd) to read data from the drive in 1k blocks to see if you've got a problem.
For instance, if you hard drive is /dev/sda:
dd if=/dev/sda of=/dev/null bs=1024
this thing will run (a long time) and if you've got place where it can't read, it will tell which block it did it on. However, at the end of the drive, it *will* fail with an error on read, because there's no more blocks to read - which in this case is fine.
If you want to check just individual partitions, instead of the whole drives
- you'd just refer to the partition number, so you'd substitute /dev/sda for /dev/sdan with n for partition number, for example /dev/sda1 (first partition), etc.
Now, if you *do* find a bad block in there, and you've calculated how big the drive is, and you're *not* at the end of the disk... you can run fdisk and format around it (destroying any OS involved in that block). Or, you could use gparted (linux tool) to move the os partitions off that spot by reducing or moving the partition around. However, your mileage will var depending on how bad the drive is behaving with the error. But for my money - you'd be better off just chunking that drive and not fooling with it if you're seeing errors on it.
Drives are cheap now, and there's no reason to fool with bad hardware.
Lastly, keep in mind that if you successfully dd that drive with no errors, but are still seeing things that make you believe that your having hard drive trouble, you may just have soft corruption in the file system(s) that you're using. In which case you could fsck those drives from the command line (fsck /dev/sda1, fsck /dev/sda2, etc) to see if you can fix those soft error issues.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2010 09:04 AM
09-05-2010 09:04 AM
Re: check hard disk for buffer I/O errors
Thx a lot for an excelent and very helpfull posting!
I'll try this command:
# dd if=/dev/sda of=/dev/null bs=1024
on my hard disk, but will be not better to write 1k blocks instead of read?
OS is anyway backuped.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2010 09:30 PM
09-06-2010 09:30 PM
Re: check hard disk for buffer I/O errors
# dd if=/dev/sda of=/dev/null bs=1024
on my hard disk, but will be not better to write 1k blocks instead of read?
OS is anyway backuped.
- no because if you write from /dev/null ==> /dev/sda your system will imediately crach because you will overwrite all system data.
- the logic is mostly that if you can't read you will be not able also to write to the damaged block.
mikap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2010 02:34 AM
09-07-2010 02:34 AM
Re: check hard disk for buffer I/O errors
# badblocks -s -n /dev/your_drive_type/cXdY
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2010 07:12 AM
10-13-2010 07:12 AM
Re: check hard disk for buffer I/O errors
Yes, writing is a better check, but it will destroy everything on the drive, and you'd be at the point of restoring. If this doesn't bother you, then go ahead.
But, if you're going to do this, don't use /dev/null for input of the dd command, use /dev/zero or /dev/rand (if you have the random package installed) instead.
whole drive:
dd if=/dev/zero of=/dev/sda bs=1024
or per partition
dd if=/dev/zero of=/dev/sda[n] bs=1024
where n is the number of your partition you want to test.
Just understand that the above is absolutely destructive to whatever disk or partition your "testing", and will certainly require a restore or reinstall to get it back.