A dream so easy to understand that even Sigmund Freud would laugh out loud.
Sign Up!
Login

Welcome to KMCreaXion
Wednesday, February 22 2012 @ 19:09

Flashing HTC Desire with MIUI and DATA2SD

So I was really annoyed with always getting the low space message on my internal storage.

 I was looking at APP2SD+ which is the mainstream one used on the cooked ROMs, but DATA2SD looked also very promising. So I decided to give DATA2SD a try.

Below are the steps I took to get it to work and I flashed it with MIUI, as the stock MIUI kernel doesn't support loop devices it's slightly different.

 

1. Rooting

Used unrevoked 3.22 (Follow the tutorial on XDA )

Installed HBOOT Drivers for Windows.
 

2. Backups

Make a backup. I Used Titanium Backup Pro (hit the "problems?" button to have it install BusyBox).
If you want to keep your SMS/MMS, use one of the SMS backup tools.
Don't forget to copy the content of your SD Card to your computer


 

Next is partitioning your SD Card
 


 3. SD Card Partitioning

I bought a new bigger (8 GB) SD Card.
I used GParted to partition the SD Card into 2 partitions.
As my computer runs Windows and doens't have a CD drive I did the following. I downloaded the Live CD and created a new Virtual Machine, I mounted the ISO and it would boot the Live CD with GParted. After that connect your Card Reader to the Virtual Machine.

You should see  it in the dropdown. It's not the /dev/sda but the other one.

 

We will be creating 2 partitions. The first partition is the FAT32 partition and it the SD Card that Android sees. The second partition is an EXT2 partition which will be used for the /data part.

 
 
 
 
 
Don't put in 2048 for full 2 GB space for the second partition, as the Android kernel does not like it:
 
 
Hit the APPLY button to execute the changes you did: 
 
 
This is what you should see after everything is done correctly:
 
 

4. Flashing ROM

Copy MIUI install file (zip) to the SD Card.
Boot into HBOOT (hold Volume Down + Power Button)
Select Recovery
Wipe data/factory reset
advanced -> Wipe Dalvik Cache
Go back (press hardware back button) and select "install zip from sdcard" -> "choose zip from sdcard"
If you have a language pack don't reboot, but go back intot he menu and flash the language pack.
Reboot the device and setup your phone.
 

5. Setting up DATA2SD

 
Reboot back into HBOOT and then Recovery.
 
Connect your phone with your computer.
Make sure Android SDK is installed.
 
> is Windows Prompt
# is ADB Shell prompt
 
Download 01data to your C: drive
 
Windows Prompt (cmd):
> adb shell
# mount /system
exit
> adb push c:\01data /system/etc/init.d
> adb shell
# mount /data
# mount /sdcard
 
# mount
Expected output:
mount
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
/dev/block/mtdblock4 on /cache type yaffs2 (rw,nodev,noatime,nodiratime)
/dev/block/mtdblock3 on /system type yaffs2 (rw,relatime)
/dev/block/mtdblock5 on /data type yaffs2 (rw,relatime)
/dev/block/mmcblk0p1 on /sdcard type vfat (rw,relatime,fmask=0000,dmask=0000,all
ow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,errors=remount-ro)
 
# chmod 755 /system/etc/init.d/01data
# chown 0.0 /system/etc/init.d/01data
 
# cd /
//# mount /dev/block/mmcblk0p2 /sd-ext
//# dd if=/dev/zero of=/sd-ext/ext2 bs=1048576
# /system/xbin/busybox mke2fs -m 0 -F -L userdata /dev/block/mmcblk0p2
 
# mkdir /sd
# system/xbin/busybox mount -t ext2 /dev/block/mmcblk0p2 /sd
# cd /data
 
# cp -a * /sd
(This may take a while depending on the amount of data)
 
# cd /
# sync
 
# ls -la /sd
Expect some files and/or directories:
ls -la /sd
drwxr-xr-x   13 root     root          4096 Dec 23 13:34 .
drwxr-xr-x   16 root     root             0 Dec 23 13:33 ..
drwxrwx--x    2 system   system        4096 Dec 23 13:23 app
drwxrwx--x    2 system   system        4096 Dec 23 13:24 app-private
drwx------    5 system   system        4096 Dec 23 13:26 backup
drwxrwx--x    2 system   system       12288 Dec 23 13:26 dalvik-cache
drwxr-xr-x   79 root     root          4096 Dec 23 13:26 data
drwxr-x---    2 root     log           4096 Dec 23 13:24 dontpanic
drwxrwx--x    3 shell    shell         4096 Dec 23 13:24 local
drwxrwx---    2 root     root         16384 Dec 23 13:24 lost+found
drwxrwx--t    9 system   misc          4096 Dec 23 13:29 misc
drwx------    2 root     root          4096 Dec 23 13:26 property
drwxrwxr-x   10 system   system        4096 Dec 23 13:29 system
 
# df -k
Expected output:
df -k
Filesystem           1K-blocks      Used Available Use% Mounted on
tmpfs                   208116         0    208116   0% /dev
/dev/block/mtdblock4     40960      1208     39752   3% /cache
/dev/block/mtdblock3    256000    121232    134768  47% /system
/dev/block/mtdblock5    151168     81856     69312  54% /data
/dev/block/mmcblk0p1   5770216    161528   5608688   3% /sdcard
/dev/block/mmcblk0p2   2015824     81236   1934588   4% /sd
 
# /system/xbin/busybox umount /sd
# exit
> adb reboot
 
ENJOY!

Trackback

Trackback URL for this entry: http://kmcreaxion.com/trackback.php/20101224122528237

No trackback comments for this entry.

0 comments

Miku

Topics

My Account





Sign up as a New User
Lost your password?

Older Stories

Saturday 30-Oct


Friday 29-Oct


Tuesday 19-Oct


Sunday 03-Oct