Something rather wrong with Samba

I was trying to re-copy my iTunes library over to the MBL, and it was creeping along at 4 Megabytes per second  (I usually get closer to 30.)

So I SSH’d in, and saw that, for some reason, the top process was apache2, consuming about 70% of the CPU.

Then I looked in the file system…

*ALL* of the iTunes files are owned by a user named “www-data”  

Hmmm.   What’s up with that?

All of my older files are owned by ROOT, which is what I would expect.

Also, when I delete everything out of my iTunes share (which I do frequently) my Windows Explorer screen indeed is empty, but:

MYBOOKLIVE:/shares/tony# ls -la
total 256
drwxrwxr-x 4 root share 65536 Oct 14 19:36 .
drwxr-xr-x 6 root share 65536 Sep 4 19:55 ..
drwxrwxrw- 2 www-data www-data 65536 Oct 14 19:36 .DAV
drwxrwxrw- 2 www-data www-data 65536 Oct 14 19:31 Band

… and if I close and re-open the Windows Explorer window, that one folder reappears.

 and where is that .DAV file coming from?  It’s not in my Windows box…

And finally, if I delete that folder from within the shell, and then copy the folder over anew, I get errors with EVERY file:  “The file is too large for the destination file system.”

My MBL is only 4% full at the moment.

I guess as a workaround you could chown files and folders back to root and remove them manually, which I guess is ok for the knowledgable but for the people who don’t have a clue?  I’ve not come across this because I don’t have anything from Apple that needs the iTunes server.

Strange that the web server used up the majority of the MBL’s CPU’s capacity.

I’m actually not using the iTunes Server component;  I’m just storing my media in a private share so that I can stream it via Twonky to various devices.

So I spent a lot of time on this last night.   I even did a factory restore of the MBL…  

Still can’t figure out this WebDAV business.   That is news to me.

…  it appears that WD has completely changed how the file system operates with Windows. 

I tried to delete my (freshly copied) iTunes folder via Windows…  Windows said it was going to take 15 minutes to delete the folder!

Instead, I SSH’d in, and deleted it via the shell in about 3 seconds.

Now anything I copy over says that there’s an unknown error… that a process has the file locked.

I’m guessing it’s that WebDAV is out of sync…   Having to reformat my MBL again.

WebDAV?  My mind’s asleep.  How is that used?

(Point of note . . . On my computers the service Web Client is turned off. Description of this service is: “Enables Windows-based programs to create, access, and modify Internet-based files. If this service is stopped, these functions will not be available. If this service is disabled, any services that explicitly depend on it will fail to start.”)

WebDAV is only a presumption.

Web Client is also turned off on my Win7 box as well, but it’s using it, nonetheless.

By way of circumstantial evidence:

MyBookLive:/shares# find | wc -l
19638
MyBookLive:/shares# find | grep DAV | wc -l
10262

 The MBL has 19638 files in the shares, 10262 of which are DAV folders / files.

And I ran a WIRESHARK when opening up a directory listing (which took about 10 seconds to bring up the list.)

Check it out:

scrape.png

It’s all HTTP based!  Not SMB!

Note all the packets that are HTTP PROPFIND:   That’s WEBDAV, sure as ***.

http://msdn.microsoft.com/en-us/library/aa142960(v=exchg.65).aspx

I don’t know what’s going on here.   I’m a network guy, but I’m not an APPLICATIONS / WINDOWS expert.

But all I know is that ain’t right, it’s slow, and it’s causing me all kinds of problems.  :smileyvery-happy:

Bah!

Smoking gun!

C:\Users\Tony>net use
New connections will be remembered.


Status Local Remote Network

-------------------------------------------------------------------------------
             U: \\mybooklive\tony Web Client Network
OK V: \\bignas1\tv Microsoft Windows Network
OK W: \\bignas1\kids movies Microsoft Windows Network
OK X: \\bignas1\tv shows Microsoft Windows Network
OK Y: \\bignas1\movies 1 Microsoft Windows Network
OK \\MYBOOKLIVE\public Microsoft Windows Network
The command completed successfully.

 It’s Web Client Network! 

The PUBLIC share is using SAMBA; the PRIVATE share is using WebDAV.

Hm…  Curiouser and Curiouser.

If  Western Digital won’t cure this problem maybe there is a way to disable WebDAV on the Windows operating system?

Also set the network provider order so Microsoft Windows Network is first, Microsoft Terminal Services second and Web Client Network third.

A quick google search brought up this page:  http://www.windowstipspage.com/2010/02/what-is-webclient-service.html

Do you have Web Folders active on your computer?

I wonder…

Maybe WebDAV can be throttled on MyBook Live so the resources are not there for Windows 7 to use and force Windows 7 to use SMB?

The Apache2 configuration files I refer to are . . .

  • /etc/apache2/sites-available/Apollo3G
  • /etc/apache2/sites-available/Apollo3G-ssl

This may affect WD2go functionality if WD2go relies on WebDAV.  I think it WD2Go estableshes a VPN tunnel and might use WebDAV to access shares and associated files the MyBook Live.

The Web UI and associated scripts will still re-write /etc/nas/apache2/auth/require.inc but because Include /etc/nas/apache2/auth/require.inc is now # Include /etc/nas/apache2/auth/require.inc in both /etc/apache2/sites-available/Apollo3Gand /etc/apache2/sites-available/Apollo3G-ssl all the other shares desired as private will be inaccessible to WebDAV.

Point of note is to journal all your changes so when there is a desire to apply a official firmware update you can put back the original configuration BEFORE applying a future official firmware update.

So, the “before” would be . . .

############################
    # WebDav Extension
    ############################

    Include /etc/nas/apache2/auth/alias.inc
    Alias /shares /shares

    <Location /shares>
        Dav On
        Order Deny,Allow
        Deny from all
        Allow from all
        AuthName DeviceUser
        AuthType Digest
        AuthDigestDomain /shares
        AuthDigestProvider file
        AuthUserFile /etc/nas/apache2/auth/htpasswd
        AuthGroupFile /etc/nas/apache2/auth/htgroup
        #AuthzGroupFileAuthoritative Off
    </Location>

    Include /etc/nas/apache2/auth/require.inc

    #############################

 … and after the change it should look like …

############################
    # WebDav Extension
    ############################

    # Include /etc/nas/apache2/auth/alias.inc
    Alias /shares /shares
    Alias /Public /shares/Public

    <Location /shares>
        Dav On
        Order Deny,Allow
        Deny from all
        Allow from all
        AuthName DeviceUser
        AuthType Digest
        AuthDigestDomain /shares
        AuthDigestProvider file
        AuthUserFile /etc/nas/apache2/auth/htpasswd
        AuthGroupFile /etc/nas/apache2/auth/htgroup
        #AuthzGroupFileAuthoritative Off
    </Location>

    # Include /etc/nas/apache2/auth/require.inc

    <Directory /shares/Public/>
        Dav on
        Allow from all
        AuthName DeviceUser
        AuthType Digest
        AuthDigestDomain /shares/ /shares/Public/ /Public/
        AuthDigestProvider file
        AuthUserFile /etc/nas/apache2/auth/htpasswd
        AuthGroupFile /etc/nas/apache2/auth/htgroup
        <Limit PROPFIND>
            Require valid-user
        </Limit>
    </Directory>

    #############################

Sometyhing to try. I fit does not work then the changes are easily reversable.

Think a reboot would be necessary to effect changes but I think the following command may restart Apache . . .

apache2ctl -k graceful

 The above command is used within /usr/local/sbin/addUser_apache.sh.

I’ve been googling for the better part of two days…  There’s a remarkable LACK of information on Windows & WebDAV… and I haven’t come across ANYTHING describing how to disable it… or the consequences of doing so.

Most of the docs out there are in regard to Microsoft Sharepoint.

I have those network provider orders exactly that order… Web Folders I believe is Built Into IE 7 and higher; that weblink you provide is for IE 6…   

Thing is, I use Firefox and I can still get at files without thge MyBook Live challenging me for a valid user name and password.  It just shows me the file.

Looks like W.D. made a boo-boo with their implementation of WebDAV.

More than WD2Go can use it and WebDAV ignores(?) user access settings.

It’s a hacker dream come true.

NOT setting port forwarding or from WAN to the MyBook’s Apache2 internal web server removes the issue.  For sure DO NOT put the MyBook Live onto the router’s DMZ !!!