News for hackers. Stuff that matters.
Re:Paragon submits 27k-line NTFS driver to Linux kernel by jcrawfordor on Sunday August 23, 2020 @04:50PM (#24255181)
I think the basic problem is that FAT is generally "good enough," and in the increasingly common case where it isn't exFAT is close to universal and addresses the only problem that consumers frequently run into (file size limit).

While FAT/exFAT leave the possibility of a variety of different types of filesystem inconsistency, these seem to be fairly rare in actual practice, probably in good part due to Windows disabling writecaching on devices it thinks are portable. This kind of special handling of external devices is sort of distasteful, and leads to some real downsides on Windows (e.g. LDM handling USB devices weird), but using a newer file system doesn't really eliminate that problem - NTFS and Ext* external devices require special handling on mounting to avoid the problems that come from file permissions traveling from machine to machine, for example.

Re:Paragon submits 27k-line NTFS driver to Linux kernel by wheybags on Sunday August 23, 2020 @06:09PM (#24255708)
> in good part due to Windows disabling writecaching on devices it thinks are portable. This kind of special handling of external devices is sort of distasteful

What's distasteful is that on my linux machine with a lot of ram, when I copy a multiple gigabyte file to a USB key it "completes" the copy almost immediately, when actually all it has done is copy the file to a ram buffer. Then when I try to disconnect the drive, it will hang for ages while it actually finishes the write. IMO windows does it better here (although I never realised what exactly they did, nice to know.

Re:Paragon submits 27k-line NTFS driver to Linux kernel by sirffuzzylogik on Sunday August 23, 2020 @06:56PM (#24255990)
You should try to use the "sync" command, this is exactly what it solves.
Re:Paragon submits 27k-line NTFS driver to Linux kernel by wheybags on Sunday August 23, 2020 @07:03PM (#24256029)
I'm talking about dragging files with the GUI file manager, I shouldn't have to use any commands :(.

What I end up doing is using a "watch" on some command I can't remember that shows overall dirty pages.

Re:Paragon submits 27k-line NTFS driver to Linux kernel by nitrogen on Sunday August 23, 2020 @08:00PM (#24256358)
GUI file copy tools should be using O_DIRECT, or periodically calling f/sync(). An argument could also be made that the kernel write cache should have a size limit so that one-off write latency is masked, but very slow bulk I/O is not masked.
Re:Paragon submits 27k-line NTFS driver to Linux kernel by wtallis on Sunday August 23, 2020 @09:10PM (#24256725)
O_DIRECT seems like overkill, and the lack of write buffering could be a real detriment in some circumstances. Syncing at the end of each operation (from the user's perspective) should be the best mix of throughput and safety, but it makes it hard to do an accurate progress bar. Before the whole batch operation is finished, it may be useful to periodically use madvise or posix_fadvise to encourage the OS to flush the right data from the page cache—but I don't know if Linux really makes good use of those hints at the moment.

On really new kernels, it might work well to use io_uring to issue linked chains of read -> write -> fdatasync operations for everything the user wants to copy, and base the GUI's progress bar on the completion of those linked IO units. That will probably ensure the kernel has enough work enqueued to issue optimally large and aligned IOs to the underlying devices. (Also, any file management GUI really needs to be doing async IO to begin with, or at least on a separate thread. So adopting io_uring shouldn't be as big an issue as it would be for many other kinds of applications.)

Re:Paragon submits 27k-line NTFS driver to Linux kernel by im3w1l on Sunday August 23, 2020 @09:34PM (#24256825)
If you syncfs every reasonable-unit-of-time, you can get a progress bar.
Re:Paragon submits 27k-line NTFS driver to Linux kernel by wtallis on Sunday August 23, 2020 @09:47PM (#24256882)
Not always. If you're reading from a SSD and writing to a slow USB 2.0 flash drive, you could end up enqueuing in one second a volume of writes that will take the USB drive tens of seconds to sync(), leading to a very unresponsive progress bar. You almost have to do a TCP-like ramp up of block sizes until you discover where the bottleneck is.
Re:Paragon submits 27k-line NTFS driver to Linux kernel by flukus on Sunday August 23, 2020 @11:14PM (#24257256)
Which distro/desktop? My standard ubuntu 18.04 with gnome and mounted through the file manager doesn't do this and copying to a slow USB drive is as glacial as it should be, but copying between internal drives is instant and hidden.
Re:Paragon submits 27k-line NTFS driver to Linux kernel by wheybags on Monday August 24, 2020 @05:48AM (#24259011)
Default gnome on Ubuntu 20.04. How much free ram do you normally have? If you don't have enough to buffer the whole operation, then it's not a problem.
Re:Paragon submits 27k-line NTFS driver to Linux kernel by flukus on Tuesday August 25, 2020 @02:31AM (#24268628)
Now that I think about it, this might actually explain some bugs I've seen when copying multiple files. Copying one file seems to work but then copying a second the progress sits at 0%, it's probably waiting for the first transfer to sync.
Re:Paragon submits 27k-line NTFS driver to Linux kernel by marcodiego on Sunday August 23, 2020 @07:06PM (#24256042)
sync is your friend.
Re:Paragon submits 27k-line NTFS driver to Linux kernel by Wowfunhappy on Sunday August 23, 2020 @05:14PM (#24255344)
I don’t know if it’s just because I’m largely on Mac and Apple’s drivers suck, but I have run into lots of data corruption issues with exFAT on large drives (1TB+). More than enough for me to stop using it.

(Now I use NTFS and Tuxera’s commercial Mac driver, because I don’t know how else to have a cross-platform filesystem without a stupidly-low file-size limit.)

Re:Paragon submits 27k-line NTFS driver to Linux kernel by 0xcde4c3db on Sunday August 23, 2020 @05:36PM (#24255472)
It's pretty widely accepted that exFAT should be avoided on Nintendo Switch because of data corruption issues. So I don't think it's just Apple.
Re:Paragon submits 27k-line NTFS driver to Linux kernel by kasabali on Monday August 24, 2020 @03:49AM (#24258335)
> because I don’t know how else to have a cross-platform filesystem without a stupidly-low file-size limit

UDF is natively supported on all major OS.

I haven't used it in macOS but on paper macOS seems to be having even better support for it than Linux so you can give it a shot.

Lastly, you can use https://github.com/JElchison/format-udf for creating most compatible filesystem across different devices.

Re:Paragon submits 27k-line NTFS driver to Linux kernel by Wowfunhappy on Monday August 24, 2020 @06:18AM (#24259191)
Oh, the optical disk filesystem! That would be a useful hack. I won’t have problems using it on a standard hdd or ssd?
Re:Paragon submits 27k-line NTFS driver to Linux kernel by kasabali on Monday August 24, 2020 @03:05PM (#24264197)
It isn't a 1st class fs in any OS so it lacks some polish tooling-wise etc., but it should work fine for basic file transfer jobs.

I'm using it on an external HDD for copying/watching video files between Linux and Windows boxes and haven't had any problems yet.

On the other hand 7-8 years ago I tried to use an UDF partition for sharing a common Thunderbird profile between Windows and Linux and had done strange errors on Windows side after a while. I didn't dig further so it may have been a non-udf os or tooling issue, or it may have been solved in the meantime.