NTFS read-write GPL kernel driver
lore.kernel.org
lore.kernel.org
https://www.reddit.com/r/linux/comments/i9mdqg/ntfs_readwrit...
When exFAT was announced about 5 months ago Paragon Software posted a rant against that.
Rant is posted here:
Performance is a different question, since it’s not in kernel.
[0] If you tie your company's worth to a proprietary technology.
The driver was deployed to 65,000 Ubuntu-based servers (as far as I remember), but we had a ton of issues with it, to the point that we removed it entirely and went back to NTFS-3g. We were told by paragon that we used a too-old version but at that point we had already moved on.
However, their NTFS check tool that ships with the driver (I forgot the name, but I can dog it up if anyone is interested) is actually super awesome! It is so so so much better than even the Windows chkdsk tool itself, and corrects many more issues. We use it to fix NTFS errors in millions of backup images. Can highly recommend!
Hope this helps.
(The second bug in the email linked above is a NULL ptr deref during an in-order recursive directory copy into the volume. That is real basic stuff; I don't think it required ASAN/UBSAN to hit. It shows a lack of even relatively basic testing, if I understand correctly.)
Not sure about Linux Mint, but MX Linux & antiX has NTFS driver bundled into ISO-images.
https://github.com/Microsoft/WSL/issues/873#issuecomment-425...
WSL2 itself uses a virtual file system.
On Linux, and other unices, there have always been important workloads where it really matters, so that itch got scratched.
Windows metadata performance is horrendously bad for code that needs to get metadata for a large number files in the same folder the way it would be done on Linux: by calling the Windows equivalent of `stat` (`GetFileAttributesEx`) for every file.
Metadata performance is much better if the code uses `FindFirstFileEx`, which IIRC has no direct Linux equivalent, to grab metadata en masse for all files in a folder and then filtering the results down the files that the code needs to know about.
Unfortunately, most code ported to Windows from Linux uses `GetFileAttributesEx`, under the assumption that it's as fast as `stat` is on Linux, but results in a poor user experience. Worse, many modern cross-platform languages (including Python) don't expose `FindFirstFileEx` without platform-specific add-ons, which means that devs have no easy way to do Windows metadata access right even if they know there's one specific way to do it.
On the other hand, if you look at e.g. Windows Explorer. Explorer will take somewhere from a few seconds to ~tens of seconds to list the contents of a SSD-backed directory with a couple thousand files. The same operation on Linux is practically instant. Copying a bunch of small files on Windows takes forever, maybe doing around a few hundred files per second. Meanwhile Linux will happily copy thousands of files per second, all on the same hardware.
Explorer might be using incorrect ways to do I/O, but if that is the case, then that would mean that the proprietary, only-ever-developed-for-Windows-by-Microsoft tool that is also the main way users do I/O doesn't do I/O properly. What would that say about Windows?
I wouldn't be surprised if it used the wrong API (in fact the lack of long path support is an example of using an outdated API). The only reason Windows Explorer appears reasonable is because people generally consider creating files you can't access with Windows Explorer a bug or misfeature.
In fact, if you use Total Commander, in the settings you will find option regarding things like "getting correct icons for files", with the option for "display icons for all files" explicitly marked as "SLOW".
Explorer always gets the icons, and possibly other metadata.
The last time I needed something along these lines the only option were os.listdir or using FindFirstFile through win32py. Os.listdir was an order of magnitude slower for my use case.
If I'm remembering the details right (and that's a big if), large files written sequentially would have their blocks scattered all over the place, making e.g. large uncompressed videos written from Linux too slow to play due to seek times, when if they'd been written sequentially they would have been fine.
Years ago when working on a commercial virtualization product I had to support initializing sparsely populated ntfs filesystems where only the filesystem metadata was written out, with allocated file extent ranges logged externally and not actually populated in the sparse ntfs filesystem in a file. I ended up deriving a small library for doing this from the libntfs-3g code, I don't think it took more than a weekend to do, the code was quite sane.
What I recall from that experience was that the file extent allocations on an empty filesystem was perfectly efficient, since you'd have to go out of your way to make it bad.
The real trouble was when the filesystem was used enough for its free space to become fragmented. At that point the allocation strategy was quite poor and you would end up with extremely fragmented large files. IIRC it was really just a naive sequential find first free blocks kind of thing. This aspect is consistent with your memory.
I think if we wanted to improve that aspect of linux ntfs support we're better off working from ntfs-3g.
Not to mention there are some significant down sides to in-kernel filesystem drivers, they are rather problematic when it comes to containers/namespaces and the security story is a total shit show.
For me, the use cases for NTFS in my Linux-centric life are all fraught with trust issues when it comes to knowing what's in that filesystem isn't malicious and about to exploit a kernel fs driver bug for unfettered ring-0 execution.
It's less of a concern with filesystems you initialized from your host, on devices permanently attached to said host, with a clear chain of custody, accessed purely from the trusted environment. There's a lot of implicit trust when it comes to mounting filesystems with a kernel driver, the kernel fs devs aren't shy about admitting there's significant trust assumptions throughout those drivers - they aren't exactly hardened against malicious input, and they aren't isolated processes like w/FUSE.
I suppose some people may treat every box with that level of security profile but I don't think it should come as much of a surprise that level of hardening is not the normal use case considered when new drivers are staged in the kernel tree.
The idea of handling I/O errors is pretty recent in most Linux file systems, I don't think security concerns are much of an issue with adding another file system - the kernel is probably full of easily exploitable holes anyway.
It does not. Thanks to Microsoft’s obsessive attention to backwards compatibility, you can safely mount a Windows 10 NTFS partition with journal on Windows XP (and I hear even Windows 2000) and get some form of safe read/write. However certain chunks of the fs on disk are not backwards compatible, this is mainly the system volume information used for system restore and shadow copy (and not accessible to typical user land in all cases).
More to the point, the submitted driver does, too:
> and supports journal replaying.
The logfile has changed like once. They don't want to break compatibility when you move removable disks between systems.
And even then, supporting just one version would be a big improvement.
So I wouldn't trust Paragon's claim of "decades of expertise in commercial file systems development and huge test coverage."
On Linux, my most common scenario of deploying Windows is in small VMs and, when needed, mounting host folders from them. It's true these VMs will probably not run some PC software well, but I have a Windows PC for that. The other way around we have WSL and WSL2 on Windows, again kind of erasing the need to dual boot from the Windows user side.
The money for them here is in support. Maybe they have licensees that bind them to support contracts and merging software into mainline Linux counts as a "best effort" to make others chip in at keeping it functional as the kernel evolves.
Personally when dual-booting I don't share anything at all between the OS'es, but my understanding is that most do.
They had a GPT GUID for it: 6a898cc3-1dd2-11b2-99a6-080020736631.
Honestly, for me, mounting Amiga file systems would be more useful.
However, "mounting windows filesystems" is undeniably a more common case for Linux users as a whole than "mounting amiga filesystems". Maybe WSL changed this, but Windows/Linux dualbooting used to be one of the two gateways for Linux users alongside VMs. Perhaps the absence of a apfs-3g is a contributor we see less Mac/Linux dual boots.
(Disclaimer: I've made occasional contributions to ntfs-3g upstream)
HN gets all bent out of shape about minor differences between btrfs and zfs. Like how zfs supports raid5/6 but btrfs raid5/6 support is immature. Meanwhile NTFS doesn't even support checksumming, multiple block devices, copy on write, the performance on SSDs is garbage, etc etc.
Both VMS and NT had the same manager, in the person of Dave Cutler. Microsoft hired a large team away from DEC to build NT (which became the subject of litigation from DEC).
I have read that NTFS shares common architecture with Files-11/ODS-2&5 (native VMS filesystems). Aspects were also lifted from OS/2.
ZFS was developed a decade after NTFS. Most UNIX was still on FFS when NTFS was born.
I'm still interested to see if an in-kernel driver can be better.
(Disclaimer: I have contributed a few patches to ntfs-3g upstream)
[1] https://tuxera.com/opensource/ntfs-3g_ntfsprogs-2017.3.23.tg...