:: [DNG] alternative filesystems F2FS …
Góra strony
Delete this message
Reply to this message
Autor: Martin Steigerwald
Data:  
Dla: dng
Stare tematy: [DNG] f2fs
Temat: [DNG] alternative filesystems F2FS and BCacheFS (was: Re: f2fs)
Steve Litt - 27.12.23, 03:49:00 CET:
> From what I've read, f2fs is beneficial to Nand storage only when doing
> write operations. For write operations it's often faster, it reduces
> unnecessary writes on individual Nand gates, and I think it handles
> fstrim automatically.
>
> I've observed two distinct usages of Nand (SSD/NVMe) drives:
>
> 1) SSD/NVMe is the only drive on the computer. Typical of laptops.
>
> 2) SSD/NVMe is root partition, with often written directories mounted
>    on spinning rust.

>
> Case #1 cries out for f2fs. F2fs minimizes write activity. In today's
> world, a laptop's typical 1TB to 2TB is very little space, considering
> huge video files, and considering that for drive longevity you
> shouldn't completely populate it. Also, if I understand right, you
> don't need to remember to fstrim / frequently.


As I explained here before I think, I am totally not concerned about too
many writes to good (!) modern SSD drives. Up to now none of my SSD drives
failed. They are not even close to failing. I cut this short here.

Regarding saving on space usage, I'd rather go with a filesystem that does
compression.

Main use cases I see for F2FS is simple flash like in MicroSD card or USB
stick and some embedded use cases, for example with eMMC. Especially in
case you know some details like the size of an erase block. I think
Samsung intended F2FS mainly for use with Android phones. I considered
F2FS as a replacement for Ext4 on LineageOS based Fairphone3+, but I read
switching from the standard can cause some trouble, so I did not bother.

Yet, still my Omnia Turris router uses full blown BTRFS on eMMC, since
about autumn 2016. No issues either. However the TurrisOS setup is heavily
minimized on writes anyway, so no persistent log files. Until I put in that
nice 1 TB mSATA SSD I bought with it. No you might ask why would you put a
1TB SSD into a router? Because I can. :) And it may have some use cases.
At least I can use it for a Linux container on the router.

I would however not use F2FS as a filesystem for a desktop or a full blown
heavy duty Linux server. It is to limited for me for that use case. I rely
on snapshots for my backups, so I use BTRFS on my SSD based Linux
machines, which are basically all machines in use, except for /boot. Also
I can use compression with BTRFS and manually invoked deduplication. You
mentioned it 1 or 2 TB are easily used

% LANG=en ; df -hT […]
Filesystem             Type   Size  Used Avail Use% Mounted on
/dev/mapper/[…] btrfs  1.3T  1.3T  5.0G 100% […]


(And no: having BTRFS run this full is not recommended. It works here
cause it is a filesystem for archival purposes that is not randomly written
to all the time. Above figure are with some deduplication in place, so if
you copy the data you need to have a bit more space than that. I had this
filesystem run out of disk space before so it was even fuller at times.)

I am currently evaluating and considering BCacheFS as a replacement,
currently on Linux 6.7-rc7, as I hope it has quite some performance and
probably also other advantages and less of the shortcomings I have seen
with BTRFS. It can do snapshots, it can do compression, even in the
background, and it should be able to deduplicate as well. In case there is
interest I can elaborate on this a bit more at a later time. However at
this point in time I am still evaluating BCacheFS. I bet it will take some
more time before I consider switching critical filesystems to it, although
apparently some folks have been using BCacheFS out of tree for years,
including the developer who almost one-handedly developed BCacheFS until
its inclusion in mainline Linux.

https://bcachefs.org/

Best,
--
Martin