<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to locate a sector into the file system in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/how-to-locate-a-sector-into-the-file-system/m-p/4137862#M31491</link>
    <description>Please see:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.gra2.com/article.php/20041015232512624" target="_blank"&gt;http://www.gra2.com/article.php/20041015232512624&lt;/A&gt;</description>
    <pubDate>Wed, 30 Jan 2008 21:16:26 GMT</pubDate>
    <dc:creator>Ivan Ferreira</dc:creator>
    <dc:date>2008-01-30T21:16:26Z</dc:date>
    <item>
      <title>How to locate a sector into the file system</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-locate-a-sector-into-the-file-system/m-p/4137861#M31490</link>
      <description>I have a disk sector error.&lt;BR /&gt;&lt;BR /&gt;* How could I locate in which file this sector is contained?&lt;BR /&gt;&lt;BR /&gt;Then I would know which application is impacted, and I would know which file should be restored, or recreated?&lt;BR /&gt;&lt;BR /&gt;I am using ext3 file systems.&lt;BR /&gt;&lt;BR /&gt;dmesg |tail&lt;BR /&gt;&lt;BR /&gt;end_request: I/O error, dev hda, sector 29012529&lt;BR /&gt;hda: dma_intr: status=0x59 { DriveReady SeekComplete DataRequest Error }&lt;BR /&gt;hda: dma_intr: error=0x40 { UncorrectableError }, LBAsect=29012535, high=1, low=12235319, sector=29012529&lt;BR /&gt;ide: failed opcode was: unknown&lt;BR /&gt;end_request: I/O error, dev hda, sector 29012529&lt;BR /&gt;&lt;BR /&gt;If possible, I would prefer not to halt the system.&lt;BR /&gt;</description>
      <pubDate>Wed, 30 Jan 2008 20:16:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-locate-a-sector-into-the-file-system/m-p/4137861#M31490</guid>
      <dc:creator>Geert Van Pamel</dc:creator>
      <dc:date>2008-01-30T20:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to locate a sector into the file system</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-locate-a-sector-into-the-file-system/m-p/4137862#M31491</link>
      <description>Please see:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://www.gra2.com/article.php/20041015232512624" target="_blank"&gt;http://www.gra2.com/article.php/20041015232512624&lt;/A&gt;</description>
      <pubDate>Wed, 30 Jan 2008 21:16:26 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-locate-a-sector-into-the-file-system/m-p/4137862#M31491</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2008-01-30T21:16:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to locate a sector into the file system</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-locate-a-sector-into-the-file-system/m-p/4137863#M31492</link>
      <description>&lt;!--!*#--&gt;Well, I suspected that it was boinc that was suffering from the bad sector, but now I know for sure.&lt;BR /&gt;&lt;BR /&gt;boinc did not use any CPU time...&lt;BR /&gt;&lt;BR /&gt;ps -fu boinc&lt;BR /&gt;UID        PID  PPID  C STIME TTY          TIME CMD&lt;BR /&gt;boinc     1864     1  0 05:27 ?        00:00:06 ./boinc&lt;BR /&gt;boinc     9655  1864  1 16:39 ?        00:00:52 einstein_S5R3_4.20_i686-pc-linux&lt;BR /&gt;&lt;BR /&gt;And the system had huge I/O wait times&lt;BR /&gt;&lt;BR /&gt;I/O wait times &amp;gt; 80 %&lt;BR /&gt;&lt;BR /&gt;vmstat 5&lt;BR /&gt;procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----&lt;BR /&gt; r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa&lt;BR /&gt; 0  2  40720   3396   8468  20700    1    2    38    37   39    66  6  6  8 80&lt;BR /&gt; 0  3  40720   3336   8496  20700    0    0     3    17 1018    46  0  6  0 93&lt;BR /&gt;&lt;BR /&gt;The system did already perform an unplanned crash/reboot&lt;BR /&gt;&lt;BR /&gt;uptime&lt;BR /&gt; 22:40:04 up 1 day, 17:14,  2 users,  load average: 0.03, 0.04, 0.00&lt;BR /&gt;&lt;BR /&gt;Normally the system would never be idle, nor reboot...&lt;BR /&gt;&lt;BR /&gt;smartctl -A /dev/hda&lt;BR /&gt;smartctl version 5.33 [i386-redhat-linux-gnu] Copyright (C) 2002-4 Bruce Allen&lt;BR /&gt;Home page is &lt;A href="http://smartmontools.sourceforge.net/" target="_blank"&gt;http://smartmontools.sourceforge.net/&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;=== START OF READ SMART DATA SECTION ===&lt;BR /&gt;SMART Attributes Data Structure revision number: 16&lt;BR /&gt;Vendor Specific SMART Attributes with Thresholds:&lt;BR /&gt;ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE&lt;BR /&gt;  1 Raw_Read_Error_Rate     0x000b   100   100   051    Pre-fail  Always       -       41&lt;BR /&gt;  3 Spin_Up_Time            0x0007   067   042   000    Pre-fail  Always       -       5760&lt;BR /&gt;  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       174&lt;BR /&gt;  5 Reallocated_Sector_Ct   0x0033   253   253   010    Pre-fail  Always       -       0&lt;BR /&gt;  7 Seek_Error_Rate         0x000b   253   253   051    Pre-fail  Always       -       0&lt;BR /&gt;  8 Seek_Time_Performance   0x0024   253   253   000    Old_age   Offline      -       0&lt;BR /&gt;  9 Power_On_Half_Minutes   0x0032   097   097   000    Old_age   Always       -       19359h+40m&lt;BR /&gt; 10 Spin_Retry_Count        0x0013   253   253   049    Pre-fail  Always       -       0&lt;BR /&gt; 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       102&lt;BR /&gt;194 Temperature_Celsius     0x0022   151   094   000    Old_age   Always       -       29&lt;BR /&gt;195 Hardware_ECC_Recovered  0x000a   100   100   000    Old_age   Always       -       432100053&lt;BR /&gt;196 Reallocated_Event_Count 0x0012   099   099   000    Old_age   Always       -       3&lt;BR /&gt;197 Current_Pending_Sector  0x0033   253   253   010    Pre-fail  Always       -       0&lt;BR /&gt;198 Offline_Uncorrectable   0x0031   099   099   010    Pre-fail  Offline      -       3&lt;BR /&gt;199 UDMA_CRC_Error_Count    0x000b   100   100   051    Pre-fail  Always       -       0&lt;BR /&gt;200 Multi_Zone_Error_Rate   0x000b   100   100   051    Pre-fail  Always       -       0&lt;BR /&gt;201 Soft_Read_Error_Rate    0x000b   100   100   051    Pre-fail  Always       -       0&lt;BR /&gt;&lt;BR /&gt;fdisk -lu /dev/hda&lt;BR /&gt;&lt;BR /&gt;Disk /dev/hda: 120.0 GB, 120060444672 bytes&lt;BR /&gt;255 heads, 63 sectors/track, 14596 cylinders, total 234493056 sectors&lt;BR /&gt;Units = sectors of 1 * 512 = 512 bytes&lt;BR /&gt;&lt;BR /&gt;   Device Boot      Start         End      Blocks   Id  System&lt;BR /&gt;...&lt;BR /&gt;/dev/hda6        21109473    31358879     5124703+  83  Linux&lt;BR /&gt;&lt;BR /&gt;df -kl |sort&lt;BR /&gt;...&lt;BR /&gt;/dev/hda6              5044156    365184   4422740   8% /home&lt;BR /&gt;&lt;BR /&gt;grep /home /etc/fstab&lt;BR /&gt;LABEL=/home             /home                   ext3    defaults        1 2&lt;BR /&gt;&lt;BR /&gt;tune2fs -l /dev/hda6 |grep Block&lt;BR /&gt;Block count:              1281175&lt;BR /&gt;Block size:               4096&lt;BR /&gt;Blocks per group:         32768&lt;BR /&gt;&lt;BR /&gt;We have 8 sectors in a block = 4096 / 512&lt;BR /&gt;&lt;BR /&gt;Thus: the block offset number within the partition is 987882&lt;BR /&gt;&lt;BR /&gt;bc&lt;BR /&gt;( 29012535 - 21109473 ) / 8&lt;BR /&gt;987882&lt;BR /&gt;quit&lt;BR /&gt;&lt;BR /&gt;29012535 = bad sector&lt;BR /&gt;21109473 = first sector of partition&lt;BR /&gt;&lt;BR /&gt;which debugfs&lt;BR /&gt;/sbin/debugfs&lt;BR /&gt;[root@hp-interex ~]# debugfs&lt;BR /&gt;debugfs 1.37 (21-Mar-2005)&lt;BR /&gt;debugfs:  open /dev/hda6&lt;BR /&gt;debugfs:  icheck 987882&lt;BR /&gt;Block   Inode number&lt;BR /&gt;987882  481248&lt;BR /&gt;debugfs:  ncheck 481248&lt;BR /&gt;Inode   Pathname&lt;BR /&gt;481248  /boinc/BOINC/slots/0/skygrid_0750Hz_S5R3.dat&lt;BR /&gt;debugfs:  quit&lt;BR /&gt;&lt;BR /&gt;So I stopped boinc, and moved the impacted file.&lt;BR /&gt;&lt;BR /&gt;ls -l /home/boinc/BOINC/slots/0/skygrid_0750Hz_S5R3.dat&lt;BR /&gt;-rw-rw-r--  1 boinc boinc 4552614 Sep  2 20:45 /home/boinc/BOINC/slots/0/skygrid_0750Hz_S5R3.dat&lt;BR /&gt;&lt;BR /&gt;We could move this 4 MB file to e.g. /home/badblocks/ and ask boinc to abort processing of this file.&lt;BR /&gt;&lt;BR /&gt;Or it could be that boinc will skip this file automatically, when we start boinc up again, after moving the file containing the bad block.&lt;BR /&gt;&lt;BR /&gt;We can give it a try.&lt;BR /&gt;&lt;BR /&gt;mkdir /home/badblocks&lt;BR /&gt;&lt;BR /&gt;mv /home/boinc/BOINC/slots/0/skygrid_0750Hz_S5R3.dat /home/badblocks/&lt;BR /&gt;&lt;BR /&gt;Note that we must move the file within the "same" partition ... we moved it to a badblocks subdirectory.&lt;BR /&gt;&lt;BR /&gt;Better double check&lt;BR /&gt;&lt;BR /&gt;debugfs&lt;BR /&gt;debugfs 1.37 (21-Mar-2005)&lt;BR /&gt;debugfs:  open /dev/hda6&lt;BR /&gt;debugfs:  icheck 987882&lt;BR /&gt;Block   Inode number&lt;BR /&gt;987882  481248&lt;BR /&gt;debugfs:  ncheck 481248&lt;BR /&gt;Inode   Pathname&lt;BR /&gt;481248  /badblocks/skygrid_0750Hz_S5R3.dat&lt;BR /&gt;debugfs:  quit&lt;BR /&gt;&lt;BR /&gt;Yes, we did it !!! If we never move or delete this file, the bad block will stay within and does not harm us any more...&lt;BR /&gt;&lt;BR /&gt;We will simulate the sector read error:&lt;BR /&gt;&lt;BR /&gt;dd if=/home/badblocks/skygrid_0750Hz_S5R3.dat of=/dev/null&lt;BR /&gt;&lt;BR /&gt;dd: reading `/home/badblocks/skygrid_0750Hz_S5R3.dat': Input/output error&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Now we can restart boinc&lt;BR /&gt;&lt;BR /&gt;And yes, it skips this file that it could no longer find, and automatically recoveres processing by downloading a new file to process... notice 99 % CPU now, which is what we want.&lt;BR /&gt;&lt;BR /&gt;ps -fu boinc&lt;BR /&gt;UID        PID  PPID  C STIME TTY          TIME CMD&lt;BR /&gt;boinc    31263     1  3 23:30 pts/2    00:00:00 ./boinc&lt;BR /&gt;&lt;BR /&gt;  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND&lt;BR /&gt;31277 boinc     39  19 25624 6620   12 R 99.2  3.5   0:06.92 setiathome-5.27&lt;BR /&gt;&lt;BR /&gt;We do no longer have I/O wait times...&lt;BR /&gt;&lt;BR /&gt;vmstat 5&lt;BR /&gt;procs -----------memory---------- ---swap-- -----io---- --system-- ----cpu----&lt;BR /&gt; r  b   swpd   free   buff  cache   si   so    bi    bo   in    cs us sy id wa&lt;BR /&gt; 1  0  92352  12496   5064  29672    1    1    56    33  181    64  7  6 10 77&lt;BR /&gt; 1  0  92352  12468   5080  29672    0    0     0    14 1014    41 100  0  0  0&lt;BR /&gt; 1  0  92352  12484   5096  29672    0    0     0    18 1020    47 100  0  0  0&lt;BR /&gt;&lt;BR /&gt;The Hardware_ECC_Recovered is always and rapidly increasing ... seems not OK ??&lt;BR /&gt;&lt;BR /&gt;195 Hardware_ECC_Recovered  0x000a   100   100   000    Old_age   Always       -       434019663&lt;BR /&gt;195 Hardware_ECC_Recovered  0x000a   100   100   000    Old_age   Always       -       434019677&lt;BR /&gt;&lt;BR /&gt;And a serious indication of the near death of the disk ??&lt;BR /&gt;&lt;BR /&gt;Disk should be replaced immediately? Serious HW problem ??&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;* I have now found the command how to measure the disk temerature, and to alarm on temperature problems:&lt;BR /&gt;&lt;BR /&gt;smartctl -A /dev/hda&lt;BR /&gt;...&lt;BR /&gt;194 Temperature_Celsius     0x0022   145   094   000    Old_age   Always       -       31&lt;BR /&gt;&lt;BR /&gt;disktemp=$(smartctl -A /dev/hda |awk '/Temperature_Celsius/ {print $10}')&lt;BR /&gt;&lt;BR /&gt;echo $disktemp&lt;BR /&gt;31&lt;BR /&gt;&lt;BR /&gt;if [ $disktemp -gt 31 ] ;then echo "Disk temperature alarm" ;fi&lt;BR /&gt;</description>
      <pubDate>Wed, 30 Jan 2008 23:11:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-locate-a-sector-into-the-file-system/m-p/4137863#M31492</guid>
      <dc:creator>Geert Van Pamel</dc:creator>
      <dc:date>2008-01-30T23:11:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to locate a sector into the file system</title>
      <link>https://community.hpe.com/t5/operating-system-linux/how-to-locate-a-sector-into-the-file-system/m-p/4137864#M31493</link>
      <description>&amp;gt;&amp;gt;&amp;gt; Disk should be replaced immediately? Serious HW problem ??&lt;BR /&gt;&lt;BR /&gt;Don't know, but as it is a IDE disk (according to /dev/hd*), IDE didsks are not "smart" to avoid the usage of badblocks, and also, is true that badblocks happens. Your options are:&lt;BR /&gt;&lt;BR /&gt;- Run fsck with -c argument (badblocks verification - must be done offline). This will avoid the usage of badblocks in your disk.&lt;BR /&gt;- Replace the disk&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 31 Jan 2008 12:37:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/how-to-locate-a-sector-into-the-file-system/m-p/4137864#M31493</guid>
      <dc:creator>Ivan Ferreira</dc:creator>
      <dc:date>2008-01-31T12:37:23Z</dc:date>
    </item>
  </channel>
</rss>

