What’s different regarding your older post?
I’ve managed to cross-compile a 3.8.13 kernel and got it booting on the NAS, therefore, there are no limitations regarding the Debian flavor you want to install and as a result we will be installing Debian Wheezy on the device.
Also the kernel has boot parameters set that will override the uBoot ones, therefore we only have to place the kernel image on the small partition and afterwards boot the system using the filesystem on the bigger partition (3rd).
The kernel is stuck at 3.8.13 at the moment and will not likely to get any support in newer kernel releases due to the fact that the kernel now uses Device Tree to configure all devices (means uBoot hands over it’s configuration to the kernel), which the uBoot on the MediaHub does not support, but this kernel should be sufficient for the next upcoming releases of Debian.
I’ve prepared a basic filesystem containing Debian Wheezy and have installed some basic administration tools:
– archive/package utilities
– SSH server
– NTP sync
I’ve included support for the system hardware as builtin modules in the kernel and the rest as modules, because uBoot is not able to load a kernel bigger than 2Mb. Some of the separate modules I’ve included are:
– USB disk/stick support
– Ext4, JFS and XFS support
– NTFS support
– NFS and CIFS support
– Appletalk support
– Preemption model set to “Server”
– I/O scheduler set to “noop”
(I’ve included the kernel sources with the kernel config on my downloads page, this is exclusively for use with the Mediahub so it can be rebuilt with the options you want)
You can use any 3,5″ SATA harddrive for this installation up to 2TB (anything bigger cannot be used due to the limitations of the 32-bit CPU). You also need to download the 2 mediahub files from my Downloads section (bottom of page).
Preparing the harddisk:
We now have to partition the harddisk for usage in the NAS, therefore the following partitions have to be created (I assume you have some knowledge on partitioning, formatting and mounting disks):
partition 1 - swap - 256MB
partition 2 - ext3 - 100MB (kernel)
partition 3 - ext4 - 20GB (rootfs)
partition 4 - ext4 - rest of remaing space for data
Partition 2 must be ext2 or ext3, else uBoot will not be able to load the kernel image from the disk as it does not support ext4 or any other filesystem and it may not exceed 300MB of space, else uBoot will not recognize the partition and it’s contents.
Partition 3 is set to 20GB for the root filesystem, you may change this to a higher or lower value or even all the space remaining on disk ignoring partition 4. I always like to separate the data partition from the OS partition so a reinstall can be done much more efficiently!
Mount the partitions 2 and 3 on your local machine and move on to the next step.
Installing the kernel:
Extract the contents of the “mediahub_boot.tgz” package to the root of partition 2, the 100MB partition.
Installing the filesystem:
Extract the contents of the “mediahub_fs.tgz” package to the root of partition 3, the 20GB partition.
Now modify the network interfaces file, because the installation was performed on my device which was eth0, but yours has a different MAC address, therefore will be eth1. Please move in the mounted directory for partition 3 and edit the following file:
Rename all “eth0” instances to “eth1”.
I’ve updated the archives with a newer kernel and fixed some filesystem issues, the renaming step is unnecessary anymore!
After the contents have been extracted, unmount the partitions. Preparation is now finished!
Booting the NAS
Place the prepared harddisk in your NAS, connect the network cable and plug in the power. The NAS should now be able to boot and boot time will take around 2 minutes (there is a loading delay in uBoot for the kernel).
Connecting to the NAS
I’ve set up the network interface to use DHCP, you should be able to obtain the IP-address taken by the NAS by looking at the DHCP table of your router or run a nmap for open SSH ports on your subnet.
Once you know the IP-address you should be able to log in via SSH with the root account, it’s password is “root”.
I advise you to change this immediately via the “passwd root” command.
You should now be connected to your NAS via SSH and be able to install all necessary software you want to run on the device, some things worth changing:
– The generated SSH hostkey
– The used APT mirror (is now set to Holland)
– The used timezone (is now set to Amsterdam)
– The used locales (is currently en_US and nl_NL using UTF-8)
– The root password
– Set the IP address to a static one
Using a 2nd disk:
If you plan to use 2 disks in the NAS you have to place the disk you’ve prepared in slot 2. uBoot tries to boot from the first SATA disk, but the slot numbers on the case itself and the mainboard are switched, so slot 1 on the case is slot 2 on the mainboard and vice versa. One booted you are able to partition the second disk as usual.
Functions not working:
The Mediahub has a reset and backup button which are GPIO controlled, the support of these buttons is currently not available and will not work, you might be able to create triggers yourself to perform certain tasks when pressing these buttons. Also the small LCD screen on the 400 series is not supported for now.
I recently became in posession of a NMH400 (thanks to Joost which is on this blog as well!), my software boots on the NMH400 just fine and the cardreader is working out of the box (it’s connected to an internal USB connector). The LCD screen is not controlled via a kernel module by the looks of it and it seems that some software is controlling this screen but I have yet to find out what this is.
I’ve updated the archives with the following fixes:
– Kernel on the NMH300 should now set the powerled to a fixed state (it stops blinking after booting has completely finished).
– Kernel on the NMH300 should now handle the harddisk leds the proper way, during I/O operations the appropriate led will blink blue. The earlier lit red led is now deactivated.
– The kernel still boots on the NMH400, but no actions are taken to fix leds etcetera, a separate kernel needs to be built for this device.
– The network fix from Simon Quigley (thanks!) regarding the removal of the interfaces caching file has been implemented, therefore the renaming of the interface name during the setup process is now unnecessary!