Installing Debian to disk on an ix2-200

Warning: This completely removes the existing filesystems from disk and kernel images from the flash that ship with the ix2-200 and leaves you with a basic Debian install. Only do this if you understand what this means and have nothing important stored on the device.

uBoot Parameters

The first step in installing Debian that I did was to reconfigure the uBoot environment to fix a number of issues. This is done from the uBoot prompt, which is only accessible via a serial interface.

Update the MAC address of the disconnected ethernet port on the SoC to an address from an unused range so that udev doesn’t get confused:

setenv ethaddr AA:00:00:00:00:01

Enable booting of a standard linux kernel

setenv mainlineLinux yes
setenv arcNumber 1682

Save and reset

saveenv
reset

Booting the Debian installer and completing the install

I used the published debian installer images from here copied to a ext2 formatted usb stick. I connected the usb stick to the front port of the ix2-200.

You should also have the ix2-200 connected to the internet somehow. A simple way of doing this for me was to connect to the Ethernet port of my laptop running Ubuntu and bridge it with the virtual bridge I use for running VirtualBox VMs and provides DHCP and NAT. Internet connectivity can than be used through another connection e.g. a home wireless connection. You can do this by running the following command on the laptop:

sudo brctl addif virbr0 eth0

From uBoot on the ix2-200, start the usb subsystem and load the netboot installer kernel and initial RAM disk into memory:

Exit the shell and reboot into uboot by selecting the “Finish the installation” option. At this point we should be able to now boot from disk using the uInitrd and uImage files on usb. Note that I also setup the mtd in the bootargs_console setting so we can write the kernel and initrd files to flash once we know it’s working. Replace the root value with what ever you setup during the install:

Hi,
Great post! Thank you! Can you also post the performance achievements? For example: How many mb/s read/write can be archived with fresh debian+smbd. Or CPU usage at full load. Some real-world examples will be helpful. Thank you!

I haven’t done much testing, but using NFSv3 I can get >20MB/s read and write on large files e.g. 500MB. The CPU is ~80% at this rate. I haven’t tried samba.

I’ve also tried getting nfsv4 working using the instructions from here , but I’ve run into some strange behaviour where performance drops off significantly for larger files. I’ve posted to the linux-nfs mailing list about it and I’m hoping someone there can help.

“ALERT! /dev/mapper/ does not exist. Dropping to a shell!” is the clue where it’s going wrong. What was the name of the LVM volume that should be mounted as root? Once you have that, you should change root parameter when booting linux. E.g. for me I use vg0-root as the volume and the command is the following:

is it just an updated uboot?
nigelr im considering putting up one of these blogs aswel to keep track of my own installation procedure and kernel building would you mind if i borrowed some of the stuff that you have done like the pictures and perhaps parts of your instructions? (because im lazy and dont wanna have to type everything again lol)

hi all, is there option to make nas go to sleep and spin off hard drives? that hdds run all the time is irriting me, and last week one of them fail after year 😦
better with original iomega fw, or something with web management, i am not so big linux geek 🙂
i think that something like run linux from usb stick will solve this. like here http://spblinux.de/arm9/README.txt

you could also look at using the hdparm command. hdparm -S 12 should allow the drive to power down after 1 minute of no activity. You’ll need to cut right back on logging to make this work properly though.

I think this is because there are applications still writing to the disk. Perhaps using USB is the best way of doing this, and it should be easy enough to redo the Debian install with a USB flash drive connected.

This tells the kernel the flash partitions I want to use, and you’ll note that I’ve only included partitions for uImage and uInitrd which are well outside what is used for uboot (0x4000@0xc0000). This makes it much harder to accidentally overwrite uboot.

It does overlap. I think this intentional by the people who designed uBoot, perhaps to allow the config to be addressed seperately and included in a single image that is written to the uboot partition.

I think kernel 3.4 is broken i had it on my ix2-200 and im using nfs and the kernel kept panicing and crashing. so i went back to the 3.3.8 kernel and no problems since im also using wheezy not squeeze so it could possibly be a problem with the samba version in squeeze.

