Category:Ix2-200-usb-init

From NAS-Central Iomega Wiki
Jump to: navigation, search

You can recover NAND and init new hard disks by preparing an USB Stick:

WARNING: Thist method may ignore existing data on the hard disks.

Only the five files from /boot/images/ are required for this operation

apps

config

initrd

oem

zImage

You can get the files by decrypting a firmware file:

openssl enc -d -aes-128-cbc -in "ix2-200-3.0.9.37355.tgz" -out ix2-200-3.0.9.37355-decrypted.tar.gz -k "EMCNTGSOHO"

To get config you can mount apps, copy and gunzip the config.gz file from usr/local/cfg

  • For each file you must create an .md5 file containing the MD5 hash
    • The .md5 must be 33 bytes long containing only the hash and a new line character (0x0A)
  • Pack all files in one GZip compressed Tar-Archive, the extension must be .tgz
  • The USB Stick should have a size of at least 2GB
  • The USB Stick must be formated in FAT32, if this is not working for you:
    • I used this tool to prepare the stick: [1] and removed the file in emctools/ix2-200d_images after that
  • Create a folder emctools and a sub folder ix2-200d_images
  • Copy the .tgz to the folder emctools/ix2-200d_images

You can automate the steps in linux or cygwin with this shell script:

mkix2usbimage

#!/bin/sh
ix2=/opt/nas-os/ix2-200-2.1.25.229-files
usb=/media/USB

find $ix2/images/ -name *.md5 -exec rm {} +
imgs=$(find $ix2/images/)
for img in ${imgs} ; do
  if [ -f $img ] ; then
    md5=$(md5sum $img)
    md5=${md5% *}
    md5=${md5% }
    echo "$md5" > $img.md5
  fi
done
cd $ix2/images/
tar czvf ../ix2-boot.tgz *

mkdir -p $usb/emctools/ix2-200d_images/
cp $ix2/ix2-boot.tgz $usb/emctools/ix2-200d_images/

NOTE: The script I posted first did not work, had to fix it and tested sucessfully.

To extract the files directly from firmware file use this script instead:

mkix2fw2usb

ifw=/opt/nas-os/ix2-200-3.0.9.37355.tgz
ofw=${ifw%.tgz}-decrypted.tar.gz
ix2=${ifw%.tgz}-files
usb=/media/USB

mkdir -p $ix2/images
mkdir -p $ix2/update
mkdir -p $ix2/apps

openssl enc -d -aes-128-cbc -in $ifw -k "EMCNTGSOHO" -out $ofw
tar xzvf $ofw -C $ix2/update/

imgs=$(find $ix2/update/)
for img in ${imgs} ; do
  if [ -f $img.md5 ] ; then
    mv $img $ix2/images/
    mv $img.md5 $ix2/images/
  fi
done

mount -o loop,ro $ix2/images/apps $ix2/apps
cp -p $ix2/apps/usr/local/cfg/config.gz $ix2/images/
umount $ix2/apps
gunzip $ix2/images/config.gz

img=$ix2/images/config
md5=$(md5sum $img)
md5=${md5% *}
md5=${md5% }
echo "$md5" > $img.md5

cd $ix2/images/
tar czvf ../ix2-boot.tgz *

mkdir -p $usb/emctools/ix2-200d_images/
cp $ix2/ix2-boot.tgz $usb/emctools/ix2-200d_images/

Now you can plug the new hard drives and the USB stick in your ix2, press and hold reset and power it on.

Hold reset until the activity LED of your USB stick starts blinking.

The ix2 will do the required steps and shuts itself down.

It may take over 10 minutes to complete. After 1 minute the activity LED of your USB stick should blink for 5-6 minutes. After ix2 is shutdown you can remove the USB stick and power on it again to boot the newly created system.

This category currently contains no pages or media.