#!/system/bin/sh
# Remount all partitions with noatime

for k in $(busybox mount | grep relatime | cut -d " " -f3);
do
#sync;
busybox mount -o remount,noatime $k;
done;

mount -o noatime,remount,rw,discard,barrier=0,commit=60,noauto_da_alloc,delalloc /cache /cache;
mount -o noatime,remount,rw,discard,barrier=0,commit=60,noauto_da_alloc,delalloc /data /data;
mount -o noatime,remount,rw,discard,barrier=0,commit=60,noauto_da_alloc,delalloc /data/idd /data/idd;
mount -o noatime,remount,rw,discard,barrier=1,commit=60,noauto_da_alloc,delalloc /modemfs /modemfs;

mount >> /sdcard/fsck.log;
echo "Remount Done! Please see /sdcard/fsck.log for your new mount options.";
echo "If this script works, you'll see most of your mounts being noatime, and";
echo "/data, /datadata and /cache having barrier=0 and commit=60.";
