NSLU2 (Linksys networked storage) and Linux SMB/Samba

I really do like my little Linksys storage link. But I’ve run into a problem with it that is perplexing.

One of the reasons I got the NSL was to facilitate backups of my various machines. And sort of “key” to that backup strategy is being able to preserve files from my Linux server (the one you are connected to now). The NSL natively supports SMB (server message block) file shares: for this to work with Linux, you have to install a client that supports SMB file system mounts. Samba is the package I selected, and its pretty much the defacto standard. And it works: my Linux box can connect to my NSL and copy files to and fro without difficulty.

Where the problem comes is with large files…files greater than 2 gigabytes in size. That’s pretty much the minimum size for a backup (tar) file in this day and age. What happens is that writing to a file on the NSL from my Linux box fails as soon as the file reaches 2 gigabytes. This is not good…

Some of the places I checked said that this was a problem with the operating system on the Linksys NSL when it was first released. The proble was corrected somewhere around firmware release V2.3R29. I have V2.3R63, and I can confirm that, from Windows at least, I can create files larger than 2 gigabytes in size on an NSL hosted share. Since both Windows and Samba use SMB for file shares on the NSL, it seems that the problem I’m experiencing resides not in the Linksys box, but in my Linux version. This seems to be supported by some of the content on the NSLU2-Linux wiki…although like most Wiki’s, its sometimes a bit unclear. This is the text from that Wiki entry that seems to support my current theory:

The 2GB limit seems to be gone

I know that more recent versions of smbfs no longer have a 2GB limit. I tested with my Gentoo linux box, mounting the NSLU2 share with the ‘lfs’ option, which gets passed to smbmount. I was able to successfully transfer a 40 GB file to the slug (cat /dev/hda > /nslu2/share/big_file.dat). Could’ve done more, but that took all night as it was. Anyway, the version of samba that came with my slug seems to no longer have this limit. I’m using Samba 3.0.14 and Linux kernel version 2.6.12 on my Gentoo box. Earlier versions probably work as well. Also, the CIFS driver in the newer Linux kernel does not have that limit either, but for me, it seemed to have stability issues, though it is much faster than the older smbfs module.

What I don’t know is exactly why my Linux box still has this limit. I have Mandrake version 10.0, with kernel version 2.6.3-7 and Samba client 3.1. I do have a long term plan to move to RedHat Fedora Core (probably), but…not today.

Technorati Tags: , , , ,

2 thoughts on “NSLU2 (Linksys networked storage) and Linux SMB/Samba”

  1. Hi Kelly,

    I’ve got some possibly cool news, after browsing the samba manual and some sources I decided to thoroughly roam SMB4K’s settings. I found a setting to “Use large filesystem support” (I didn’t need to remount either, you might if using CLI mount). Now I’m comfortably rolling past the 3.3GB mark with my backup. If you are using samba manually you must use the “lfs” option, for example:

    /usr/bin/smbmount //xxx/D$ /home/jlynch/smb4k/xxx/D$ -o workgroup WORKGROUP ip 192.168.0.xxx netbiosname GENTOO lfs fmask 0755 dmask 0755 port 139 rw username administrator

    Cool site BTW! Another gremlin bites the dust, in our modern day shouldn’t LFS be enabled by default? I always assumed the capability of the shares were automatically negotiated, go figure. Feel free to email me any additions or comments.

  2. James…thank you for your comment! That goes double for this particular comment, since it fixes a problem that was really bugging me: as we speak I have a file of > 2.2 GB, and growing by the minute as my backup completes its run.

    And yes, you are right…I would expect that large filesystem support would be enabled by default. Arrrgh.

Leave a Reply

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