xda-developers
Linux
Windows
Factory Image
Filesystem Maintenance
Notes
Can only be done within TWRP Recovery either via built-in Terminal or over ADB
Ideal to do before a clean ROM flash, after an improper shutdown, and after configuring all apps/copying over all data
Quick-command
Normal
adb shell 'umount '/data' && umount '/cache' && umount '/sdcard' && fsck.f2fs -f '/dev/block/mmcblk0p30' && fsck.f2fs -f '/dev/block/mmcblk0p23' && e2fsck -y -f -v '/dev/block/mmcblk0p22' && e2fsck -y -f -v '/dev/block/mmcblk0p4' && mount '/data' && mount '/cache' && mount '/system' && mount '/persist' && rm -Rf '/data/dalvik-cache' && fstrim -v '/data' && fstrim -v '/cache' && fstrim -v '/system' && fstrim -v '/persist' && sync && umount '/data' && umount '/cache' && umount '/system' && umount '/persist' && reboot'
firmware Partition
adb shell 'mount '/system' && fsck_msdos -p -y '/dev/block/mmcblk0p1' && umount '/system' && reboot'
Unmount Partitions
umount '/data'
umount '/cache'
umount '/sdcard'
umount '/system'
umount '/persist'
umount '/firmware'
umount '/sdcard'
system + persist Filesystem Maintenance
e2fsck -y -f -v '/dev/block/mmcblk0p22'
e2fsck -y -f -v '/dev/block/mmcblk0p4'
data + cache Filesystem Maintenance
fsck.f2fs -f '/dev/block/mmcblk0p30'
fsck.f2fs -f '/dev/block/mmcblk0p23'
firmware Filesystem Maintenance
fsck_msdos -p -y '/dev/block/mmcblk0p1'
Mount Partitions
mount '/data'
mount '/cache'
mount '/system'
mount '/persist'
mount '/firmware'
Clear Dalvik/ART Cache
mount '/data'
rm -Rf '/data/dalvik-cache'
fstrim
If done immediately after booting TWRP, /data
and /cache
are already mounted, but /system
, /persist
, and /firmware
aren't
adb shell
mount '/system' && mount '/persist' && mount '/firmware'
fstrim -v '/system' && fstrim -v '/data' && fstrim -v '/cache' && sync
Ideal Stack
microG
Flash Order
TWRP
LineageOS for easy microG + UnifiedNlp
ElementalX Kernel
Settings
Select thermal throttling: run hot
Max CPU Frequency: 1728MHz
GPU Governor: Simple
I/O Scheduler: ROW
Readahead Buffer Size: 1024
Available S2W/DT2W Gestures: Double tap
Short sweep and Magnetic cover toggles: Disabled
Sweep2Sleep: Disabled
Enable USB Fast Charge
Disable fsync
Magisk
Official
Unofficial
F-Droid
Install
wget -O ~/'Downloads/FDroid.apk' 'https://f-droid.org/FDroid.apk' && adb install ~/'Downloads/FDroid.apk' && adb shell 'sync' && rm -f ~/'Downloads/FDroid.apk' && sync
microG Repo
adb shell input text "microg.org/fdroid/repo"
adb shell input text "9BD06727E62796C0130EB6DAB39B73157451582CBD138E86C468ACC395D14165"
Apps
F-Droid
Core
Yalp Store
VLC
Pokémon GO
Ingress
Keybase
Steam
Obenkyo
EZVIZ
VPN.AC Client
Disable
adb shell
su
pm disable 'com.android.email'
pm disable 'org.lineageos.jelly'
pm disable 'com.cyanogenmod.eleven'
pm disable 'org.lineageos.updater'
Legacy
Flash Order
TWRP
LineageOS
ElementalX Kernel
Settings
Select thermal throttling: run hot
Max CPU Frequency: 1728MHz
GPU Governor: Simple
I/O Scheduler: ROW
Readahead Buffer Size: 1024
Available S2W/DT2W Gestures: Double tap
Short sweep and Magnetic cover toggles: Disabled
Sweep2Sleep: Disabled
Enable USB Fast Charge
Disable fsync
Magisk
Official
Unofficial
Modules
ART Optimization
Unified Hosts Adblock
The Open GApps Project
gapps-config.txt