5 ms·
An implementation of the NTFS filesystem in a Rust crate
- jandrese 3y agoBefore you get too excited it is read only.
- tibbydudeza 3y agoProbably prudent - would not trust any implementation except native ones in Windows that does writes.
- naikrovek 3y agowell, you should. write support for NTFS is supported by quite a few tools, now, including the Linux Kernel.
- brucethemoose2 3y agoAnd I've had the new linux NTFS driver corrupt files more than once. 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.
- adzm 3y agoThis is pretty great. I've been wanting to make a simple utility that can scan an NTFS drive for a filename pattern; scanning the MFT is incredibly fast versus using the actual filesystem API calls to do so.
- gregschlom 3y agoSounds exactly like Everything (https://www.voidtools.com/ https://www.voidtools.com/) - do check it out if you're not aware of this tool.
- worewood 3y agoEverything is one of those things that are so obvious that it hurts it's not offered by default on operating systems (even Linux and Mac). Why go the effort to index the files in a filesystem when the filesystem IS an index in itself? Just query it directly
- Moomoomoo309 3y agoThe locate or mlocate command does that on Mac/Linux.
- nfriedly 3y agoLooks like it's read-only at the moment, but still pretty cool. It's dual-licensed as MIT or Apache 2.0, so it ought to be usable just about anywhere.
- msla 3y ago> Looks like it's read-only at the moment, but still pretty cool. That's how Linux NTFS support started out, too. What is it about NTFS that makes writing hugely more difficult than reading?
- codetrotter 3y agoIt’s probably mostly done out of carefulness. I’d do the same if I were to write my own implementation of a file system. 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.
- nineteen999 3y ago> I’d do the same if I were to write my own implementation of a file system. 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".
- Diggsey 3y agoI would expect writing to be much harder on all file-systems. There's only one way to read the data, but there could be any number of strategies for deciding where to write new data.
- pengaru 3y agoReading is always easier to implement than writing. Only writing has the potential to actively corrupt the filesystem or leave it in some inconsistent state. Generally, the more modern the filesystem, the more complicated writing becomes.
- andy_xor_andrew 3y agoQuestion for the experts! 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!
- MuffinFlavored 3y ago> 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...) 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)
- Cu3PO42 3y agoext4 remains the default for a lot of distros and probably most end users, but other options are common as well. openSUSE and Fedora now default to btrfs, RHEL defaults to XFS.
- loeg 3y agoXFS also has not changed much in the past 10-20 years :-).
- yjftsjthsd-h 3y agohttps://en.wikipedia.org/wiki/XFS https://en.wikipedia.org/wiki/XFS lists what I would call significant improvements, in particular, > 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.
- colinfinck 3y agoAuthor here. Surprised to suddenly find my project from 2021 on Hacker News! 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_rust/ https://archive.fosdem.org/2022/schedule/event/misc_ntfs_rus... Also I'm open to any questions here.