Announcement

Collapse
No announcement yet.

SMB - weird quirk

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    SMB - weird quirk

    i just installed & updated a Kubuntu 12.04 installation into a VMWare image. this is for testing, before moving over to a real dedicated file server running Kubuntu.

    SMB was also installed.

    i shared out the 'Music' folder with the appropriate permissions to allow my user account on my Windows machine access to read/write. all of that works perfectly.

    i copied some flac files onto the Kubuntu machine - worked perfectly.

    i open Winamp on my Windows machine and drag (selecting the parent folder) the flac files that reside on the Kubuntu machine to its playlist - not all of the files appear in the Winamp playlist and they're not in any specific order.

    when i go directly into the folder with all of the files listed, they are displayed in correct order (by track number) and i can add them to my Winamp playlist manually (selecting all of the tracks at once) and they are listed in the correct order.

    i am very confused as per why this is happening... any insight would be appreciated.

    ----

    just for clarification, each file is listed in the following manner:
    band name - track number - song name

    example:
    M83 - 01 - Intro.flac
    M83 - 02 - Midnight City.flac
    M83 - 03 - Reunion.flac

    and so on...

    #2
    This is indeed odd behavior. I tried to repeat your results, but my setup is somewhat different:

    Server running Ubuntu Server (no desktop/headless), Desktop PC Kubuntu, Virtual Machine Windows XP SP3 (Via VirtualBox), SAMBA connection from VM to Server:

    I opened my Music folder on my server using the VM > My Network Places and dragged a folder containing 14 flac files and a playlist file (m3u) to a local folder (My Music) on the VM machine.

    I observed the files copying over in what appears to have been random order, but they all copied completely and all files arrived.

    I would say it is evident SAMBA must use a file order other than alphabetical or in the file creation order (I created the target files in alphabetical order too).
    Maybe your SAMBA server or your Windows machine is dropping it's connection after a certain number of bytes or files

    I can't speak of the winamp playlist because I don't have it, but if it's free I might give it a try.

    Please Read Me

    Comment


      #3
      I installed the free version Winamp in my VM without all the extra crap they want you to install - like another toolbar - and dragged the same folder from Network Places to the Winamp playlist. All files are listed but not in any order I could discern UNTIL I re-copied them by dragging the folder from the server to the VM again.

      I could see the file list order as they were copied was the same as the file list order in Winamp.

      Obviously, the order of files is being determined by SAMBA.

      Please Read Me

      Comment


        #4
        thanks for taking a look.

        i don't have an issue wiping out my Kubuntu Desktop VM and using a Kubuntu Server VM instead, if that will resolve this.

        anywho...

        just like in your test, all of the files did copy over correctly. when i am viewing the contents of the 'Music' folder (shared), all of the files are listed in the correct manner (as described above). Winamp is free (www.winamp.com) - just fyi, i use the 'classic' style of skin/appearance.

        i don't believe that this is an issue of a dropped network connection - i begin playing the songs (in the incorrect order) and they do play without issue - just in the wrong order. also, my Kubuntu VM is set with a static IP address as well, so DHCP leases is not an issue either - i am not using the windows firewall either - using Comodo firewall.

        admittedly, this certainly is not a 'show stopper' of an issue, but it sure is annoying.

        ----

        and, on another slightly related topic, being that my current windows file server has roughly 6.5TB of storage, i had to give Kubuntu a test with partitioning and mounting/sharing other folders. the point is that the default KDE partition manager did not work correctly for me. after creating the partition and formatting it (ext4), it did not take ownership of it. i could not create a folder or copy any files into the new partition (i will outline my steps below). i searched for a partition editing software and found 'disk utility' (via the Muon Software Center) - it worked beautifully.

        shut down Kubuntu VM.
        created the partition within the VMWare software.
        booted up the Kubuntu VM.
        went to the partition software (KDE Partition Manager did not work - so i used Disk Utility) and mounted/formatted/took ownership of the newly created/added partition.
        checked the contents - empty other than 'lost+found' folder.
        created a new folder 'test.'
        copied 22 Flac files into the 'test' folder.
        verified that the files were all present.

        haven't tried adding the 'test' contents (same Flac files as previous) to my winamp playlist yet. will report back on that later.

        ----

        the above was typed before your latest reply.

        very strange that SMB would find such a strange pattern by which to organize files into the winamp playlist. i've tested it, and the order in which it puts songs into the playlist is exactly the same each time.

        not exactly sure where to go from here... any recommendations?

        Comment


          #5
          Re. Ubuntu Server: Kubuntu is Ubuntu only with a different Desktop Environment so the basic software is the same. I mentioned Ubuntu Server because that is the default server installation release from Canonical and has included software that does not install by default with the desktop editions of either Ubuntu or Kubuntu desktop. Ubuntu Server also installs by default without any Desktop Environment so if you want a DE you have to install it. I (almost) never directly access my server so I have no need for it to have a DE.

          Re. the file ordering: I was able to find only one random post regarding this issue elsewhere on the internet. It appears no one else has had an issue with it and there does not appear to be any documented reasons for this behavior. Can you discern any pattern in the order SAMBA transfers the files? Date, Time, anything?

          I'm unclear as to what you mean about Kubuntu not "taking ownership" of a newly created partition. This is not the default behavior of any linux distribution that I am aware of. Partitions - or actually more properly File systems - must be created and mounted by the root user (or an admin user with root access aka "Super" user). Once the file system is mounted, the user can have access IF the file system is mounted in a way to allow this. The default Windows behavior is to allow anyone access to almost everything, which is the beginning of why they have so many viruses and malware. Removable media is usually treated differently and the default Ubuntu behavior is to allow the user to mount and access it.

          The steps for a hard drive partition to be used with Kubuntu (Ubuntu):

          As admin or "super" user:
          1. Create a partition
          2. Create a file system on the partition
          3. Create a mount point for the new file system with desired ownership/permissions
          4. Edit /etc/fstab to create default mounting behavior for the new file system
          5. Mount the new file system

          As normal user:
          1. Use the new file system.

          The GUI tools you're using do some or most of this for you (after asking for your password). Usually, editing the fstab isn't. The only tool I have ever run across that did correctly put a new file system into fstab was DiskDrake in Mandriva Linux.

          Please Read Me

          Comment


            #6
            thanks for the clarification. i was under the impression that the Server and Desktop versions were very similar, but i admit i am still quite a novice and have a lot to learn.

            i will investigate the order in which the files are added to my playlist and if any pattern exists, i'll post my findings.

            here are the steps that i've gone through (all performed within KDE):
            1. open KDE Partition Editor
            2. type in SU password
            3. select the 2nd hard drive (/dev/sdb)
            4. click 'new' and select ext4 as the file system type (partition is a 'primary' type - using the entire hard drive size) - press 'ok'
            5. click 'apply'
            6. wait for the 'successful' message - then click 'ok'
            7. close the KDE Partition Editor.
            8. open Dolphin - navigate to the newly created partition. 'lost+found' folder is visible.
            9. try to create a new folder - cannot, the option is greyed out.

            (note: the mount point is - /media/0ef9c511-7dc3-4fe4-bf8b-81781fc7d31b)

            so... a bit frustrating as the file system has been created and formatted. here are the next steps i perform.

            1. open Muon Software Center.
            2. search for 'partition' and select/install 'Disk Utility'
            3. open Disk Utility.
            4. navigate to the newly created partition (created in the steps above) - unmount then delete the partition.
            5. create a new partition - give it the name 'Music' (ext4 type) - verify that the 'Take ownership of filesystem' option is checked - click 'create'
            6. open Dolphin - attempt to create a new folder - it works.

            (note: the mount point is - /media/Music)

            i have tried, and can repeat this process and get exactly the same results each time.

            now, again, this is all within a VMWare image. i do not know if that has any bearing on this, but i just want to be clear about it.

            Comment


              #7
              so, i have tested the exact same files again.

              i have checked the following criteria:
              file name / file size / date created / date modified / last accessed

              i can see no specific pattern of any kind.

              m83 - 04 - where the boats go.flac / 9.67mb / may 11, 2012, 18:27:22 / may 11, 2012, 18:27:22 / august 6, 2012
              m83 - 07 - train to pluton.flac / 6.75mb / may 11, 2012, 6:27:50 / may 11, 2012, 6:27:50 / august 6, 2012
              m83 - 11 - soon, my friend.flac / 18.4mb / may 22, 2012, 6:27:49 / may 11, 2012, 6:27:49 / august 6, 2012
              m83 - 06 - raconte-moi une histoire.flac / 28.5mb / may 11, 2012 6:27:46 / may 11, 2012, 6:27:46 / august 6, 2012

              all of the files share the same 'last accessed' time.

              i've also tried removing the files from the Kubuntu machine, then copying them back over in the correct order (track 1, track 2, etc) - no change.

              i have to say, i am quite puzzled by this...

              i just had a thought that maybe the tracks are being put into the list in reverse alphabetical order, but they're not - the order is random.

              Comment


                #8
                so, i hopped on the #samba channel and here is what it boils down to.

                when samba does an 'ls' (performed whenever a folder is being requested by a user), it actually performs an 'ls -f' (does not sort).

                so, in order to fix this... edit the 'smb.conf' file and add "vfs objects = dirsort" under the 'global' area.

                it WILL increase the latency of displaying files/folders. being that i have only a home based file server, it doesn't impact really. but, the most you have that needs to be sorted (in excess of 10,000), then you'll notice lag...

                so yeah... it works!

                Comment


                  #9
                  Cool, good job figuring this one out! I'll make the same mod to my conf just in case someone over here needs to use my server in this way.

                  Please Read Me

                  Comment


                    #10
                    Yes, interesting to know -- thanks for sharing that. On my setup -- a Win 7 VM on a Debian KDE desktop system, I have noticed that when, working in the Win 7 file manager, I copy a folder that holds a lot of files (~2500) over to the Linux filesystem, it will sit there at the bottom of the list of other stuff in that directory for some time -- perhaps a half minute or so, then it suddenly pops into its proper alphabetical position. So I knew there was some kind of recalculating going on.

                    Comment


                      #11
                      Originally posted by oshunluvr View Post
                      Here's a stanza from my smb.conf, although it's a bit dated. My server is running 10.04.4 Ubuntu and Samba 3.4.7"

                      [shared]
                      path = /mnt/shared
                      comment = Shared Files
                      browsable = yes
                      public = yes
                      writable = yes
                      inherit permissions = 0755
                      create mask = 0755
                      security mask = 0755
                      security = share
                      guest ok = yes

                      If I recall, there are issues accessing samba with Win7. You might want to search the Windows forums.
                      i tried a near identical setup, based upon the above notes. still no go.


                      Originally posted by oshunluvr View Post
                      Here's something I found:

                      To get Windows 7 clients to connect to the domain running Samba 3.3.4 or higher, four registry keys need to be changed. For the ones that don't exist, create them.
                      Two dword keys within HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesL anmanWorkstationParameters:
                      "DomainCompatibilityMode" = 1
                      "DNSNameResolutionRequired" = 0

                      And two within HKEY_LOCAL_MACHINESYSTEMCurrentControlSetservicesN etlogonParameters:
                      "RequireSignOnSeal" = 0
                      "RequireStrongKey" = 0

                      After setting these, you should be able to join the machine to the existing Samba-run domain. Again, this is assuming you're working in an already-working environment. Configuring Samba to act as a domain controller is covered in the article, Build a Primary Domain Controller With Samba.
                      added the 4 registry entries. no go.


                      Originally posted by dibl View Post
                      /media is typically used by the OS for connecting removable drives. If it is not inconsistent with your intentions for the shared music, I would suggest making a /mnt/MUSIC folder, mount the shared partition to that, and then use Alt-F2 "kdesu dolphin" to set that /mnt/Music folder to be shared, with an appropriate owner (nobody?) and group (users?) for your setup. That should keep the sharing and permissions permanently.
                      previously, i tried using the default partitioning software - did not work, would not grant me ownership of the newly created partition. downloaded and installed Disk Utility. it chooses where to mount newly created partitions, so it wasn't my choice in that matter.

                      i've not followed the rest of your recommendations - too busy for my own good. but, i'll give them a try in the next day or so.

                      Comment

                      Working...
                      X