SDCARD Mounting Paradigm - Cyanogenmod7 - G Tablet Android Development

There are two sdcard mounting paradigms. Currently Cyanogenmod for the tablet is set to use the one that matches phones.
1) Internal SDCARD mounted to /SDCARD, External to /SDCARD2(or equivalent)
Pros
-Internal sdcard is easily accessible
Cons
-External sdcard isn't mounted to computer over usb
2) Internal SDCARD mounted to /EMMC, External to /SDCARD
Pros
-External SDCARD is default and mounted to computer over usb
-Works well for phones with small internal storage sizes
Cons
-Your internal storage is hard to access, not mounted over usb
I took this GIT commit and rolled the changes back for CM7. I then recompiled CM7 to use the option 1 mounting paradigm.
Let me know which you prefer. I personally like option 1 because it doesn't rely on having an external sdcard. Additionally the internal sdcard is not easily removable like the external, so being able to access it over usb is important. If there are reasons for options 2, let me know.
Download:
CM7RC0 with Option 1 Mounting Paradigm(Mounting over USB works): http://www.multiupload.com/NJFGUW04A2
Gapps: http://android.d3xt3r01.tk/cyanogen/gapps/gapps-gb-20110120-signed.zip

Very cool, I was planning to do that myself this weekend. I played with CM7 yesterday for a few minutes but with no SDCard in the "external" slot there were some limits to have useful the OS was....
I'll probably still pull the source down this weekend, but I can flash your ROM tonight and start having a more detailed look at CM7.

Hey Rothnic, nice call, I agree that the CM7 default mounting scheme is both somewhat confusing and somewhat less useful with the G Tablet.
Quick question - you packaged up those performance packs with updated drivers for TNT etc. I know this may be a dumb question, but are these the same drivers currently being used in CM7? Or are they Froyo specific and incompatible with a Gingerbread ROM build because of library dependencies or structural changes?
I'm just trying to figure out if there's some way to speed up 2d graphics stuff in CM7 without waiting for more drivers from NVidia.

rcgabriel said:
Hey Rothnic, nice call, I agree that the CM7 default mounting scheme is both somewhat confusing and somewhat less useful with the G Tablet.
Quick question - you packaged up those performance packs with updated drivers for TNT etc. I know this may be a dumb question, but are these the same drivers currently being used in CM7? Or are they Froyo specific and incompatible with a Gingerbread ROM build because of library dependencies or structural changes?
I'm just trying to figure out if there's some way to speed up 2d graphics stuff in CM7 without waiting for more drivers from NVidia.
Click to expand...
Click to collapse
CM7 uses the Nvidia libraries from TnT 3588. I haven't gotten to merging in the newer "performance pack" ones that TnT doesn't include.
The libraries are Froyo specific, and were for many devices. I believe the CM team has built wrappers so that it can use the froyo specific libraries. I'm not sure on the acceleration issue.

Ok I got 2 questions:
Do we have any clue how does Incredible (for example) works? It has 8gb internal plus External, they both mount on usb.
Doesnt the fact that we can mount the internal storage on the computer, etc etc, can be a reason for the corruption of partitions? (maybe unplugged before unmounting by mistake or stuff like that..). That may have happen to almost everyone, everything starts crashing, FC, etc, all because of the repartitioning. Maybe paradigm 2 its better and correct.
Another quick thing, is it possible to mount internal on /scard and external on /sdcard/sdcard2? That would make both accesible on usb mount no?
Thanks

great work rothnic
I tried to play with cm7 last night but was getting frustrated by this issue. Thanks for doing this!!

+1 for /SDCARD here...
thanks, rothnic

Thanks for the efforts. Oh, option 1until I can get my hands on a 32GB micro SD, but probably still favor /sdcard and /sdcard2 anyhow.
Also, can't wait for hardware acceleration with this Rom, best one so far.

I like option 1 over option 2 for the gTab. What would really be cool is an option 3.
Internal + External = virtual SDCard.

+1 for Option 1.

If it is going to be a 'true' Cyanogen port, it should probably use the default Cyanogen behavior, which is Option 2.

This is meant as a discussion for the merits of each. For my use case option 1 makes sense.
Id like to hear why option 2 makes sense to others. How do you access your 14gb of internal storage?

slaughts said:
If it is going to be a 'true' Cyanogen port, it should probably use the default Cyanogen behavior, which is Option 2.
Click to expand...
Click to collapse
This is handled in the device specific config files so in no way makes it different. Each device has its own specific mounting scheme.

I prefer option 1, because it does not depend on having the external inserted.
Sent from my VEGAn-TAB-v1.0.0B5.1 using Tapatalk

danielsjam said:
I prefer option 1, because it does not depend on having the external inserted.
Sent from my VEGAn-TAB-v1.0.0B5.1 using Tapatalk
Click to expand...
Click to collapse
This has to be the most compelling reason on why it should be mounted as sdcard and sdcard2.

thebadfrog said:
This has to be the most compelling reason on why it should be mounted as sdcard and sdcard2.
Click to expand...
Click to collapse
I agree. I prefer internal being SDCARD.

A vote for Option 1. As a temporary solution, I go into the Terminal Emulator and type
Code:
su
mount /emmc/ /sdcard/
and it works
gksmith said:
I like option 1 over option 2 for the gTab. What would really be cool is an option 3.
Internal + External = virtual SDCard.
Click to expand...
Click to collapse
You mean.............just like Windows Phone 7?

It depends on the read/write speed of the sdcard. But since the internal sdcard is shared with other system partitions it makes sense for the external sdcard to be mounted at /sdcard, especially if you have media on it. Processes that read/write to /sdcard (like Gallery) can't mean anything good for performance. What we should have is both the sd and emmc to have /data, /system, and /sdcard mdraid partitions created and mounted/initialized for a nice perf increase. I wonder if its possible with android. It certainly is supported in the kernel with the right config. I should check to see if there are arm binaries for mdadm. Then i could create a test partition to measure performance.
Oh and CIFS is what i use to xfer files. There are plenty of ways to access partitions without mounting them as a drive. I think that usually leads to trouble. There is even file expert which lets you create smb shares... there prob solved, map network drive.

Blades said:
It depends on the read/write speed of the sdcard. But since the internal sdcard is shared with other system partitions it makes sense for the external sdcard to be mounted at /sdcard, especially if you have media on it. Processes that read/write to /sdcard (like Gallery) can't mean anything good for performance. What we should have is both the sd and emmc to have /data, /system, and /sdcard mdraid partitions created and mounted/initialized for a nice perf increase. I wonder if its possible with android. It certainly is supported in the kernel with the right config. I should check to see if there are arm binaries for mdadm. Then i could create a test partition to measure performance.
Click to expand...
Click to collapse
How would you handle people who do not have an external sdcard?

One more for option 1.

Related

APPS2SD Confusion.

From the recovery image to get APPS2SD by simply running the format the SD using Ext2+Swap+fat32 right?
I have a class 6 card. How do I know if this actually works? I formatted and my internals space did not change?
Are there major benefits of doing APPS2SD?
Yes, first format the SD card.
To see if its working,
Check your Settings -> SD card & phone storage -> Internal phone storage. Make note of what it is at. Install some apps, maybe even try reinstalling some of the apps on your phone. Then, check the internal storage again and see if you have some more space.
As for the benefits, it just frees up your internal memory on your phone. I don't think it makes your phone faster or anything.
The question I have about APPS2SD is this. How come when I use it my internal memory drops after I install apps. I have not used it since I had to go back to the original Sprint ROM to do the update and installing the same apps I had before, my internal memory was about the same as it was when I used APPS2SD. I used the recovery screen to format to Fat32-Ext2-Swap and files were on the sd card when I checked, but my internal memory still drops everytime I install something. What is the real benifit of this if the internal memory drops anyway. I am real confused about this and have not decided if it is worth using since I have read it can damage your memory card. Can someone with knowledge of how this works please explain it.
Thx for all the great Info found here.
AppsToSD only puts the apps themselves on the SD. The internal memory is still used by the boot-cache, dalvik-cache, and actual app data like settings, saved games, cache, etc.
Must it be ext3?
What if i have ext2?
rvenes said:
Must it be ext3?
What if i have ext2?
Click to expand...
Click to collapse
If youre using one of the newer recovery images there should be an option to upgrade ext2 to ext3
as for the difference...im not to sure exactly
Tipharet said:
How do I know if this actually works? I formatted and my internals space did not change
Click to expand...
Click to collapse
Answer: . . . . .
nelson8403 said:
Just because the apps are installed to the SD card doesn't mean they don't store things on the phone.. cache is stored on the phones, theres a /data/data folder on the phone that the apps populate as well, it just doesn't take AS MUCH space on your phone as a non appstosd
also to make sure your apps are working go into your adb shell, type in
Code:
cd /data/app
pwd
cd /data/app-private
pwd
What this will do is go to your /data/app folder and because with appstosd that is a symbolic link to /system/sd/app the PWD (present working directory) will display /system/sd/app, if PWD shows /data/app you are not running appstosd
Click to expand...
Click to collapse
rvenes said:
Must it be ext3?
What if i have ext2?
Click to expand...
Click to collapse
As far as I know it works just fine on ext2.
As far as the difference, the nutshell version is that ext3 is pretty much just ext2 with journaling hacked in. If you don't know that that means, do a google search on "journaling file system".
There should be no downside whatsoever to switching to ext3. It can still be read from and written to by anything that can use ext2, and it adds more robust error recovery.
Caveats: I'm not sure how well, or if, that error recovery works on flash memory devices. My expertise is working with large servers that use hard disks. I also don't know if there are tools in our android builds that take advantage of the benefits that ext3 provides.
Having said that, I'm still confident that choosing to upgrade to ext3 offers NO downside, and while there might also be no upside, there is also the potential for a huge upside.
My advice: Do it.

default USB Mass storage issue