just tried the 3.5rc5 with the ix2-200 and it stops at waiting for the root partition on boot so we may have some trouble with the 3.5 kernel unless they have changed something else in the config maybe?

Hi,
Thanks for putting this together, I’m 90% of the way there. I’m running into the same problem as Giancarlo. I first made the mistake of blindly copying your root= argument and not replacing it with the proper path. I recorded the message at the end of the install that said it couldn’t make the system bootable and to manually specify root=/dev/sdb2. Even after doing that it still doesn’t work. Upon further investigation I found that the blkid command returned the following:

Are sda and sdb always detected in the same order? Perhaps sometimes you want to boot off /dev/sda2 instead depending on what disk gets detected first? If that’s the case, you’ll want to specify the UUID in the boot command rather than the dev name.

That did it! After I left that message I did some more research and it was looking like that was the problem, but when I’d run blkid it would show /dev/sdb2 as pointing to the right drive/partition, so I’m not sure why it wasn’t working. But regardless, it is now.

For those interested, the exact syntax for the root command was as follows:

root=UUID=

Thanks again for putting this all together, I never would have figured this all out on my own!

You mean leave a serial console open to it? I can try that. My guess is some kind of kernel panic too, but I’m not getting much to go by (or I don’t know where to look). Yes, I’m just using the default kernel, no patches or anything custom.

Actually, just noticed it’s dead this morning after a reboot maybe 15 hours ago, usually it takes longer than that.

Still crashing, here’s another report with maybe some more info? Thanks for trying to help, I probably should have just stuck with Iomega’s firmware, this is just well above my troubleshooting abilities!

windows would be a waste of time on 1 of these for a start there is no graphics chip so you would not be able to see anything. i have had both squeeze and wheezy running on mine without issue for over a year.

have you not tried compileing a custom newer kernel to see if that fix’s your issue? or try wheezy instead of the old squeeze?

I hear what you’re saying about Windows, my comment was more anecdotal than anything else 🙂

It appears my problem is worse now, yesterday I ran an apt-get update/upgrade and updated several packages, now the box is crashing everyday. And to make matters worse it doesn’t seem to be rebooting automatically like I told it to! I’ve used Linux off and on for 10 years and this has generally been my experience, it just doesn’t work. But I realize that isn’t the experience of many people out there.

As for compiling a new kernel, I’ve tried but I usually hit a point where I get above my head and I give up. Maybe I’ll give it another shot and report back here with questions, I just hate to be that guy that’s bothering people who know what they’re doing with silly questions Don’t get me wrong, I’m not completely useless in Linux, I have no problem writing shell and RC scripts, setting up Apache, Samba, etc. but I’ve never had luck messing with kernels. The only way I was able to get Debian going on this was thanks to the great instructions on this blog.

Yeah there’s always been some reference to ext3, didn’t think much of it. Could you possibly upload your compiled kernel for me to test? I imagine it would work fine since the hardware is exactly the same. Also, I noticed the webmin package I had on there would kernel oops occasionally, so I just got rid of it entirely. So far the NAS has been up for 1 day and 16 hours without a crash, but then again it’s gone a week in the past, so maybe that’s meaningless. I’m almost positive I’ve been having this issue before I installed webmin, so I still don’t think that’s the main problem, but we’ll see.

What version of the kernel package are you using? The latest is 2.6.32-46. You could try regenerating the uImage/uInitrd files from the latest kernel image and write them to flash using the instructions in one of my posts. You could also try doing an fsck of the filesystem to see if it’s being triggered by corruption of some kind. I don’t have an easily installed kernel package of the kernels I used, so if this doesn’t work you could even try one of the kernels from the backports repository.

Why is there a discrepancy between “2.6.32-5-kirkwood” and “Debian 2.6.32-45”. Also, when I run apt-get update / apt-get upgrade it says everything is up-to-date. So I’m not sure how I get a hold of 2.6.32-46. So far over 2.5 days without a crash…

Well I went ahead and made new uBoot files out of the uImage and uInitrd files I had in /boot and wrote them to onboard flash and rebooted. Now it’s reporting I’m on 2.6.32-46, so I think during an update process the new kernel got downloaded and I didn’t notice, so that’s why it was reporting being up-to-date. I’ll let it run like this and we’ll see how it goes.

