[GUIDE] SD card partitioning for rooted phones

Rapier

Recognized Contributor
Jun 23, 2008
5,156
2,566
253
Bucharest
OK. I've decided to give it a try with Data2Ext, that means I need partitions.
One question before I start... My card is the stock 2GB one and I used it for creating my Goldcard. Partitioning it will "delete" the goldcard info?
I'm asking because on some thread it was specified that you can even wipe the card completely, it'll still remain as goldcard.
 

BlaY0

Retired Recognized Developer
Sep 15, 2007
1,553
566
0
Medvode
OK. I've decided to give it a try with Data2Ext, that means I need partitions.
One question before I start... My card is the stock 2GB one and I used it for creating my Goldcard. Partitioning it will "delete" the goldcard info?
I'm asking because on some thread it was specified that you can even wipe the card completely, it'll still remain as goldcard.
1st of all data2ext on stock 2GB card is nonsense. 2nd, if you repartition it, you don't lose goldcard info. But if you completely wipe it, for instance dd with /dev/zero from block 0, then you certainly loose goldcard info.
 

JonasDroid

Senior Member
Apr 12, 2010
423
50
0
I don't have mkfs.vfat, not in CM7 #25, not on HD2 desire Z rom and not in recovery mode :S (it doesn't work without busybox and my busybox doesn't include it)
Is there any other method for formating the fat32 partition?
 
Last edited:

psyionx

Senior Member
Nov 30, 2010
229
50
0
Kota Kinabalu
Rom Manager

does this have the same achievement using the "Partition SD Card" using RomManager? i'm experiencing quadrant=11xx with it to partition a Kingmax 16GB class 10 MicroSD card. set at 512 ext and 256 swap....

is it the card too big or this method of partitioning the card have different result? Or its the wrong way?

P/s: i'll use this to method later when i get home.
 

BlaY0

Retired Recognized Developer
Sep 15, 2007
1,553
566
0
Medvode
1st... why do you need swap partition?

2nd... with partition smaller than 1 GB default block size is set to 1 kB which is not good in terms of performance.

3rd... partition alignment is also a big factor in overall performance. I don't think RomManager does the alignment and it also uses default formatting parameters.

Sent from my HTC Legend
 
  • Like
Reactions: psyionx

psyionx

Senior Member
Nov 30, 2010
229
50
0
Kota Kinabalu
ok, i'll give this a try. i'll start reading and got my handy calculater by my side. it seems that the partition from Rom Manager have other usage that i really dont know. i'll comback once done or meet some problem.

.... about Half an hour later....

done:

Disk /dev/block/mmcblk0: 15.8 GB, 15803088896 bytes
4 heads, 16 sectors/track, 482272 cylinders, total 30865408 sectors
Units = sectors of 1 * 512 = 512 bytes

Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 256 26623999 13311872 c Win95 FAT32 (LB
A)
/dev/block/mmcblk0p2 26624000 30865407 2120704 83 Linux

Command (m for help):w
Thanks man! now testing on your new ROM... (fingers X)

data2ext --enable
phone need a while to load programs....

went to SD & phone storage....

Holy crap!!! I have a lot of space!!!!!!!!!!!!

Thanks BlaY0 !!!! you and your ROM ROCKS!!!!!!!!!!!!!!!!
 
Last edited:

whitetigerdk

Senior Member
Jun 1, 2010
1,057
59
68
Odense
www.dkmdesign.dk
@blaY0: need a little help here.. today I got myself a Kingston 8gb card to replace my 4gb.. I disabled data2ext and put in the new card.. did a partitioning using this excellent guide.. enabled data2ext but nothing. Not at a comp at the moment.. could this be due to slower mounting of the card? Or do I just need to wipe and reinstall rom?

Sent from my HTC Legend using XDA App
 

psyionx

Senior Member
Nov 30, 2010
229
50
0
Kota Kinabalu
@whitetigerdk did you done the part below [from the guide]

At this point you have partitioned your SD card but not yet formatted it. Format fat32 partition with mkfs.vfat and ext partition with mkfs.ext2:

Code:
mkfs.vfat /dev/block/mmcblk0p1
...and:

Code:
mkfs.ext2 -m0 -b4096 /dev/block/mmcblk0p2
 

laie1472

Senior Member
Feb 18, 2010
4,549
820
253
A sup Blayo, Hope all is well. Forgive me for posting here as it has nothing to do with the subject. Just wanted to say thanks. The data2ext/ext2- mod I use from grammar freak says, modified from Blayo's script. So you know, I only see it as right to give you BIG THANKS OFF TOP. Keep doing what you do. Much success.



Something.About.Me.U.Dont.Like
Its.Cool.I.Understand.
.AWAH.
 

Bricolo_fr

Senior Member
Apr 25, 2010
169
7
0
@blaY0: need a little help here.. today I got myself a Kingston 8gb card to replace my 4gb.. I disabled data2ext and put in the new card.. did a partitioning using this excellent guide.. enabled data2ext but nothing. Not at a comp at the moment.. could this be due to slower mounting of the card? Or do I just need to wipe and reinstall rom?

Sent from my HTC Legend using XDA App
can you test your card with sd tools on your phone?
I also have a class 4 kingston, and write speed is lower than 2MB/s with sd tools :/
 

whitetigerdk

Senior Member
Jun 1, 2010
1,057
59
68
Odense
www.dkmdesign.dk
@whitetigerdk did you done the part below [from the guide]

At this point you have partitioned your SD card but not yet formatted it. Format fat32 partition with mkfs.vfat and ext partition with mkfs.ext2:

Code:
mkfs.vfat /dev/block/mmcblk0p1
...and:

Code:
mkfs.ext2 -m0 -b4096 /dev/block/mmcblk0p2
yup.. all this was accounted for.. switched to a card from my wifes SE Vivaz.. she won't notise aby differense anyway ;)

Sent from my HTC Legend using XDA App
 

cobraplayer

Senior Member
Oct 16, 2010
121
18
36
Can I use this guide to partition my sd card independently using any linux pc, and then insert the partitioned (and formatted) card in my phone. Will it work properly?
 

cobraplayer

Senior Member
Oct 16, 2010
121
18
36
Yup. It's all the same tools :D
...but different device files.
Thanks. I am trying to do partitioning on a ubuntu desktop. My sd card is sandisk 8G class 4.

Using fdisk to create partition table, here is the result:
Code:
Command (m for help): p

Disk /dev/sdb: 7948 MB, 7948206080 bytes
245 heads, 62 sectors/track, 1021 cylinders, total 15523840 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xcb08e1f7

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1             256    13721599     6860672   83  Linux
[COLOR="Red"]Partition 1 does not end on cylinder boundary.[/COLOR]
/dev/sdb2        13721600    15523839      901120   83  Linux
[COLOR="Red"]Partition 2 does not end on cylinder boundary.[/COLOR]
(I intend to create a fat partition of 6700mb and ext of 880mb)

I guess the warnings above indicate that there is something wrong in this partition table. Similar warning of misalignment is generated when using parted.

Help plz.
 

BlaY0

Retired Recognized Developer
Sep 15, 2007
1,553
566
0
Medvode
Read again 1st post, paragraph "Background", point 6. We don't have CHS here, coz we are on "solid state disk"... we only have blocks or sectors if you prefer.