Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
omv:disk-check [2015/11/06 02:00]
admin created
omv:disk-check [2015/11/12 16:45] (current)
admin [Hard Drives Health Checks]
Line 1: Line 1:
 ====== Hard Drives Health Checks ====== ====== Hard Drives Health Checks ======
  
-When one builds a NAS, specifically on a tight budget, it might well happen that used hard drives are used to fill the hard disk bay...+When one builds a NAS, specifically on a tight budget, it might well happen that "​second hand" ​hard drives are used to fill the hard disk bay...
  
 One important thing to do before trusting those drives to safely store your precious data is to check their health. Here are a few command tools that can be used to performs such checks. One important thing to do before trusting those drives to safely store your precious data is to check their health. Here are a few command tools that can be used to performs such checks.
  
-The following was collected ​in [[http://​linuxpoison.blogspot.be/​2008/​01/​howto-check-disk-drive-for-errors-and.html|this blogspot article]].+The following was collected ​from [[http://​linuxpoison.blogspot.be/​2008/​01/​howto-check-disk-drive-for-errors-and.html|this blogspot article]], as well as from [[http://​linoxide.com/​linux-how-to/​how-to-fix-repair-bad-blocks-in-linux/​|this one on LinOxyde]]. 
 + 
 +===== badblocks ===== 
 + 
 +The //​**badblocks**//​ command is part of the //​**e2fsprogs**//​ package, if it is not yet installed on your system: 
 + 
 +<​code>​ 
 +> sudo apt-get install e2fsprogs 
 +</​code>​ 
 + 
 +badblocks will check a hard drive and log defective sectors to a file that can be used with other programs, like //​**mkfs**//,​ so that they will be locked out of usage. 
 +<​code>​ 
 +> sudo badblocks -v /dev/hda1 > hda1-bad-blocks 
 +</​code>​ 
 + 
 +//​badblocks//​ isn't particularly verbose, so if one wants to (more or less) monitor it's activity, iostat can help visualize disk activity: 
 +<​code>​ 
 +> sudo apt-get install sysstat 
 +</​code>​ 
 + 
 +To monitor activity per disk: 
 +<​code>​ 
 +> sudo iostat -xd <update interval in seconds>​ 
 +</​code>​ 
 + 
 +To monitor activity per partition:​ 
 +<​code>​ 
 +> sudo iostat -pxd <update interval in seconds>​ 
 +</​code>​