Swapping mount points - Android Q&A, Help & Troubleshooting

I have a cheapo DragonTouch Y88X. I'm not looking for a custom ROM or anything - its for the kids and honestly it does everything they need, with one exception: Disney Movies Anywhere can't download videos to the external SD card.
As near as I can tell, this is an application problem - hardwired looking for /mnt/sdcard instead of using the Google API to find where the SD card is mounted, and DragonTouch was brain dead and mounted part of the internal storage to /mnt/sdcard (the actual SD card gets mounted to /mnt/extsd).
OK, so I'm not going to get Disney to change the app (and there's no setting to change where it downloads to other than "Save To/Play From SD Card"), so I started poking around how to change the mount points. I'm reasonably familiar with linux, sys admin duties and the like. But the format and options on the fstab file are a bit unfamiliar to me... All I really want to do is make the external SD card be mounted at /mnt/sdcard (and maybe mount the internal partition to something useful - maybe app cache space or something?)
I managed to get root and installed ES File Explorer, and the fstab file (/fstab.sun8i to be specific) has the following lines that I think are relevant...:
Code:
...
/devices/virtual/block/nandk auto vfat defaults wait,check,noemulatedsd,voldmanaged=sdcard:auto
/devices/platform/sunxi-mmc.2/mmc_host auto vfat defaults wait,check,noemulatedsd,voldmanagedsd=sdcard:auto
/devices/platform/sunxi-mmc.0/mmc_host /mnt/extsd vfat rw,realtime,fmask=0000,dmask=0000,wait,check,voldm anaged=extsd:auto
/devices/platform/sunxi-mmc.1/mmc_host /mnt/extsd vfat rw,realtime,fmask=0000,dmask=0000,wait,check,voldm anaged=extsd:auto
...
I don't know quite enough about either fstab or Android/DragonTouch's variant of it to know why both sdcard and extsd have two entries each... Or exactly how to swap them. I could try to change the voldmanaged=[name] entry on each - would that be safe?
Is what I'm trying to do crazy, or should this work?
Thanks

Related

Change internal and external sdcard mounts

I do not like how the internal sdcard is the default data storage instead of the external sdcard. I've had to factory reset a couple times now and all app data, downloads, etc.. were erased. That and if something happens to the phone the data would be lost. I remembered it was like this on one of the tabs I had so dug around a bit and found a mod to the vold.fstab file.
This file is in etc/ and also system/etc/
(not sure why it says HTC Passion???)
Code:
## Vold 2.0 fstab for HTC Passion
#
## - San Mehat ([email protected])
##
#######################
## 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
######################
# Mounts the first usable partition of the specified device
dev_mount sdcard /mnt/sdcard 37 /devices/platform/msm_sdcc.1/mmc_host/mmc0
dev_mount sdcard2 /mnt/sdcard/ext_sd auto /devices/platform/msm_sdcc.3/mmc_host/mmc2
If I read the mod correctly you would have to change the sdcard to sdcard2 and vice versa like this:
Code:
dev_mount sdcard2 /mnt/sdcard 37 /devices/platform/msm_sdcc.1/mmc_host/mmc0
dev_mount sdcard /mnt/sdcard/ext_sd auto /devices/platform/msm_sdcc.3/mmc_host/mmc2
What I'm not sure on is if it is the same for phones as it is for tablets and is this the correct way to change the sdcard mounts? I am thinking the mod needs to be done on both files and if this is the correct way it may be hit or miss if the mod sticks after a temp root reboot.
i'm really curious about this too. i want to figure it out so as soon as i get s-off i can change the mounts. this has already bit me in the a$$ once with this phone and i lost some stuff.
Do u mean like if ur downloading files and how data is stored that way? Just curious, because it is annoying to me as well.
"BEATin" through "REZOUNDingly"
youngpettyboi said:
Do u mean like if ur downloading files and how data is stored that way? Just curious, because it is annoying to me as well.
"BEATin" through "REZOUNDingly"
Click to expand...
Click to collapse
Some applications are correctly downloading files to the external SD card where storage is supposed to go. But other applications (usually older not updated) have the tendency to use the internal SD card. This becomes an issue when you factory reset and the internal SD is wiped. Some people have lost their data unexpectedly.
I guess I'm the only one who likes the way this is set up, I hated it when apps would crap up my sdcard with all their data. As for changing the mount points you would need to be rooted to accomplish that.
I got hit hard when all my downloaded pics from mms where wiped
I'll try it this weekend and see what happens and if it sticks after reboot. I wonder if it does work, would a factory reset wipe the external card if it is not removed. Well I won't test that theory but I would like to at least see if the mounts are able to be changed with only temp root.
You should be able to remount if Android supports the "-o remount" flag in mount. I believe it does. I don't think this will persist beyond a reboot but if it does, then I'd like to do something a little more intricate. Mount 10GB(of external SD) to /sdcard/music and 2GB to /sdcard/DCIM and 4 GB to /sdcard/Download or something like that. Might cause hell connecting to a PC though..
you need to be root to mount devices, also just issuing the command won't persist beyond reboots, you need to place it in the equivalent of fstab.
That's what I'd thought too.
/system/etc/vold.fstab would need to repoint /sdcard to the real external
card. And something to the /sdcard fuse re-director for the internal memory.
Right now, I sync /sdcard/Kindle and /sdcard/Nook to their corresponding
/sdcard2 directories so my user data (side loaded books) can be found
since those apps are written to Froyo's SDK level. I've written to both vendors
and they say their developer's are working on updates in support of the
ICS level of SDK. They both thought the simple solution of a configurable
option to use as an 'app root' for where to look for its data made sense.
That would workaround future directory moves in the OS.
A full scan of user space, like Titanium Backup, does for its
data directory works too.
Would the hboot wipe / write rom functions be using the
/dev/<devicename> or their mount points to do its writing?
I'm guessing the built in recovery's fstab would be pointing all
at the internal memory directories and partitions, be cause it would
not be aware of customization in the running OS's /system/etc.
I'd guess whatever custom recovery get put together, would be
aware of int_flash vs ext_flash memory locations.
As far as downloading stuff, you can change that thru your browser. It gives you the option to download stuff to your internal SD or external in the options. Not sure if any of you knew that. For pics, GOSMS always saves my pics on the Ext SD card by default. I actually like it like this better. I hated the Dinc since it would always run out of space and had to use my Ext SD Card for apps.
/sdcard is part of the internal flash erased by a hard reset
So since by default, there isn't a way to save user data programatically,
or by virtue of being a physically separate partition, it gets wiped too.
I manually mount the /sdcard and /sdcard2 directories to windows
and sync them with desktop directories for backup, daily.
I wonder if anyone has (or knows of) an android app to sync
between /sdcard and /sdcard2 sub-directories? I mean,
to use /sdcard2/Kindle and /sdcard2/Nook for example as
backups of the e-book databases on /sdcard (which is subject
to erasure by accident).
Does Titanium's sync app do that?
Thanks
Therev29 said:
I do not like how the internal sdcard is the default data storage instead of the external sdcard. I've had to factory reset a couple times now and all app data, downloads, etc.. were erased. That and if something happens to the phone the data would be lost. I remembered it was like this on one of the tabs I had so dug around a bit and found a mod to the vold.fstab file.
This file is in etc/ and also system/etc/
(not sure why it says HTC Passion???)
Code:
## Vold 2.0 fstab for HTC Passion
#
## - San Mehat ([email protected])
##
#######################
## 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
######################
# Mounts the first usable partition of the specified device
dev_mount sdcard /mnt/sdcard 37 /devices/platform/msm_sdcc.1/mmc_host/mmc0
dev_mount sdcard2 /mnt/sdcard/ext_sd auto /devices/platform/msm_sdcc.3/mmc_host/mmc2
If I read the mod correctly you would have to change the sdcard to sdcard2 and vice versa like this:
Code:
dev_mount sdcard2 /mnt/sdcard 37 /devices/platform/msm_sdcc.1/mmc_host/mmc0
dev_mount sdcard /mnt/sdcard/ext_sd auto /devices/platform/msm_sdcc.3/mmc_host/mmc2
What I'm not sure on is if it is the same for phones as it is for tablets and is this the correct way to change the sdcard mounts? I am thinking the mod needs to be done on both files and if this is the correct way it may be hit or miss if the mod sticks after a temp root reboot.
Click to expand...
Click to collapse
Just made this change on my ReZound, and its stuck in a boot loop. So I suggest doing a nandroid backup before trying it!
Let me know if anybody does this mod successfully...
lennysh said:
Just made this change on my ReZound, and its stuck in a boot loop. So I suggest doing a nandroid backup before trying it!
Let me know if anybody does this mod successfully...
Click to expand...
Click to collapse
Code:
dev_mount sdcard /mnt/sdcard 37 /devices/platform/msm_sdcc.3/mmc_host/mmc2
dev_mount sdcard2 /mnt/sdcard/ext_sd auto /devices/platform/msm_sdcc.1/mmc_host/mmc0
I think that is how it should be, but I haven't tested it.
con247 said:
Code:
dev_mount sdcard /mnt/sdcard 37 /devices/platform/msm_sdcc.3/mmc_host/mmc2
dev_mount sdcard2 /mnt/sdcard/ext_sd auto /devices/platform/msm_sdcc.1/mmc_host/mmc0
I think that is how it should be, but I haven't tested it.
Click to expand...
Click to collapse
Yeah, as soon as i get this rom back restored, I'll try that method...
lennysh said:
Yeah, as soon as i get this rom back restored, I'll try that method...
Click to expand...
Click to collapse
My change should work because it swaps the hardware addresses for each mount point. The OP's swap had the names and mount points contradicting eachother.
con247 said:
My change should work because it swaps the hardware addresses for each mount point. The OP's swap had the names and mount points contradicting eachother.
Click to expand...
Click to collapse
Trying now...
---------- Post added at 02:17 PM ---------- Previous post was at 02:11 PM ----------
con247 said:
My change should work because it swaps the hardware addresses for each mount point. The OP's swap had the names and mount points contradicting eachother.
Click to expand...
Click to collapse
Nope, neither card would load the file list, and one was reporting as damaged. Reverting back...
lennysh said:
Trying now...
---------- Post added at 02:17 PM ---------- Previous post was at 02:11 PM ----------
Nope, neither card would load the file list, and one was reporting as damaged. Reverting back...
Click to expand...
Click to collapse
Wanna try one more? I have one last idea.
im interested... what would i need to do to test your idea?
im curious to a fix as well....as google music seems to save all music to the internal sd card....very annoying due to lack of space.
Code:
dev_mount sdcard2 /mnt/sdcard/ext_sd 37 /devices/platform/msm_sdcc.1/mmc_host/mmc0
dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_sdcc.3/mmc_host/mmc2
That should do it. If not, then it can't be done this way.

