3

I'm trying to run a mod for a game on Linux and this mod reads files from a texture folder in a case insensitive manner (the mod runs on Windows as well).

I was wondering if there was a way to expose this folder to the game in a case insensitive way. Perhaps as some kind of symlink or a script that to_lower()s the file name access.

Would such a thing be possible?

The problem was also reported on steam, which you can look for more details: https://steamcommunity.com/workshop/filedetails/discussion/1800248038/1640917196996115981/

phuclv
  • 26,555
  • 15
  • 113
  • 235
Bodhi Daruma
  • 33
  • 1
  • 3
  • ZFS, XFS and JFS have long been case-insensitive if necessary. Nowadays ext4 also has that capability: [Case insensitive partition under Linux](https://superuser.com/q/290480/241386) – phuclv Mar 29 '22 at 03:18

2 Answers2

4

Starting with Linux 5.3, ext4 has support for case-insensitive directories. This work was contributed by Gabriel Bertazi of Collabora, and the work was funded by a company that ports Windows games to Linux. You'll want to use at e2fsprogs 1.45.4.

Linux 5.4 will likely be the next long-term stable kernel, so this feature should start showing up in distributions next year.

Theodore Ts'o
  • 901
  • 4
  • 5
2

Your best bet is probably to mount an exfat or vfat filesystem which is case insensitive. You can either use a partition or maybe use a file as a block device, and format as exfat or vfat

You can probably (I've not tried it, but it makes sense) use http://www.brain-dump.org/projects/ciopfs/ to use FUSE to make a lowercase version of the filesystem - although this working will depend, I expect, on the program asking for lowercase files. It has the advantage of being an overlay, so not creating disk requirements.

davidgo
  • 68,623
  • 13
  • 106
  • 163
  • Using a file (loop-mount) might be a good option, as you can run `fstrim` on it and it'll become a sparse file... so you can have a 10GB image that only uses 5GB on disk. – u1686_grawity Oct 19 '19 at 10:05
  • 1
    By the way, ext4 _did_ just add a per-directory case-insensitive mode in kernel 5.3 – but from what I've been able to figure out, it has to be activated during mkfs time, so OP would have to use a separate filesystem anyway (or go through reformatting their existing filesystem). – u1686_grawity Oct 19 '19 at 10:06
  • @grawity it seems like changing casefold feature (which enables case insensitive lookup) is not supported, it can only be set in fs creation. That said, would it be possible to reformat my existing fs without losing all my data? As in reformatting "in place" where I keep all my data the way it is. – Bodhi Daruma Oct 19 '19 at 13:38
  • Not currently, no. If it were possible, it would be included in tune2fs / fsck.ext4, which already have similar code for enabling other features. – u1686_grawity Oct 19 '19 at 14:26
  • It seems like my problem lied elsewhere. I tried ciopfs and it worked as I'd expect, but it did not solve my issue with the mod, which makes me conclude that it wasn't a problem case sensitive file names after all. – Bodhi Daruma Oct 19 '19 at 18:54
  • It seems that with recent e2fsprogs, `tune2fs -O casefold` can now be done on an existing filesystem. – u1686_grawity Sep 15 '22 at 05:02