LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM
User Name
Password
Slackware - ARM This forum is for the discussion of Slackware ARM.

Notices


Reply
  Search this Thread
Old 11-06-2019, 02:01 AM   #1
Desiderius
Member
 
Registered: Jun 2017
Location: France
Distribution: Slackware
Posts: 151

Rep: Reputation: Disabled
F2FS for SD cards


Hi all

Looking at the SD cards for my RPI , I was told that the best OS to put on the SD card is F2FS.

I did not know this filesytem but I have seen that it has been put in the Linux kernel and that Slackware current has the f2fs tools.

Is this filesytem realy more interesting than ext4 for SD cards ?
 
Old 11-06-2019, 10:38 AM   #2
DMcCunney
LQ Newbie
 
Registered: Feb 2009
Posts: 16

Rep: Reputation: 2
What will you do with the SD card?

My understanding is that FSFS is intended for solid state drives, which are a rather different animal. SSDs and SD cards are both flash media, but have different use cases and requirements.

My desktop boots from an SSD, and applications all live there. Data tends to live elsewhere. I have an assortment of USB thumbdrives that are used for backups and data I need to be portable. Those come formatted as FAT32 or exFAT, and I leave them that way. Linux can read and write FAT32 cards using the built-in support in the kernel. exFT may not be supported out of the box, but support can be added by installing the exfat-fuse and exfat-utils packages.

SD cards come formatted the same ways. My use for SD cards here is external data storage on Android devices. The devices can normally read the cards as formatted by the manufacturer. What I can't do with them is store on and run programs from them - FAT* filesystems have no place to store the metadata the kernel needs to run programs, like the application's owner, group, and permissions mask. (Some newer Android devices will offer to "adopt" a large capacity SD card when you insert it. If you say yes, the device will reformat the card as ext4, which is what Android uses internally. This will let you store programs on and run them from the card, but forget about trying to pop the card and reading it in something else. I played with that and decided it was more trouble for me than it was worth.)

I have no reason to format SD cards as ext4, let alone F2FS. Tell me what you want to do that might need either?
______
Dennis
 
Old 11-06-2019, 01:52 PM   #3
drmozes
Slackware Contributor
 
Registered: Apr 2008
Distribution: Slackware
Posts: 1,540

Rep: Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309Reputation: 1309
Quote:
Originally Posted by Desiderius View Post
Hi all

Looking at the SD cards for my RPI , I was told that the best OS to put on the SD card is F2FS.

I did not know this filesytem but I have seen that it has been put in the Linux kernel and that Slackware current has the f2fs tools.

Is this filesytem realy more interesting than ext4 for SD cards ?
What did you hear ?

I don't know about this FS, but to me, whatever's being hammered the most by disk writes and reads is the only concern.
Think /var/log, swap and any other location that stores volatile data, or that serves it constantly and it's too be to be cached in RAM by the kernel.
Other than that and any metadata that the filesystem itself maintains and modifies or reads frequently, what's it matter? :-)
 
Old 11-07-2019, 01:18 AM   #4
Desiderius
Member
 
Registered: Jun 2017
Location: France
Distribution: Slackware
Posts: 151

Original Poster
Rep: Reputation: Disabled
Thanks for your answer which is what I was thinking !

I only want to put the OS on the SD card and all the data on an USB3 key.

I wonder if the many write/read of /var /usr /swap .. is better managed by F2FS but as @drmozes said it should be better to put them into memory


Quote:
Originally Posted by DMcCunney View Post
What will you do with the SD card?

My understanding is that FSFS is intended for solid state drives, which are a rather different animal. SSDs and SD cards are both flash media, but have different use cases and requirements.

My desktop boots from an SSD, and applications all live there. Data tends to live elsewhere. I have an assortment of USB thumbdrives that are used for backups and data I need to be portable. Those come formatted as FAT32 or exFAT, and I leave them that way. Linux can read and write FAT32 cards using the built-in support in the kernel. exFT may not be supported out of the box, but support can be added by installing the exfat-fuse and exfat-utils packages.

SD cards come formatted the same ways. My use for SD cards here is external data storage on Android devices. The devices can normally read the cards as formatted by the manufacturer. What I can't do with them is store on and run programs from them - FAT* filesystems have no place to store the metadata the kernel needs to run programs, like the application's owner, group, and permissions mask. (Some newer Android devices will offer to "adopt" a large capacity SD card when you insert it. If you say yes, the device will reformat the card as ext4, which is what Android uses internally. This will let you store programs on and run them from the card, but forget about trying to pop the card and reading it in something else. I played with that and decided it was more trouble for me than it was worth.)

I have no reason to format SD cards as ext4, let alone F2FS. Tell me what you want to do that might need either?
______
Dennis
 
Old 11-08-2019, 11:42 AM   #5
Didier Spaier
LQ Addict
 
Registered: Nov 2008
Location: Paris, France
Distribution: Slint64-15.0
Posts: 11,057

Rep: Reputation: Disabled
Quote:
Originally Posted by DMcCunney View Post
My understanding is that FSFS is intended for solid state drives, which are a rather different animal. SSDs and SD cards are both flash media, but have different use cases and requirements.
Actually f2fs is adapted to NAND flash memory storage devices, such as SSD, eMMC, and SD cards equipped with a flash translation layer aka FTL (quoting https://www.kernel.org/doc/Documenta...stems/f2fs.txt). If the controller (that does the translation) is good enough it will protect the drive from wearing out fast, but this notwithstanding f2fs, beyond also avoiding this wearing out, is specifically adapted to these drives, thus supposed to provide better performances.

So yes, using it for an SD card is a better choice than ext4 IMO. Additionally you may want to not only count on caching by the kernel, but also have /tmp in tmpfs, and also store the cached files in your $HOME in /dev/shm/desiderius. For instance in my ~/.profile I have this code snippet:
Code:
export XDG_CACHE_HOME=/dev/shm/$(whoami)
mkdir -p /dev/shm/$(whoami)
chmod 700 /dev/shm/$(whoami)
export XDG_RUNTIME_DIR=$XDG_CACHE_HOME
As far as I know all desktops app work well with this setting. I also mount such file systems with noatime and nodiratime options, but I digress and you may want to know the access times

PS I base my opinion on this matter on a discussion on the f2fs-dev mailing list:
Initial post: https://sourceforge.net/p/linux-f2fs...sage/36753508/
Answer 1: https://sourceforge.net/p/linux-f2fs...sage/36753600/
Answer 2: https://sourceforge.net/p/linux-f2fs...sage/36754211/
Granted, you wouldn't expect from f2fs devs that they do not say it's good

Additionally, I suggest using a fairly recent kernel, like 5.4.0_rc6 now provided in /testing as enhancements of f2fs are provided at a fast pace, even though 4.19 be OK.

Last edited by Didier Spaier; 11-08-2019 at 12:57 PM. Reason: PS added.
 
2 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Initial F2FS File-System Results Are Impressive LXer Syndicated Linux News 0 10-21-2012 03:50 PM
LXer: Open-source Flash file system F2FS released by Samsung LXer Syndicated Linux News 0 10-09-2012 12:10 PM
LXer: Samsung contributes F2FS NAND filesystem to Linux LXer Syndicated Linux News 0 10-08-2012 12:30 PM
LXer: Samsung Introduces New Linux File-System: F2FS LXer Syndicated Linux News 0 10-05-2012 07:10 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware > Slackware - ARM

All times are GMT -5. The time now is 01:04 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration