How to partition SD Card

If you’ve rooted your phone using Revolutionary you can partition your SD Card from the Recovery menu. After booting into recovery (Revolutionary CWM), you have an optionPartition SD Card. It will ask you how big the EXT partition should be, and how big the Swap partition should be. After selecting the right values, it will automatically partition your SD Card.

If you didn’t used Revolutionary to root your phone, you can still follow the tutorial from here, and after inserting the key, it says that your phone is S-OFF, but it still asks you if you want to install Clockwork Mod. Press y and Enter and wait until the the CMD disappears. Reboot into recovery once again and you should see the Partition SD Card option that I was talking about in the first paragraph.

Note that creating partitions this way will result having an EXT3 partition. If you want an EXT4partition, connect to the phone with adb shell and follow only the 6th step of the following tutorial.

How manually partition SD Card

Don’t be afraid to do something manually. It may be a little bit harder than using a specialized software, but you can learn new things and you know you did it and it worked. For example, partitioning from ROM Manager proved to be a mistake, because I couldn’t select an EXT Partition bigger than 512Mb and it practically messed up my partitions… and using gParted to partition your SD Card is a little bit difficult since you have to install the image on a CD or stick, reboot your PC in gParted and try to get things working from there. From my experience, every time I’ve tried this using a stick to load the image, I couldn’t see the SD Card.

So.. doing something manually is better Smile

Step 1 – Connect to Phone

Restart your phone to recovery mode. Connect your phone to the PC via USB Cable. Use adb shell to connect to the phone

Step 2 – Display the partitions

Open parted (an application from the Android OS) to partition your SD Card
After you connect with adb shell write parted /dev/block/mmcblk0 and then <Enter>. Wait until you see (parted) in the left if your cursor and write print and <Enter>. You should get something like this:

parted_1

As you can see, I’ve got a 3942MB SD Card. It has 3 partitions

  • Number 1 – 2886MB FAT32
  • Number 2 – 1024MB EXT3
  • Number 3 – 31.6MB linux-swap

I’m going to remove all these partitions in order to repartition the card. Note that you’ll lose all your data from the card.

Step 3 – Remove the existing partitions

You’ll have to remove the existing partitions first. So.. look at how many partitions you have, and then write remove <space> partition number <Enter>. 
For example:
rm 1
rm 2
rm 3

parted_2

You can run the print command again to make sure everything was deleted. Now I have an empty unpartitioned SD Card

Step 4 – Create the partitions

Ok, let’s start computing the partitions size. For most of the custom ROM, you need an 1GB EXT partition, and a FAT32 partition.. You’ll also need a swap of 32 or 64MB. So, let’s say that you want to create a 1024MB EXT and a 32MB swap partition. Subtract these values from the entire partition size, and you’ll get the needed size of your FAT32 partition. In my case, I have a3942MB card, so 3942-1024-32 = 2886MB for FAT32

In conclusion, we’ll have to create:

  • 2886MB FAT32
  • 1024MB EXT2 (because parted only allows us to create EXT2 partitions, but we’ll convert it to EXT3 or EXT4 at the end of the tutorial)
  • 32MB swap

Now run the following commands in the (parted) shell:

  • mkpartfs primary fat32 0 2886 (first value is 0, second value is the size of FAT32 partition)
  • mkpartfs primary ext2 2886 3910 (first value is the size of FAT32 partition, second value is EXT4 partition> in our case 2886+1024=3910)
  • mkpartfs primary linux-swap 3910 3942 (first value is EXT4 partition>, in our case 2886+1024=3910, second value is the size of the entire SD Card, in our case 3942)

Note that for every command, the first value is the second value from the previous command. The first value from the first command should be 0 and the second value from the last command should be the size of the entire SD Card.

After you finish with creating the partitions, run print again and you’ll see the newly created partitions:

parted_3

If everything is ok, run quit to exit the parted, and return to the adb shell

parted_4

Step 5 – convert your EXT2 partition to EXT3 (skip it if you don’t want to do this)

In the adb shell, run the following command to convert your EXT2 partition to EXT3

Note that the last number from the command, 2, refers to the second partition. If your EXT2 partition has another number assigned (you can view the number using the print command), replace the “2” with your number, but if you’ve followed the tutorial and you didn’t create more or less partitions, it should be 2 )

tune2fs -j /dev/block/mmcblk0p2

toext3

Step 6 – convert your EXT3 partition to EXT4 (skip it if you don’t want to do this, but you must follow Step 5 if you have an EX2 partition to convert it to EXT3)

In the adb shell, run the following command to convert your EXT2/3 partition to EXT4

Note that the last number from the command, 2, refers to the second partition. If your EXT partition has another number assigned (you can view the number using the print command), replace the “2” with your number, but if you’ve followed the tutorial and you didn’t create more or less partitions, it should be 2 )

tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2

toext4

If you want to check your filesystem too, you should run e2fsck -fpDC0 /dev/block/mmcblk0p2too

Step 7 – Finish

Finished. Check your work with print.

  • command:  parted /dev/block/mmcblk0 (open parted again)
  • command:  print (check all your system partitions and their sizes)
  • command:  quit (exit parted)
  • command:  reboot (reboot your system to the operating system)

Step 8 – Align your SD Card (optional)

In order to increase the access time, write speed and read speed of your SD Card, you may want to follow this tutorial

[Ref: http://android.bytearrays.com/android/how-to-partition-sd-card/]

Root HTC Desire using REVOLUTIONARY method

Easiest Root Method

– The easiest root method for the HTC Desire

[STEP1]- Check Hboot version. Poweroff, and hold Volume Down & Power (it’s the number after “HBOOT”. Examples are 0.75xxxxx, 0.83xxxxx, 0.93xxxxx, 1.02xxxxx)

REVOLUTIONARY

[REVOLUTIONARY]- If your HBOOT version is 0.93 or above (NOTE: Version 1.03 is NOT supported) then continue, if it is below then use the Alpharev method.

[REVOLUTIONARY][STEP1]- Go to revolutionary.io and go to the “Downloads” section, Pick your operating system, choose device as HTC Desire, and choose your HBOOT version (you should already know this from STEP1). Then enter your serial number, it can be found in “about phone” or behind the battery.

[REVOLUTIONARY][STEP2]- Read the documentation page and download these fastboot drivers.

[REVOLUTIONARY][STEP3]- Make sure HTC Sync is disabled, if you have it installed on your PC. Plug your phone in via USB and make sure USB debugging is turned ON (settings> applications)

[REVOLUTIONARY][STEP4]- Extract all of the tools from the revolutionary.zip file and run revolutionary.exe. A CMD window should pop up and show you the progress (See [3] for how it should look like).

[REVOLUTIONARY][STEP5]- When the process is almost finished, it will prompt you to flash a custom recovery, type YES or Y. Follow tutorial number [10] if you would like to flash a different recovery – This is optional and not required if you decide to flash recovery during the revolutionary process.

[REVOLUTIONARY][STEP6]- Download superuser.zip, put it anywhere on your sd-card (preferably in a path you can remember). Boot into recovery by holding Volume Down & Power (You will see lines of green text flash, this is normal), then using the volume keys to navigate to RECOVERY, and use POWER to select. The phone will now boot into recovery.

[REVOLUTIONARY][STEP7]- Once you are in recovery, use the trackball (if it’s broken then use volume keys) to navigate to “install zip from sd-card > choose zip from sd-card > #directory where you put superuser.zip# > superuser.zip > yes”

[REVOLUTIONARY][STEP8]- After the process is finished, reboot, and your phone will now be rooted.

[Ref: http://forum.xda-developers.com/showthread.php?t=1275632]