[GUIDE] External2Internal Ultimate

badge2033

Senior Member
Mar 20, 2011
177
61
28
Monastir
I thought about this idea more than a month ago when i came to know that the partitions could freely be altered, but i could not put into practice until i got my 32 gb card yesterday.
so basically, after following my guide you will have:
* supersized data partition (12 gigs): no more move to sd needed unless for huge games (i'm thinking fifa12 and asphalt7) and then again the stock move to sd feature will work as expected (it will move data to the actual external sd card)
* external sd card mounted as internal sd card: nothing to say here, just does what is expected
* real internal sd (ums partition) shrinked to minimum (half gig) because it needs to stay present: used to mount a swap file (optional)



What you will need:
* g.lewarne hydracore 4.3b kernel: you don't need it for anything special, but it's the most amazing kernel, and gavin is the most devoted developer ive seen on the n7000. cheers gavin and keep up the good work :good:
* swapper2: if you want to use the swap file (see at the end)

so be warned, i'm no real specialist here, so i'm not aware of the no dos, i just got my guide to work through trial and error and getting information from other threads.
so if you follow my guide you're almost good, if not you may cause an atomic bomb to fall over your city, not my problem :silly:

enough chit chat for now let's head directly for the guide:
1. reboot to recovery, and connect your phone to your pc
2. run a command prompt and type the following (wait a little bit until the adb server starts on the phone, you can verify it by typing "adb devices" if you get a serie of digits then you're good to go.
Code:
adb shell
parted /dev/block/mmcblock0
you'll get into the parted interactive shell, this is where serious work done
Code:
did i remind you to backup your system,
this is your last stop before the no back point
so you just might wanna "move" all your internal sd stuff to the external sd,
and backup your system to the external sd also 
(you just need to restore the data partition afterwards the rest of the system is safe but who knows :p)

ps: you can do your backup on cwm without leaving adb shell on the pc just like you will do the format later thanks to cwm
remove the partitions
Code:
rm 10
rm 11
make the new changed size partitions
Code:
unit b
mkpart primary 1174405120 14680064511
mkpart primary 14680064512 15216934911
name 10 DATAFS
name 11 UMS
now in cwm go to mounts and storage and select "format /emmc" and "format /data"

in parted type "print" and you should see this output
Code:
Number  Start         End           Size          File system  Name       Flags
 1      4194304B      25165823B     20971520B     ext4         EFS
 2      25165824B     26476543B     1310720B                   SBL1
 3      27262976B     28573695B     1310720B                   SBL2
 4      29360128B     37748735B     8388608B                   PARAM
 5      37748736B     46137343B     8388608B                   KERNEL
 6      46137344B     54525951B     8388608B                   RECOVERY
 7      54525952B     264241151B    209715200B    ext4         CACHE
 8      264241152B    281018367B    16777216B                  MODEM
 9      281018368B    1174405119B   893386752B    ext4         FACTORYFS
10      1174405120B   14680064511B  13505659392B  ext4         DATAFS
11      14680064512B  15216934911B  536870400B    fat32        UMS
12      15216934912B  15753805823B  536870912B    ext4         HIDDEN
now the hardest part is over, restore your data partition and you will be able to boot you system normally. and you go to your storage information you will find that your app storage is now 13gigs and the usb storage is just 500 megs yay

to switch the sd with the internal you will have to modify vold.fstab file(thanks to ciphray for his guide on how to do so)
you can use the modified file from ciphray thread here which i didn't beacuse his file was smaller :p
so i just pulled the file to my pc
Code:
adb pull /etc/vold.fstab vold.fstab
modified it with notepad++ or any dev text editor (don't use windows notepad it will mess the file)
Code:
# internal sdcard
{
storage_struct = cover, "/mnt/sdcard/external_sd","/mnt/sdcard/usbStorage"
ums_sys_path = /sys/class/android_usb/f_mass_storage/lun0/file
discard = enable
}
dev_mount sdcard /mnt/sdcard auto /devices/platform/s3c-sdhci.2/mmc_host/mmc1

# external sdcard
{
ums_sys_path = /sys/class/android_usb/f_mass_storage/lun1/file
android_secure_containers = enable
}
dev_mount sdcard1 /mnt/sdcard/external_sd 11 /devices/platform/dw_mmc/mmc_host/mmc0/mmc0 encryptable_nonremovable
and push it back to phone + change permissions
Code:
adb push vold.fstab /etc/vold.fstab
chmod 644 /etc/vold.fstab
restart your phone and voila
as a final step you can use the now pretty useless internal space (500megs remember) as a swap sapce
download swapper2 from the play store here https://play.google.com/store/apps/details?id=lv.n3o.swapper2

run it and go to settings
set swap place as /sdcard/external_sd/swapfile.swp
set swap size to the max
set the swappiness to 20 ( you can rise the value a little but don't put a high value or the system will do much swapping all the time -value of 100 means any memory not used actively will be swapped- )

wait until the process finishes then reboot your phone
you can verify that swap is working by typing "free" in the shell if the line beginning with swap is not all zeros then you're swap is working.

hope my guide will be usefull, and don't hesitate to ask me any question
 

Attachments

Last edited:

cooldoud

Senior Member
Aug 9, 2008
106
34
0
Melbourne
Okay, I've performed the whole thing, and just a few remarks on my experience :)

If you want to modify the vold.fstab straight from recovery without having to reboot first, you can simply mount the system partition, and retrieve the file from /system/etc/vold.fstab instead of /etc/fstab

More importantly, following your instructions, I ended up in a situation where my apps previously moved to the sd card weren't recognized. I've solved this by modifying my vold.fstab as follows:
Code:
# internal sdcard
{
	storage_struct = cover, "/mnt/sdcard/external_sd","/mnt/sdcard/usbStorage"
	ums_sys_path = /sys/class/android_usb/f_mass_storage/lun1/file
	android_secure_containers = enable
}
dev_mount sdcard /mnt/sdcard auto /devices/platform/s3c-sdhci.2/mmc_host/mmc1

# external sdcard
{
	ums_sys_path = /sys/class/android_usb/f_mass_storage/lun0/file
	discard = enable
}
dev_mount sdcard1 /mnt/sdcard/external_sd 11 /devices/platform/dw_mmc/mmc_host/mmc0/mmc0 encryptable_nonremovable
That way, all my apps were properly recognized without issues. I'll probably be moving them back to phone now though.

Will be trying this setup over the next few days and see how it performs, but one caveat I missed is that you may not be able to install the whole of some apps on the data partition, as some the data will always be stored in the sdcard/Android folder, which would make the 12GB on /data less useful than I initially thought, unless I'm missing something of course :)
 

zongamin

Senior Member
Sep 13, 2010
117
13
0
Hi

Could you post a screenshot of the Storage page (under Settings)?

I'm interested to see what these look like after this mod.

Internal
USB Storage
SD Storage


Thanks!
 

badge2033

Senior Member
Mar 20, 2011
177
61
28
Monastir
Hi

Could you post a screenshot of the Storage page (under Settings)?

I'm interested to see what these look like after this mod.

Internal
USB Storage
SD Storage


Thanks!
here you are, look at the OP
i didn't realize the screenshot like was corrupt
if you read the op i mentioned the resulting sizes after the mod
sd storage will be mentioned as 500 megs (actually taken from the internal emmc) that i use for swap space
 

badge2033

Senior Member
Mar 20, 2011
177
61
28
Monastir
Why isn't it possible to use the rest of the space for apps and reroute the ums to the ext sdcard so it reads it as the internal?

Sent from my GT-N7000 using Tapatalk 2
i was fearing that the phone won't boot if the partition isn't available after a clean setup.
so i decided to leave the small size partition and make it useful for swap instead.

btw does anyone know how to use a bigger swap file with swapper2?
 

antique_sonic

Senior Member
Aug 16, 2009
2,128
1,052
0
Corner of the earth
I guess, this method is only working for a "healthy" note, which never got a mmc cap bricks, right ?

And if a note got brick before, and recovered by hg42 pit revival method, I think the repartition command for the start-end of the DATA and UMS will be different.
Hmmpppfff... Do you have a way on how to read the partition setting of the note ? :fingers-crossed:


Send from the corner of this rounded earth
 

badge2033

Senior Member
Mar 20, 2011
177
61
28
Monastir
I guess, this method is only working for a "healthy" note, which never got a mmc cap bricks, right ?

And if a note got brick before, and recovered by hg42 pit revival method, I think the repartition command for the start-end of the DATA and UMS will be different.
Hmmpppfff... Do you have a way on how to read the partition setting of the note ? :fingers-crossed:


Send from the corner of this rounded earth
just type print on the parted shell
and then you can recalculate new sizes for the data partitions, it should work like a charm :)
 

Hammerfest

Senior Member
Apr 3, 2008
1,659
279
83
San Antonio, TX
So... Im a USER, and there are part I am a bit confused about... BUT ill ask anyway!

It seems that if I wanted to resetup the partitions, I wouldnt need to mess with the pit files correct?

OR, because I want to totally KILL USB Storage, dedicate the entire internal memory to /data, and make /sdcard TRULY my sdcard, would I truly need to mess with the pit file?


Has anyone tried with killing off /ums completely?


Any help is appreciated. Also, I am using the i717 (AT&T GNote version), but my desire is the same so I figured Id post here...


EDIT: im not too worried about rom flashing, I normally slim down ROM's before I flash them, so Im not afraid of changes that have to be made (in txt files) in order to have them work properly on a UMS'less modded device. However, I do need to find out how to properly backup the pit file before I even THINK Of messing with it.
 
Last edited:

sarjarim

Senior Member
Dec 5, 2005
140
38
0
JB ready

I've tried it worked fine on Ultimate and Alliance ROM. Just edit vold.fstab in /etc after install new ROM. Replace 11 to auto and { } to { }. Now I need help if anyone have the original partition info, incase I wanted to restore.
 

Attachments