0

With NTFS on a Windows machine if you create a directory "ABC" and then try to create a directory "abc" it will be rejected because Windows considers it the same name.

Now on Linux the standard ntfs-3g filesystem doesn't suffer this (NTFS, itself, allows for both... it's just Windows doesn't).

I've found that -t lowntfs-3g -o ignore_case will produce the error, but it does this by forcing everything to lower case. mkdir ABC results in abc.

Is there a way of using NTFS on Linux that follows what Windows would do? Retains the case for display purposes, but acts case insensitive for operations?

1 Answer 1

0

Is there a way of using NTFS on Linux that follows what Windows would do? Retains the case for display purposes, but acts case insensitive for operations?

Display purposes is something the system is not aware of, it just reads directory entries from the filesystem. So it is not possible both retain the case and ignore it at the same time.

That's because the filesystem implementation cannot know if it's reading the information (via openat()/fstat() for example) for ls or, say, for cat.

Note that although -t lowntfs-3g -o ignore_case will show lowercase, it will preserve the original case. You can check that with two mount sessions:

Create the filesystem:

# dd if=/dev/zero of=/tmp/ntfs bs=1M count=100
# mkfs.ntfs -F /tmp/ntfs

Now, with ignore_case (and lowercase) create AbC:

# mount.lowntfs-3g -o ignore_case /tmp/ntfs /mnt
# mkdir /mnt/AbC
# ls /mnt
abc
# umount /mnt

afterwards, umounting and re mounting the same filesystem without case conversion:

# mount.ntfs  /tmp/ntfs /mnt
# ls /mnt
AbC
# umount /mnt

What you want to achieve is doable though. Just not, from what I see, with ntfs-3g current implementation. You could have that behavior (after all Windows does it) with a customized ls or file explorer. Preloading readdir() for example also looks like something that might work.

2
  • Well, it's more than ls; affects many calls such as mkdir() open() readdir() and more. Anything that deals with filenames, really! Commented May 1, 2023 at 12:38
  • @StephenHarris I get your point and you are right but in my answer I mentioned preload just for whatever file manager/listing program the OP uses, since it seems to be mostly a display issue. Trying to replicate Windows behaviour across the board with preloads would be messy and break things ... not worth it. For the file manager, it is a manageable number of calls, I think. In no way I'd recommend that though. I was only trying to see if there was a way to solve it. Commented May 1, 2023 at 16:53

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.