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

F2FS with aufs overlay

Mon Dec 16, 2013 10:42 pm

I've been playing a bit more with F2FS with an F2FS overlay.

It's seeming fairly resilient and performant. Using 1.2 of f2fs tools fsck seems to at least pretend to repair problems on sudden loss of power.

My own image is fairly heavily customised to do a very specific headless loginless task so is not suitable for general distribution (/etc/rc.local is a thousand of lines mess that copes with lots of different hardware configs. It's grown over the last 2 years & is well overdue a rewrite from scratch).

Having said that, if there is enough interest I would be willing to put a generic raspian image onto f2fs with an aufs overlay with the only customisation being "my" kernel, which is now up to 3.12.4 and make available an image of it suitable for deploying to a 4GB or bigger SD card.

I use a 3rd partition for the RW overlay as I need to persist changes over reboots, but I want to minimise the main fs write activity and be able to roll back to a known good state if the RW branch corrupts.

Anyway enough waffle. Some of you have played with the aufs overlay instructions I have contributed to here using ext2/3/4.

If there is enough interest I will release an F2FS image.

When I next update my kernel/initrd.cpio in the main aufs thread that will be good enough to support your own rolled F2FS card, but getting to that point (an F2FS installation) is a non-trivial exercise.

Anyway, let me know you are interested.

MF

User avatar
hojnikb
Posts: 128
Joined: Mon Jun 04, 2012 3:59 pm
Location: @Home

Re: F2FS with aufs overlay

Tue Dec 17, 2013 1:15 pm

what about normal f2fs image with no overlay... Is this possible at this point ?
I would like to try f2fs, because my usb drive sux, when dealing with random data... I just dont have an idea how to convert and setup everything to work with f2fs.
+°´°+,¸¸,+°´°~ Everyone should have a taste of UK Raspberry Pie =D ~°´°+,¸¸,+°´°+
Rasberry Pi, SoC @ 1225Mhz :o, 256MB Ram @ 550Mhz, 16GB SD-Card, Raspbian

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

Re: F2FS with aufs overlay

Thu Dec 19, 2013 3:53 pm

OK,

I have taken vanilla Raspian and apt-get safe-upgraded'd it. (Java is removed due to some space constraints)
Firmware is at the latest version, and the kernel is my build of 3.12.4 with AUFS support.
F2FS root filesystem.
As it comes it will mount the rootfs directly with no AUFS overlay.
You can
mount -o remount,rw /boot; cp /boot/cmdline.txt.aufs /boot/cmdline.txt ; sync ; mount -o remount,ro /boot
to enable a permanent aufs overlay (partition 3) with partition 2 mounted read only.

A full fsck is done on every boot, this can take a minute, maybe 2, so don't be surprised if the console output appears to stop, just wait it out.....

This is suitable for deploying to a 4GB (or larger) SD card with dd/rawrite/whatever tool you use to deploy raw images (don't forget to un7zip it first!).

There is a little space left free at the end of the SD card, so if yours happens to be slightly smaller it should still be OK even if you get an I/O error at the end of the dd.

You can grab it from:
https://dl.dropboxusercontent.com/u/151 ... c18.img.7z

Most things are built in as modules to the kernel, however the sound system is disabled as I have no use for it, so don't be surprised if it doesn't work.

mkfs.f2fs and fsck.f2fs are included by hand compilation of the latest versions, rather than being owned by any packages.

Use entirely at your own risk.

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

Re: F2FS with aufs overlay

Thu Dec 19, 2013 9:05 pm

I suppose I should have mentioned that you can use a tmpfs RWFS overlay which gives you an RO SDcard which resets to the default on every boot, but also gives you what appears to be a fully RW file system with minimal risk of SD corruption. If you do go this route use ext4 for tmpfs, not f2fs.

rogerman
Posts: 3
Joined: Mon Jan 27, 2014 8:54 pm

Re: F2FS with aufs overlay

Mon Jan 27, 2014 10:02 pm

MattF wrote:OK,

I have taken vanilla Raspian and apt-get safe-upgraded'd it. (Java is removed due to some space constraints)
Firmware is at the latest version, and the kernel is my build of 3.12.4 with AUFS support.
F2FS root filesystem.
As it comes it will mount the rootfs directly with no AUFS overlay.
You can
mount -o remount,rw /boot; cp /boot/cmdline.txt.aufs /boot/cmdline.txt ; sync ; mount -o remount,ro /boot
to enable a permanent aufs overlay (partition 3) with partition 2 mounted read only.

A full fsck is done on every boot, this can take a minute, maybe 2, so don't be surprised if the console output appears to stop, just wait it out.....

This is suitable for deploying to a 4GB (or larger) SD card with dd/rawrite/whatever tool you use to deploy raw images (don't forget to un7zip it first!).

There is a little space left free at the end of the SD card, so if yours happens to be slightly smaller it should still be OK even if you get an I/O error at the end of the dd.

You can grab it from:
https://dl.dropboxusercontent.com/u/151 ... c18.img.7z

Most things are built in as modules to the kernel, however the sound system is disabled as I have no use for it, so don't be surprised if it doesn't work.

mkfs.f2fs and fsck.f2fs are included by hand compilation of the latest versions, rather than being owned by any packages.

Use entirely at your own risk.
Dear Mattf,

I started with RPI and it would be great use aufs for my purposes.
I had performed a rpi-update today (don't know if is the same one)
Do not know why, but when try to boot image, red led stays fixed as if card was empty.
I have seen a empty space on cards beginning (over 4 MB), I moved the partition to beginning but it seems not to be the problem.
If I'm not wrong when it is a firmware or version conflict, all leds blink a few seconds.
When do the dd comand on ubuntu looks all right (mount partitions and files are there), but raspberry don't want to start.

Also have tried other /boot files from other cards, but no luck.

What's wrong?

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

Re: F2FS with aufs overlay

Mon Jan 27, 2014 10:32 pm

Hi,

I'm assuming you've downloaded the image I linked from Dropbox and dd'd it to an SD card (with a block size of 1M).

That at least should boot.

You need to use something like your Ubuntu system to do that (not on the Pi)

If you then subsequently update the card, care needs to be taken as /boot is mounted read only and you may run into a conflict. Even then I'd expect the kernel to boot unless /boot has corrupted

rogerman
Posts: 3
Joined: Mon Jan 27, 2014 8:54 pm

Re: F2FS with aufs overlay

Tue Jan 28, 2014 9:51 am

Hello,

I'm doing something wrong,I did step by step un ubuntu 10.04:
Download again from dropbox:
Yesterdays cksum: 1853084274 3904897024 ../DD/releases/pi/raspian-f2fs-dec18.img
Today......................:1853084274 3904897024 raspian-f2fs-dec18.img
Image copied to SD with:
[email protected]:~/crosscompiler# dd if=../DD/releases/pi/raspian-f2fs-dec18.img of=/dev/sdb bs=1M &
After that, checked sdb1(tried after and before check):
[email protected]:~/crosscompiler# sudo dosfsck -w -r -l -a -v -t /dev/sdb1
dosfsck 3.0.7 (24 Dec 2009)
dosfsck 3.0.7, 24 Dec 2009, FAT32, LFN
Checking we can access the last sector of the filesystem
Boot sector contents:
System ID "mkdosfs"
Media byte 0xf8 (hard disk)
512 bytes per logical sector
8192 bytes per cluster
16 reserved sectors
First FAT starts at byte 8192 (sector 16)
2 FATs, 16 bit entries
16384 bytes per FAT (= 32 sectors)
Root directory starts at byte 40960 (sector 80)
512 root directory entries
Data area starts at byte 57344 (sector 112)
7161 data clusters (58662912 bytes)
63 sectors/track, 255 heads
0 hidden sectors
114688 sectors total
Checking file /16-Dec-13.txt (16-DEC~1.TXT)
Checking file /start_cd.elf (START_CD.ELF)
Checking file /cmdline.txt (CMDLINE.TXT)
Checking file /cmdline.txt.aufs (CMDLIN~1.AUF)
Checking file /cmdline.txt.noaufs (CMDLIN~1.NOA)
Checking file /config.txt (CONFIG.TXT)
Checking file /fixup_cd.dat (FIXUP_CD.DAT)
Checking file /fixup.dat (FIXUP.DAT)
Checking file /.fseventsd (FSEVEN~1)
Checking file /fixup_x.dat (FIXUP_X.DAT)
Checking file /._.Trashes (_~1.TRA)
Checking file /start.elf (START.ELF)
Checking file /.Trashes (TRASHE~1)
Checking file /issue.txt (ISSUE.TXT)
Checking file /.firmware_revision (FIRMWA~1)
Checking file /start_x.elf (START_X.ELF)
Checking file /kernel_aufs.311.img (KERNEL~1.IMG)
Checking file /kernel_aufs.img (KERNEL~2.IMG)
Checking file /bootcode.bin (BOOTCODE.BIN)
Checking file /.apdisk (APDISK~1)
Checking file /.fseventsd/.
Checking file /.fseventsd/..
Checking file /.fseventsd/fseventsd-uuid (FSEVEN~1)
Checking file /.Trashes/.
Checking file /.Trashes/..
Checking for bad clusters.
Reclaiming unconnected clusters.
/dev/sdb1: 21 files, 1552/7161 clusters
Could be the card type? It is a SanDisk 8Gb class10. SDHC I but works with raspberrypi.org images.

When connect to power, green led blinks one time and after that only the red one remains fix.
Also tried changing bootcode.bin, fixup.dat , start.elf picked form working set.
It is a rebel pi :lol: !!!!!

notfrombrooklyn
Posts: 1
Joined: Thu May 29, 2014 3:22 pm

Re: F2FS with aufs overlay

Thu May 29, 2014 3:25 pm

Hey MattF, your dropbox link is down. Could you share the image again?

Return to “Advanced users”