unCoRrUpTeD SD--PARTITIONER [Partition SDCARD without losing fat32 contents] (SCRIPT)

unCoRrUpTeD

Senior Member
Mar 22, 2010
1,707
237
0
Fort Worth, TX
This is outdated and probably does not work.

UnCoRrUpTeD SD--PARTITIONER

I have made this really easy to partition your sdcard while preserving all data on the fat32 partition.This one is used to setup your sdcard for a2sd and swap instead of using the built in partitioning program, which will destroy all your fat32 contents. Eventually I will add support for backing up the ext partition if you want to resize the existing partitions.

You have the option of specifying the size of the partitions in /sdcard/sdpartmap.txt

To specify your own sizes and filesystem do..
Code:
c:\xxxxxx\adb shell
/ # echo 150 200 ext4 > /sdcard/sdpartmap.txt
replacing 150, 200, ext4 with your own
.
The 1st number is a2sd data partition (system/sd or sd-ext mounted at /dev/block/mmcblkXp2)
The 2nd number is swap partition. (mounted at /dev/block/mmcblkXp3)
The 3rd entry will be for ext3 or ext4 FS

It's best to do a2sd data in increments of 256MB and
swap in increments of 32MB

If you don't specify an ext type it will default to ext2.
If there is no sdpartmap.txt file the partitions will be automatically set to
a2sd data = 256
swap = 0
ext type = ext2

Make sure you have enough free space on the card to accommodate the extra partitions until I incorprate checks for that.

INSTRUCTIONS:
1. Download unCoRrUpTeD_SD--PARTITIONER.zip

2. Reboot into recovery
Code:
adb shell reboot recovery
3. Unzip the contents of sdpart.zip. There should be a folder named sdpart. Push the files inside sdpart folder to /tmp/
Code:
adb push c:\xxxxxx\sdpart /tmp/
4. run /tmp/sdpart.sh in adb shell
Code:
adb shell /tmp/sdpart.sh
If sdpart.sh doesn't run then you will have to chmod it before running it, but it should already have permission to run.

Code:
adb shell chmod 777 /tmp/sdpart.sh
If for some reason you can not push the files mount your sdcard through your phone and copy the sdpart folder to your sdcard and then

Code:
adb shell reboot recovery (might need to do adb reboot recovery or just reboot into recovery)
adb shell
mount /sdcard
cp -a /sdcard/sdpart/* /tmp
/tmp/sdpart.sh
 

Attachments

Last edited:

chelsearulz5

Senior Member
Sep 4, 2011
308
50
0
You've got to be kidding me.
Saves me the trouble of transferring 16 GB everytime I partition.
Waiting for the flashable zip.

Sent from my Galaxy Fit @ 801Mhz- RazoDroid
 

dswaggz

Senior Member
Jun 12, 2010
1,237
52
0
Dude what ever happened to the whole dualboot thing for every phone I really wanted that

via tha xquizit EII4G ♚ of phonez
 

daxiaamu

Senior Member
Mar 11, 2011
140
137
73
www.daxiaamu.com
Hey you did a good job but there's some bugs in it

the script
Code:
$parted $extmount -s mkpartfs primary ext2 $newfat $newa2sd &> /dev/null ;
if [ "$exttype" = "ext4" ] ;
then 
$mke2fs -T ext4 ${extmount}p2 &> /dev/null ; 
fi
obviously ,it can't creat ext3

so I crrect it

Code:
$parted $extmount -s mkpartfs primary ext2 $newfat $newa2sd &> /dev/null ;
if [ "$exttype" = "ext2" ] ;
then
$mke2fs -T ext2 ${extmount}p2 &> /dev/null ;
elif [ "$exttype" = "ext3" ] ;
then 
$mke2fs -T ext3 ${extmount}p2 &> /dev/null ;
elif [ "$exttype" = "ext4" ] ;
then 
$mke2fs -T ext4 ${extmount}p2 &> /dev/null ;
fi
 
Last edited:

unCoRrUpTeD

Senior Member
Mar 22, 2010
1,707
237
0
Fort Worth, TX
Dude what ever happened to the whole dualboot thing for every phone I really wanted that

via tha xquizit EII4G ♚ of phonez
I ran into a problem with my java code and got frustrated with trying to figure out why it doesn't work correctly. That and my wife was getting upset that I was on the computer all the time. I have been running the stock ROM on my EVO 3D since getting it on launch day and just recently flashed some ROMs in Boot Manager to test some things out.
 

tristan202

Senior Member
Nov 12, 2009
670
345
93
Somehow I fail to see how this is easier than using the parted that's built in to almost every recovery out there.

But maybe that's just me.