[HOWTO] Mount 4th partition (CM7 Boot disk) as SD Card on Stock

Are you using a CM7 boot disk and another OS? By default the B&N stock will mount the first partition of the SD card. This is not what we want, as the 4th partition is the one where we are going to be storing data.
In order to change the mount point you need to edit the vold.fstab file located in /system/etc
You will find a line that points to the sd card for mounting:
Code:
dev_mount sdcard /mnt/sdcard auto auto /devices/platform/usb_mass_storage/lun1/devices/platform/mmci-omap-hs.1/mmc_host/mmc0
Change the first "auto" to 4. This defines the 4th partition for mounting. As seen in the following:
Code:
dev_mount sdcard /mnt/sdcard 4 auto /devices/platform/usb_mass_storage/lun1/devices/platform/mmci-omap-hs.1/mmc_host/mmc0
Now reboot your device and you should now have access to the 4th partition in the stock android OS.

mount sdcard to /sdcard

is there anyway to mount the real sdcard to /sdcard?
i tried to edit the vold.fstab, but it just bootloop on the animation.
http://forum.xda-developers.com/showpost.php?p=23347641&postcount=14
he is mounting to "/mnt/sdcard" while i used "/sdcard"
Code:
dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_sdcc.3/mmc_host/mmc2
where should it be mount to or is it because of different phone?
sams-roots said:
is there anyway to mount the real sdcard to /sdcard?
i tried to edit the vold.fstab, but it just bootloop on the animation.
http://forum.xda-developers.com/showpost.php?p=23347641&postcount=14
he is mounting to "/mnt/sdcard" while i used "/sdcard"
Code:
dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_sdcc.3/mmc_host/mmc2
where should it be mount to or is it because of different phone?
Click to expand...
Click to collapse
/sdcard is normally a symbolic link pointing to /storage/emulated/legacy
There's an internal "sdcard" that normally gets mounted onto /mnt/shell/legacy from /init.qcom.rc - that's symlinked to /storage/emulated/legacy in that same file. It also appears to start up a daemon that re-mounts the internal "sdcard".
What are you trying to do? Normally the external SDcard is mounted to /mnt/extSdCard, so you should just store data there rather than /sdcard.
(Or /mnt/sdcard, /mnt/shell/legacy, /storage/emulated/legacy, or any of the other things simlinked to the internal sdcard.)

[Q] Emulated internal storage as sdcard

Hello everyone.
Yesterday I received my Huawei Honor 3C and I've installed MIUI ASAP instead of Emotion UI.
Everything's great but I have a problem with double SD Card, I mean: I have my own external card and the phone got his own by emulating it's internal storage as SD Card (it's a symlink to /storage/emulated/0 and it's the same as /storage/emulated/legacy, so this fake sd is eating up my storage, there are also other symlinks in /storage/, /mnt/ and even in root folder there is a symlink sdcard->/storage/emulated/legacy). Phone and apps are correctly seeing external card as SD Card but in reality the internal storage is being used for everything.
Because of this I have only about 5GB available instead of 64GB
Is there any way to terminate the emulation or changing it's target to sdcard2 so that I could use my card correctly? I've tried few things but nothing works. Symlinks are being recreated during boot so editing or deleting them does not work. Editing vold.fstab does nothing because ext is being mounted after boot while the emulation stars while in it - I guess that a proped ini script could do the work.
huaweiproblem said:
Hello everyone.
Yesterday I received my Huawei Honor 3C and I've installed MIUI ASAP instead of Emotion UI.
Everything's great but I have a problem with double SD Card, I mean: I have my own external card and the phone got his own by emulating it's internal storage as SD Card (it's a symlink to /storage/emulated/0 and it's the same as /storage/emulated/legacy, so this fake sd is eating up my storage, there are also other symlinks in /storage/, /mnt/ and even in root folder there is a symlink sdcard->/storage/emulated/legacy). Phone and apps are correctly seeing external card as SD Card but in reality the internal storage is being used for everything.
Because of this I have only about 5GB available instead of 64GB
Is there any way to terminate the emulation or changing it's target to sdcard2 so that I could use my card correctly? I've tried few things but nothing works. Symlinks are being recreated during boot so editing or deleting them does not work. Editing vold.fstab does nothing because ext is being mounted after boot while the emulation stars while in it - I guess that a proped ini script could do the work.
Click to expand...
Click to collapse
First thing I do to troubleshoot that stuff is to copy everything off the internal storage, then format it in recovery, then copy everything back when booted up.
Why do you think that wiping and installing the exact same stuff could help? If you're copying back the same files that were there before - then you're back at starting point.
I've tried also a few different things, mostly trying to modify inid.rc scripts.
I found an interesting script in init.ssd.rc, that is:
Code:
on init
# See storage config details at source.android.com/tech/storage/
# fix non-shell uid process can not access shared-sd
mkdir /mnt/shell 0700 shell shell
chmod 0750 /mnt/shell
chown shell sdcard_rw /mnt/shell
mkdir /mnt/shell/emulated 0700 shell shell
mkdir /mnt/shell/emulated/0 0700 shell shell
mkdir /storage/emulated 0555 root root
mkdir /storage/sdcard1 0000 system system
export EXTERNAL_STORAGE /storage/emulated/legacy
export SECONDARY_STORAGE /storage/sdcard1
export EMULATED_STORAGE_SOURCE /mnt/shell/emulated
export EMULATED_STORAGE_TARGET /storage/emulated
mount tmpfs tmpfs /storage/emulated mode=0705,uid=1023,gid=1023
# Support legacy paths
symlink /storage/emulated/legacy /sdcard
symlink /storage/emulated/legacy /mnt/sdcard
symlink /storage/emulated/legacy /storage/sdcard0
symlink /mnt/shell/emulated/0 /storage/emulated/legacy
symlink /mnt/shell/emulated/0 /storage/emulated/0
symlink /storage/sdcard1 /mnt/sdcard2
and so I deleted those symlinks, packed up the ramdisk and flashed boot.img with those changes... still nothing, the symlinks are still being recreated every boot.
Damn, what a stupid thing. I've found a solution on 4pda forums. I was trying to do it the complicated way while I had everything in the system settings, in a hidden MIUI menu with some untranslated chinese marks.
Under battery settings there are options in chinese, I just had to choose the fifth chinese one and change the storage options :victory:
huaweiproblem said:
Damn, what a stupid thing. I've found a solution on 4pda forums. I was trying to do it the complicated way while I had everything in the system settings, in a hidden MIUI menu with some untranslated chinese marks.
Under battery settings there are options in chinese, I just had to choose the fifth chinese one and change the storage options :victory:
Click to expand...
Click to collapse
Glad you solved it. The reason I mentioned the wipe and all because it's not an uncommon issue when switching from some stock system to custom ones (like CM, etc) where they change the mount point of external from /sdcard to /sdcard0 and it will just copy everything from /sdcard/ to /sdcard0 and you'll have copies of everything which cuts the storage in half. Case in point: http://forum.xda-developers.com/showthread.php?p=51709918#post51709918