Well I hope I’m not jumping the gun but I think you were on to something with the fsck. Changing to the new kernel didn’t work, it still crashed within a day. I then decided to run a fsck as you suggested and so far I’ve been up for 10 days, definitely a record. I’ll keep and eye on it, but unless I report back, I think that solved it! Thanks for all the help, I really appreciate it!

Maybe the new ones don’t boot from flash at all and the flash is only used for u-boot itself? What do the u-boot and kernel boot messages tell you about the flash size and where the kernel images are being read from?

I assume this means the kernel image and initrd are stored on the disks. With a bit of experimenting it should be easy enough to figure out how to write the files to the write parts of the disk, perhaps using ‘dd’. Alternatively you could just boot from a usb flash drive you leave plugged in.

Yes, i had made many experimentation with a USB, but the kernel won’t load. After some research, the new ix2 doesn’t the same ARM Core (a ARMADA 300 (88F6282) ).
So I have to make my own kernel image by cross compiling 🙂 (with the sources given by EMC)

Hey guys,
I do need a bit of help – if that’s possible of course.
I had ix2-200 up and running with Debian Wheezy on it for a nearly a year now.
So I have decided to upgrade drives to something a bit bigger that 2x1TB and thought that would be good to do fresh install – you know, new beautiful life for my oldy.
But that was a split of the second when I have realised that I have done something wrong.
My mistake was – “flash_eraseall /dev/mtd0”
Why? Because on “cat /proc/mtd” I did get
mtd0: “uBoot” itself
and
mtd1 was “uImage”
ans
mtd1: “uInitrd”
So I have erased uBoot itself by accident…

I had it running still on Debian for a few weeks while I was trying to build my own uBoot (as replacement for the erased one) and when I thought I had it decided to reboot and see…
Unfortunately I haven’t seen anything…

Basically something went wrong so no uBoot and therefore on signs of life…

Can someone please dump their uBoot NAND image and share it with me?
Much appreciated.

I followed this excellent tut – during install I just chose one drive (with lvm on top) – now im curious if it is possible to install RAID afterwards. Basically yes, it will work with Debian …
But my problem – as I am almost newbie on linux – I am not able to install Grub or anything similar …

Is there a chance for me to install second drive within RAID afterwards ?

By the way – I also have trouble with command “make menuconfig”; but that’s not so important to me at the moment 😉

It’s possible to setup RAID after install by configuring the other disk as one half a RAID mirror the way you want it setup and copying the data before adding the other disk to the mirror. It’s probably quite complicated though and it maybe easier to backup and reinstall with the disk partitions you want. Maybe there’s a how to somewhere? Grub won’t work, but it’s not needed either (booting is handled by uBoot).

So, to my clarification – as I don’t need LILO or Grub, which I thought would be prerequisite – can you briefly advice how to update bootloader (which might be the crux) ?
Do I just need to setup things with mdadm and then mkimage of uImage and reflash ?

Yes, I’ve done this and it works well. One thing I haven’t tried is use a different part of flash for the custom kernel/uImage. In theory, this would let you restore the ix2-200 back to its default state.

It causes “Kernel” CRC FAILS, on last step (booting from flash) because of “erroneous” location of u-boot env in flash. I could boot the kernel + initrd from tftpboot (USB Disk cant be readed by this bootloader …. timeouts in many different disk).
So to those that had fighting for this error here is the cause: Inside the booted linux from tftp i readed the uImage from mtd0 and started to compare… at offset 0x004000 there is the u-boot env (ah!!! …because when it wrote uImage to flash caused uboot to reflash env defaults… uhmmm…)
So i went digging…
NOTE: env_start=0x84000 , env_size=0x4000 (it could be readed with printenv)
Marvell>> saveenv
Saving Environment to NAND…
Erasing Nand…Writing to Nand… done
Marvell>> nand write.e 0x00800000 uImage

OK – i thought – sooo… what if i put kernel at 0x110000… and – just because i will shift addresses let’s put uInitrd on some lower address (kernel tops up at 0x410000) so i put initrd starting at 0x510000 (random > 0x410000 )