Hi
for the last few hours I am trying to resolve the issue that I only today found out and after lots of testing, reflashing different roms I realized that this is a general issue and not related only to me or the rom I am using. So far tried only CM7 roms and NexusHD 3.0.
First it only happens if you have second partition on your sdcard. If you have only one fat32 partition everything works OK.
To see the issue try next:
-Enable USB Mass storage via default mount option in notification area. (issue is not present with 3rd party mount apps)
-On your computer open some folder on your SD card and remember its content
-Turn off USB Mass storage
-copy any file to that folder via any file manager app ib your phone
-Turn on USB Mass Storage and again open that folder to check for the new file (second mount lasts much longer then the first)
-File is not visible via USB mount until next phone reboot.
I have tried so far:
-HyperDroid 3 and Hyperdroid GBX v12
-Typhoon 3.6.4
-NexusHD 3.0 and 3.1a
-UltimateDroid 3.3
(all cLK)
Tried to use vold files from several other roms (MIUI and sense rom) but the issue is always there.
Also tried disabling USB debugging, changing USB ports, even PC's.
After some testing I realized that it only occurs if there is extra partition on sd. I tried ReiserFS and ext4 format, no difference. Only when I deleted all the partitions, created one and reformat it to fat32 mount was working fine.
I am currently using AdamG's a2sd modified by Seader for Hyperdroid, but while trying this on NexusHD I used Darktremor 2.7.5.2 and the issue is there.
Workaround for this is to use alternative apps for mounting. I am using Multi Mount SD-Card Lite.....
I have several people so far confirming this, on HyperDroid and Typhoon. All have partitions for a2sd.
I am not sure when this started happening. I will try tommorow some older roms but until then any information about this is helpfull. Please post if you have the issue and what rom you are on.
This is a log while mounting the USB for the second time. I see lots of vold, mount lines.
http://pastebin.com/XKUqpU56
update:
The cause of this issue is definitely a2sd. After I installed fresh rom (hyperdroid) with a2sd script removed from init.d folder USB mount doesn't have this issue.
So something is happening during mount or unmount process with active a2sd which breaks the ability of USB mount to update its file index which is sent to the computer.
This is happening with both Darktremor (tried 2.7.5.2 and 2.7.5.3. beta4) and AdamG's a2sd scripts.
update2:
this is another logcat
while mounting, checking Camera folder on a computer, unmounting, takes a picture, mounting again(this mount takes about 3 times longer then the first) and then checking the Camera folder again.
http://pastebin.com/HtqXzVx4
update3:
I found a way to stop this issue from happening. I have modified one line in vold.fstab file that is located in /system/etc
from
dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
to
dev_mount sdcard /mnt/sdcard 1 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
As soon as I change 1 to auto again and reboot issue is back.
This way only the first partition (fat32) is mounted and the issue is gone. I dont know if this change can cause any other issues, but so far only thing I noticed that is different is that when you turn USB Mass storage on while connecting the phone to a linux computer it only mounts first partition and no sdext one. For me this is not important, but as I said I am not sure if this change could have an impact on stability to any part of the system or phone functionality.
So to summ up:
- there is an issue of phone doesnt updating file index after first mount and you can't see any new files on your PC that are created in the meanwhile until phone reboot (for example new pictures taken with Camera)
-this only happens if you have extra partition on sdcard (for a2sd) and installed a2sd script (so far tried only Darktremors and AdamG's, but I guess that they all basically are doing the same thing). If you remove one of this elements the issue is gone
-after changing line in /system/etc/vold.fstab
"dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1 "..........from auto to 1
so the system will mount first and not automaticaly the first available partition, the issue is gone but someone with more knowledge then me could say what kind of issues this change might produce.
(Some time ago while applying this change in hyperdroid release at that time lots of people had issues with getting an corrupt SD card error. Not sure why it happened because it worked fine on my phone)
I have that issue also and i'm using NDT MIUI...now have to use the eMAgldr 1.13 USB Mount Storage to move or copy the file.
I have just installed Ultimate Droid 3.3 to check this issue and it is also there. UD is a 2.3.3 rom with tytung r9 kernel. So the issue is not so new
I need to test even older roms to find out if this ever worked right.
Is there anyone with some old rom installed on it? Nand or SD.
clyder said:
tytung r9 kernel.
Click to expand...
Click to collapse
Yup just try updating your kernel to be able to support ext2-4 partitions
its a big mistake that almost everybody does...
Dakargr said:
Yup just try updating your kernel to be able to support ext2-4 partitions
its a big mistake that almost everybody does...
Click to expand...
Click to collapse
You havent read my post. There is no problem with functionality of sdext partition. But the presense of sdext partitions is one of the conditions for this issue.
I am using Hyperdroid with kernel that is based on tytung r12. After I realized the issue I thought that it is related to that rom and after that with my sd card or something 3rd from my side. But that is not the case.
I have tried about 5 different roms, vold files from 5 more and the issue is always there. Issue is present only where there is a second partion on SD card.
Oldest rom I tried is UD 3.3. I havent found much older cLK roms to test, and now dont have time to convert older roms to test. I will do so later. I want to see if this thing ever worked right and in what point it stopped.
Also you havent mentioned if you tested the issue or not.
I think I don't have any USB Mass storage issue.
My SD card has FAT32 and Ext3 partitions but I don't use Apps2SD. (i.e. Ext3 partition is empty.)
I will try your steps when I go home. (I didn't bring my mini USB cable in hand.)
I rarely copy files using file manager apps.
If you can use USB Mass Storage, it seems there's no reason to use file manager apps.
tytung said:
I think I don't have any USB Mass storage issue.
My SD card has FAT32 and Ext3 partitions but I don't use Apps2SD. (i.e. Ext3 partition is empty.)
I will try your steps when I go home. (I didn't bring my mini USB cable in hand.)
I rarely copy files using file manager apps.
If you can use USB Mass Storage, it seems there's no reason to use file manager apps.
Click to expand...
Click to collapse
Thanx for replying. I havent tried with ext3. Only reiserFs and ext4 and the behavior was the same. Only when I removed the ext partition it was gone.
The issue is like phone is sending the same directory listing to a computer in both first and all other mounts until reboot.
One also good way to test is by taking photos from a camera. Look at the DCIM/Camera folder with USB mass storage. Turn storage off. Take another picture. Use Mass storage again and the new pic wont be visible through USB mass storage on your computer.
So far I tried only on windows and not linux. Maybe the behavior is different. I will make more tests later.
At one point I thought that my windows system made that issue, so I tried to change USB ports, also tried hooking phone to another computer and the new files wasn't present.
Also it came to me that a2sd can cause this, but on your rom I tried Darktremor a2sd, while on others it was AdamG's one. Issue was exactly the same.
I havent tried any sense rom, because I would need to reflash different partition layout and was too lazy to do that yesterday.
Point of this thread was to check other people experiences with this to try to realize if this is all general HD2 issue, or perhaps only on AOSP roms. So far not much reports
Can any of your older kernel (<r9) work with newer roms(2.3.4+). I dont care about wifi, phone or anything. It is enough if I can just boot the phone to test this.
update:
I just tried USB mount in Ubuntu and the behavior is the same. Also since I can see ext partition when do a USB mount in linux I realized that the same issues goes with files on ext. New files are not visible to the computer until phone reboot.
clyder said:
Thanx for replying. I havent tried with ext3. Only reiserFs and ext4 and the behavior was the same. Only when I removed the ext partition it was gone.
The issue is like phone is sending the same directory listing to a computer in both first and all other mounts until reboot.
One also good way to test is by taking photos from a camera. Look at the DCIM/Camera folder with USB mass storage. Turn storage off. Take another picture. Use Mass storage again and the new pic wont be visible through USB mass storage on your computer.
So far I tried only on windows and not linux. Maybe the behavior is different. I will make more tests later.
At one point I thought that my windows system made that issue, so I tried to change USB ports, also tried hooking phone to another computer and the new files wasn't present.
Also it came to me that a2sd can cause this, but on your rom I tried Darktremor a2sd, while on others it was AdamG's one. Issue was exactly the same.
I havent tried any sense rom, because I would need to reflash different partition layout and was too lazy to do that yesterday.
Point of this thread was to check other people experiences with this to try to realize if this is all general HD2 issue, or perhaps only on AOSP roms. So far not much reports
Can any of your older kernel (<r9) work with newer roms(2.3.4+). I dont care about wifi, phone or anything. It is enough if I can just boot the phone to test this.
Click to expand...
Click to collapse
This problem appears only after dismounting SD storage you don't remove the cable from the phone.
It is normal before mounting it again to disconnect the USB cable!
Denkov said:
This problem appears only after dismounting SD storage you don't remove the cable from the phone.
It is normal before mounting it again to disconnect the USB cable!
Click to expand...
Click to collapse
This is not the case here. I tried disconnecting my phone, also tried connecting it to another PC and again I can't see any new files until phone reboot.
Have you actualy tested this or just guessing? Do you have ext partition on your SD card? What rom are you using?
clyder said:
This is not the case here. I tried disconnecting my phone, also tried connecting it to another PC and again I can't see any new files until phone reboot.
Have you actualy tested this or just guessing? Do you have ext partition on your SD card? What rom are you using?
Click to expand...
Click to collapse
I have second partition ext3.
I mount SD card, check screen shot folder, unmounted the card, remove the cable, take a screenshot, mount it again and the new image was there.
When I try to do same thing second time it did't work! Maybe you are right - there is issue with th SD card mount and I think the card is not dismounted properly!
tytung said:
I think I don't have any USB Mass storage issue.
My SD card has FAT32 and Ext3 partitions but I don't use Apps2SD. (i.e. Ext3 partition is empty.)
I will try your steps when I go home. (I didn't bring my mini USB cable in hand.)
I rarely copy files using file manager apps.
If you can use USB Mass Storage, it seems there's no reason to use file manager apps.
Click to expand...
Click to collapse
I have tried it.
Mount -> check the content of a folder in the SD card.
Unmount -> Copy a file to that folder using ES File Explorer. (Second testing is Root Explorer. Has the same result.)
Mount -> new file is there.
Win7 x64
NexusHD2-Gingerbread V3.1a NAND
tytung said:
I have tried it.
Mount -> check the content of a folder in the SD card.
Unmount -> Copy a file to that folder using ES File Explorer. (Second testing is Root Explorer. Has the same result.)
Mount -> new file is there.
Win7 x64
NexusHD2-Gingerbread V3.1a NAND
Click to expand...
Click to collapse
You said before that you dont have a2sd installed. Did you tested this without a2sd also? Maybe that is the key. All my tests so far included the presence of some kind of a2sd script.
Also I am on cLK, and two other guys that confirmed it are also on cLK. I dont know about denkov.
I will do more tests later but the issue is definitely related to ext. Because of some incompatibility of a2sd scripts with some part of android system or for some other reason.
I have just tried the combination of NexusHD 3.1a/cLK/AdamG's a2sd script/ext4
issue remains here
clyder said:
You said before that you dont have a2sd installed. Did you tested this without a2sd also? Maybe that is the key. All my tests so far included the presence of some kind of a2sd script.
Also I am on cLK, and two other guys that confirmed it are also on cLK. I dont know about denkov.
I will do more tests later but the issue is definitely related to ext. Because of some incompatibility of a2sd scripts with some part of android system or for some other reason.
Click to expand...
Click to collapse
I am on MAGLDR.
And I don't use any a2sd as I said before.
So my testing is without a2sd.
I think a2sd scripts may be the suspect.
tytung said:
I am on MAGLDR.
And I don't use any a2sd as I said before.
So my testing is without a2sd.
I think a2sd scripts may be the suspect.
Click to expand...
Click to collapse
They are definitely the cause. I have tried both Darktremor's and AdamG's script.
All of the people who confirmed this to me was using a2sd.
edit:
Just did a fresh install of hyperdroid with a2sd script removed from init.d and usb mount issue is gone.
So something is happening while mounting or remounting USB with active a2sd script which breaks the file list updating when mounting it the second time.
I have found a way to stop the issue from happening. Updated first post....if anyone is actually reading this thread...
clyder said:
update3:
I found a way to stop this issue from happening. I have modified one line in vold.fstab file that is located in /system/etc
from
dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
to
dev_mount sdcard /mnt/sdcard 1 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1
As soon as I change 1 to auto again and reboot issue is back.
This way only the first partition (fat32) is mounted and the issue is gone. I dont know if this change can cause any other issues, but so far only thing I noticed that is different is that when you turn USB Mass storage on while connecting the phone to a linux computer it only mounts first partition and no sdext one. For me this is not important, but as I said I am not sure if this change could have an impact on stability to any part of the system or phone functionality.
So to summ up:
- there is an issue of phone doesnt updating file index after first mount and you can't see any new files on your PC that are created in the meanwhile until phone reboot (for example new pictures taken with Camera)
-this only happens if you have extra partition on sdcard (for a2sd) and installed a2sd script (so far tried only Darktremors and AdamG's, but I guess that they all basically are doing the same thing). If you remove one of this elements the issue is gone
-after changing line in /system/etc/vold.fstab
"dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1 "..........from auto to 1
so the system will mount first and not automaticaly the first available partition, the issue is gone but someone with more knowledge then me could say what kind of issues this change might produce.
Click to expand...
Click to collapse
Good job! I will try!

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

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:
dev_mount sdcard /mnt/sdcard
Click to expand...
Click to collapse
To:
dev_mount emmc /mnt/emmc
Click to expand...
Click to collapse
5. Do the same thing with the emmc section:
dev_mount emmc /mnt/emmc
Click to expand...
Click to collapse
To:
dev_mount sdcard /mnt/sdcard
Click to expand...
Click to collapse
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):
# 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
Click to expand...
Click to collapse
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.
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?
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
Zewsan said:
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?
Click to expand...
Click to collapse
same doubt raised here ...is it possible to mount external sdcard to /mnt/external_sd instead of mnt/emmc...???
please need solution
Zewsan said:
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?
Click to expand...
Click to collapse
Its the same technique....
So remember this:
Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
Click to expand...
Click to collapse
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)
dev_mount hammertime /mnt/hammertime auto /devices/platform/s3c-sdhci.2/mmc_host/mmc1
Click to expand...
Click to collapse
That will work correctly.
Hope that helps!
mattisdada said:
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!
Click to expand...
Click to collapse
is there no any requirement of changing build.prop file after doing this....?????
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!
HAvoktek said:
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!
Click to expand...
Click to collapse
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.....
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
jeromepaez said:
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
Click to expand...
Click to collapse
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 , short of modifying a flashable zip first and rekeying it.)
Forgot to post back with my results, Got HFS & AOKP to see the changes, however something broke when I did a PC mount. After playing with the lines "Experimentation" if you will, I ended up needing to rebuild my partitions! No fault of yours, I just wanted to see if I can have that functionality through the whole phones usage and features eg. mounting to the PC.
Thanks for the guide though, I'm seeing now that some devs are including the option to use the internal memory via a menu select, I wonder how there implementing that.
Probably something very similar but programmatically instead of the haxy file editing method I'm noting to use .
PC mounting is working as per normal for me here though...... (I don't have an external card right now so that may be a variable)
mattisdada said:
Probably something very similar but programmatically instead of the haxy file editing method I'm noting to use .
PC mounting is working as per normal for me here though...... (I don't have an external card right now so that may be a variable)
Click to expand...
Click to collapse
That it is, cause I can see my internal, but it doesn't mount the external.
Purpose
What is the purpose of this? Does it mount the EMMC so that the system thinks EMMC is actually an external sd card?
I am trying to figure out if there is a way to make the above mentioned happen. Or is there a way to re-partition it so that EMMC is used as system memory... or maybe even both? It seems that since ICS better integrates with on board memory, there would be a way to better integrate the internal memory of older devices with the system.
hfj00788 said:
What is the purpose of this? Does it mount the EMMC so that the system thinks EMMC is actually an external sd card?
I am trying to figure out if there is a way to make the above mentioned happen. Or is there a way to re-partition it so that EMMC is used as system memory... or maybe even both? It seems that since ICS better integrates with on board memory, there would be a way to better integrate the internal memory of older devices with the system.
Click to expand...
Click to collapse
This guide shows you how to "flip" the points. Several ROMs have it differently preconfigured. But if this is your current situation:
Code:
Emmc: External SD Card
SDcard: Internal SD Card
It will make it:
Code:
Emmc: Internal SD Card
SDcard: External SD Card
And vice versa obviously (its a flip).
This guide will do what your wishing it to do.
The folders sdcard and emmc (or there /mnt varient more closely) are just soft links, meaning they don't really exist, but just point to another location. We can modify which folder they are linked to in the fstab.void file.
so to make emmc to external_sd i change "dev_mount emmc /mnt/external_sd"?
Worked great on a Captivate running AOKP-36 right after a wipe data/factory.
lol you need no guide on cm9
you can switch them in storage settings by a simple checkbox
its mentioned in team hacksung's FAQ
Im on CM9. Can someone post the code so i can just do a simple copy and paste? I wanna switch emmc to external_sd
(there is no storage settings simple checkbox for me)
Sent from my SGH-I997 using xda premium
bradman117 said:
Im on CM9. Can someone post the code so i can just do a simple copy and paste? I wanna switch emmc to external_sd
(there is no storage settings simple checkbox for me)
Sent from my SGH-I997 using xda premium
Click to expand...
Click to collapse
Never use a copy and paste for the file in this operation. You only need to modify partially two lines (which you can copy and paste from the OP).
Your just swapping two words around really. Its fairly easy, just follow the steps and it will work, it looks daunting at first if your not used to doing this sort of thing, but its fairly easy.

IDEA: Hacking internal/external sdcard mount paths

Hello.
I'm using the latest aurora and I'd like to discuss an idea I had.
Since the U8800 has plenty internal memory and it's quite fast comparing to an average sd card, it'd be great if we could use the internal memory for the tasks that need "speed" instead of "space".
Running apps from the sd card is the perfect example!
So the idea would be, while keeping the external sdcard mounted on /mnt/sdcard, having /mnt/sdcard/Android/data, for instance, point to the «internal sdcard path»/Android/data.
What do you think would be the best solution:
- hacking the mount points?
- using links?
- other solution?
Any developer or filesystem savvy user can point the advantages or dangers of using this solution?
- e.g.: the system or some apps may check if the external sd-card is mounted before trying to read/write to /mnt/sdcard/Android/data... that would mean the system/those apss may think that path isn't reachable with the ext-sdcard unmounted, altough they can be read.
Suggestions? Rants? Ideas?
Regards!
I have wondered if the /data/app or maybe the whole /data partition could be mounted in the internal storage partition. That would give 2gb space for apps and associated files instead of 3-400 ish and would mean no need to move apps to sd card which would mean faster loads at startup due to internal memory being faster.
VuDuCuRSe said:
Hello.
I'm using the latest aurora and I'd like to discuss an idea I had.
Since the U8800 has plenty internal memory and it's quite fast comparing to an average sd card, it'd be great if we could use the internal memory for the tasks that need "speed" instead of "space".
Running apps from the sd card is the perfect example!
So the idea would be, while keeping the external sdcard mounted on /mnt/sdcard, having /mnt/sdcard/Android/data, for instance, point to the «internal sdcard path»/Android/data.
What do you think would be the best solution:
- hacking the mount points?
- using links?
- other solution?
Any developer or filesystem savvy user can point the advantages or dangers of using this solution?
- e.g.: the system or some apps may check if the external sd-card is mounted before trying to read/write to /mnt/sdcard/Android/data... that would mean the system/those apss may think that path isn't reachable with the ext-sdcard unmounted, altough they can be read.
Suggestions? Rants? Ideas?
Regards!
Click to expand...
Click to collapse
Well this is known for a while now . Quoted from my thread here:
vold.fstab - CHANGE THE DEFAULT SDCARD: -thanks to julle131
There is this file named vold.fstab at your /system/etc/ folder, which controls which of your sdcards (Internal/External) will be mounted when you connect your phone to the PC. The last 2 lines are the only that matter. These are the two possibilities:
EXTERNAL SDCARD MOUNTED (DEFAULT):
dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_sdcc.4/mmc_host
dev_mount emmc /mnt/sdcard1 14 /devices/platform/msm_sdcc.2/mmc_host
INTERNAL SDCARD MOUNTED:
dev_mount sdcard /mnt/sdcard 14 /devices/platform/msm_sdcc.2/mmc_host
dev_mount emmc /mnt/sdcard1 auto /devices/platform/msm_sdcc.4/mmc_host
change them as you wish with a root explorer or before flashing.
Click to expand...
Click to collapse
Make this change and every app will use the internal sdcard. Gallery works ok with images to external sdcard, it just might take a while for the first refresh. But I don't know if you'll notice any difference in terms of speed....
Cheers
spirosbond said:
Well this is known for a while now . Quoted from my thread here:
Make this change and every app will use the internal sdcard. Gallery works ok with images to external sdcard, it just might take a while for the first refresh. But I don't know if you'll notice any difference in terms of speed....
Cheers
Click to expand...
Click to collapse
That's not what he talked, I think. He said that the apparel would be installed on the external sd card, but the data would be moved to the internal one. And we have speed, but the main card would be the external one.
I think its a great idea if I understood it right!
Sent from my U8800 using xda premium
mrasquinho said:
That's not what he talked, I think. He said that the apparel would be installed on the external sd card, but the data would be moved to the internal one. And we have speed, but the main card would be the external one.
I think its a great idea if I understood it right!
Sent from my U8800 using xda premium
Click to expand...
Click to collapse
Oh I see! Sorry about that. As far as I know apps are not choosing were to put their data. They just say to the OS "I want these things to be at the sdcard" and the OS puts them at the correct place. So you can't "hack" the app to "see" at somewhere else. On the other hand the OS initialises on boot which card is the primary and which is the secondary. So my knowledge stops there and I can't imagine a way to make this separation between app data and the rest...
I hope for someone else's help!
PaulMilbank said:
I have wondered if the /data/app or maybe the whole /data partition could be mounted in the internal storage partition. That would give 2gb space for apps and associated files instead of 3-400 ish and would mean no need to move apps to sd card which would mean faster loads at startup due to internal memory being faster.
Click to expand...
Click to collapse
Maybe this cannot be done, because I think that the mapping of the partitions and mounts comes from the bootloader, but there is already the solution of resizing the data partition using the space of internal storage.
PaulMilbank said:
I have wondered if the /data/app or maybe the whole /data partition could be mounted in the internal storage partition. That would give 2gb space for apps and associated files instead of 3-400 ish and would mean no need to move apps to sd card which would mean faster loads at startup due to internal memory being faster.
Click to expand...
Click to collapse
That's a great idea!
I almost don't use the so called "internal sd card", therefor I have 2GB of fast empty space being wasted.
Why not simply mounting the internal sd-card partition in the data folder and the data partition on the internal sd card folder?
I only use the internal sd card to hold ringtones and other small stuff that I need to be in accessible 100% of the time, so a few hundred MB are enough!
Me gusta!
Every ROM flashes it's own fstab, right?
So all we'd need to do would be, editing the fstab before flashing it.
-----------------
Regarding the my first idea... I don't think one can simply mount a path on another path. We'd need a "virtual" device pointing to /mnt/sdcard-internal/data/ then mount that virtual device on /mnt/sdcard-external/data/.
My knowledge of unix mount/filesystems is not much more than what's explained here: https://help.ubuntu.com/community/Mount
OK, just found this:
http://askubuntu.com/questions/11079/mount-a-directory-to-look-like-a-drive
there is a FUSE filesystem named bindfs that probably does exactly what you want. For example the following:
bindfs -n /media/USB-HDD-01/ISO/ /home/johnc/ISO-images
Click to expand...
Click to collapse
would result in ISO-images to show up as a mounted filesystem in the Places sidepanel in Nautilus. The -n is required because otherwise bindfs tries to use the allow_other FUSE option, which by default is not allowed for regular users (if you use bindfs in /etc/fstab this is not a problem).
The first directory you give is the existing one, the second directory you give is an empty directory under which the contents of the existing one will appear.
Click to expand...
Click to collapse
So, bindfs depends on FUSE... and there's a port of fuse to android: https://github.com/seth-hg/fuse-android but looking at the README I get the feeling that it's not really working. The last step would be having a kernel with FUSE support... and regarding that, I have no idea, how easy it is to get a kernel like that for our U8800 :\
Finding such a solution to expand the DATA partition indirectly would be great!
I used to apply genokolar's custom partition method as "1.2G DATA + 1.46G INTERNAL SD" before, but i found out that it has some issues with Official 2.3 Roms. One of them -the most important IMHO- is the BOOTLOOP problem occurring in some specific situations!!!
See the details in my post here:
http://forum.xda-developers.com/showpost.php?p=25853141&postcount=134
(Seems that I don't encounter the bootloops on Custom Roms, but i'm not %100 sure and never will be )
So i unfortunately gave up using it, and revert to the stock partition .
I will be grateful to the one who will find a better and reliable solution. Hope to see it soon...
I still have to gather more information on the official update "modus operandi".
My goal is to simply reformat both partitions and then swap their mount points.
If the official update formats the partitions before applying the flashing official ROM files, then partitioning changes shouldn't cause any failure on the official update.
But like I said, I'm still yet to confirm that info.
Gen's idea was great (I learned a lot just by looking at his scripts) but resizing partitions has its dangers.
Since "no one" really uses the internal memory, why not simply exchange its room with /data, right?
This would be awesome! I would love to have 2gb for apps, instead of cluttering my phone.. plus the 2gb of internal storage are just a waste for me.. I never use them.. so this would be great!

Important and Read RE: MTP in recovery aka data/media

This is completely pulled off of my other thread in the HOX+ section
our device is a data/media device which is why usb mount don't work
here's a link that explains it all
http://teamw.in/DataMedia
and part of the convo with dees_troy is below
<Dees_Troy> Nope, it will *never* work on a data/media device
<Dees_Troy> read and learn: http://teamw.in/DataMedia
<WinBot> [Link] http://tinyw.in/lstO :: What is a data media device? | TeamWin
<Dees_Troy> definitely worth understanding
<Dees_Troy> at some point we're going to try to kang in MTP for recovery
<Lloir> so for now then it's sideload or from inside the rom
<Dees_Troy> or adb push
<Lloir> aye
<Dees_Troy> or gtfo
<*****> so cant mount usb storage with newer devices...hmm one x did guess this is where confusion at least on my part came to be
<Lloir> lmao Dees_Troy
<Dees_Troy> one x wasn't a data media device
YOU MUST either transfer the rom\boot\porn\audio\mods while the phone is on or use adb push or even sideload when in recovery, THIS IS THE ONLY way
IF you want to read without clicking the link i'll whack it up in #2
What is a data media device?
I'm writing this page because there seems to be a lot of confusion about how many of the newer Android devices work. Starting in Honeycomb 3.0 with the Xoom, Google changed the way that they handled storage. Instead of having a "data" partition with your apps and a separate "sdcard" partition for storage, Google started giving you a single, very large data partition. Inside /data is a folder at /data/media that contains all of the contents of what you think of as your internal sdcard.
Since /data/media is part of /data, we pretty much never actually format the data partition. Formatting data, of course, also removes the media folder that contains the internal sdcard. When you choose a factory reset, instead of formatting, we use rm -rf commands to remove all the folders except for the media folder so that we can remove all of your apps and settings while leaving your "sdcard" intact. In TWRP we also have a wipe internal storage option that rm -rf's the media folder and a "Format Data" option that formats to recreate the entire file system in case something goes completely wrong or to remove device encryption.
When you're booted to Android, Android fuses the media folder to /sdcard and emulates a FAT files system that doesn't have permissions for legacy apps. We don't currently have fuse in recovery, so we just add an extra mount command to mount /data/media to /sdcard so in recovery you still have to worry about permissions on /sdcard.
Because the "internal sdcard" is not a true FAT file system, you can't mount it via USB storage. Well, that's not technically true, but the vast majority of people use Windows computers and Windows doesn't recognize ext4. If we were to allow you to mount the data partition via USB storage, Windows would claim that the device wasn't formatted and offer to format it for you, which, as you can imagine, would be a disaster. The whole ext4 setup is another reason that Android switched to using MTP for transferring files. Most of these devices don't have the necessary kernel configuration to even support USB storage mode, so it's not very easy to enable USB storage if we even wanted to try. Unfortunately at this time, MTP isn't available in recovery, so if you have no other option, you will have to use adb to push and pull files to/from your device.
As a special note, if you choose to do a factory reset from your ROM, even if the ROM says that it will wipe everything including the internal storage, well, that's not what TWRP will do. A stock AOSP recovery would format data including the "sdcard" but TWRP will use its regular factory reset setup that leaves the internal storage intact.
There are a couple of nice gains with using this setup vs the old data + FAT storage partition. With /data/media you, as the user get more control over how you use your storage. If you have a ton of apps, then that's no problem since you have a huge data partition to work with. If you don't have a lot of apps, you get more room to use for storing things like movies. Further, ext4 doesn't suffer from the 4GB file size limit that FAT has, so you can have a large, high-def movie on your device if you like. I'm sure another motivating factor was to get Android away from using FAT which is a Microsoft creation. Performance on ext4 in Android is also probably better than FAT. As a downside, data media devices tend to store a lot more app data in the "data" section and so backups on these devices tend to be larger.
Thank you for this post. I had been a bit curious about this. I have Evo LTE. But I also Boughy a family member a GNex that I have to maintain. I know that my Evo, I can plug into windows, and when I select USB transfer (not in recovery), it mounts my internal storage (not ext_SD) , and it shows as removable drive in windows. But,....when I plug in GNex, it shows up as GNex , not removable drive H. I always wondered a bit about what this all means.
Thanks for the info. :thumbup:
Sent from my EVO using xda premium
Thanks for the useful post.
If I make a nandroid backup for the whole device, will it exclude the /data/media folder? Because on my old phone the nandroid backup doesn't include /sdcard.
romitkin said:
Thanks for the useful post.
If I make a nandroid backup for the whole device, will it exclude the /data/media folder? Because on my old phone the nandroid backup doesn't include /sdcard.
Click to expand...
Click to collapse
Yes it does, we are past the point where that causes issues.
Everyone just needs to get used to the data/media thing. And learn how to use adb side load
I predict a whole bunch of "bricks" due to people not informing themselves on how the phone works and how to use adb
Sent from my One X using Tapatalk 2
A little bit from my side as well I hope someone will find this helpful. Virtual SD card on Android
Can't you use USB Host if you got recovery installed as well? I think I've read that somewhere...
mike1986. said:
A little bit from my side as well I hope someone will find this helpful. Virtual SD card on Android
Click to expand...
Click to collapse
Link broken, here is the correct URL:
http://android-revolution-hd.blogspot.com/2013/03/virtual-sd-card-on-android.html
Oh and bump for anyone new to the idea of a "data/media" device. You're not in Kansas anymore.
NxNW said:
Link broken, here is the correct URL:
http://android-revolution-hd.blogspot.com/2013/03/virtual-sd-card-on-android.html
Oh and bump for anyone new to the idea of a "data/media" device. You're not in Kansas anymore.
Click to expand...
Click to collapse
Lloir, thanks for sharing and good explanation. MTP makes sense and on my One, this way file transfers are simple and fast. However there are two things I dislike about MTP right now:
When you copy files to the device, on some file types it throws a warning that the device might not be able to read the file. This interrupts the file transfer and I have to confirm I want to copy the file to the device. On an older MP3 player I have, I could deactivate this by editing a device capabilities XML file. On the One, I did not find such a file. Perhaps an option in the MTP deamon?
When I am transferring files, I can't browse through other folders at the same time. It says the device is busy.
Is there a way to solve those two issues or "is it what it is"?
Lloir said:
Windows would claim that the device wasn't formatted and offer to format it for you, which, as you can imagine, would be a disaster
Click to expand...
Click to collapse
I did that on a device. Windows offered to format and I did it. Man that was not good! 2 hours later after manually restoring the partition values I was OK and the most amazing thing all my data was there perfect and untouched :silly: :highfive:
Thanks for that great explanation. Been having some issues with windows and android. Nothing big just had to sideload my ROM and killed my "sdcard" at least now I know why

Categories

Resources