20

Is there a filesystem that respects both these requirements?

  1. supports Linux standard file permissions
  2. is recognized natively by Windows

I would like to use it to format an USB external stick I mostly use for Linux stuff but I would also access from a Windows machine.

A simple workaround is to just read the content of the USB stick from a Linux VM on the Windows host, but was interested to know if such a filesystem exists.

3
  • If you can relax the ‘native’ Windows support requirement, you might consider BTRFS. Current versions of winbtrfs are pretty much rock solid in my experience, and unlike UDF there is actually good Linux support not just for reading the filesystem but also maintaining it (and unlike NTFS, you don’t need a FUSE module to get user mapping working). Commented Jan 18 at 18:17
  • Does WSL count as "native"? If so, then all of them. Windows can read the Lunix filesystems via 9P, and Linux can add permissions to Windows filesystems via drvfs metadata. Commented Jan 18 at 21:19
  • @OrangeDog No, I'm looking for a filesystem supported by Windows without needing to access it through WSL. Commented Jan 20 at 8:04

2 Answers 2

33

UDF (Universal Disk Format), commonly used on DVDs and Blu-ray discs but usable on other devices, works for this type of scenario: it supports POSIX metadata, and is handled natively in Windows.

To handle compatibility quirks, for best results you should format the external drive using format-udf. This creates a UDF 2.01 partition occupying the whole drive, with a fake MBR, ensuring read/write compatibility with Linux, Windows, and macOS.

3
  • 7
    Oh, whow, I did not see that one coming. Nice one! I was going into the direction of pure-ext2 (no ext3, no ext4, no journaling, no fancy extensions), and some janky Windows filesystem filter that hasn't been maintained in 20 years, but this solution is brilliant. Commented Jan 17 at 18:50
  • 11
    +1 I have long used UDF for USB sticks, but there's one gotcha to know about. There's no fsck for udf on Linux, so if anything goes wrong with the filesystem (trust me, it eventually will, pendrives aren't the most reliable pieces of HW, flash does wear out, and all that hotplugging/unplugging doesn't help either), Windows is your only hope of repairing it. I have once lost the filesystem irrecoverably all of a sudden (without an obvious cause). I have contemplated porting fsck.udf from OpenSolaris (Illumos, or whatever they call it these days) but never got around to it. Commented Jan 18 at 15:01
  • 1
    @TooTea that’s a useful warning, thanks — there’s a UDF fsck in NetBSD, which can apparently be built on Linux with libbsd, but I haven’t tried it (yet). Commented Jan 19 at 22:20
8

Linux NTFS support is fairly good these days (i.e. native, not just via FUSE).

Not as good as native filesystems, but for a USB stick it should be fine, especially if you're careful to unmount it cleanly in both Linux and Windows.
I don't know the relative advantages / disadvantages vs. UDF.

NTFS itself is POSIX-compatible. Default mount options might not present it that way on a Linux machine, but a Q&A from 2011 (https://askubuntu.com/questions/11840/how-do-i-use-chmod-on-an-ntfs-or-fat32-partition) discusses mount options. Being from 2011, it's about ntfs-3g, the 3rd-party FUSE driver, so I don't know much of that is the same with the native kernel module.

3
  • 3
    The kernel NTFS driver doesn’t support user mappings, but NTFS-3G is still developed and available in most distributions. Commented Jan 18 at 8:48
  • 2
    @StephenKitt: I'd almost count that as an advantage. The kernel 'ntfs3' driver stores POSIX metadata in an entirely separate location (as EAs, the same ones as WSL1 uses) rather than trying to translate between NTFS ACLs and POSIX ACLs, so it doesn't have some weird edge cases that I recall ntfs-3g did. Commented Jan 19 at 12:16
  • 1
    @grawity I haven’t used either enough to form an opinion, all I wanted to do was clarify the supported features (the “I don’t know” in Peter’s answer). Within the context of the question I agree it seems like an advantage. Commented Jan 19 at 15:07

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.