Samsung Creates New File System F2Fs For Linux & Android
sfcrazy writes "Samsung has created a new Linux file system called F2FS. Jaegeuk Kim of Samsung writes on the Linux Kernel Mailing List: F2FS is a new file system carefully designed for the NAND flash memory-based storage devices. We chose a log structure file system approach, but we tried to adapt it to the new form of storage. Also we remedy some known issues of the very old log structured file system, such as snowball effect of wandering tree and high cleaning overhead."
While the primary benefit will initially be for Android devices, this will be great news for solid state drives as well. Great job Samsung!
I don't think Samsung would've created this if Android wasn't a huge driver behind their mobile success.
Glad to see proof that Samsung does innovate and not steal everything from AAPL like all Apple Fanboys think.
Karma: Bad
Commercial hardware companies contributing to open-source and the kernel, I mean.
It’s nice to see that Linux and the open-source philosophy more and more just is generally accepted.
Let's hope it.s because they have seen the advantages of humans working together, helping each other out... and not just for nefarious dog-eat-dog (aka capitalist aka "free market" aka law of the jungle*) purposes.
* Don’t worry. I know they're not supposed to be the same. The point I want to make, is that nowadays it gets all used to describe the same thing.
That's the beauty of the open source model. People and businesses contribute things that benefit them directly, but they benefit everyone indirectly. Large companies don't contribute to the Linux kernel to be nice guys, they generally contribute code and patches to benefit their own products and systems. Their contributions benefit everyone, however.
Watch out, Apple.. we have a FILE SYSTEM!!!
"I like to lick butts!" by MobileTatsu-NJG (#32700246) (Score:5, Informative)
Hope Apple wasn't planning on using this in their iPads...
Peter predicted that you would "deliberately forget" creation 2000 years ago...
No. SSDs present themselves to the OS as contiguous block devices. Filesystems intended for bare NAND flash like jffs(2), yaffs, and this new F2Fs would be totally useless for SSDs. They're intended for bare NAND, which SSDs are not.
You're wrong
f2fs work on top of block devices. f2fs sends TRIM (ATA command) down to the device. Bare NAND flash doesn't grok ATA commands.
Bogus
Watch out, Apple.. we have a FILE SYSTEM!!!
You know who else had a filesystem?...
the preceding comment is my own and in no way reflects the opinion of the Joint Chiefs of Staff
Actually you should say "Samsung-ssi" or "Samsung sunsengnim" in Korean. The -san is a Japanese thing. :)
You can find a lot of details in the txt file: https://lwn.net/Articles/518719/
int main() { while(1) fork(); }
I'm not a filesystem expert, but this is what I believe they are referring too: http://en.wikipedia.org/wiki/Log-structured_file_system
This cannot replace FAT, since the whole point of FAT is to be interoperable with all those Windows machines out there. For as long as Windows only understands FAT and NTFS on removable devices, any consumer device will use those (and specifically FAT, for certain other reasons) in any of its memory that is directly exposed to be mounted as a block device.
On the other hand, for internal device memory, Android has already moved to a high-level protocol (MTP) to expose that to PCs, so they don't care what file system backs it internally. I haven't checked, but I'd expect that any 4.x device has its internal memory fully in ext4 or other Linux native FS already.
The move to MTP is something I've been speculating has to do with moving away from the FAT patent licensing issues that Microsoft is using to bilk Android manufacturers
There may be that angle to it, but I think the main reason is because it removes the requirement for the phone to unmount the device to allow the PC to mount it - this can wreck havoc on any app that has files on the unmounted partitions open, requiring them to be aware of this scenario (and for many apps that pretty much means that they have to shut down - e.g. mapping apps that store their map cache there), and it also means that manufacturers have to carve out two partitions - one for the OS and other non-PC-mountable data, the other one for user data - and decide on how large each one should be, which they often get wrong.
You don't need it to be treated as a block device to get your OS (and Python etc) to access it as a normal filesystem. You just need a filesystem driver that wraps MTP. Since you're on Linux, you can just use mtpfs or go-mtfps with FUSE, and get the best experience of any desktop OS out there.
Windows has some built-in support for MTP (at least since Vista), though it's not on FS level - instead, it's hooked up into Shell/Explorer, much like Libraries in 7. So if you're content with Explorer, or some file manager that's using Shell interfaces, then it should just work.
For automation, when you actually want to see it as FS, yeah, it's a mess. Ideally a driver-source-compatible port of FUSE would solve this, and people have made several attempts at FUSE-Win32, but apparently writing Win32 FS drivers is not for the faint of heart, so I don't know of anything stable.
While the primary benefit will initially be for Android devices, this will be great news for solid state drives as well. Great job Samsung!
Before you go congratulating them on a great job, remember this is the second time they did this. The original attempt was called Robust File System. It was an abortion based on FAT16/32 with a duplicated file allocation table and some sort of journalling hacked on top.
It was claimed to be optimised for NAND devices and all that other good stuff, but the community quickly came to rename it Really Fucking Slow.
This file system was so slow that on the original Galaxy S the kernel would think software locked up while writing to the disk and prompt the user to force close the device. Search for "lagfix" if you're interested in what a disaster this was. There were users world wide trying to find fixes for the slow system performance, and the fix was often in the form of a kernel which supported ext4 or yaffs and a utility which converted the entire /system and /data partitions in the phone to the more common file systems.
I don't have high hopes in Samsung's competence here.
It looks to me like most the problems they are solving have already been solved. There are already several open source log-structured file systems. This list excludes experimental and similar software from educational institutions:
- Yaffs - http://www.yaffs.net/ - designed from the ground up for NAND
- JFFS2 - http://sourceware.org/jffs2/jffs2-html/jffs2-html.html - ditto.
- NANDFS - http://wiki.freebsd.org/NAND - BSD style licence
Plus there's Ext4 - which is used in Android now - not designed for NAND, but seems to work ok.
This work by Samsung fixes the problems with their previous file system. It's good, but it's not unique. Good PR though.
They donate at least $100,000 to the Linux Foundation a year, if nothing else. Pocket money to Google, maybe. But No small chunk of change to the Linux Foundation. Creating and releasing an extremely popular and novel Linux-based OS has got to count for something, too.
Samsung donates at least $500,000 a year, so they do still win in "we love Linux" top trumps.