An implementation of the NTFS filesystem in a Rust crate
github.com
github.com
Has NTFS changed much in... 20 years?
Linux filesystems seem to be evolving all the time (try to install any new distro today and check out how many filesystems you can pick from the dropdown...)
Apple replaced one filesystem with another in just the past few years, with apparently some very advanced new features.
But NTFS is just... NTFS? Does NTFS today look anything like how it looked in 1994? Or 2018? Does it change radically between versions of Windows? Or does the MS creed of compatibility at all costs mean it's basically a filesystem unchanged from the 90s? Thanks!
This sounds like evolution of options more than evolution of existing file systems
Is ext4 still not most popular for most end users? Curious how much ext4 has changed vs NTFS past... ~20 years (ext4 went stable 2008 apparently)
> Linux kernel 4.8 in August 2016 added a new feature, "reverse mapping". This is the foundation for a large set of planned features: snapshots, copy-on-write (COW) data, data deduplication, reflink copies, online data and metadata scrubbing, highly accurate reporting of data loss or bad sectors, and significantly improved reconstruction of damaged or corrupted filesystems. This work required changes to XFS's on-disk format.
It's pretty nice. I think it also supports some flavor of volumes or virtual partitions, but I don't have any real use for that kind of thing.
The snapshots are really good though. Very fast and don't take up a ton of space, somehow.
Looks like kicking the tires will remain somewhat in the future for me.
Then, in frustration, I rebooted into my Windows partition, which I rarely ever use. to see if I could back up my stuff and figure out why I wasn't having the same reboot problems in Windows.
After trying a bunch of Btrfs repair commands over a bootable usb disk I found online, I hit a wall with some errors that couldn't be fixed. So, I threw in the towel and reinstalled my system with ext4. It's been running smoothly for three weeks now with no more error headaches.
Could not find the logs of the errors anymore unfortunately to report.
Not like, "hehe we need to sync", but "good luck repairing, enjoy probably formatting"
LVM/MD RAID, ZFS, etc all behave fine. Only BTRFS is this fragile.
Source: had to patch yaboot(PowerPC Mac bootloader) to update ext4 to boot with /boot on ext4.
ReFS on Windows is where the changes are coming to. finally a 1st party filesystem which supports Copy on Write file cloning. a lot of core features of NTFS aren't supported on ReFS, so it's clearly not intended to be a replacement for NTFS.
they're gonna live side by side for 30+ years. they are meant for different uses.
The Tukwila team, still working with the old codebase, had a rule that NTFS could be upgraded, but it had to either accept the old file system structures, or be upgraded in-place. And their code allowed for that. Relevant portion starts at about 2:10
Surely you lie..
For example, I have a dual-boot arch/win system with 2 ntfs partitions and a with a recent update the linux kernel ntfs driver can't mount the filesystems, have to fall back to the fuse implementation.
It also didn't seem to be able to do things like set system flags hsra, but I found a way with the fuse implementation.
Why go the effort to index the files in a filesystem when the filesystem IS an index in itself? Just query it directly
It's dual-licensed as MIT or Apache 2.0, so it ought to be usable just about anywhere.
That's how Linux NTFS support started out, too.
What is it about NTFS that makes writing hugely more difficult than reading?
Bugs and mistakes in the code are already not great when implementing the read part. But if you mess up the writing well now you’re gonna cause corruption of existing data. No one likes that :)
Better to stick to just reading for a long while, and weed out most of the bugs and getting an even deeper understanding of the filesystem, before starting the implementation of anything that will modify the data.
Exactly. I have my own ext2 driver for a couple of hobby OS projects where the read side is extremely stable, but as the write side involves inode allocation, block/bitmap allocation etc. I don't turn it on on outside of testing since I know it's going to destroy the disk images until I "get it right".
Generally, the more modern the filesystem, the more complicated writing becomes.
If you want to learn more about NTFS internals and my crate, check out the talk I gave at FOSDEM 2022: https://archive.fosdem.org/2022/schedule/event/misc_ntfs_rus...
Also I'm open to any questions here.
In fact, it just corrupted the partition table of my external backup drive this year. Which was last time I trusted it for anything but read-only mounting.
And I have had /windows/ corrupt NTFS volumes.
Personal anecdotes rock :D