[Q] Serious problem with Android's built-in encryption?

I came across a problem with Android's built-in encryption function and typical sdcard data. I searched everywhere on the internet and this is what I could collect so far:
Also, from my research, while I cannot confirm this, I have read that prior to 4.2, external (public) storage in Android was /mnt/sdcard/ (if you are not familiar with the Android file system, "sdcard" refers to public storage that is internal...not necessarily an external sdcard), but this was just a symbolic link from the protected /data/ directory. At the time, Android only encrypted /data/, which was fine because the symbolic link would also encrypt any personal files in the public directory.
After 4.2, due to multiple profiles, the public storage was moved to /storage/emulated/legacy. That means if Android's "full disk encryption" only encrypted /data...then any sensitive data in the public directories is not encrypted (this could be downloads from work, private photos, etc).
Click to expand...
Click to collapse
Source and full topic: https://productforum...xus/Lzsje-4QfTQ
This can be OEM dependent indeed, but /mnt/sdcard is now just a symlink to
a 'virtual' SD card that lives under /data. So downloaded documents, media
etc. are encrypted along with private data, etc. From the boot script:
# create virtual SD card at /storage/sdcard0, based on the /data/media directory
# daemon will drop to user/group system/media_rw after initializing
# underlying files in /data/media will be created with user and group
media_rw (1023)
If one some device /mnt/sdcard (external storage) is independent from /data,
it might not get encrypted. But then again they may modify the
firmware to encrypt it.
Click to expand...
Click to collapse
Source and full topic: https://groups.googl...uss/-mE-XTot0Gg (This is also only referring to Android versions =< 4.0)
1.) I checked a CM 11 installation on a Huawei Ascend Y300 and I could find the same internal SD card data in
/internal_sd -> /storage/sdcard0 (fuse)
/mnt/internal_sd -> /storage/sdcard0 (fuse)
/mnt/media_rw/sdcard0 -> /mnt/media_rw/sdcard (vfat)
2.) /data/media does not contain the files as the others in 1.).
3.) /internal_sd is the only partition visible via TWRP file manager, which could mean that the others are created during the start of Android itself.
2012
So the actual physical storage place is still /data/media. /storage/sdcard0 is a "virtual" SD card. /sdcard and /mnt/sdcard are symbolic links of /storage/sdcard0.
Click to expand...
Click to collapse
I'd guess that the virtual sdcard exists because /data/media is part of an ext# partition, so they use fuse filesystem and virtual sdcard to make it look like fat to apps, many of which don't understand ext# filesystems.
Click to expand...
Click to collapse
2013
http://forum.xda-developers.com/galaxy-s3/general/info-flashed-4-2-sdcard-data-t2274218
Click to expand...
Click to collapse
I'd assume the actual physical storage place is /storage/sdcard0 now, but I'm not sure.
Conclusion: To make the encryption include typical "sdcard data" again, we would have to somehow change it back to this:
So the actual physical storage place is still /data/media. /storage/sdcard0 is a "virtual" SD card. /sdcard and /mnt/sdcard are symbolic links of /storage/sdcard0.
Click to expand...
Click to collapse
Are my thoughts on this correct so far or does anyone have an idea?
Does this mean older Android versions (pre-4.2) did not actually have this problem?

Categories

Resources