[MOD][F2FS partition file system]Nuova gestione della memoria : dubbi e consigli
Ormai se ne parla sempre di piu ed è doveroso sapere di cosa si tratta dato che tutte le rom e i kernel per il nostro gnex stanno adottando questa nuova partizione del file system.
L'idea è nata dalla Samsung che ha creato un file system chiamato F2FS pensato appositamente per le memorie di smartphone e tablet e l’ha donato alla comunità Linux. Samsung non è nuova ad iniziative di questo genere, visto che già in passato aveva creato il file system RFS, adottato sul Galaxy S, ma i risultati erano stati poveri. F2FS sta per Flash-friendly File System e deriva da LFS (Log-structured File System), ma migliora quest’ultimo eliminandone molte limitazioni.
Questa è la descrizione che ne dà Samsung nella mailing list del kernel:
i
“[F2FS is] a new file system carefully designed for the NAND flash memory-based storage devices. We chose a log structure file system approach, but we tried to adapt it to the new form of storage. Also we remedy some known issues of the very old log structured file system, such as snowball effect of wandering tree and high cleaning overhead. Because a NAND-based storage device shows different characteristics according to its internal geometry or flash memory management scheme aka FTL, we add various parameters not only for configuring on-disk layout, but also for selecting allocation and cleaning algorithms.”
“[F2FS è] un nuovo file system progettato con grande attenzione ai dispositivi con storage basato su memoria NAND flash. Abbiamo scelto un approccio di tipo log structured file system, ma abbiamo cercato di adattarlo a nuove forme di storage. Poniamo anche rimedio ad alcune problematiche conosciute del vecchissimo log structured file system, come l’effetto snowball del wandering tree e un grande overhead sulla pulizia. Poichè un dispositivo di storage basato su NAND mostra differenti caratteristiche secondo la sua geometria interna o scherma di gestione della memoria flash (noto anche come FTL), abbiamo aggiunto vari parametri non solo per configurare il layout on-disk, ma anche per selezionare gli algoritmi di allocazione e pulizia.”
Al momento attuale, F2FS altro non è che un insieme di 16 patch al kernel Linux, per un totale di circa 13’000 righe di codice. Il fatto che Samsung abbia deciso di condividere questo file system con tutto il mondo Linux invece che tenerlo in casa è molto positivo, poichè permette l’adozione da parte di tutti di tale file system ed anche un miglioramento condiviso e proveniente da tutti. Ci vorrà ancora del tempo prima che venga adottato dagli OEM, ma questo pare un importante passo avanti in ogni caso.
Grazie a FUSE e MTP non ci sarà poi bisogno di driver o di software terzi con Windows. Insomma, la situazione è un vantaggio per tutti. Grazie Samsung!
Questo file system è pensato per essere più veloce di file system tradizionali come EXT4 su memoria flash, ma è davvero più veloce? E se sì, di quanto? Un esperto XDA Androguide.fr ha deciso di misurare le differenze di prestazioni sul suo Sony Xperia Z1 con benchmark sintetici popolari, e il risultato vi sorprenderà.
Come ci si potrebbe aspettare, F2FS dimostrato di essere più veloce sulla Z1 che EXT4 nella stragrande maggioranza dei casi. Questo è stato dimostrato in diversi tipi di benchmark sintetici che vanno da operazioni di database per i parametri di stoccaggio di ordine superiore trovati in AnTuTu e Quadrant. E quando si cerca specificamente AndroBench (screenshot mostrato a destra), operazioni di database sono stati costantemente intorno un ordine di grandezza più veloce su F2FS che su EXT4. Velocità di scrittura di archiviazione sono state migliorate in misura ancora maggiore per le scritture sequenziali e casuali in questo benchmark sintetici, sia con sia maggiore di due ordini di grandezza più veloce su F2FS.
Ci sono pero anche degli svantaggi (almeno su Z1 ): F2FS è in realtà circa il 20% più lento in letture sequenziali di EXT4.
1. RL Bench
RL Bench is an SQLite benchmark, it only tests database read/writes with various SQL commands in various amounts.
As we can see in the results below, f2fs trumps ext4 with an overall time of only 14.417 seconds versus the 21.403 seconds of the latter.
2. Androbench
Androbench is supposedly an all-around I/O benchmark.
On this one, the results were so incredibly appart that I think we can safely assume a big part of these results are due to poor coding on the benchmark side.
Still, if we believe the results, f2fs provides slightly slower reads (51mbps vs 66mbps) but over 120x faster sequential writes & 300x faster random write speeds!
I had to reboot and run it a second time to make sure this wasn't an error, but the second run results were even a bit better, as you can see in the screenshots below.
3. CF-Bench
CF-Bench is an overall benchmark by Chainfire which measure everything except graphics.
Here again, f2fs is the winner with a better overall score.
That being said, the native writes are a little inferior to the ext4 native write score with 529 vs 535, but has a higher native read score with 996 vs 913.
4. 0xBenchmark
This reliable open-source benchmark by 0xlab is an overall benchmark used by the Linaro android team during their famous toolchain demonstration.
It has the advantage to output the results in text, xml and json, which you can download below.
On the SunSpider javascript benchmark run, f2fs gets a better score with 744.5ms vs 792.0ms for ext4.
Strangely, on Linpack, ext4 gets a better score with 156mflops/s vs 122mflops/s for f2fs.
On the other hand, Scimark2 reports better mflops/s scores for f2fs in all 6 of its tests, as seen below:
EXT4 Scimark2 Results in Mflops/s
codice:
Scimark2
------------------------------------------------------------
Composite:
191.7992650532917
Fast Fourier Transform:
121.33004358991259
Jacobi Successive Over-relaxation:
431.85904395507
Monte Carlo integration:
10.79962368351458
Sparse matrix multiply:
132.34248411160723
dense LU matrix factorization:
262.6651299263541
F2FS Scimark2 Results in Mflops/s
codice:
Scimark2
------------------------------------------------------------
Composite:
195.01022812596952
Fast Fourier Transform:
125.55719947408143
Jacobi Successive Over-relaxation:
436.3575761486842
Monte Carlo integration:
11.192272530363814
Sparse matrix multiply:
138.67117163604067
dense LU matrix factorization:
263.27292084067756
5. AnTuTu Benchmark
No need for an introduction, it's probably the most popular benchmark these days.
On this one again, f2fs is the clear winner with a difference of over 1200 points.
1. ADB setup installer 1.3 : Download
2. F2FS support TWRP Recovery (2.7.0.0) : Download
F2FS/EXT4 support TWRP Recovery (2.7.0.0) : Download
F2FS/EXT4 support TWRP Recovery (2.7.1.1) : Download
3. Base Zip package : Download
BEWARE!! backup everything in your phone to your Desktop Computer before operation!
Setup: (Windows 7/8 environment)
1. Setup the ADB Installer
1.1 Right-click the file adb-setup-1.3.exe and choose “Run as Administrator“.
1.2 Type “Y” and press Enter to install ADB and Fastboot, and set the environment variables. Enter “N” if you don’t want to do the same and want to just install the drivers.
1.3 In the next step, enter “Y” to install the drivers for your device. Enter “N” to skip this step.
1.4 Wait till the driver installation finishes up. That would take only some seconds.
2. Flash the TWRP recovery zip file with current recovery
3. Format the partition to F2FS
3.1 Reboot into recovery > Advanced > f2fs/ext4 switch >
3.2.Format all the partition listed to f2fs (Remember! you will lost everything with this, including the emulated sdcard partition!)
3.3 After Format, recomment to reboot the recovery again.
4. Update the Rom package
Open both the base package and rom package with archiver, drag the files(namely, the "boot.img" and the "META-INF" folder, Don't extract them! ) from base package and replace the Rom package.
5. Use adb sideload command to flash the patched rom and Gapps.
5.1 connect the phone with a usb cable, open a command prompt is from the place containing patched rom and gapps. Hold SHIFT and the right-click and choose “Open command prompt…"
5.2 input "adb sideload {complete name}.zip" to flash the patched-rom and gapps
5.3 reboot when finished
GUIDA PRATICA IN ITALIANO
thanks to gnex88,Nautiluz e tutti gli altri collaboratori che ormai ritengo esperti su questo campo!!
i
FATE UNA COPIA DI TUTTO QUELLO CHE VI SERVE E UN NANDROID BACKUP DELLA VOSTRA ROM E COPIATELI SUL PC
Metodi di conversione rom EXT4>F2FS
Metodo 1
i
a)scaricate il pacchetto EXT4_to_F2FS_gnex.zip da qui o da QUI ,relativo al vostro sistema operativo
Istruzioni per i vari sistemi operativi
Spoiler:
Windows instructions:
1) Unzip the windows zip to any empty folder.
2) Place your EXT4 gnex ROM zip in the same folder, make sure there are no other zips in this folder.
3) Run EXT4_to_F2FS_gnex.bat.
Linux instructions:
1) Ensure you have sed, zip, and unzip installed. And note that this is a bash script.
2) Unzip the linux zip to any empty folder.
3) Place your EXT4 gnex ROM zip in the same folder, make sure there are no other zips in this folder.
4) cd into your converter folder
5) Run "chmod +x EXT4_to_F2FS_gnex.sh". This only needs to be done once.
6) Run "./EXT4_to_F2FS_gnex.sh"
Android instructions:
1) Unzip the android zip to any empty folder on the SD card.
2) Place your EXT4 gnex ROM zip in the same folder, make sure there are no other zips in this folder.
3) Open an Android terminal
4) Run "su" (there's problems with unzipping when not root for some reason)
5) cd into your converter folder
6) Run "sh f2fs.sh"
ROMs that have successfully converted and booted:
Carbon
LiquidSmooth
Omni FML
Paranoid Android
SlimKat
TREX
Vanir
ROMs that have caused problems:
Shiny
b)Scompattare il pacchetto in una cartella vuota avendo cura che non ci siano spazi vuoti nella directory in cui lo estraete
c)Mettete la vostra rom in formato EXT4 nella stessa cartella
d)Avviate EXT4_to_F2FS_gnex.bat.
a)scaricate il pacchetto "Base Zip package" necessario per modificare la ROM (vedi sopra link)
b)scaricate lo zip della rom che volete "convertire"
c)scompattare il pacchetto "Base Zip package" e quello della vostra rom
d)trascinate i files presenti nello Base Zip package scompattato nella vostra rom scompattata e premete OK per confermare la sovrascrittura dei files
e)ricompattate la cartella dalla vostra rom (che adesso sarà in formato F2FS) in formato zip
FLASH ROM FORMATO F2FS
1)scaricate e installate il file adb (su pc) preferibilemnte in C:\adb o su un percorso facile da arrivarci
2)installate la recovery TWRP (ora c'è anche quella che va bene per flashare entrambi i tipi di rom EXT4/F2FS)
Spoiler:
F2FS support TWRP Recovery (2.7.0.0) : Download
F2FS/EXT4 support TWRP Recovery (2.7.0.0) : Download ***consigliata***
F2FS/EXT4 support TWRP Recovery (2.7.1.1) : Download
(per acquisire la nuova recovery dovete poi fare reboot to recovery se no rimanete nella vecchia!!!)
3)Entrate in recovery :
andare sul menu ADVANCED:
4)Wipe cache
5)Wipe Data Format (QUESTA ELIMINA DALLA VOSTRA SD, tutti i file e le cartelle!!!!)
6)in questo modo avrete formattato da ext4 a f2fs,
7)riavviare la recovery, abilitare il sideload e collegare il cellulare al pc
8)andate nella cartella C:\adb (dove è stato installato di default il programma del punto 1)
9)aprite la finestra di comando all'interno di questa cartella : per fare cio mettetevi in uno spazio vuoto della cartella e premete alt (freccia in su) e tasto destro del mouse e
II)scrivete adb devices (a volte è necessario ripetere questo comando perche non riconosce subito il cell) e dovrebbe uscirvi un numero e affianco scritto sideload.
10)successivamente digitate adb sideload e il nome intero del file zip (compreso .zip).
11)dovete abilitare il sideload da recovery ogni qualvolta dovete flashare un file zip ( ROM , GAPPS , kernel, ecc) 12)se avete convertito la rom con il metodo 2) flashate anche un kernel alternativo
13)Una volta finiti i flash, wipe cache e dalvik e riavviate il cellulare!
PER TORNARE A EXT4 FATE GLI STESSI PASSI DA 8) A 12) solo che il punto 3) sarà questo
3)Andate su "Advanced" e swichate su EXT4
@morfances
grazie del thread, ottima idea
ho notato qualche errore nella spiegazione, hai usato google translate?
le prime cose notate sono un "può benissimo vi sorprenderà." e un "Ma prima di uscire e convertire il dispositivo F2Fs"
09-06-14, 10:19
DeathHawk
Grande! Dicci che differenze noti rispetto a prima ;)
09-06-14, 10:42
never-dark
ma si può convertire la cyanogenmod 11 in F2FS?
09-06-14, 10:47
morfances
Quote:
Originariamente inviato da PhoenixFire
@morfances
grazie del thread, ottima idea
ho notato qualche errore nella spiegazione, hai usato google translate?
le prime cose notate sono un "può benissimo vi sorprenderà." e un "Ma prima di uscire e convertire il dispositivo F2Fs"
Riveduto e corretto .grAZIE
09-06-14, 10:56
morfances
Quote:
Originariamente inviato da never-dark
ma si può convertire la cyanogenmod 11 in F2FS?
Quote:
Originariamente inviato da Ser103
Grande! Dicci che differenze noti rispetto a prima ;)
@never-dark credo di si..presto qualcuno lo farà xD