Or Continue to Thread: [KERNEL][HYBRID]G3MOD v2.5
Find Your Device:
6th October 2011, 05:32 PM   |  #782  
mankokoma's Avatar
Senior Member
Berlin
Thanks Meter: 176
 
522 posts
Join Date:Joined: Dec 2010
More
Exclamation [HOWTO] Optimizing filesystems & change/remove journaling
HOWTO: optimize filesystems
Precondition for this howto is Kernel G3MOD v2.0

BEFORE YOU START: MAKE A BACKUP OF ALL YOUR DATA!!
I AM NOT RESPONSIBLE FOR ANY LOSS OF YOUR DATA!!

If we use APP2SD/DATA2SD we have partitioned our SD-card.
The "partitions" "stl 6 / 7 / 8" are mounted on "/system, /data & /cache"
Experience shows that it's the best and safest to use ext2, ext4 & ext2 according to the partitions.
You can set options to the ext4 partitions due to optimize performance and battery life!
These settings have a very small risk of losing data, but I take it for reasons above. You should do regularly backups then I don't see any problem.
There are opinions, that on SSD memory you can even switch off journaling at all and some people do so. At the end I will explain how to do that.
But I prefer to have at least a little chance to recover my data if something goes terribly wrong.
Lets take a "little" journaling (data=writeback) and let it take a "snapshot" only every 10 minutes (commit=600),
With that we have always the chance to repair it with e2fsck in the case that........
I read about 10 times more performance (admitting that's due to spinning HDDs...)
So howto get there?
Boot into recovery/CWM with USB-cable connected...
adb shell:
first check the filesystems...
Code:
umount /cache
umount /data
umount /sdext
umount /intdata
e2fsck -fy /dev/block/stl7
....
e2fsck -fy /dev/block/mmcblk0p2
....
When everything is okay, do
Code:
tune2fs -o journal_data_writeback /dev/block/stl7
....
tune2fs -o journal_data_writeback /dev/block/mmcblk0p2
....
and you are done.
To get the mount options put a file fs.options with content in code below into /mnt/sdcard/Android/data/g3mod/

Code:
stl6 nodiratime,noatime,nobh,errors=continue 0 0
stl7 noauto_da_alloc,nodiratime,noatime,commit=600,barrier=0,nobh 0 0
mmcblk0p2 noauto_da_alloc,nodiratime,noatime,commit=600,barrier=0,nobh 0 0
reboot and enjoy the fast filesystem!

HOWTO: Complete disabling of journaling

adb shell:
first check the filesystems...
Code:
umount /cache
umount /data
umount /sdext
umount /intdata
e2fsck -fy /dev/block/stl7
....
e2fsck -fy /dev/block/mmcblk0p2
....
When everything is okay, check what kind of journaling is implemented to your FS:
Code:
tune2fs -l /dev/block/mmcblk0p2 | grep features
.......
tune2fs -l /dev/block/stl7 | grep features
.......
should result in:
Code:
Filesystem features: has_journal dir_index filetype ......
Code:
umount /cache
umount /data
umount /sdext
umount /intdata
tune2fs -O ^has_journal /dev/block/mmcblk0p2
tune2fs -O ^has_journal /dev/block/stl7
To check if the changes are done correctly:
Code:
tune2fs -l /dev/block/mmcblk0p2 | grep features
should result in:
Code:
Filesystem features: dir_index filetype ......
Now you can see the has_journal feature is not there anymore thus there is no journaling anymore.

If you face problems (e.g. can't mount /cache.....)with CM7 and FROYO in multiboot / backup/restore, look here
Last edited by mankokoma; 19th October 2011 at 10:51 AM. Reason: UPDATED
The Following 3 Users Say Thank You to mankokoma For This Useful Post: [ View ]