# SSD filesystem?

## Goverp

I've formatted the SD card for one of my Raspberry Pi's (an old model B) for f2fs.  Did I do wrong, and should I stick to ext4 (with appropriate tune2fs settings)?  I know when it was new f2fs users reported issues, but that's to be expected; has it improved?

----------

## khayyam

Goverp ...

no idea, but I'm interested to know. Given that many android devices ship with it it would have to be fairly stable, though my guess would be that it would depend on what kernel you go with, and so upgrading that kernel may be where issues creep in.

best ... khay

----------

## Goverp

Some delving on my friend Google shows reports of f2fs looking files in root directory with kernels before 4.8, so I guess the it's still a case of (a) keep backups, and (b) don't use it for something irreplaceable.  Thus warned, I'll continue trying it until I get bitten.

----------

## Irre

After several destroyed file systems using f2fs I gave it up. (I had also a crashed f2fs on a google mobile phone!) But other file system was also useless on my Raspberry gen1. Now a use /dev/mmcblk01 only during boot and running file system is on external USB-disk. Since then I had no problems.

I also have non-gentoo Raspberry with (XBIAN/KODI) with BTRFS, no problems so far.

----------

## boristheanimal

I haven't used f2fs over long periods of time but basically its similar in performance to ext4, although if I'd have to pick stability I'd go for ext4. 

The main reason behind going for f2fs over other filesystem on a flash based device would be cos of the optimization features and reduced wear and tear due to reduced frequency of writes. But then again if you're using a shitty, low grade sdcard (which I've used often to play around with raspberry pi), then it doesn't matter much in my opinion as they are bound to fail anyway after some time.

----------

## Roman_Gruber

f2fs is much faster on my nexus 4 smartphone. the memory is quite slow

No issues on my smartphone since ages.

I assume you have a backup of your rasperry. I assume the content is not that large, so just make backups and use f2fs.

 *Quote:*   

> I haven't used f2fs over long periods of time but basically its similar in performance to ext4

 

I disagree.

IT is highly optimized for slow memory, e.g. phones.

the guy who made this topic wrote he uses sdcards, these are also slow memories

----------

## Goverp

Thanks guys for the feedback.  I guess the answer is to tread carefully and see how it goes.

 *Roman_Gruber wrote:*   

> 
> 
> I assume you have a backup of your rasperry. I assume the content is not that large, so just make backups and use f2fs.
> 
> 

 

Indeed.

----------

## Yamakuzure

f2fs is really cool!

... but if something goes wrong, you have to plug in your sdcard into another machine to do an fsck, because f2fs can not fsck on a ro mounted volume. (And that's the major showstopper for me)

----------

## reddragon

what the best performance fs for a ssd f2fs, ext4 or btrfs?

----------

## Naib

how important is your data?

Out of three, ext4 is the most mature and is perfectly happy with SSD (especially with a cron fstrim call).

F2FS is extremely new 

btrfs as the replacement to ext4 shows promise but is still not really ready

----------

## asturm

The number one priority for a filesystem is to be boring, uneventful, not giving you any headaches. The SSD will be fast anyway. ext4 fulfills that condition perfectly.

----------

## NeddySeagoon

Take into account that one day you may discover that two of your options become 'write only' filesystems.

----------

## reddragon

thanks i will use ext4

----------

## roki942

 *NeddySeagoon wrote:*   

> Take into account that one day you may discover that two of your options become 'write only' filesystems.

 I tried googling that but didn't find anything about becoming write only. Would you please explain that a bit?

----------

## Naib

 *roki942 wrote:*   

>  *NeddySeagoon wrote:*   Take into account that one day you may discover that two of your options become 'write only' filesystems. I tried googling that but didn't find anything about becoming write only. Would you please explain that a bit?

 well.. if you are lucky when the file system fails you can write but not read. slightly more useful than not being able to write or read. Not by much but a bit better

----------

## NeddySeagoon

roki942,

Its like /dev/null.  You can put data in but never read it.

All your data is lost.

----------

## uberDoward

If you're going to have a lot of large files, I'll suggest xfs  :Smile: 

----------

## Proinsias

 *uberDoward wrote:*   

> If you're going to have a lot of large files, I'll suggest xfs 

 

How big is large?

----------

## depontius

 *Proinsias wrote:*   

>  *uberDoward wrote:*   If you're going to have a lot of large files, I'll suggest xfs  
> 
> How big is large?

 

I've got gobs of MythTV files, the largest 15.3G, many slightly smaller, and run-of-the-mill 3-6G.

----------

## Proinsias

I have very few files beyond a gigabyte or two. I've used ext4 and been happy with it for a few years but went wild this evening and done a mkfs.xfs on a usb thumbdrive, it hasn't gone on fire yet so I might experiment a little more.

----------

## depontius

When I was first setting up MythTV they advised xfs simply because TV recordings are so big.  That was just a few years ago - I'm not sure if ext4 was out at the time.  Not having a better or more informed opinion, I took their advice, and have been happy.  For more normal use I've stuck to ext4, though.

----------

## Aquous

Hi guys,

Random thought that crossed my mind: my / is on an SSD, so it would probably benefit from being formatted as f2fs, rather than ext4. Last I checked, f2fs was still quite experimental, but I don't know what its current state is. A quick Google search indicates that there appears to be a working fsck tool now, and I know that various phone manufacturers are beginning to use it (although in Android ROMs / is always read-only, so there's basically no risk for them). What do you guys think - is anybody using f2fs for /, and how is it working for you?

