[MOD][CM10]Swap internal/external storage links

maxdamage2122

Senior Member
Nov 16, 2007
722
205
0
This is a flashable zip for cm10 that will:
  • mount external storage to /storage/sdcard0 and internal storage to /storage/sdcard1
  • remove all links to /storage/sdcard1 (internal storage)
  • link /storage/sdcard1 (internal storage) to /internal_sd and /mnt/internal_sd
  • survive a cm rom flash (as long as /system isn't formatted beforehand)

md5: 838eb8b6e9fb2246efdc0f39d6c21c10
 

Attachments

Last edited:

maxdamage2122

Senior Member
Nov 16, 2007
722
205
0
EDIT: You can ignore this post. V2 now saves camera pics/vids to the external storage.

I know some people wanted this so their pics could be saved to the external storage but it doesn't work. The camera/gallery must be hard coded to save to /storage/sdcard0.

The only option I can think of to change this is to mount bind /storage/sdcard1 to /storage/sdcard0/DCIM. But this will save all of the camera folders to the root of the external storage. If people are interested in this I can look more into and see if it is actually possible without bad side effects.
 
Last edited:
  • Like
Reactions: silord and Steven 1

TaintedByte

Senior Member
May 24, 2009
819
673
0
Hey I was going to reply to your PM but I figured posting here would bump it up and let other people see it.

Anyway I finally got a chance to try out the zip (on vacation) and I don't see a difference. The mount points remain the same if I go to storage under settings it still shows the internal as internal and sdcard as external.

If I try to move an app over it still moves it to the internal space.

Sent from my EVO using Tapatalk 2
 

maxdamage2122

Senior Member
Nov 16, 2007
722
205
0
Actually I forgot to add a file to the zip. I'll be updating this in a bit.

EDIT: OP updated with a new version. This one should work better. Sorry about that.
 
Last edited:
  • Like
Reactions: TaintedByte

TaintedByte

Senior Member
May 24, 2009
819
673
0
Actually I forgot to add a file to the zip. I'll be updating this in a bit.

EDIT: OP updated with a new version. This one should work better. Sorry about that.
Thought I was crazy haha, I'll test it out and update this letting you know if it's working :) thanks!

EDIT: Works great, also screenshots get saved to the SD Card just fine :) haven't tested camera but I guess it still saves to the on-phone memory if you say so xD

Here is picture confirmation:

 
Last edited:

vwgtiturbo

