Sunday, June 21, 2015

How do you make Windows 7 fully case-sensitive with respect to the filesystem?


I want to make Windows 7 case-sensitive when it reads/writes anything on the hard drive (the C drive, or any other NTFS drive).


I found a video via google that says to change the registry key


HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\DontPrettyPath

to a value of 1 (source).


I also found a Windows support item that says something about modifying the registry key


HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\obcaseinsensitive

that leads me to assume putting a value of 0 will make Windows case-sensitive with NTFS filesystems (source).


I have a feeling the second solution is the answer, but I'm not sure and I don't want to try it without being sure.


Does anyone know for sure what is the correct way to make Windows 7 case-sensitive when it reads/writes to the C drive (and any other NTFS drive)?


Answer



You can set the HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\kernel\ dword:ObCaseInsensitive registry value to 0 as other authors suggested. Create a file named add.reg with the following content and run it.


Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\kernel]
"obcaseinsensitive"=dword:00000000

Then use Cygwin to work with case-sensitive filenames.


In order to do so, you need to mount NTFS filesystems with posix=1 option in your /etc/fstab, as this article suggests. Here's a snippet from my fstab:


none                    /cygdrive       cygdrive        binary,posix=1,user             0 0
C: /cygdrive/c ntfs binary,posix=1,user,auto 0 0
C:/Users /home ntfs binary,posix=1,user,auto 0 0

Once the above is done, you'll be able to deal with case-sensitive filenames using bash, mc, git etc.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...