----------

## Goverp

A recent discussion of exactly this question

can be found here

----------

## R0b0t1

Hello,

It is mature enough for me to consider using it on a rather important, but not my only, system. However if you look there are some changes you can make to your ext4 filesystems that make them more compatible with SSDs, though not exactly like f2fs. Eventually it seems like all important work in f2fs may get added into ext4.

----------

## khayyam

 *R0b0t1 wrote:*   

> It is mature enough for me to consider using it on a rather important, but not my only, system. However if you look there are some changes you can make to your ext4 filesystems that make them more compatible with SSDs, though not exactly like f2fs. Eventually it seems like all important work in f2fs may get added into ext4.

 

R0b0t1 ... you have any links to that discussion? I was thinking of f2fs for an old dell netbook (with an 8GB SSD) just for the hell of it, but I've been holding off due to lack of time. How soon might "eventually" be?

TIA & best ... khay

----------

## Roman_Gruber

 *Aquous wrote:*   

> Hi guys,Last I checked, f2fs was still quite experimental, but I don't know what its current state is. A quick Google search indicates that there appears to be a working fsck tool now, and I know that various phone manufacturers are beginning to use it (although in Android ROMs / is always read-only, so there's basically no risk for them). What do you guys think - is anybody using f2fs for /, and how is it working for you?

 

Most Fs are experimental.

 *Quote:*   

> lthough in Android ROMs / is always read-only

 

How comes?

Why should they be read-only on a phone or tablet?

There are always writes.

--

I have a quite old google developer phone.

I use f2fs for quite a while with a custom bootloader

f2fs has benefits for phones.

On a desctop I suggest you tweak ext4.

 *Quote:*   

> anybody using f2fs for /

 

I use it on my two developer phones and tablet.

 *Quote:*   

>  so there's basically no risk for them)

 

why is there no risk?

A phone has to work with the desired functionality in an emergency for example

----------

## Naib

https://forums.gentoo.org/viewtopic-t-1062564-highlight-.html

----------

## Naib

https://forums.gentoo.org/viewtopic-t-1062564-highlight-.html

----------

## R0b0t1

 *khayyam wrote:*   

>  *R0b0t1 wrote:*   It is mature enough for me to consider using it on a rather important, but not my only, system. However if you look there are some changes you can make to your ext4 filesystems that make them more compatible with SSDs, though not exactly like f2fs. Eventually it seems like all important work in f2fs may get added into ext4. 
> 
> R0b0t1 ... you have any links to that discussion? I was thinking of f2fs for an old dell netbook (with an 8GB SSD) just for the hell of it, but I've been holding off due to lack of time. How soon might "eventually" be?
> 
> TIA & best ... khay

 

Sorry khay, I realize it is something I should provide a citation for but I can't remember much about the discussion where I found it. "Eventually" in this case would be multiple years.

----------

## Hu

 *Roman_Gruber wrote:*   

> Most Fs are experimental.

 You have an odd definition of experimental.  What do you consider non-experimental in the filesystem realm?

 *Roman_Gruber wrote:*   

