• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Root [GUIDE] Swap external sd card with internal

jokerpks

Android Enthusiast
Apr 13, 2013
331
108
New York
I figured this out a long time ago but forgot to update this post sorry, here is a easy guide.

1. Use a file explorer with access to system files such as ROOT EXPLORER
2. Navigate to /etc directory
3. Activate Mount R/O
4. Copy internal_sd.fstab and external_sd.fstab files to a different folder
5. Rename internal_sd.fstab to external_sd.fstab
6. Renaming, do the opposite external_sd.fstab to internal_sd.fstab
7. Copy both files to /etc directory and replace both files
8. Restart your phone
9. Enjoy
 
  • Like
Reactions: jtintle and Sepero
What is the advantage of swapping cards?
It causes your phone to use your sdcard as primary storage, and stores less files on internal storage

Rather than "swap" I setup my phone to relocate internal storage to the location /mnt/sdcard/internal_fs. So I decide what gets saved on internal storage and what isn't. Which means-

  1. More free space on internal storage, so I can install more apps.
  2. Also if my device can't boot (smashed screen, water damage, other), all my personal files stored safely on sdcard. Simply pull the sdcard out and put it in another device.
 
  • Like
Reactions: Spec2nirvash
Upvote 0
# Vold 2.0 Generic fstab
## - San Mehat (san@android.com)
##

#######################
## Regular device mount
##
## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
## label - Label for the volume
## mount_point - Where the volume will be mounted
## part - Partition # (1 based), or 'auto' for first usable partition.
## <sysfs_path> - List of sysfs paths to source devices
######################

## Example of a standard sdcard mount for the emulator / Dream
# Mounts the first usable partition of the specified device
#dev_mount external_sd /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
dev_mount flash /mnt/external_sd auto /devices/virtual/mtd/mtd9/mtdblock9
dev_mount sdcard /mnt/sdcard auto /devices/platform/rk29_sdmmc.0/mmc_host/mmc0
dev_mount udisk0 /mnt/usb_storage/USB_DISK0 1 /devices/platform/usb
dev_mount udisk1 /mnt/usb_storage/USB_DISK1 1 /devices/platform/usb
dev_mount udisk2 /mnt/usb_storage/USB_DISK2 1 /devices/platform/usb
dev_mount udisk3 /mnt/usb_storage/USB_DISK3 1 /devices/platform/usb
dev_mount udisk4 /mnt/usb_storage/USB_DISK4 1 /devices/platform/usb
dev_mount udisk5 /mnt/usb_storage/USB_DISK5 1 /devices/platform/usb
## Example of a dual card setup
# dev_mount left_sdcard /sdcard1 auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
# dev_mount right_sdcard /sdcard2 auto /devices/platform/goldfish_mmc.1 /devices/platform/msm_sdcc.3/mmc_host/mmc1

## Example of specifying a specific partition for mounts
# dev_mount sdcard /sdcard 2 /devices/platform/goldfish_mmc.0 /devices/platform/msm_
 
Upvote 0
This should swap your internal and external mount locations. First make a backup of your vold.fstab file, then change the following two lines
Code:
dev_mount flash /mnt/external_sd auto /devices/virtual/mtd/mtd9/mtdblock9
dev_mount sdcard /mnt/sdcard auto /devices/platform/rk29_sdmmc.0/mmc_host/mmc0

To this
Code:
dev_mount flash /mnt/sdcard auto /devices/virtual/mtd/mtd9/mtdblock9
dev_mount sdcard /mnt/external_sd auto /devices/platform/rk29_sdmmc.0/mmc_host/mmc0
 
Upvote 0
This should swap your internal and external mount locations. First make a backup of your vold.fstab file, then change the following two lines
Code:
dev_mount flash /mnt/external_sd auto /devices/virtual/mtd/mtd9/mtdblock9
dev_mount sdcard /mnt/sdcard auto /devices/platform/rk29_sdmmc.0/mmc_host/mmc0

To this
Code:
dev_mount flash /mnt/sdcard auto /devices/virtual/mtd/mtd9/mtdblock9
dev_mount sdcard /mnt/external_sd auto /devices/platform/rk29_sdmmc.0/mmc_host/mmc0


I think the file he posted is actually /system/etc/external_sd.fstab
I changed the values you said to and it changed the mount points...but the OS still sees the actual SD card as an sdcard in settings> storage.

