Renaming files/folder changing only the casing doesn't work on Windows

  • I've recently noticed this because I haven't been manipulating any files on my shares until recently.


    If I have a file named "Abcdef.txt" and rename it to "ABcdef.txt" Windows shows an error stating the source and destination files are the same, same thing with folders, this does works when done on local drives, only with the SMB shares it fails, is there any setting I should change? I don't understand why it fails. The drives on OMV are ZFS and they all have "casesensitivity=insensitive" values, is this a bug?

    • Offizieller Beitrag

    they all have "casesensitivity=insensitive"

    ??? not sure what you mean by that, as you probably know any additional settings are added to smb/cifs -> Extra options


    For instance in mine I have: mangled names = no


    Your casesensitivity should be case sensitive =


    The option you have added -> insensitive is not an option, it's either yes, no, or auto


    Have a look here under the section name mangling

  • Hey, I was referring to this: https://openzfs.github.io/open…ps.7.html#casesensitivity


    I tried setting mangled names = no in the SMB config but I'm still getting the same error. When I tried in CMD I got:

    "A file with the same name already exists

    or the file was not found."


    It's like it's not detecting I'm changing the casing or something like that.


    I've tested renaming a folder on a share that is EXT4 and I don't get any error so I'm guessing it has something to do with ZFS, if you or anyone that is reading this has ZFS drives and a Windows machine at hand, can you please try renaming something and only changing the case, do you get any error? If not can you please share your pool/volume config.

    • Offizieller Beitrag

    I use zfs, but what you are referring too is smb/cifs in windows, the reason I use mangled names = no was down to moving ripped films from my windows machine to an smb share on the server, the server was defaulting to the dos 8.3 format


    I have just tried a .txt file on one of my smb shares -> test.txt if I try to rename that to Test.txt windows barfs, with a warning saying there is a file with that name do I want to name it test(2).txt


    This is normal for windows, it does not honour renaming based upon case, therefore look at the link I provided, the default for case sensitive on smb is auto which effectively is no


    The settings are therefore client/server specific so it may require some testing/trial and error to find what works

    • Offizieller Beitrag

    if you or anyone that is reading this has ZFS drives and a Windows machine at hand, can you please try renaming something and only changing the case, do you get any error? If not can you please share your pool/volume config.

    I don't have any special configuration about this in samba. It does not give me an error when changing a letter from uppercase to lowercase or vice versa in the name of a file. This is my dataset configuration.

    (Though I'm not sure what this means: "only changing the case" Changing the file named "pepita" to "pePIta" does not give an error)

  • geaves Mmm I don't think smb is the culprit here, if you have a non-ZFS drive at hand and create a share from that drive you will be able to change the case of files/folders without problems, at least it worked in my end with a EXT4 drive, in the other hand all the ZFS drives fail.


    Oh and thanks for the tip, I just set the mangled names option on all the shares.


    chente Thanks for sharing your config.

    Code
    casesensitivity       sensitive

    I'm guessing this is the reason why we can't change the case of files/folders and you were able to.

    • Offizieller Beitrag

    newbie have you tried running the zfs get all as chente did


    EDIT: this gets interesting, my properties are set on the pool not on each dataset, so if run zfs get all trinity I get the properties of the pool which are obviously not passed to each dataset

    • Offizieller Beitrag

    Sorted -> select a dataset in the pool, click properties on the menu, locate sharesmb select it, then click on edit and change it from off to on, click save -> now I can rename without an error


    EDIT: It does work if you don't want to move away from the page, so not a solution

    • Offizieller Beitrag

    that's interesting, mine barfs if I run zfs get all trinity/software -> dataset does not exist

    Check if your pool is updatable. zpool status will tell you. If the zpool is not updated to the latest version of ZFS there will be new features that are not usable.


    Edit: By the way, I just saw that a version came out 4 days ago. https://zfsonlinux.org/

    • Offizieller Beitrag

    If the zpool is not updated to the latest version of ZFS

    I take it you mean this

    Code
    zpool status
      pool: trinity
     state: ONLINE
    status: Some supported and requested features are not enabled on the pool.
            The pool can still be used, but some features are unavailable.
    action: Enable all features using 'zpool upgrade'. Once this is done,
            the pool may no longer be accessible by software that does not support
            the features. See zpool-features(7) for details.
      scan: scrub repaired 0B in 01:45:55 with 0 errors on Sun May 14 02:09:57 2023


    Solved the problem, my properties appear to set on the pool not on each dataset, so if do zfs set sharesmb=on trinity this sets that property on the pool and I can rename a file within an smb share

    • Offizieller Beitrag

    EDIT: this gets interesting, my properties are set on the pool not on each dataset, so if run zfs get all trinity I get the properties of the pool which are obviously not passed to each dataset

    Yes that is interesting. Could it be that each dataset needs to be upgraded separately to the latest version of ZFS?

    • Offizieller Beitrag
    Code
    action: Enable all features using 'zpool upgrade'. Once this is done,
            the pool may no longer be accessible by software that does not support
            the features. See zpool-features(7) for details.

    Yeah. I mean that.

    • Offizieller Beitrag

    Solved the problem, my properties appear to set on the pool not on each dataset, so if do zfs set sharesmb=on trinity this sets that property on the pool and I can rename a file within an smb share

    What do you need sharesmb=on for?

    The plugin mounts the datasets in OMV with fstab. So OMV only sees one file system and manages it like all the others to create shared folders and share via services like samba. Maybe I'm wrong, but I don't think that value is necessary, in my case it's off and it works normally.

    • Offizieller Beitrag

    Could it be that each dataset needs to be upgraded separately to the latest version of ZFS

    Don't know, when I moved to zfs crashtest helped me, whilst I am familiar with it from using XigmaNAS (nas4free) the implementation in omv is slightly different


    Your output from zfs get suggests that your properties are set on each dataset, whereas mine are set on the pool, hence when I ran zfs get all trinity/software it barfed -> dataset does not exist. But running zfs get all trinity it works and returns the relevant information

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!