Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[How To] Swap the mounting points on ICS (CM9) for emmc and sdcard.

OP mattisdada

11th April 2012, 10:11 AM   |  #1  
mattisdada's Avatar
OP Senior Member
Flag Melbourne
Thanks Meter: 50
 
257 posts
Join Date:Joined: Feb 2010
More
This is a quick tutorial I want to write up based on a recent experience I've had recently with my micro sd-card. (More info on that below)

This how to shows how to switch between the internal sd card and the external sd cards mounting points (so the external is accessed via /sdcard, and the internal is accessed through /eemc)

The nuts and bolts how to:
0. Perform backups on System, i am not responsible for any damages or boot loops.
1. Download root explorer (or any other file explorer with root privileges)
2. Go to /system/etc, and mount R/W
3. Long press on vold.fstab and select Open With... , select Text Editor
4. You will find a line with sdcard in it a few times, change this section:
Quote:

dev_mount sdcard /mnt/sdcard

To:
Quote:

dev_mount emmc /mnt/emmc

5. Do the same thing with the emmc section:
Quote:

dev_mount emmc /mnt/emmc

To:
Quote:

dev_mount sdcard /mnt/sdcard

6. But you just flipped the first section around? Yes I did, this changes the mounting points. But not the original location of where it is being mounted......
7. Please don't change anything else in this file....
8. Reboot, enjoy!

I had to do this hax because the current nightly of CM9 doesn't support there being no external sd card, and mine got corrupt (eep!), it then continued to mount the internal sd card location to emmc instead (wtf?). So i did this quick hax so i could take pictures with the stock camera and use several applications which just default to the internal sdcard (and doesn't allow changing that).

Hope that helps some random Googlers......

Note: This has only been tested on CM9 Nightly apr-9th on SGSII, but i see no reason for this not work across all ROMs and devices( with ICS, the emmc thing wasn't on GB and below i don't think) as long as you don't do anything as foolish as change more than the lines specified above.

An example of a swapped file is (DO NOT COPY AND PASTE THIS, YOU PROBABLY WONT BE ABLE TO BOOT):
Quote:

# internal sdcard
dev_mount emmc /mnt/emmc 11 /devices/platform/dw_mmc/mmc_host/mmc0/mmc0 encryptable_

# external sdcard
dev_mount sdcard /mnt/sdcard auto /devices/platform/s3c-sdhci.2/mmc_host/mmc1

Please note that the latest CM9 nightlies lets you do this from the system menu! This was written pre that advancement. This is for the curious and other ROMs/phones.
Last edited by mattisdada; 23rd May 2012 at 02:10 AM.
The Following 19 Users Say Thank You to mattisdada For This Useful Post: [ View ]
12th April 2012, 10:39 AM   |  #2  
Senior Member
Thanks Meter: 33
 
188 posts
Join Date:Joined: Mar 2012
Is it possible to use something in the lines of:
dev_mount emmc /mnt/external_sd ? To just bind the external sd to the stock location?
The Following User Says Thank You to Zewsan For This Useful Post: [ View ]
16th April 2012, 03:48 AM   |  #3  
Senior Member
Flag SÚlestat
Thanks Meter: 20
 
131 posts
Join Date:Joined: Jul 2011
Donate to Me
More
If I understood your question right, that's the default behavior in CM7/9 so you don't need to change anything.
(internal gets mounted as /sdcard and external as /emmc. At least that's how it always behaved on my device -takes a bit of getting used to but it's manageable once you know the trick)

edit : aw sawry, mistook /mnt/external_sd for /mnt/sdcard. But it changes nothing besides the name of the mountpoint, easily adjustable.. Although why you would want to have it named like that is beyond me, it makes for more keys to hit when typing it... xD
Last edited by Snakeforhire; 17th April 2012 at 09:44 PM.
16th April 2012, 09:33 AM   |  #4  
gnan10's Avatar
Senior Member
Flag andhra-kdp
Thanks Meter: 92
 
444 posts
Join Date:Joined: Apr 2011
Quote:
Originally Posted by Zewsan

Is it possible to use something in the lines of:
dev_mount emmc /mnt/external_sd ? To just bind the external sd to the stock location?

same doubt raised here ...is it possible to mount external sdcard to /mnt/external_sd instead of mnt/emmc...???
please need solution
16th April 2012, 10:07 AM   |  #5  
mattisdada's Avatar
OP Senior Member
Flag Melbourne
Thanks Meter: 50
 
257 posts
Join Date:Joined: Feb 2010
More
Quote:
Originally Posted by Zewsan

