OpenWRT USB storage

Posted: 25th January 2013 by knoppi in Computer Stuff, Hardware, Linux
Tags: , , ,

This is a continuation of my last post OpenWRT on TP-Link WDR3600. It deals with the use of my TP-Link WDR3600 as a central file server.

Setting up USB storage

USB storage is addressed in USB Storage. I learned that I should install kmod-usb-storage kmod-fs-ext4 kmod-usb-storage-extras block-mount kmod-fs-vfat kmod-nls-cp437 kmod-nls-iso8859-1 (my USB stick was formatted as ext3, my hard disc as vfat with iso codepages).

I created a mount folder /mnt/share and modified /etc/config/fstab in a way that it now contains

config mount
option device '/dev/sda1'
option options 'rw,sync'
option enabled '1'
option target '/mnt/share'
option fstype 'ext3'

Of course user-id and group-id have to be present, as well as the mount point. /etc/init.d/fstab start led to an automatic mounting of the stick. With /ent/init.d/fstab enable I enabled this tho be started after every reboot. Now from the command line I can access the storage, create folders copy data, whatever.
As the disk space on the router’s flash disk is very limited I also added the line
dest usb /mnt/share/packages
to /etc/opkg.conf so with opkd -dest usb install package software is installed on the USB disk, which, then, of course, has to be attached if you want to use the software. Also not every software works without further configuration from USB storage.

File access

For file access I installed NFS and Samba (following Network File System (NFS) and Samba).
I had some additional work as I installed the Servers on the USB-stick, but the kernel-modules on the hard disc. In principle everything could by solved by adjusting the /etc/init.d scripts.
My NFS client then made problems. On my main computer, I’m running Chakra Linux. The solution to the error messages

mount.nfs: rpc.statd is not running but is required for remote locking.
mount.nfs: Either use '-o nolock' to keep locks local, or start statd.
mount.nfs: an incorrect mount option was specified

I found in NFS unter Chakra Linux and in the Chakra project forum. Additionally minor problems with NFS appeared, which could, however be resolved (again I know a bit more about NFS).

MiniDLNA

See HowTo on this link. I use this server to stream media over the network.

  1. […] First I thought, CUPS would be a good solution for the print server and as this needs storage space for spooling installing additional hard disc space seemed a good idea. As this ist not true for the chosen print server this section is not neccessary here and has been moved to a separate post. […]

  2. Stefan Amarandei says:

    Hi Knoppi,

    What speeds do you get when transferring files to/from the usb storage via samba ?

    Thanks!

    • knoppi says:

      Hi Stefan!

      I recently moved to another flat, so the TP-Link is a bit far away from me to test it right now. But telling from my experience with similar solutions and from the memories when working with the TP-Link, I would not suggest it as a NAS replacement. I did not check where the bottleneck is sitting, but it is rather slow.
      Maybe it is the USB controller, maybe the processor. I think it’s unlikely that the network is too slow. But I had system crashs when using it as UPNP-Server and quickly scrolling through a lot of media.

      • Stefan Amarandei says:

        Thank for the quick reply, what do you mean by slow ? I got 2MB/s the most through network, and whenever I tried copying from a flash drive to the external hard drive, I even got 1.2MB/s 🙂

        I don’t plan to use it as NAS, just a network share to store media and play it from various devices at my home.

        • knoppi says:

          That’s the problem. I don’t have numbers. It just felt slow.

          But I never tried over SAMBA, my experience was only with UPNP. Listening to audiobooks went quite well. Where it crashed was, when I quickly scrolled through the photo library from my TV. But I had ownCloud running at the same time and PHP used a lot of CPU.

          Still, this is very speculative since the device is somewhere else and I have a FritzBox here at the moment where the USB port is very slow by the way. 1 – 2 MB/s is quite ok, I would say.

          • Stefan Amarandei says:

            I was thinking of switching to DDWRT and then back to stock while testing, I read on forums that people get better speeds: http://www.gargoyle-router.com/phpbb/viewtopic.php?f=5&t=1109#p5292

          • knoppi says:

            I didn’t like the shippped firmware at all. In particular the strange USBoverEthernet-thing they were using.

            In the link they are talking about some other router. The TP-Link doesn’t have high-end hardware, actually I chose it for its price. At that time it was the cheepest thing with a USB port which nowadays is sort of standard.

  3. Stefan says:

    Hey,

    I have no idea why but now it works like a charm for both read and write, I mounted it as ext4 and I read/write through network with about 80 mbps.

    I think I should have rebooted the router after I was done configuring the usb mount and the samba share, cause there have been some power failures today and now it just started working.

    I am thinking of formatting it as NTFS for portability and compatibility with Windows machines, but also I wouldn’t touch it anymore now that it works 🙂