How to create a virtual disk with a case-sensitive filesystem on Windows 7?

6

2

I don't care which filesystem exactly it will be, I just need the file paths to work in a case-sensitive manner.

Maybe a behavior similar to a samba share on Linux box that has case-sensitivity turned on. That would be perfect, except that I need the disk to be stored locally.

Are there any drivers/tools for that?

I have already tried a couple of ext2 drivers for Windows which didn't work for this purpose :( ( http://www.fs-driver.org/ and http://www.fs-driver.org/)

Ivarpoiss

Posted 2011-09-09T16:36:17.773

Reputation: 173

This is a fallback from DOS where filenames were not case-sensitive, and MS-Windows is built to be compatible with this user-friendly feature. Unfortunately, if NTFS was suddenly switched to being case-sensitive, then a lot of things would fail (and the OS probably wouldn't boot at all) as you'll be able to find case-insensitive variations throughout the Windows Registry (e.g., C:/WINDOWS/, C:/Windows, C:/windows, etc.) and in various configuration files (and probably some hard-coded stuff too). Windows and many applications would need some major work to support this for drive C: at least. – Randolf Richardson – 2011-09-09T17:36:12.060

– samack – 2011-09-09T18:10:26.003

That's what I was asking actually: How to avoid turning NTFS file handling globally case-sensitive on Windows :) So I would need some sandboxy tools, an installable file system or something like that. Like those ext2 drivers up there. The only requirement is they must respect the letter case when identifying files. – Ivarpoiss – 2011-09-09T19:28:38.460

Answers

4

The simple answer is no. The long answer is...

NTFS does store filenames in a case-sensitive way (NTFS can have README.txt and readme.txt in the same directory), and even the Windows filemanager can internally manage case-sensitive requests to filenames via the NtOpenFile / NtCreateFile syscalls.

Unfortunately for you, the Win32 function CreateFile (used everywhere including by fopen) will internally call NtCreateFile using the OBJ_CASE_INSENSITIVE flag which will mean that all applications which use CreateFile will see your case-sensitive filesystem case-insensitively. In practise this means that all applications will see your filesystem in a case-insensitive way regardless of whether your filesystem is actually case-sensitive under the hood.

The only way I can think for you to practically force case-sensitivity is to write a filter-driver which will remove the OBJ_CASE_INSENSITIVE flag from the incoming syscall requests which will then allow NTFS, EXT2 or whatever internal filesystem you have to behave in their default, case-sensitive way.

SecurityMatt

Posted 2011-09-09T16:36:17.773

Reputation: 2 857

1

From inside Windows, this is possible, but you gotta be able to write C.

NTFS actually stores names as case sensitive (to support the POSIX subsystem). However, NTFS does not actually support case sensitive functions itself. Considering NT was originally written as a direct competitor to UNIX, this comes as no surprise.

http://support.microsoft.com/kb/100108

http://blogs.msdn.com/b/sfu/

http://www.netbsd.org/docs/pkgsrc/platforms.html#interix

surfasb

Posted 2011-09-09T16:36:17.773

Reputation: 21 453

0

Looks like the only way is to install a virtualized Linux and share the VM's drive out to Windows.

I've been looking around the Internet for the same solution, primarily to checkout a GIT repository from a Linux system that has files only differing in case (don't preach why they're there -- it's beyond my control). But looks like there isn't a relatively straightforward way to do this short of writing your own subsystem or deeply integrating to the Interix (now Unix services) subsystem.

adib

Posted 2011-09-09T16:36:17.773

Reputation: 245