<?xml version="1.0" encoding="utf-8"?><!DOCTYPE article  PUBLIC '-//OASIS//DTD DocBook XML V4.4//EN'  'http://www.docbook.org/xml/4.4/docbookx.dtd'><article><articleinfo><title>OnSiteVisits/20100130</title><revhistory><revision><revnumber>1</revnumber><date>2010-03-06 06:27:40</date><authorinitials>RichardDarst</authorinitials><revremark>add my notes of sector layouts and changes this day</revremark></revision></revhistory></articleinfo><section><title>Info about what was wrong</title><screen><![CDATA[all sizes are in SECTORS=512 bytes
]]><![CDATA[
312500000  sda  (same layout for sdb)
1959866    sda1
15631244   sda2
294905204  sda3
]]><![CDATA[
15631104   md0
294904960  md1
]]><![CDATA[
1959864    sda1 filesystem size
294904960  md1 filesystem size = 36863120 4096-byte blocks
]]><![CDATA[
312496135  sector causing I/O error write (sda and sdb)
294904960  sector causing I/O error, offset from sd?3 start.
]]><![CDATA[
256        sectors for raid superblock (at end of device)
]]><![CDATA[
partition table for both sda and sdb:
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63     1959929      979933+  83  Linux
/dev/sda2         1959930    17591174     7815622+  fd  Linux raid autodetect
/dev/sda3        17591175   312496379   147452602+  fd  Linux raid autodetect  
]]><![CDATA[
=== to do ==
]]><![CDATA[
294904960  sector causing I/O error, offset from sd?3 start.
]]><![CDATA[
]]><![CDATA[
294904896 new target partition size (not actually going to resize)
294904640 new target filesystem size (partition size minus 256-sector superblock)
294904384 new target filesystem size (partition size minus 512 sectors for safety)
 36863048  new filesystem size, in sectors (part-512sectors)
294904704  sector minimum filesystem size to create.
]]><![CDATA[
]]><![CDATA[
resize2fs 
]]><![CDATA[
]]><![CDATA[
mdadm --grow]]></screen></section><section><title>actually done to fix it this day</title><screen><![CDATA[fsck -f /dev/md1
resize2fs /dev/md1 -p 36861840
# resized to 36861840 4Kblocks, 294894720 sectors, 147447360 KiB
]]><![CDATA[
mdadm --grow --size=147447360 /dev/md1
]]><![CDATA[
resize partition to 294894720 + 512 sectors = 294895232 sectors = 147447616 KiB
fdisk /dev/sdb
>>> u
>>> d 3
>>> n p 3 \n  +294895232
mdadm --add /dev/md1 /dev/sdb3 #NOTE a=b, b=3 in the live system
(wait for sync)
]]><![CDATA[
mdadm --fail /dev/md1 /dev/sdc3
mdadm --remove /dev/md1 /dev/sdc3
]]><![CDATA[
fdisk /dev/sd3
>>> <same>
]]><![CDATA[
mdadm --add /dev/md1 /dev/sdc3
(wait for sync)
]]><![CDATA[
reboot, and it works!
]]><![CDATA[
]]><![CDATA[
== New layout and stuff ==
   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63     1959929      979933+  83  Linux
/dev/sda2         1959930    17591174     7815622+  fd  Linux raid autodetect
/dev/sda3        17591175   312486407   147447616+  83  Linux
]]><![CDATA[
]]><![CDATA[
New sector error:
end_request: I/O error, dev sda, sector 312486279]]></screen></section></article>