Enable Long Path Windows Server 2016

20 בSeptember 2017

תגיות:
אין תגובות

Hey folks, hope you are doing well because my last two months was very interesting, challenging and frustrating.

Hopefully, you remember the article I have published about file server migration if not, let me show it to you again if you don’t mind.

– In that article, you can get the most important points you should check when we file server migration.

http://pelegit.co.il/migrate-file-server/

I guess you have known about the path limitation which is only 260 characters in full path, this limit oppressive many IT guys, you can create folders with up to 260-character full path.

Try it, create a folder inside create more folders repeat this step until you will get the following popup:

Well, as you know me, I like to drill down to the core let’s talk business and realize what was interesting:

My customers have thousands of files that exceed Windows limitation which is 260 characters (full path), this issue makes us many problems, the old storage was based NAS and as you already know in NAS/NFS there are no such limits, that is why it worked for him and they weren’t experiencing any issue.
I could re-name the longest file to 260 characters using PowerShell command,
The script could be very simple, like “go over all the files/folders and if fount “path length more than 260 characters so re-name them up to 260 characters(Full Path).This action would be not good enough for the customers, he has more than 1000 users which have many shortcuts on their desktop, changing paths would be breaking the network path, along with that I had concern and indecisive with regards to what will happen to the folders that contain folder which already passed the 260 full path…? does script delete the folder?’ I don’t know, although it depends on the script, you could exclude folder type as well.

This action wouldn’t be good enough for the customer, he has more than 1000 users which have many shortcuts on their desktop, changing paths would be breaking the network path, along with that I had concern and indecisive with regards to what will happen to the folders that contain folder which already passed the 260 full path…? does script delete the folder?’ I don’t know, although it depends on the script, you could exclude folder type as well.

challenge – what should I say to the customer?  get started, let’s re-naming longest files by telling your Help Desk team to take it as a project and perform manual work, otherwise, we could install “Free NAS“ or just installing Linux machine and connect the machine to the Active Directory using LDAP.
Thereby, it was challenging for me, finding any solution, whether is bypass the limit or install third-party software, the customer doesn’t care what solution is, (maybe he does). As you can imagine the situation especially after you already have purchased storage and invested money, it is more complicated to get it back.

Frustrating, oh damn!  it’s freaked me out! I open a case to Microsoft PFE in order to get an advice, workaround, solution, something that can direct me!

They said that there is no workaround or solution which makes possible the use of paths longer than 256 characters, attach the email:

Usually, when we got such an official answer we might give up and carry on to additional solution, stopping with irrelevant troubleshooting, just attach that email to the customer with a formal answer which explains to him that it doesn’t work and it won’t work and apparently he has to accept it moreover consider my other suggestions as I described above.

Google search skills have been initiated, after many searches, I have found very valuable and interesting feature:

In Windows Server 2016 and Windows 10 1607, there is a new GPO feature “Enable Wind32 Long Paths”, which definitely can help us to solve this issue.

The policy help tab describes this:

Enabling Win32 long paths will allow manifested win32 applications and Windows Store applications to access paths beyond the normal 260 character limit per node on file systems that support it.  Enabling this setting will cause the long paths to be accessible within the process.

What does it do?

It creates a new REG_DWORD key on:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

LongPathsEnabled – Value 1

The new group policy locates on “Administrative Templates > System > FileSystem> “

I enabled the policy and it still didn’t work, does not matter what I tried, Either Window 10 or Windows Server 2016.

I would like to demonstrate it, [1] create a new NTFS Partition with 10GB, do not forget, [2] the policy is enabled:

Then, [3] I started creating many folders just for reaching the 260 characters full path:

E:\TESTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT\pelegittttttttttttttttttttttttttttttttttttttttttttttttttttttt
\MEIRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR\
ITTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT\ISRAELLLLLLLLLLLLLLLL

As soon as we get to “ISRAELLLLLLLLLLLLLLLL” folder and then tried to create another one and the got a POPUP, OPS…(too long),  I can’t create a folder because of it’s too long, so I opened PowerShell Windows and from there I was able creating two more items, the first one is [4]test123456789” folder, get into “test123456789\” [the second ] created a new notepad and called [5]Pelegit.txt” which is a normal notepad file, while tried to open “test123456789” folder just for opening /viewing the “txt” file I just blocked by windows and didn’t let me go into the folder, so it turns out that using PowerShell I can create folders, files I would want, but while opening it with Windows Explorer, it doesn’t open.

After several days of going down deeply, the Reduxio engineer guys found a solution, Reduxio is new a STORAGE brand that recently extremely increased the number of their customers worldwide.

They opened “Wireshark” and found that the old storage presents “Short Name” value, the old storage presents us that value and on the Windows side there’s nothing which specifies that.

Thereby, I would like to demonstrate to you the outcomes from my LAB environment, please concentrate –  [1] normal Windows partition have been created, [2] while the long path policy is enabled, [3] opened Wireshark and tried to access to the long path that I have created on my server, and found out the following value ‘Short Name Length:’ is equal “0

Now let’s create a new Volume on Windows and add attaching it through Server Manager > File and Storage Service > Disk. [4]

During creating the disk in the “File System Settings” tab you will small section of “Generate short file names which are not recommended “> [5] Allow the Checkbox:

Then I went into the folder and creating several folders just to reach to the 260-full path [7].

As soon as I reach to the 260 get an error about “Too Long”, [8] I have opened the PowerShell and I have run [9]mkdir” and succeed to create a new folder and called “asdalksdjaksjdkasjdasd” and then [10] I created a new notepad with ‘new-item’ command and called it  “www.Pelegit.co.il.txt

So, what is going on?

While I’m clicking on the link path I got these shortcuts:

F:\ASDASL~1\23D23D~1\23F239~1\23F230~1\23F23F~1\222222~1\TEST12~1\asdalksdjaksjdkasjdasd

Look at the differences:

What will be the output on Wireshark right now?

As you can see we got “Short Name length:16” which means that now it works and available for clients.

You can use this command in order to enable\disable it per volume:

fsutil behavior set disable8dot3 `f`: 0

Those who are wondering how does it behaviors on Windows Clients, just reassuring you it works from any Windows machine.

Well, what is 8dot3 at all?

First of all, just to make you aware, Microsoft recommends disabling 8.3 because of it may decrease directory enumeration performance, to be honest with you guys, I am not so familiar with 8dot3, we are talking about very old name creation method on Windows 2000, XP, Windows NT Operation systems. At those times, I think I was playing soccer with my friend, but I did Google and then realized what it is, how does it work.

8.3 automatically generating an MS-DOS-readable (8.3) name for each file.

The conversion of the short name is like this:

If the long filename is:

Meir Peleg IT1.txt so turns out “mepeit~1.txt”

Another one:

We Love Israel2.txt turns out “WeLoIs~2.txt”

You can find all your longest flies with the following command:

dir /x

For further information about 8.3 and Using File Names I suggest visit here:

https://technet.microsoft.com/en-us/library/cc976806.aspx?f=255&MSPPError=-2147217396

Reduxio guys have been done a wonderful job, got into SMB protocol and provided a great solution.

I would like to praise the Reduxio engineers which are truly extraordinary guys, I have been working with them for several months since the first acquaintance I noticed that they are highly professional guys.

 

For more information about Reduxio:

הוסף תגובה
facebook linkedin twitter email

Leave a Reply

Your email address will not be published. Required fields are marked *