Senior Member
Jul 7, 2010
182
23
0
This is a flashable zip for cm10 that will:
  • mount external storage to /storage/sdcard0 and internal storage to /storage/sdcard1
  • remove all links to /storage/sdcard1 (internal storage)
  • link /storage/sdcard1 (internal storage) to /internal_sd and /mnt/internal_sd
  • survive a cm rom flash (as long as /system isn't formatted beforehand)

md5: 410DE4F0FD9AB5CA37828C9084355C67
When you say "survive CM ROM flash as long as system isn't formatted...", do you mean that a complete wipe can't be done? And if a complete wipe IS done, assuming it erases this mod, can the mod be immediately flashed after flashing the ROM, or do we need to boot the system once for some setup actions before the mod will work?
 

maxdamage2122

Senior Member
Nov 16, 2007
722
205
0
When you say "survive CM ROM flash as long as system isn't formatted...", do you mean that a complete wipe can't be done? And if a complete wipe IS done, assuming it erases this mod, can the mod be immediately flashed after flashing the ROM, or do we need to boot the system once for some setup actions before the mod will work?
Depends on what you mean by complete wipe. If you wipe/factory restore the mod will stick. If you flash a cm ROM the mod will stick. The only time the mod will be gone is if you format /system or use one of those super wipe things.

Edit: The mod will also be gone if you flash any other ROM other than cm.

If you do format system and want the mod back you can flash it after the ROM in the same recovery session.
 
Last edited:
  • Like
Reactions: vwgtiturbo

vwgtiturbo

Senior Member
Jul 7, 2010
182
23
0
Depends on what you mean by complete wipe. If you wipe/factory restore the mod will stick. If you flash a cm ROM the mod will stick. The only time the mod will be gone is if you format /system or use one of those super wipe things.

If you do format system and want the mod back you can flash it after the ROM in the same recovery session.
Awesome... So, does this "fix" the issue with mounting internal storage on the desktop instead of the external card? It baffles me why my CM10 install mounts the internal storage on any of my desktops (Win,Lin,Mac) instead of the external...
 

maxdamage2122

Senior Member
Nov 16, 2007
722
205
0
Awesome... So, does this "fix" the issue with mounting internal storage on the desktop instead of the external card? It baffles me why my CM10 install mounts the internal storage on any of my desktops (Win,Lin,Mac) instead of the external...
Not sure because I never tested it. I have a hunch it won't but if you want try it out and let me know.
 
  • Like
Reactions: vwgtiturbo

vwgtiturbo

Senior Member
Jul 7, 2010
182
23
0
Not sure because I never tested it. I have a hunch it won't but if you want try it out and let me know.
Okay, after quite a bit of flashing/rebooting, and various tests, I can confirm that this DOES INDEED fix the CM USB desktop mount issue. Instead of USB mounting making the internal storage available to the OS of the host computer, it instead makes the external SD card available. AWESOME SAUCE!!!

So, just for those that may be curious (and to show the lengths I went to to see how this mod changes the filesystem), I've listed below all of the conditions I looked at before and after flashing this mod.

I used two OSs on the phone (Stock with Goodies v2.03, just as something to compare CM to, knowing that it isn't affected by this mod; and CM10 nightly from 9/06). Also, on the host side, I used all three major OSs (Mac, Lin, Win), just to verify that the USB storage mounts I experienced weren't flukes.

I know that a lot of this is really redundant, as most of these locations are linked and such, but I included everything just for completeness.

And here it is…

Filesystem Mounts:

Stock203 (via TWRP)
---------------------------------------------------------------
sdcard/ internal
sdcard2/ external
sd-ext/ nothing (empty)

Stock203 (via Terminal Emulator)
---------------------------------------------------------------
/mnt/usb/ nothing (empty)
/mnt/sdcard/ internal
/mnt/sdcard/ext-sd/ external
/sdcard internal
/sdcard2 external
---------------------------------------------------------------
---------------------------------------------------------------


PREMOD

CM10 (via TWRP)
---------------------------------------------------------------
/sd-ext/ nothing (empty)
/sdcard/ internal
/sdcard/ext_sd/ nothing (empty)
/sdcard2/ external
---------------------------------------------------------------

CM10 (via Terminal Emulator)
---------------------------------------------------------------
/external_sd/ external
/sdcard/ internal
/mnt/external_sd/ external
/mnt/sdcard/ internal
/mnt/sdcard/ext_sd/ nothing (empty)
/storage/sdcard0/ internal
/storage/sdcard0/ext_sd/ nothing (empty)
/storage/sdcard1/ external

Titanium Backup
* SD Card (mapped to internal)
* Ext SD card (mapped to external)

USB mount to desktop
* Internal storage
---------------------------------------------------------------
---------------------------------------------------------------

POSTMOD

CM10 (via Terminal Emulator)
---------------------------------------------------------------
/internal_sd/ internal
/mnt/internal_sd/ internal
/mnt/internal_sd/ext_sd/ nothing (empty)
/mnt/sdcard/ external
/sdcard/ external
/storage/sdcard0/ external
/storage/sdcard1/ internal
/storage/sdcard1/ext_sd/ nothing (empty)

Titanium backup
* SD Card (mapped to external)
* Ext SD card (mapped to internal)

USB mount to desktop
* External storage
---------------------------------------------------------------
---------------------------------------------------------------


EDIT: And of course, all of my spacing is removed... This really should be WYSIWYG.
 
Last edited:

maxdamage2122

Senior Member
Nov 16, 2007
722
205
0
Just so you know that ext_sd folder on your internal storage can be deleted if you like. Sense creates it to link to the external card. So on cm10 its useless.
 

maxdamage2122

Senior Member
Nov 16, 2007
722
205
0
FYI this was taken from the cm10 thread:
After I flashed this mod I found that I was no longer able to take pics in rapid succession as it took several seconds to save each pic to the external card. Thought I would throw it out there in case it is important for others thinking about using this mod. I've got a 10 month old and taking quick pics kinda matters to me.

FWIW, I have a class 10 card.

Sent from my EVO using xda premium
I tested it on my class 4 with the same results.
 
  • Like
Reactions: dsEVOlve

vwgtiturbo

Senior Member
Jul 7, 2010
182
23
0
FYI this was taken from the cm10 thread:


I tested it on my class 4 with the same results.
Hmm... I'll have to look into that. Honestly though, the camera on cmx is ****e, relative to sense. If I end up loading cmx into the phone permanently, it's with the understanding that I'll be bringing a point and shoot with me, for pictures that matter (or the crappy camera/slowness would be fine for things that are out of the norm/unusual occurrences). In my use, mounting the external to the desktop is a much higher priority than quicker pictures. Just my usage, of course; everyone has their own priority :)

Not to mention, is someone has a highly rated class 10 SD card (versus a cheapie), there shouldn't be much lag unless the system is a bottleneck.
 
Last edited: