Emergency recover procedure for TSLive

From a post on Buffalo Technology forums.
  1. Emergency boot
  2. Gain telnet access using ACP_Commander (remember that this voids warranty).
  3. Re-assemble all arrays as follows:
    1. mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1 /dev/sdc1 /dev/sdd1
    2. mdadm --assemble /dev/md1 /dev/sda2 /dev/sdb2 /dev/sdc2 /dev/sdd2
    3. mdadm --assemble /dev/md2 /dev/sda6 /dev/sdb6
    4. mdadm --assemble /dev/md3 /dev/sdc6 /dev/sdd6
    Note that my TSLive has been repartitioned to have two RAID1 volumes, for this reason there is also /dev/md3.
  4. (Optional, check if applies) if any devices are bad, you'll see the message that the array was assembled with three (one) out of four (two) drives. If this occurs, add that drive back in as follows:
    1. mdadm -a /dev/mdX /dev/sdyZ
    where X, y, and Z depend on which disk is bad in which array. It may take some time to re-add the faulty device to the array. You can check progress using
    1. cat /proc/mdstat
    1. mdadm --detail /dev/mdX
  5. Once all 3 (4) arrays are re-assembled, you need to mount them as follows:
    1. mount /dev/md0 /boot
    2. mount /dev/md1 /rootfs
    3. mount /dev/md2 /mnt/array1
    4. mount /dev/md3 /mnt/array2
  6. Use vi to edit /etc/melco/diskinfo to ensure correct info:
    1. array1=raid5
    2. array2=raid5
    3. disk1=array1
    4. disk2=array1
    5. disk3=array1
    6. disk4=array1
    7. usb_disk1=
    8. usb_disk2=
    9. usb_disk3=
    10. usb_disk4=
  7. Ensure that /boot contains only initrd.buffalo and uImage.buffalo
  8. Use a windows PC to flash firmware
  9. Done!