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

Search This thread

unCoRrUpTeD

Senior Member
Mar 22, 2010
1,707
238
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

  • unCoRrUpTeD_SD--PARTITIONER.zip
    928.1 KB · Views: 2,238
Last edited:

unCoRrUpTeD

Senior Member
Mar 22, 2010
1,707
238
Fort Worth, TX
It should work on any phone, but you should back up your sdcard to a PC every once in a while just in case your sdcard gets corrupted or quits working.

Sent from my HERO200 using XDA App
 
  • Like
Reactions: nagasgura

chelsearulz5

Senior Member
Sep 4, 2011
307
50
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
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
160
158
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
238
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.
 

unCoRrUpTeD

Senior Member
Mar 22, 2010
1,707
238
Fort Worth, TX
Just make the fat partition the size of the sdcard and swap and ext both 0.

When using parted in recovery you lose your data (pics, downloads, backups, etc). This way you won't lose anything.

Sent from my PG86100 using XDA App
 
  • Like
Reactions: drfr and johnhale

Top Liked Posts

  • There are no posts matching your filters.
  • 21
    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
    3
    still wating for that flashable zip...people like who are not that great on pc

    I might be able to get an app to do this. I'm going to look into it.

    Sent from my PG86100 using XDA App
    2
    Just make the fat partition the size of the sdcard and swap and ext both 0.

    When using parted in recovery you lose your data (pics, downloads, backups, etc). This way you won't lose anything.

    Sent from my PG86100 using XDA App
    1
    you said you could make it into a flashable Zip /
    Would love to see this.
    ADB Retarted.....:D

    That's why I put step by step instructions. I'll have to find the flashable one.

    Sent from my HERO200 using XDA App
    1
    It should work on any phone, but you should back up your sdcard to a PC every once in a while just in case your sdcard gets corrupted or quits working.

    Sent from my HERO200 using XDA App