>  *Quote:*   lthough in Android ROMs / is always read-only 
> 
> How comes?
> 
> Why should they be read-only on a phone or tablet?
> ...

 On most mobiles, / is used only for content from the vendor, so there is no need to write to it except on those extremely rare occasions the vendor can be bothered to provide (usually quite belated) software updates.  The rest of the time, / has no need to change, so it could be read-only without impacting the functionality.  In my opinion, if there is no functionality loss from making a mount read-only, then it ought to be made read-only.

As an aside, on a real ROM, in the original definition of the word, / would of course be read-only because it was stored in Read Only Memory ("ROM").  Attempts to write to it would fail because the memory literally could not be modified.  I recognize that popular usage has thoroughly perverted this definition, though, so people frequently use ROM to refer to things other than actual hardware-enforced read-only memory.

 *Roman_Gruber wrote:*   

>  *Quote:*    so there's basically no risk for them) 
> 
> why is there no risk?
> 
> A phone has to work with the desired functionality in an emergency for example

 Most risk from filesystems would come from buggy code modifying the filesystem in a way that produces bad results (whether corruption, privilege elevation, information disclosure through mangled ACLs, etc.).  If the filesystem is mounted read-only, or stored on a block device that enforces immutability, then many, though not all, classes of problems become impossible.

----------

## n05ph3r42

 *Aquous wrote:*   

> Hi guys,
> 
> Random thought that crossed my mind: my / is on an SSD, so it would probably benefit from being formatted as f2fs, rather than ext4. Last I checked, f2fs was still quite experimental, but I don't know what its current state is. A quick Google search indicates that there appears to be a working fsck tool now, and I know that various phone manufacturers are beginning to use it (although in Android ROMs / is always read-only, so there's basically no risk for them). What do you guys think - is anybody using f2fs for /, and how is it working for you?

 

Hi,

 I use F2FS for / more than a year on my notebook, works like a charm. SSD is  Samsung 840 Pro. 

Fsck run on boot since 4.10.x kernel update (or after certificates update, im not sure), because of uncommon characters in turkish certificates filenames (seems like crc cannot calculate right checksum for them).

----------

## mirekm

I also use f2fs as root filesystem since over 1 year.

It works very well, and I didn't got any problems with that.

Additionally I make this filesystem as RO. There are only several files that system want to update during runtime (like mtab, and resolv.conf).

and I made mtab softlink to /proc/mounts.

and resolv.conf an softlink to /run/resolv.conf (which I create during startup).

----------

## pjp

 *Aquous wrote:*   

> Hi guys,
> 
> Random thought that crossed my mind: my / is on an SSD, so it would probably benefit from being formatted as f2fs, rather than ext4. Last I checked, f2fs was still quite experimental, but I don't know what its current state is. A quick Google search indicates that there appears to be a working fsck tool now, and I know that various phone manufacturers are beginning to use it (although in Android ROMs / is always read-only, so there's basically no risk for them). What do you guys think - is anybody using f2fs for /, and how is it working for you?

  Merged to consolidate for future searchers.

 *Goverp wrote:*   

> I've formatted the SD card for one of my Raspberry Pi's (an old model B) for f2fs.  Did I do wrong, and should I stick to ext4 (with appropriate tune2fs settings)?  I know when it was new f2fs users reported issues, but that's to be expected; has it improved?

  Merged to consolidate with a newer thread (this post). Result is that posts title becoming the new thread title.

----------

## Naib

Just to bump this... Pushing again filesystems are meant to be boring...

CVE-2017-10663 is over a missing buffer boundary check.

CVE-2017-10662 is regards to a possible integer overflow.

CVE-2017-0750 is another missing boundary check.

----------

## eccerr0r

Honestly it doesn't matter, as long as the underlying wear leveling and flash media is actually "good".

Bad/crappy flash media and bad wear leveling, like in most cheap SD cards, you're dead or going to die either way whether you use f2fs or ext4fs or xfs.  BACKUP.

I would imagine f2fs is good for raw NAND flash, though I think most phones use emmc which is a "cooked" interface (meaning, embedded wear leveling) and thus should be fs agnostic.

So far I have one 16GB "full" xfce Gentoo install on a flash USB stick and so far so good.  It's using ext3fs.  Most of my SD cards that I try to do the same thing has failed by now.

Note that most SD / USB cards don't pass TRIM commands and ext4fs probably don't do much for these... but again if it has good wear leveling then it's not entirely necessary, just a speed bump.

----------

