Disconnect
Posts: 12
Joined: Fri Nov 16, 2012 7:37 pm

F2FS

Fri Dec 14, 2012 9:00 pm

Just in case anyone was curious, I've been messing with f2fs on pi for a few days now. With the most recent set of patches (report used inodes as a positive number, for example) it seems ready for experimental prime-time. I did a bit of copying here and there, speeds on media files (treated as 'cold' based on the extension list fed to it at mkfs time) are comparable to ext4, and it has successfully been seeding a pile of isos and such (including raspberry of course) for 4 days without any issues. It is set to mild OC (850mhz iirc) and running the main system off sd still.

I didn't do any special tuning at mkfs time, mostly because the defaults should be ok and I can't find a good map between the flash info at https://wiki.linaro.org/WorkingGroups/K ... CardSurvey and the mkfs parameters..

Later today I'll convert over to run off usb entirely. Then (once I make sure my backups are ok) I'll convert my working-server pi over. (Raspbian stock, OC to 1ghz, running entirely off usb.)

If anyone wants the patch (or a 3.6.y kernel with it enabled) let me know.

More info on f2fs is, well, everywhere :) but https://lwn.net/Articles/518988/ has a good write-up from when it was first announced.

Disconnect
Posts: 12
Joined: Fri Nov 16, 2012 7:37 pm

Re: F2FS

Fri Dec 14, 2012 10:07 pm

First problem with a straight copy fo f2fs-root is lack of fsck. (Creating a noop fsck.f2fs shell script works.) The other problem is that you can't have swapfile on f2fs so if you want swap you need to create a partition.

User avatar
eix
Posts: 85
Joined: Sat Sep 15, 2012 8:09 am

Re: F2FS

Sat Feb 09, 2013 4:01 pm

hi Disconnect, how's going your experience with F2FS? Still using it?
Would you reccomend it or did you identify problems clearly related to it?

anto
Posts: 26
Joined: Tue Jan 01, 2013 5:20 pm
Location: Vienna, Austria

Re: F2FS

Sun Mar 24, 2013 12:25 am

Disconnect wrote:First problem with a straight copy fo f2fs-root is lack of fsck. (Creating a noop fsck.f2fs shell script works.) The other problem is that you can't have swapfile on f2fs so if you want swap you need to create a partition.
I have been playing around with F2FS recently. As you mentioned, there is no fsck.f2fs so far, so I have to disable the fsck flag on the fstab. But I am wondering why you wrote that we can not have swapfile on f2fs, because it seems to work fine on mine. Could you please let me know what the exact problems are?

User avatar
eix
Posts: 85
Joined: Sat Sep 15, 2012 8:09 am

Re: F2FS

Sat Apr 06, 2013 7:25 am

Do I need special kernel to use F2FS or will work with current Raspbian?

anto
Posts: 26
Joined: Tue Jan 01, 2013 5:20 pm
Location: Vienna, Austria

Re: F2FS

Sat Apr 06, 2013 8:56 pm

eix wrote:Do I need special kernel to use F2FS or will work with current Raspbian?
Are you expecting that you just need to update your kernel to the most updated Raspbian kernel?
Well... You definitely need to do more than that.
F2FS is officially only available on kernel 3.8+. But there are some people backporting the F2FS patch into the older kernels. You can get the patch for Raspbian kernel 3.6.11 for instance on this topic , which I have tried and failed but I don't want to pursue it further.
After you manage to compile your kernel with F2FS patch, you then need to compile f2fs-tools package as you need mkfs.f2fs tool to format your device. I use the source of f2fs-tools package from Debian Sid repository.

JerryPi
Posts: 17
Joined: Tue Nov 20, 2012 8:25 am

Ext4, F2FS, BTRFS

Tue Jul 23, 2013 2:50 pm

Last week I was messing around with the 3.10.0+ kernel, and decided to tryout F2FS.
I used these two simple scripts.
sdtest-block:

Code: Select all

#!/bin/bash
echo "48 MiB write test, 2x repeatition:";

echo -e "\nBlock size = 4M";
echo "Test 1:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=4M count=12
rm ./test.dat
echo "Test 2:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=4M count=12
rm ./test.dat

echo "Block size = 2M";
echo "Test 1:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=2M count=24
rm ./test.dat
echo "Test 2:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=2M count=24
rm ./test.dat

echo -e "\nBlock size = 1M";
echo "Test 1:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=1M count=48
rm ./test.dat
echo "Test 2:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=1M count=48
rm ./test.dat

echo -e "\nBlock size = 512k";
echo "Test 1:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=512k count=96
rm ./test.dat
echo "Test 2:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=512k count=96
rm ./test.dat

echo -e "\nBlock size = 4k";
echo "Test 1:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=4k count=12288
rm ./test.dat
echo "Test 2:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=4k count=12288
rm ./test.dat

echo -e "\nBlock size = 2k";
echo "Test 1:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=2k count=24576
rm ./test.dat
echo "Test 2:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=2k count=24576
rm ./test.dat

echo -e "\nBlock size = 1k";
echo "Test 1:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=1k count=49152
rm ./test.dat
echo "Test 2:";
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=./test.dat bs=1k count=49152
rm ./test.dat 
sdtest-writezero:

Code: Select all

#!/bin/bash
echo -e "\n /dev/zero tests"
echo -e "\nWrite zero bs=1M 10MiB"
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=test-a bs=1M count=10
echo -e "\nRead zero bs=1M 10MiB"
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=test-a of=/dev/null bs=1M count=10
rm test-a

echo -e "\nWrite zero bs=1M 50MiB"
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=test-b bs=1M count=50
echo -e "\nRead zero bs=1M 50MiB"
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=test-b of=/dev/null bs=1M count=50
rm test-b

echo -e "\nWrite zero bs=1M 100MiB"
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=/dev/zero of=test-c bs=1M count=100
echo -e "\nRead zero bs=1M 100MiB"
sync; echo 1 > /proc/sys/vm/drop_caches
dd if=test-c of=/dev/null bs=1M count=100
rm test-c
Here are the results. It is all done on a SanDisk microSD HC 16GB mobile Ultra 30MB/s UHS-I Class 10, using a 3.10.0+ kernel and a 512MB RPI running raspbian.
Ext4:

Code: Select all

	Ext4		
Block size write test	Pass 1	Pass 2	Average
48MiB write test, block size=4M	51,9 MB/s	51,8 MB/s	51,85 MB/s
48MiB write test, block size=2M	50,8 MB/s	52,7 MB/s	51,75 MB/s
48MiB write test, block size=1M	52,5 MB/s	49,2 MB/s	50,85 MB/s
48MiB write test, block size=512k	50,0 MB/s	50,3 MB/s	50,15 MB/s
48MiB write test, block size=4k	49,8 MB/s	50,3 MB/s	50,05 MB/s
48MiB write test, block size=2k	34,0 MB/s	35,8 MB/s	34,90 MB/s
48MiB write test, block size=1k	20,7 MB/s	21,2 MB/s	20,95 MB/s

Write test, block size=1M	Ext4
10MiB Write	52,2 MB/s
50MiB Write	50,5 MB/s
100MiB Write	11,9 MB/s

Read test, block size=1M	Ext4
10MiB Read	21,4 MB/s
50MiB Read	21,5 MB/s
100MiB Read	21,5 MB/s
F2FS:

Code: Select all

	F2FS		
Block size write test	Pass 1	Pass 2	Average
48MiB write test, block size=4M	85,7 MB/s	82,0 MB/s	83,85 MB/s
48MiB write test, block size=2M	86,1 MB/s	84,1 MB/s	85,10 MB/s
48MiB write test, block size=1M	81,9 MB/s	86,7 MB/s	84,30 MB/s
48MiB write test, block size=512k	82,1 MB/s	83,2 MB/s	82,65 MB/s
48MiB write test, block size=4k	96,8 MB/s	94,1 MB/s	95,45 MB/s
48MiB write test, block size=2k	64,2 MB/s	62,0 MB/s	63,10 MB/s
48MiB write test, block size=1k	41,9 MB/s	43,0 MB/s	42,45 MB/s

Write test, block size=1M	F2FS
10MiB Write	92,6 MB/s
50MiB Write	78,5 MB/s
100MiB Write	14,2 MB/s

Read test, block size=1M	F2FS
10MiB Read	21,0 MB/s
50MiB Read	21,5 MB/s
100MiB Read	21,4 MB/s
Writing small files on F2FS sure looks very promising! I am fighting the urge to try it out as a root fs, due to lack of fsck.

On the other hand, I have another RPI, which had a bad SD card, that would silently corrupt data (silent read errors are the worst kind of errors!) and the system would start segfaulting. Every time I ran debsums, there was more corruption. I decided that was the perfect opportunity to try out BTRFS in raid1 mode. Beside the boot partition I made two equally sized partitions and a btrfs raid1 on top of that. Then I transfered the system on it (you need a custom initramfs and kernel with support for it). I was getting around 10 recoverable errors per hour and was so pleased with the setup, that I decided to transfer it to a good SD card.
Just for the sake of comparison, here are the results, but keep in mind, its raid1 on the same card. These were done on a 3.6.11+ kernel and a RPI with only 256MB of ram running Raspbian:

BTRFS, raid1, autodefrag:

Code: Select all

	BTRFS (raid1, autodefrag)		
Block size write test	Pass 1	Pass 2	Average
48MiB write test, block size=4M	8,8 MB/s	6,0 MB/s	7,40 MB/s
48MiB write test, block size=2M	8,5 MB/s	6,8 MB/s	7,65 MB/s
48MiB write test, block size=1M	6,0 MB/s	6,4 MB/s	6,20 MB/s
48MiB write test, block size=512k	7,6 MB/s	5,6 MB/s	6,60 MB/s
48MiB write test, block size=4k	13,3 MB/s	6,9 MB/s	10,10 MB/s
48MiB write test, block size=2k	3,2 MB/s	4,2 MB/s	3,70 MB/s
48MiB write test, block size=1k	3,6 MB/s	3,8 MB/s	3,70 MB/s

Write test, block size=1M	BTRFS(raid1,autodefrag)
10MiB Write	124,0 MB/s
50MiB Write	10,0 MB/s
100MiB Write	3,3 MB/s

Read test, block size=1M	BTRFS(raid1,autodefrag)
10MiB Read	21,1 MB/s
50MiB Read	21,9 MB/s
100MiB Read	22,1 MB/s
Don't grow up, it's a trap!

MattF
Posts: 55
Joined: Tue Feb 12, 2013 10:01 am

Re: F2FS

Tue Jul 23, 2013 9:31 pm

f2fs tools added fsck a couple of weeks ago, but it doesn't seem very reliable (at least on arm) for me, unless I've mis-built it.

Anyone else tried yet?

JerryPi
Posts: 17
Joined: Tue Nov 20, 2012 8:25 am

Re: F2FS

Wed Jul 24, 2013 1:26 pm

Yeah, current f2fs-tools can only check fs consistency and fragmentation. It can not repair a broken fs just yet.
Don't grow up, it's a trap!

ae.vasconcelos
Posts: 11
Joined: Sun Dec 22, 2013 10:18 pm

Re: F2FS

Mon Jan 06, 2014 11:15 am

Hi,

I'm sorry to revive an old thread but I had the need of resizing the partitions created by a raspbmc installation and found out that I couldn't because the gparted on my linux box listed that partition as "unknown".

After reading a bit about f2fs I noticed the no fsck issue. So I don't feel very safe using a fs that I can't repair on need.

Do you have any additional info about the use of this fs on the Pi ?

TIA

--
vasco

sarfarazahmad
Posts: 1
Joined: Wed Jan 21, 2015 4:55 am

Re: F2FS

Wed Jan 21, 2015 4:59 am

time to revive an old thread.


As of version 1.14 f2fs has fsck support.
ext4 was getting corrupted for me running root of a Hp usb drive 16GB. (sdcard has /boot readonly).
I am using f2fs and am pleasantly surprised. however thats just the initial take and it will take a while for f2fs to earn my faith.
Anybody using the same out there ? Any ideas/ inputs on this ?

http://www.phoronix.com/scan.php?page=n ... px=MTc5Mjk

User avatar
ambrosa
Posts: 7
Joined: Tue Feb 03, 2015 6:08 am
Location: Milan - Italy

Re: F2FS

Sun Jan 29, 2017 8:21 am

I've a big issue involving F2FS.
I've posted the issue here: viewtopic.php?f=28&t=172102&p=1101367#p1101367
and here: https://sourceforge.net/p/linux-f2fs/ma ... sg35621355
without any answer.

Any idea ?
If not, I reinstall my system with ext4.

Return to “Advanced users”