Is it possible to use something in the lines of:
dev_mount emmc /mnt/external_sd ? To just bind the external sd to the stock location?

Its the same technique....

So remember this:
Quote:

Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>

So <label> doesn't really matter, but we may as well keep it sane (and have it the same name as the mount point)! And <mount_point> is where its mounted. Make sure the folder exists first though! leave <part> and <sysfs_path*> alone and it will work correctly.


So if you were to create a folder /mnt/hammertime , then make a line look something like this (taken from my example in first post)
Quote:

dev_mount hammertime /mnt/hammertime auto /devices/platform/s3c-sdhci.2/mmc_host/mmc1

That will work correctly.

Hope that helps!
Last edited by mattisdada; 16th April 2012 at 10:10 AM.
The Following User Says Thank You to mattisdada For This Useful Post: [ View ]
16th April 2012, 06:39 PM   |  #6  
gnan10's Avatar
Senior Member
Flag andhra-kdp
Thanks Meter: 92
 
444 posts
Join Date:Joined: Apr 2011
Quote:
Originally Posted by mattisdada

Its the same technique....

So remember this:


So <label> doesn't really matter, but we may as well keep it sane (and have it the same name as the mount point)! And <mount_point> is where its mounted. Make sure the folder exists first though! leave <part> and <sysfs_path*> alone and it will work correctly.


So if you were to create a folder /mnt/hammertime , then make a line look something like this (taken from my example in first post)

That will work correctly.

Hope that helps!


is there no any requirement of changing build.prop file after doing this....?????
17th April 2012, 04:30 AM   |  #7  
HAvoktek's Avatar
Senior Member
Flag Cleveland, OH
Thanks Meter: 64
 
278 posts
Join Date:Joined: Jan 2010
More
Ok I'll bite, late night tonight I'm going to flash back to AOKP....and give it a shot. It can't be that simple.....
Most certainly appreciate your effort...been looking for this for some time now.l!
17th April 2012, 04:42 AM   |  #8  
mattisdada's Avatar
OP Senior Member
Flag Melbourne
Thanks Meter: 50
 
257 posts
Join Date:Joined: Feb 2010
More
Quote:
Originally Posted by HAvoktek

Ok I'll bite, late night tonight I'm going to flash back to AOKP....and give it a shot. It can't be that simple.....
Most certainly appreciate your effort...been looking for this for some time now.l!

I didn't think so either, but i had the problem, hoped it was like its Linux cousin and searched for fstab, i found it. Swapped the mounting destinations around. And voila, done.....
The Following User Says Thank You to mattisdada For This Useful Post: [ View ]
21st April 2012, 01:40 PM   |  #9  
jeromepaez's Avatar
Junior Member
Flag Mandaluyong
Thanks Meter: 0
 
4 posts
Join Date:Joined: Apr 2012
More
Question Swapped but CWM Recovery still the same
Hi, first of all nice guide you did here.
Here's the thing: somehow somewhere by flashing nightlies i ended up
with /sdcard being treated as my external SD while /emmc was for internal.
So I wanted to fix that and using your guide although the other way around
I was able to make it as such: /sdcard = internal storage; /emmc = external storage.
ALL IS GOOD however when i booted to CWM recovery:
CWM still mounts my internal storage as /emmc.
SO in recovery internal storage = /emmc while when in CM9 internal storage = /sdcard

Is there anyway i can change CWM so that internal storage = /sdcard? to be more uniform and not confusing
21st April 2012, 03:13 PM   |  #10  
mattisdada's Avatar
OP Senior Member
Flag Melbourne
Thanks Meter: 50
 
257 posts
Join Date:Joined: Feb 2010
More
Quote:
Originally Posted by jeromepaez

Hi, first of all nice guide you did here.
Here's the thing: somehow somewhere by flashing nightlies i ended up
with /sdcard being treated as my external SD while /emmc was for internal.
So I wanted to fix that and using your guide although the other way around
I was able to make it as such: /sdcard = internal storage; /emmc = external storage.
ALL IS GOOD however when i booted to CWM recovery:
CWM still mounts my internal storage as /emmc.
SO in recovery internal storage = /emmc while when in CM9 internal storage = /sdcard

Is there anyway i can change CWM so that internal storage = /sdcard? to be more uniform and not confusing

Yeah CWM doesn't read the /system stuff, it has its own partition....
I've got no idea sorry, but its just a little inconvenient in CWM thats all.... But im sure you can check it out... Just search for fstab when you figure out how to explore the recovery partition (I've got no idea :P, short of modifying a flashable zip first and rekeying it.)

The Following User Says Thank You to mattisdada For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes