Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    I need a maximal file length beyond 255.

    Hello I'm a windows user searching for a solution , I have a extensive hierarchy of files and in some folders I'm hitting the 255 file name limit.

    I'm searching for a solution to this problem , is there one on Linux ? Is there a file system that supports filenames that are 1024 characters long ? This would be ideal and I donít see how I can hit a 1000 character limit in the future (if there is one beyond 1000 like 2048 I will be even more happy ).

    The only other requirement is that he file system supports partitions of 50TiB or 300TiB and file sizes of minimally 2GiB.

    And if this is possible so that I set up a Linux server for all the computers will windows freak out if linked to file names longer then 255 characters on a Linux server ?

  2. #2
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    You need to distinguish between filename length and pathname length.
    The filename length seems to be max 255 on about any filesystem, including ntfs, ext2/3/4/ xfs and even zfs.
    ZFS - Wikipedia, the free encyclopedia
    ext4 - Wikipedia, the free encyclopedia
    NTFS - Wikipedia, the free encyclopedia

    The max pathname on linux is 4096, IIRC
    See here, I operate on a ca 300 char deep directory path without a problem:
    pwd | wc -c
    touch foo
    ls -la
    total 8
    drwxrwxr-x. 2 irithori irithori 4096 Dec 15 10:26 .
    drwxrwxr-x. 3 irithori irithori 4096 Dec 15 10:25 ..
    -rw-rw-r--. 1 irithori irithori    0 Dec 15 10:26 foo
    On windows the pathname seems to be limited to 260
    Naming Files, Paths, and Namespaces
    Maximum Path Length Limitation
    In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters.

    So, even if you build your directory structure on a unix machine, windows will most likely have a problem with the max pathname length.
    Maybe this hierarchy needs to be reconsidered.
    Or you migrate everything to unix
    You must always face the curtain with a bow.

  3. #3


    Thank you for your quick response and help.

    I meant path name length of course. I have only some question is this 4096 limit is in Unicode characters (Iím not a native English speaker and have non-english characters in some directory and file names) ? Is the 4096 limit for every file system under Linux (ext4 , ext3 , ReiserFS , Reiser4 ) ? Is the 4096 limit counted including the / characters ?

    What is ďIIRCĒ?
    Is it easy to make the Linux server display some extra nested directories to be separate drives for windows without messing up the hierarchy on the Linux server ?

    For example lets say we have {some long directory}../personal/recreation/pictures/summer2008
    To be displayed for windows like the folder recreation is a HDD ? So that
    {some long directory}../personal /recreation/pictures/summer2008 would be seen for windows on a network to be Z:\recreation\pictures\summer2008 ?

    Will this work with windows ? Will windows read this normally ? Will I be able to write files to Z:\recreation\pictures\summer2008 without problems with the Linux server ?

  4. $spacer_open
  5. #4
    Trusted Penguin Irithori's Avatar
    Join Date
    May 2009
    It is defined here and valid for all linux filesystems:
    Quote Originally Posted by /usr/src/kernels/3.1.5-2.fc16.i686/include/linux/limits.h
    #define PATH_MAX 4096 /* # chars in a path name including nul */
    The "/" will take a char each.

    A unicode char will probably be saved as two chars. But I am only guessing here.
    You may want to avoid unicode file and pathnames anyway, as it will involve multiple conversions.
    windows client <-> samba server <-> filesystem.

    iirc == if I remember correctly

    Yes, you can define multiple shares in the samba config, pointing to different paths in a unix filesystem hierarchy, thus shortening the path to a length that windows can deal with.

    One more thing: You mentioned 50-300TiB.
    This is too much for the linux standard filesystem ext4.
    You can use xfs, which is part of any bigger distribution.

    But I would use FreeBSD instead of linux here.
    Because FreeBSD has zfs, which imho ( = in my humble opinion) is the most advanced server filesystem out there.
    Until linux catches up with an production ready Btrfs.

    For an easy entry in freebsd/zfs you can try FreeNAS 8 | Storage For Open Source
    Last edited by Irithori; 12-16-2011 at 08:22 AM.
    You must always face the curtain with a bow.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts