Skip to main content
NetApp Knowledgebase

What are the file naming conventions for Network File System(NFS) and SMB/CIFS and maximum length of file names?

Views:
1,307
Visibility:
Public
Votes:
0
Category:
data-ontap-7
Specialty:
core
Last Updated:

 

Applies to

Data ONTAP 7 and earlier

Answer

File names are truncated

Error message: File not found

Files with long file names cannot be opened

When browsing from a Windows XP machine via CIFS, filenames appear in 8.3 format.

UNIX users are saving files via NFS mount point. When browsing from a Windows XP machine via CIFS, the filenames appear in 8.3 format.

 

File naming conventions for files that are used by both NFS and CIFS

File naming conventions depend on both the clients' operating systems and the file-sharing protocols. For example, file names are case-sensitive for clients running UNIX operating systems, and are case-insensitive for clients running any Windows operating systems.

Maximum length of file names

On the storage system, the maximum length of a file name is 255 characters for NFS clients and CIFS clients that support PC's long file name format.

Note: The file name length is limited by the length of the names in the files path, (e.g. With an existing path of 205 characters, a new file name can only be up-to 50 characters).

Some CIFS clients, such as MS-DOS and Windows 3.x clients, support only file names in the 8.3 format (8 characters for the file name and 3 characters for the file name extension). In any directory that has access from a CIFS client, the storage system creates and maintains two names: the original long name and an additional short name in 8.3 format. The storage system generates the 8.3 name as follows:

  1. It truncates the file name to six characters.
  2. It appends a tilde (~) and a number or letter to the name. If it runs out of letters and numbers because there are too many similar names, it creates a unique file name that bears no relation to the original file name.
  3. It truncates the file name extension to three characters.

Note: The number or letter appended to the short name ensures that the file name is unique. It is not for showing the order of file creation.

For example, if an NFS client creates a file named specifications.html, the short name created by the storage system is specif~0.htm. If this short name already exists, the storage system uses a different number at the end of the file name. For example, if the UNIX client creates another file named specifications_new.html, the short version of specifications_new.html is specif~1.htm.

The short names appear on clients that support only the 8.3 format. The short names are not visible to NFS clients. On Windows 95 and Windows NT clients, you can choose to display the short name or the long name by using File Properties.

Note: Under some circumstances, an application running on a client that uses names in 8.3 format can lose the file's original long-format name. This can occur as a consequence of the way an application saves a file that it has edited. Some applications rename the original file, then save the edited file as if it were newly created. The filer then receives instructions to delete the original file and create a new one. When the client supports only 8.3 names, this new name will no longer have an equivalent in long format.

It should be noted that the DOS emulation on NetApp is different than on Windows XP. The dir/x cmd on NetApp randomizes the names after the limit is reached, while on an XP directory the first two characters remain. The limit is 5 file or directories with duplicate character sets in the first 8 characters of the 8.3 naming scheme. Both XP and NetApp will name the files in order of last modified date with regard to the ~1 part of the naming scheme while NetApp will remove the numbering after the limit of 5 is reached.

Shown here on Windows XP Professional with SP2:

Directory of C:test dir /x

04/24/2008  10:41 AM    <DIR>                       .
04/24/2008  10:41 AM    <DIR>                       ..
04/24/2008  10:41 AM    <DIR>          MS57C1~1     MSSDK_4_01
04/24/2008  10:41 AM    <DIR>          MS67C1~1     MSSDK_4_02
04/24/2008  10:41 AM    <DIR>          MS77C1~1     MSSDK_4_03
04/24/2008  10:41 AM    <DIR>          MSSDK_~4     MSSDK_4_04
04/24/2008  10:41 AM    <DIR>          MSSDK_~3     MSSDK_4_05
04/24/2008  10:41 AM    <DIR>          MSSDK_~2     MSSDK_4_06
04/24/2008  10:41 AM    <DIR>          MSSDK_~1     MSSDK_4_07
               0 File(s)              0 bytes
               9 Dir(s)  37,710,434,304 bytes free

Same thing, but on a NetApp:

Directory of Z:test dir /x

04/24/2008  10:39 AM    <DIR>                       .
04/24/2008  10:38 AM    <DIR>                       ..
04/24/2008  10:39 AM    <DIR>          MSSDK_~1     MSSDK_4_01
04/24/2008  10:39 AM    <DIR>          MSSDK_~2     MSSDK_4_02
04/24/2008  10:39 AM    <DIR>          MSSDK_~3     MSSDK_4_03
04/24/2008  10:39 AM    <DIR>          MSSDK_~4     MSSDK_4_04
04/24/2008  10:39 AM    <DIR>          MSSDK_~5     MSSDK_4_05
04/24/2008  10:39 AM    <DIR>          U9ORL00~     MSSDK_4_06
04/24/2008  10:39 AM    <DIR>          V9ORL00~     MSSDK_4_07
               0 File(s)              0 bytes
               9 Dir(s)  2,967,848,583,168 bytes free

 

Configuring alternative presentation of illegal characters

When files created via NFS contain illegal characters, the charmap command can be used to set up a translation table to present an alternative display of such characters to CIFS clients. The client will see the full, long file name, although looking different.

Note: It is important not to map illegal characters to characters that are otherwise used or expected to be used in file names. If you do so, for example by mapping colon to a-umlaut, a-umlauts in file names generated by CIFS clients will be translated to colon for NFS clients.

Each volume can have a different translation table and must be configured for each volume as needed. The table covers only the characters that are illegal for CIFS.

Case-collisions:

As mentioned above, Windows systems are case-insensitive. So a UNIX system could create two files test.txt and TEST.txt which is fine for it, but Windows could not keep them apart. Knowing that, the Filer will create a tilde-representation for the second and every further colliding file. That should show up as text.txt and text~1.txt

Note: In Apple OS X 10.4 and earlier, using AFP will also experience limitations with Windows shares, Japanese characters, and a 32 character limit of filenames.

Related Link:

 
 
Enabling searching for short names in ONTAP.

By default the CIFS SVM (vserver) does not have the ability to search for 8.3 short names when running on ONTAP (cDOT, Clustered Data ONTAP).

If it's necessary to have the SVM also search for the short name this can be enabled, but it can also have a performance impact.  It should only be enabled if a legacy application requires it.

To enable searching for short names run this command at the advanced privilege level:

vserver cifs options modify -vserver <SVM name> -is-search-short-names-enabled true.

Additional Information