Internal SDcard not mounted - Android Q&A, Help & Troubleshooting

Goodmorning everybody.
Recently, i've tried some Android ROMs for S8500 (Samsung Wave). But the last 2, "AOKP Fast and Furious v1.3" and "Fire v1", don't work as well. The problem is the management of Internal SDcard. Camera can't take pictures, because it doesn't know where to save them; nothing can be download from the network, the browser asks me an SD card to start the download; i can't even browse folders with "root explorer", when i tap in "sdcard" under "/mnt/" the phone says "The SD card is not currently mounted". Finally, when i go to "Storage" on "Settings", i can see only Application memory (INTERNAL STORAGE), and something under "SD CARD", but nothing for "USB STORAGE".. It seems like if user's partition coldn't be seen.
Those two ROMs are based on the same kernel, and i didn't have this problem with the first Nightly by Mikegapinski and with "Slim JellyBean v1". Then, could this be a kernel problem? Can i change it with others?
More recently, i've found a way to mount manually SDcard. This is the post where it's explained.
Surfing on my phone's folders, i've found one called "emmc" under "/mnt/" where are stored all the "common" files that are normally located on "/mnt/sdcard" (like "Android", "DCIM", "obb" folders) and some picture i had taken with "Slim JellyBean v1".
Next, i've known that the name of the partition mounted on "emmc" is "mmcblk0p1". Then i've run those 3 commands on Terminal Emulator:
Code:
mount -t vfat /dev/block/mmcblk0p1 /mnt/sdcard
setprop EXTERNAL_STORAGE_STATE mounted
am broadcast -a android.intent.action.MEDIA_MOUNTED --ez read-only false -d
The first 2 were ok, but the last gave this error: "Segmentation fault"
At this point, in Settings - Storage, i can see plugged "USB STORAGE", with files inside. But the problem with programs is still present.
What can i do? Is there a way to avoid the "Segmentation fault"?
Thank you in advance for your answers!

Thread moved to Android Q&A as this is a software related issue.

Nobody can help me?

Related

[Q] mount -o bind at boot on stock rom

Hi !
I have an application (CamScanner) with large amount of data (~8Gb). This app doesn't support transfering data do external SD card, so I checked mount -o bind command to bind directory with data stored on external SD to directory in /sdcard and it's working correctly. Question is where I can put this command so that system will run it at boot time after external sd card is ready. There is no /etc/init.d directory on my SGS2 (stock XXKI4). I prefer not to install any applications to perform such a simple task...
Thanks for help, regards !
slig said:
I prefer not to install any applications to perform such a simple task...
Click to expand...
Click to collapse
I think you have no choice, as stock kernels do not have init.d support. You'd need to go down the route of either using an app to run a script on boot, install a kernel with init.d support, or stick with your current method of manually running a script when you need to use the app.
Also, you could try asking the developers kindly to allow saving to external_sd. There's an Email Developer link on the Android market, and a Contact Us link on their website
Thanks for response. I found script named init.rc located in "/", it has several mount commands inside, wonder if it can be used...
Also discovered that app Tasked has ability to run shell scripts with root privileges (at boot or at application start). I suppose I have to put this shell script in /system because in /sdcard owner permissions cannot be set so that file cannot be modified (vfat does not support that) and a security hole would be created...
I think that I'll also ask developer for this feature as You suggest.
slig said:
Thanks for response. I found script named init.rc located in "/", it has several mount commands inside, wonder if it can be used...
Click to expand...
Click to collapse
Everything in "/" is initramfs, a volatile ramdisk changes to which would be lost
on reboot. Only exception are directories in which actual partitions are mounted,
like /system and /data (you can check which directories with "mount" command).
Have you tried just using symbolic link?
INFO
This may be the best solution, try something like:
Code:
mkdir /sdcard/AppFolder
ln -s /sdcard/AppFolder /data/data/com.your.application.data.folder
Just in case you don't know, you can execute those command using
Terminal Emulator. You were considering modifications to /, so I guess you already have root.
Yes, I have rooted my SGS2 via ZergRush.
I didn't know that / is volatile initramfs, thanks for that information.
As for symbolic link - unfortunately on my stock ROM both /sdcard and /sdcard/external_sd filesystems are vfat and don't support symbolic linking. Only working way I discovered is bind mount.
In my case, I have the following:
mount -o bind /sdcard/external_sd/CamScanner /sdcard/CamScanner
And application runs OK, all data is accessible and doesn't consume internal flash memory.
I'll take a look how hard would be to write some small application to do just this task - define some pairs of source and target directories and mount - bind them at start.
I've somehow missed the fact that you're need redirection from /sdcard
to /sdcard/external_sd, I was thinking about symlink on /data...
Anyways, there another nice trick you can do - if you can devote your SD card
to this one application, then just edit /system/etc/vold.fstab to make SD card
mount in /sdcard/CamScanner instead of /sdcard/external_sd.

[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?

Swapping mount points

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

/sdcard and /storage/sdcard0 symlinks being broken at boot.

Hi I am a newbie here and I hope I posted on the correct forum.
I am having a problem with my Spreadtrum SC7731 phone. It's internal storage symlink which is /sdcard /storage/sdcard0 is being broken at boot(I think). This started when I flashed supersu through twrp to root the phone. This happens after booting and then a notification will pop up and say "SD card removed, please insert a new one". After that prompt, Apps will then lose access to the Internal Storage and when you check the /storage directory, there is a sdcard0 folder inside it but it is not linked to /storage/emulated/0 which makes this directory virtually useless. I have figured out a work around myself by deleting the directories created at boot and recreating the symlinks with a small script I created:
Code:
su
rm -R /sdcard
rm -R /storage/sdcard0
ln -s /storage/emulated/0 /sdcard
ln -s /storage/emulated/0 /storage/sdcard0
after running this script, apps will have access to the internal storage and the /sdcard in the root directory is again accessible. But sometimes, it will lose its symlinks again so I have to run the script if it happens.
Again this happens after booting, then a notification will appear that the sdcard has been removed. after that happens, I checked the symlinks and its broken.
I don't really know what is the root cause but the work around is quite a hassle for me. I am looking for like a permanent solution to fix this. I don't have an External SD Card and I am not planning on buying one since the Internal Storage is Enough for me as I do not game on this phone.
bump
Bump
help pls

Help Remount Default /sdcard PATH, Please

Reasons:
0.) You know, apps like messing up internal storage.
1.) I have installed dozens of ROMs flashed with DualBoot Patcher(It's a great tool), and all of them share the same /sdcard path( /data/media/0, actually it's /raw/data/media/0 ), it's a terriable mess.
2.) Android Nougat does NOT have xposed yet, so I cannot use xposed module XInternalSD to do this.
Due to /sdcard being linked to /storage/emulated/0, I should mount -o bing $another_path to /storage/emulated/0.
What I want to do is:
remount $data_partition_mount_point/media/$my_path to /storage/emulated/0 when the phone is booting, so my system can use another path for internal storage
I want to unmount the default /storage/emulated and only to mount /storage/emulated/0 to keep /storage/emulated clean.
CAN I ?
But after too many times failed, I failed again. I CANNOT mount $my_path as Internal Storage again. It ends up with "Access Denied",or "cross-device link", or seperated permissions(not as a sdcard)
Also, I tried to modify install-recovery.sh to let my scripts execute when booting, but sepolicy denied my orders (like mkdir, mount, setenforce ). So, I run my scripts via APP "Boot Shell".
Is there anyone who know how to do this? Or, can a script change the default Internal Storage path?

Categories

Resources