Happening now! New Honor Phone Launch
FORUMS
Remove All Ads from XDA

[GUIDE] How to Remove SD-EXT Via ADB {Create EXT / Swap Via ADB} [05/03/2013]

313 posts
Thanks Meter: 132
 
By R. SAINT, Senior Member on 3rd March 2013, 04:48 PM
Post Reply Email Thread
This article is for people with rooted Android phones. Everyone else please ignore. There are dozens of ways to remove SD-EXT Partition your SD card and I would like to share the one that has worked for me every time.

Requirements before getting started:
  • Custom Recovery (TWRP/ CWM etc).
  • SD Card (Any Class).
  • Android Device Bridge(ADB): Comes with the Android SDK.

These instructions apply to both the Windows command prompt and the Mac terminal.
As you can see from my screens, I was using Windows Vista. You can Remove/ Delete your SD-Ext Partition at any time, but you might as well do it before you flash a new build of Android and You want a different size SD-EXT Partition.

IMP: As always, back up your data when performing any hacks.
Formating your SD card will erase all data on it.
I split this guide into 5 steps, but it is not as difficult as it looks. Read the whole thing before starting.


Step 1: Connect your phone to your computer via USB. Reboot into recovery mode.


Command: adb shell reboot recovery
(this will reboot your phone into Custom recovery image.

Command: adb shell
(type this after your phone has booted and on the recovery screen. it should take you to a # prompt)



Step 2: Open parted to partition your SD card.


Command: parted /dev/block/mmcblk0
(opens parted and mounts your SD card)



Step 3: Check the size and partitions of your SD card.
The print command will display this info. You can see the size of my SD card is 7969 MB (8 GB). I have 1 partition which is fat32. If your SD card is blank and no partitions are listed, you can skip to Step 5.


Command: print
(displays SD card information)



Step 4: Remove all existing partitions. If you have multiple partitions, remove each one at a time.


Command: rm 1
(deletes partition number 1)

Command: rm 2
(if needed. keep going till all partitions are removed)

Command: print
(check when you are done to make sure all partitions are removed)



Step 5: Check the sizes of your SD Card.
Use the command print again to display the partition sizes (There should be no partition).
If you made any mistakes you can return to Step 4 and remove them.

Command: print
(displays your partition information)


IMP: Now Remove USB Cable from Phone and go to WIPE Menu in Recovery and Format/ Cleat SD Card..

Now Go to Advance Menu and Partition SD Card with What Size / Swap / ext You Want..





[Additional GUIDE]
How to manually Partition your SD CARD {EXT 2/ 3/ 4 And Swap / Linux} Via ADB.


For SD-EXT Partition Please Continue After Step 5 (Don't Remove USB cable from PC).



Step 6: Create your new partitions.
You can make these any size, but the most common setup is
32 MB linux-swap partition,
512 MB ext2 partition, and
remaining free space as a fat32 partition.

In order to work properly, the partitions must be created in this order:
fat32,
ext2,
linux-swap.

The linux-swap partition is used for a swap file on some builds. Not all builds use linux-swap, but I create one just in case I ever need it.

The ext2 partition is where your apps will be installed. I use 512 MB which gives me plenty of room but you can go larger like 1024 MB if you want.

IMP: Parted only creates ext2 partitions and we can convert them to ext3 or ext4 later.

When using the Linux command mkpartfs, you must tell it where to start and and end each partition. This can be done by taking the total SD card size and subtracting the linux-swap then ext2 partition sizes. See the following example for my 8 GB card.


Command: mkpartfs primary fat32 0 7425
(start is 0 and end is Total C)

Command: mkpartfs primary ext2 7425 7937
(start is Total C and end is Total B)

Command: mkpartfs primary linux-swap 7937 7969
(start is Total B and end is Total A)


For Example

7969 Total A
-32 Linux-Swap
7937 Total B
-512 EXT 2
7425 Total C

* If You Don't want Linux-Swap partition follow this

7969 Total A
-512 EXT 2
7457 Total B

IMP: Kindly Change Values for EXT / Linux-Swap Accordingly if You want more or less space for Partitions.



Step 7: Check the sizes of your partitions.
Use the command print again to display the partition sizes.
If you made any mistakes you can return to Step 4 and remove them.


Command: print
(displays your partition information)



Step 8: Exit parted and upgrade your ext2 file system to ext3.
For most users this is the final step.
I suggest all users upgrade to ext3.
Its main advantage over ext2 is journaling which improves reliability and eliminates the need to check the file system after an unclean shutdown.


Command: quit
(exit parted and return to # prompt)

Command: upgrade_fs
(script to upgrade from ext2 to ext3)



Step 9 (Optional): If you wish, you can upgrade your ext3 partition to ext4.
Skip to Step 10 is you wish to use ext3.
The file system (EXT 4) offers enhancements like delayed allocation.


Command: tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p2
(enter this command from the # prompt)

Command: e2fsck -fpDC0 /dev/block/mmcblk0p2
(run e2fsck after tune2fs. wait for the file check to finish)



Step 10: 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)





[Guide] How to Install SDK / ADB..

http://forum.xda-developers.com/show...php?p=37805872


Credits:
akshat.shenoy (For SDK / ADB installation GUIDE).
XDA.


Screen Shots Added in Second Post.
The Following 10 Users Say Thank You to R. SAINT For This Useful Post: [ View ] Gift R. SAINT Ad-Free
 
 
3rd March 2013, 04:49 PM |#2  
R. SAINT's Avatar
OP Senior Member
Thanks Meter: 132
 
More
Re: [GUIDE] How to Remove SD-EXT Via ADB
For Step 1 to 5:












For Step 6 to 10:












Sent from my LIL RDX using XDA premium
The Following 4 Users Say Thank You to R. SAINT For This Useful Post: [ View ] Gift R. SAINT Ad-Free
3rd March 2013, 05:01 PM |#3  
Red Devil's Avatar
Senior Member
Flag Mumbai
Thanks Meter: 2,540
 
More
Re: [GUIDE] How to Remove SD-EXT Via ADB
Awesome man. Thanks ..
Didn't know of this method.. us there a way to partition via adb?
Sent from my HTC Explorer A310e using xda app-developers app
The Following User Says Thank You to Red Devil For This Useful Post: [ View ] Gift Red Devil Ad-Free
3rd March 2013, 05:11 PM |#4  
R. SAINT's Avatar
OP Senior Member
Thanks Meter: 132
 
More
Re: [GUIDE] How to Remove SD-EXT Via ADB
Quote:
Originally Posted by akshat.shenoy

Awesome man. Thanks ..
Didn't know of this method.. us there a way to partition via adb?
Sent from my HTC Explorer A310e using xda app-developers app

Yes there is a simple method..
If u wanna know I ll post that too..

Sent from my HTC Explorer using Tapatalk 2
5th March 2013, 08:38 AM |#5  
BleedingIris's Avatar
Senior Member
HEAVEN
Thanks Meter: 752
 
More
Re: [GUIDE] How to Remove SD-EXT Via ADB
Quote:
Originally Posted by R. SAINT

Yes there is a simple method..
If u wanna know I ll post that too..

Sent from my HTC Explorer using Tapatalk 2

Nice tutorial.
Screenshots are really helpful for me (as I know nothing about adb).
Thanks bro..
And yeah post it too.. :thumbup:
Edit
Some questions
1. So wiping SD ext comes under rm2 right... and it does nothing to partition fat32(1)
2.parting with Adb... will it cause erasing all data in SD card? And partition of any type ext3 ext4 ..?

Sent from my HTC Explorer A310e using xda app-developers app
The Following User Says Thank You to BleedingIris For This Useful Post: [ View ] Gift BleedingIris Ad-Free
5th March 2013, 09:29 AM |#6  
R. SAINT's Avatar
OP Senior Member
Thanks Meter: 132
 
More
Re: [GUIDE] How to Remove SD-EXT Via ADB
Quote:
Originally Posted by ptcpayme

Nice tutorial.
Screenshots are really helpful for me (as I know nothing about adb).
Thanks bro..
And yeah post it too.. :thumbup:
Edit
Some questions
1. So wiping SD ext comes under rm2 right... and it does nothing to partition fat32(1)
2.parting with Adb... will it cause erasing all data in SD card? And partition of any type ext3 ext4 ..?

Sent from my HTC Explorer A310e using xda app-developers app

rm 1 - SD Fat32
rm 2 - SD-EXT (if available)
rm 3 - Swap / Linux (if available)

Partition via ADB delete all ur SD data.. I hv mentioned that in Guide already.

I ll add tutorial for Partition ext 2/ 3/ 4 and swap partition ASAP..

Sent from my LIL RDX using XDA premium
The Following User Says Thank You to R. SAINT For This Useful Post: [ View ] Gift R. SAINT Ad-Free
6th March 2013, 10:49 AM |#7  
unknown_anonymous's Avatar
Member
Thanks Meter: 6
 
More
Or else, we can directly do it with Mini partition tool..!(duh!)
6th March 2013, 10:55 AM |#8  
R. SAINT's Avatar
OP Senior Member
Thanks Meter: 132
 
More
Re: [GUIDE] How to Remove SD-EXT Via ADB {Create EXT / Swap Via ADB} [05/03/2013]
Quote:
Originally Posted by unknown_anonymous

Or else, we can directly do it with Mini partition tool..!(duh!)

U can.
Basically This guide is for ppl who r nt depended on different softwares.

Sent from my HTC Explorer using xda premium
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes