Iomega ix2-200, Debian and iSCSI

I recovered an old Iomega ix2-200 from the dust of my apartment, hoping to use it as a storage NAS for backups with burp. I can’t use NFS (at least, it will be unsafe), so I was looking for an iSCSI export. The ix2-200 was advertized as iSCSI-enabled, however the performance were very bad and the box was freezing literaly every night.

Looking deeper (using SSH, that you can enable if you open the “hidden” support page), the cause was that the iSCSI was merely linked to a file that was stored in the NAS RAID filesystem. So the iSCSI initiator was sending an ATA command through an TCP/IP connection (so, packed in 4 levels of abstractions), then it was interpreted by some software onboard the ix2-200, executed as an high level action on the file which results in a ATA command from the NAS motherboard to the disks (?!?!?). Clearly, some engineer had some mental issues during the development of this “feature”.

So, I was looking around the internet for a newer firmware or something custom where I can fix this issue, and I found some useful pages from users (hackers) who managed to install a fully-fledged Debian (for ARMel architecture) on the ix2-200:

Due to aging, latest Debian supporting the network card in Debian installer was Squeeze, that now is in archive.debian.org (here you can find the kernel image and init ramdisk).

To do some experiments, I made the ix2-200 booting the Debian installer from my TFTP server. The transcript of useful commands is:

# This should disable the eth0 which is not available in ix2-200
setenv ethaddr AA:00:00:00:00:01

# Initial config
setenv mainlineLinux yes
setenv arcNumber 1682
saveenv
reset

# After the reset, we can boot the Debian installer
dhcp
setenv serverip 192.0.2.1
tftpboot 0x01100000 uInitrd
tftpboot 0x00800000 uImage

setenv bootargs console=ttyS0,115200n8 base-installer/initramfs-tools/driver-policy=most debian-installer/allow_unauthenticated=true
bootm 0x00800000 0x01100000

Some details:

The installation will proceed fine until the section that is supposed to setup a bootable system (bootloader installation). On error, we need to drop in a shell and save Linux kernel and init ram disk:

apt-get install mtd-utils uboot-mkimage uboot-envtools
cd /boot
mkimage -A arm -O linux -T ramdisk -C gzip -a 0x00000000 -e 0x00000000 -n initramfs -d initrd.img-2.6.32-5-kirkwood uInitrd
mkimage -A arm -O linux -T kernel  -C none -a 0x00008000 -e 0x00008000 -n Linux-2.6.32-5 -d vmlinuz-2.6.32-5-kirkwood uImage

mount /dev/sdXX /mnt
cp uImage /mnt/uImage-new
cp uInitrd /mnt/uInitrd-new
umount /mnt

Now we can restart into the bootloader, and then:

usb start
setenv bootargs_console 'console=ttyS0,115200 mtdparts=orion_nand:0x300000@0x100000(uImage),0x1000000@0x540000(uInitrd) root=/dev/mapper/vg1-lv--root'
setenv bootargs $(bootargs_console)
ext2load usb 0:1 0x00800000 /uImage-new
ext2load usb 0:1 0x01100000 /uInitrd-new
bootm 0x00800000 0x01100000

If you installed the system in the USB drive, you can use root=/dev/sdc1.

If the system boots ok, then we can save the kernel and boot options:

# cat /proc/mtd
dev:    size   erasesize  name
mtd0: 00300000 00004000 "uImage"
mtd1: 01000000 00004000 "uInitrd"


# flash_eraseall /dev/mtd0
Erasing 16 Kibyte @ 300000 -- 100 % complete.
# flash_eraseall /dev/mtd1
Erasing 16 Kibyte @ 1000000 -- 100 % complete.
# nandwrite -p /dev/mtd0 /boot/uImage
...
# nandwrite -p /dev/mtd1 /boot/uInitrd
...


# Reboot


setenv mtdids 'nand0=orion_nand'
setenv mtdparts 'mtdparts=orion_nand:0x100000@0x000000(uboot)ro,0x20000@0xA0000(uboot_env),0x300000@0x100000(uImage),0x1000000@0x540000(uInitrd)'
setenv bootargs_console 'console=ttyS0,115200 mtdparts=orion_nand:0x300000@0x100000(uImage),0x1000000@0x540000(uInitrd) root=/dev/mapper/vg1-lv--root'
setenv bootcmd 'setenv bootargs $(bootargs_console); nand read 0x800000 uImage; nand read 0x1100000 uInitrd; bootm 0x00800000 0x01100000'
saveenv
reset

If you installed the system in the USB drive, you can use root=/dev/sdc1.