Here's the contents of the vold.fstab file:

# Copyright (c) 2011, Code Aurora Forum. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# * Neither the name of Code Aurora Forum, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
# OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_sdcc.3/mmc_host

Also there is a file called internal_fs.fstab. Here's the contents of that:

## Vold 2.0 Generic fstab
## - San Mehat (san@android.com)
##

#######################
## Regular device mount
##
## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
## label - Label for the volume
## mount_point - Where the volume will be mounted
## part - Partition # (1 based), or 'auto' for first usable partition.
## <sysfs_path> - List of sysfs paths to source devices
######################

## Example of a standard sdcard mount for the emulator / Dream
# Mounts the first usable partition of the specified device
#DTS2012012001091 w00177577 2012/01/20 rm external primary
#DTS2011121600087 w00177577 2011/12/28 ics dual sdcard
dev_mount sdcard /mnt/sdcard fuse
dev_mount sdcard2 /mnt/sdcard2 auto /devices/platform/msm_sdcc.3/mmc_host
 
Upvote 0
Well, if it's not working, then I can help get it done in a chat session. I'd need a volunteer though.

If anyone wants to volunteer, you can meet me on irc.freenode.net channel #sepero

I'll be in there for a week or so. Obviously I'm not at my computer 24/7, so if I don't answer, then just hang out and I'll eventually be around.

So do you understand that the file jokerpks posted wasn't the one you asked for?
 
Upvote 0
1. Use a file explorer with access to system files such as ROOT EXPLORER
2. Navigate to /etc directory
3. Activate Mount R/O
4. Copy internal_sd.fstab and external_sd.fstab files to a different folder
5. Rename internal_sd.fstab to external_sd.fstab
6. Renaming, do the opposite external_sd.fstab to internal_sd.fstab
7. Copy both files to /etc directory and replace both files
8. Restart your phone
9. Enjoy

I think I know how to do all steps except number 3? What does this means? I'm a noob to Android. [I bricked my first Huawei Premia 4G after 2 weeks. My sad story is told in a rooting thread]
 
Upvote 0
I think I know how to do all steps except number 3? What does this means? I'm a noob to Android. [I bricked my first Huawei Premia 4G after 2 weeks. My sad story is told in a rooting thread]

What step 3 does is make the folder writable, that way you can paste the new files in. In root explorer, it usually has a button at the top, with either rw or ro
 
Upvote 0
What step 3 does is make the folder writable, that way you can paste the new files in. In root explorer, it usually has a button at the top, with either rw or ro

It seems to me that in step 4,5,6 and 7 could be rephrased:

1. In "etc", move "A", to another folder - "X".
2. In "etc", change "B" to "A".
3. In "X", change "A", to "B".
4. In "X", move "B" back to "etc"

Is this sound logic?
 
Upvote 0
That'll work to

[Keep in mind, this is coming from someone who has bricked his first Android phone and now is working with a replacement - same model]

I have read thru the thread.

1. What are the overall risks of doing this [if any]?
2. Can you choose where to install apps after this?
3. Can you choose where to store stuff after this?
 
Upvote 0
[Keep in mind, this is coming from someone who has bricked his first Android phone and now is working with a replacement - same model]

I have read thru the thread.

1. What are the overall risks of doing this [if any]?
2. Can you choose where to install apps after this?
3. Can you choose where to store stuff after this?

From what it looks like, it'll tell the phone to use your external SD card as SD card 1 and use the internal SD Card as SD card 2.

It doesn't change how the phone stores anything, just will give you more room on SD card 1, so you can move more apps to SD card...

If that makes any sense

Here are some pics of my storage after I did this:
e8yga5y8.jpg
umebyga7.jpg
 
Upvote 0
From what it looks like, it'll tell the phone to use your external SD card as SD card 1 and use the internal SD Card as SD card 2.

It doesn't change how the phone stores anything, just will give you more room on SD card 1, so you can move more apps to SD card...

If that makes any sense

I think so. :D As long as there is no risk, I will give it a try.

EDIT: I have "File Manager" by Rhythm Software installed. It has a "Root Explorer" setting which in turn provides access to a "Mount System Folders" option. Is there another tool that is more straightforward to use to "Mount" the /etc folder as writable?
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones