Home NAS (Advanced) • Linux 3.16 kernel for Linksys Mediahub 300/400 series

Linux 3.16 kernel for Linksys Mediahub 300/400 series

 - 

Last year I’ve created a patched 3.8.13 kernel for the Linksys Mediahub NMH300 and 400 NAS series and I’ve received alot of compliments and questions about this kernel. I also stated that creating a more recent kernel would not be possible because of the migration to Device Tree. It seems that the regular boot methods (using ATAG) have been returned as well so I’ve created a newer kernel again!

This time it’s the new and fresh 3.16 release and contains the following key parts:

– LVM / RAID / DM support (this was being asked for alot)
– All major filesystems (EXT4 / Reiser / XFS / JFS / BTRFS / NTFS)
– Support for memory compression, compressed swap pages (ideal for low memory systems like this)
– LED’s are working now (only NMH300 models at this point)
– Network filesystems CIFS and NFS (client/server)
– IPv6 support
– iptables/conntrack support
– I2C support
– USB storage / printer support

Other options and settings like:
– Filesystem caching manager (speeds up remote mount access by caching the dirlist etc)
– AppleTalk support
– Scheduler set to “noop”
– Several kernel debugging options disabled for smaller kernel
– Kernel compressed using LZMA
– Kernel reports timestamps with it’s entries (in dmesg)

Stuff not working:
– The LED’s on the NMH400 series
– Buttons on the NMH300 and NMH400 series
– NAND access
– FAN control
– LCD on NMH400

Needs testing:
It seems that this newer kernel release has SHA and AES encryption methods for ARM CPU’s. I’ve compiled the kernel using the ARM type modules. I don’t know if it will speed up any SCP / Rsync actions or such and that it is even supported in the Orion SoC’s.

Conclusion so far:
I’ve got this kernel running for a couple of days now on my NMH300 and seems to be running just fine. I can’t say that it is running notably faster than the old kernel, but apart from the memory compression options available in the newer kernel the options are pretty much the same and no improvements were made and it is still the same weak CPU.

Download:
The kernel is now available from my download section, once downloaded you have to extract the contents of the archive to the root directory of the filesystem (that is: / ). If you have mounted the boot partition on /boot/ the kernel images are being placed on that partition as well, else you should mount and copy the kernel image yourself. The archive currently is 6.4MB in size.

Author:langerak

27 responses to “Linux 3.16 kernel for Linksys Mediahub 300/400 series”

  • leandro 29-09-2014 at 14:08 Reply 

    Hi, I was at the blog some years ago when you dissect the nmh300, I bought one at 2010, and leave it after a dead disk, the point is that it was a reiserfs + raid configuration, and the file rescue was hard at that time. Now I wish to give it a new life … so I have some questions.
    – there’s a comment talking about MBR vs GUID, so I think I should put a MBR on the selected disk, that’s right? (if not, the NMH will try to reformat the disk)
    – further steps indicate that I can use apt, I imagine that is to get new apps, can they be installed directly from the repository? they work? (I need a media music server, vaguely remember reading about one installed and a torrent client)

    thank you sr!


    • langerak 29-09-2014 at 15:06 Reply 

      Hi there! It’s correct that the setup is using softraid and reiserfs and therefore will take alot of time to recover your files if you are even able to mount the disks :)!

      The disks used by the NAS may both be MBR and GUID, but the disk where uBoot load it’s kernel from MUST be MBR as uBoot does not know how to load data from GUID partitioned disks. So in theory the second disk you add may be GUID but I advise you to just stick with MBR for both disks to prevent disks from not recognizing.

      If you use the Wheezy prepared system on the NAS with the kernel I supply you are able to fully use the software packages that Debian provides. This is indeed used for new apps but for upgrades as well. For MP3 server you can use something like “forked-daap” and “transmission” for setting up a torrent server.

      Basically anything you can do with a regular Debian based server is possible to install on the NAS, but as you will understand: the power and RAM is the limiting factor here. So some applications you install may need some finetuning.


  • leandro 29-09-2014 at 16:44 Reply 

    ok, will try it these days …

    I’m not a linux rookie nor an expert, and I used to install my machines with reiserfs, but the only (I mean, I tried a lot) way I could recover the lost files from a nmh300 was using a Windows (some kind of shame) utility called Diskinternals, I was not at softraid, so it saved my photo-life http://www.diskinternals.com/linux-reader/

    Will install it a write the results, the original firmware comes with a handy Twonky Media Server that I used to love, you can configure it independently at the 9000 port.


    • langerak 03-10-2014 at 09:22 Reply 

      Hi,

      That is a good recovery program indeed, I’ve used it a couple of times myself before crashing into Linux land :).

      Twonky was part of the firmware indeed and is a commercial licensed product, so it will not be available within the Debian repo’s, although some good alternatives exists like MediaTomb and has a web interface as well (and looks ugly as hell, but serves it purpose very well) and has some transcoding / device specific support, you should check it out.


    • leandro 13-10-2014 at 21:34 Reply 

      smooth process, mediahub is up with the new kernel now, let’s see what can be done

      Thanks!!!

      root@mediahub:/# uname -a
      Linux mediahub 3.16.0-langerak #1 Tue Aug 5 10:18:04 CEST 2014 armv5tel GNU/Linux
      root@mediahub:/# date
      Mon Oct 13 19:46:33 UTC 2014


      • leandro 16-10-2014 at 18:53 Reply 

        langerak, thanks again, I’m very happy with the new toy, mediatomb is up, the system is very stable and now i’m fighting with cifs/samba best config, not too poor the cpu, maybe a little shot in memory.

        There’s a thermal agent installed?


        • langerak 20-10-2014 at 16:34 Reply 

          Nice to see you got it up and running again and that it runs stable (something it did not with the original firmware). Samba can be finetuned in the smb.conf, I’m currently testing some settings which have boosted my read speed to around 26MB/sec and 12MB/sec for writing to the NAS where my stock speeds are stuck around 10 ~ 12MB/sec. Once I’m done testing I’ll write a post about this finetuning process!

          Thermal management is not available, though the CPU has a thermal feature it is not supported in the mainline Linux kernel and requires patching. You can however read the harddisk temperatures using hddtemp for example.


  • leandro 23-10-2014 at 14:26 Reply 

    I was playing with mediatomb and found that the process of adding music is very slow, don’t know yet if is the disk or the sqlite/mysql, I will wait anxiously for the new kernel


    • langerak 24-10-2014 at 21:06 Reply 

      Hi,

      You should stick with SQLite as it is less resource intensive and does not a daemon to be running :). Adding stuff can be slow indeed, that’s more to blame on the CPU and because of that the disks will never reach the speed they can manage. You can install “atop” and run that to see what consumes the most, disk or CPU.

      There won’t be any newer kernel at this point, it’s nice to have the NAS running such a new kernel and prepares it to be able to run decently the next couple of years but as applications are getting heavier, the CPU will become the limiting factor. For example, I have a EDMini V2 from Lacie with the same CPU, I have this unit in posession since 2009 and was released in 2007, in this case the CPU is at least 7 years old :). But yet still it’s nice to be able to run the almost newest Linux kernel on it!


  • leandro 25-10-2014 at 12:53 Reply 

    ok, teach me to tweak the disk 🙁

    top shows a hi wait on io value (above 60%) during media add, almost read.


    • langerak 03-11-2014 at 10:36 Reply 

      But that is not strange since the data is beind read from disk and written to the disk (SQLite database). Any disktuning is not possible for this NAS. I’ve already optimized as much as possible within the kernel, a simple I/O scheduler is used (noop). You can try using the “hdparm” commant to tune your disks, but my experience is that most of the performance gains that hdparm can offer is already default nowadays.


  • Martijn Hinderdael 19-11-2014 at 08:10 Reply 

    I am thinking about installing your image on my NMH300: Two questions though:
    -Will installing Debian have influence on the amount of harddrives I should expect to work with the Mediahub? My particular one has shown not to work out of the box with some new WD RED series disks.
    -Will the original OS still be available if I put in a new blank disk in instead of a pre-debian imaged disk?


    • langerak 30-12-2014 at 18:49 Reply 

      Hi,

      I’ve tested many harddrives in the Mediahub using 4K sector and regular drives and in this case 2 x 1TB WD RED disks and seemed to be working well. As far as I know the RED drives have 4K sectors which the old kernel in the Mediahub may not support, as my kernel is much newer this is not a problem, but feel free to test it and leave your findings here!

      Nothing regarding the original firmware will be touched, this is stored in flash memory and is not supported in my kernel so it cannot be overwritten. Just plug in any empty drive and the original software will start setting up itself.


Leave a Reply

Your email address will not be published. Required fields are marked*

*

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.