SMB and long filenames

Status
Not open for further replies.

nikj_dk

Dabbler
Joined
Jul 1, 2012
Messages
25
Hi, I have installed FreeNAS-8.2.0-BETA4-x64 (r11722).

When I copy a directory from a Windows USB disk to FN/SMB, I recieve a warning regarding long filenames. Is it possible to configure FN/SMB to accept long filenames?

Regards,
NIKJ
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
What exactly does the warning say? I don't know about ZFS, but I know in the windows world a files location including name cannot exceed 255 characters. I'm thinking you're hitting that limit. Keep in mind that the file location will be based on the local file name.. /mnt/tank/......
 

nikj_dk

Dabbler
Joined
Jul 1, 2012
Messages
25
The warning goes like this "The destination filenname is larger than the file system allows. Move to a position with a shorter pathname, or rename before copying". It is translated from danish!

And I am copying from a Windows directory to a Freenas directory.
 

Stephens

Patron
Joined
Jun 19, 2012
Messages
496
To answer your question, ZFS already accepts long filenames.

What noobsauce80's saying is if you're copying
Code:
from C:\Data\This_Has_Got_To_Be_One_Of_The_Longest_File_Names_I've_Ever_Seen_To_Date_And_That's_Really_Saying_Something_You_Know.dat
  to /mnt/I_decided_to_give_my_nas_a_really_long_and_descriptive_name/Multimedia_Files/This/Is/Where/Our/Team/Decided/The/Data/Will/Go/For/Now/This_Has_Got_To_Be_One_Of_The_Longest_File_Names_I've_Ever_Seen_To_Date_And_That's_Really_Saying_Something_You_Know.dat



You might exceed a ZFS path limit. http://en.wikipedia.org/wiki/Comparison_of_file_systems

I'd check filename length first, then path length.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
Exactly. It sounds like you are the victim of the file name/path limits. I was hoping when I first heard about ZFS that it would allow >255 characters. I mean, if you had a Zetabyte of data I'd assume that after a while you'd be really hard pressed to keep the files limited to just 255 characters.
 

nikj_dk

Dabbler
Joined
Jul 1, 2012
Messages
25
OK, I understand.

The data I am copying is customer data, so it is possibly a very long directory path.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
If you are copying from a Windows system, there is a tool you can use called "Cut Long Names" that's free and you can set a maximum file length. I recommend you use it to ensure nobody exceeds about 200 characters.

The reason why you should do this is because of a personal experience I had with this limitation. About 8 years ago a customer created a folder with files that had a name that was 50 or so characters long. Then they moved the folder to a permanent place. Including the folder path it went to about 270 characters. The files were left there for months. Our daily and weekly backups couldn't backup the folder and files because the file names were too long. To explain shortly, once the total length exceeds 255 characters you cannot access the file at all but the data is safe and chkdsk won't recognize the issues(because technically it's not an issue with the file system). Anyway, months went by and one morning the server failed. We began recovering from backups but then we had a bunch of people showed up with random missing files. For a week or so we couldn't figure out what the pattern was. We couldn't figure out if the users just didn't know where their data was or if our backup settings or file permissions might be to blame. Then I remembered this limitation. It turns out that most of the time if you exceed 255 characters you get no warning at all. This is because it's impossible to know what the path length is on the actual server so there's no way to figure it out.

Ultimately, a bunch of important files were lost and someone almost lost their job(not me thankfully) because of the lost files. You should run that tool to make sure your copying is complete and thorough. You don't want to be blamed when someone screws this up ;)
 

nikj_dk

Dabbler
Joined
Jul 1, 2012
Messages
25
Thanks for the very, very interesting information. :smile:

The files and directories has been copied from a Buffalo NAS onto a Windows NTFS formatted USB disk, and when I attempt to copy it all onto a Freenas, via a Windows 7 WS, I get the error message.

Perhaps the Buffalo accepts very long filenames, I believe it is a Linux/BSD variant, or something like that.

To me the important thing was to move the data from the USB disk onto the Freenas, so I used 7-zip to put everything in one file, and then I moved it.
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
7zip will not backup files that exceed the 255 char limit. In fact, there are no programs out there that I am aware of that can go beyond the 255 character limit because the file access is controlled by the OS, and the OS is coded with the 255 character limit.
 

Stephens

Patron
Joined
Jun 19, 2012
Messages
496
Right. But if they weren't 255 characters at the source (including path), archiving them into a reasonably named 7Z file helps them fit safely on the destination.
 

premjith

Cadet
Joined
Oct 5, 2016
Messages
1
Hi,
For me also get error message while copy from windows share to FreeNAS SMB share.
Error : "The file name would be too long for the destination folder."

Any possibility for increase MAX FILE LENGTH?
 
Status
Not open for further replies.
Top