/sdcard and /storage/sdcard0 symlinks being broken at boot. - Android Q&A, Help & Troubleshooting

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

Related

[Q] Screenshot without sdcard?

Hi,
is it possible to save the screenshots (vol- and power) into the internal storage?
Thanks.
I know such a change will not surive reboot, but how could I mount the int. storage (/dev/block/vold/179:31 on my phone) in /sdcard and ultimately in /mnt/sdcard properly? I did 'mount /mnt/emmc /sdcard' and 'mount /mnt/emmc /mnt/sdcard' - then when I do ls -la /sdcard/ or ls -la /mnt/sdcard I can see the internal storage, but the Root explorer keeps saying 'The SD card is not currently mounted' and all applications I need to put in /sdcard in order to work are refusing to believe that its mounted.
Obviously I'm missing something....

[Q] Internal/external sd not mounting [SOLVED]

Hi,
Since my last upgrade of cynaogenmod nighties yesterday on my galaxy s2, my internal AND external sdcard are not mouting anymore
I tried to understand why and I found that my /storage folder was empty. I think it should have been populated by /init.smdk4210.rc script :
Code:
...
on early-init
export EXTERNAL_STORAGE /storage/sdcard0
export SECONDARY_STORAGE /storage/sdcard1
mkdir /storage 0775 system system
mkdir /storage/sdcard0 0775 system system
mkdir /storage/sdcard1 0775 system system
mkdir /storage/usbdisk0 0775 system system
...
I tried to mount /storage/sdcard0, but without success (in fact I am not sure to have the right method).
Extract of /system/etc/vold.fstab
Code:
...
# internal sdcard
dev_mount sdcard0 /storage/sdcard0 11 /devices/platform/dw_mmc/mmc_host/mmc0/mmc0 nonremovable,encryptable
...
I thought that
Code:
mount /devices/platform/dw_mmc/mmc_host/mmc0/mmc0 /storage/sdcard0
would have been sufficient, but unfortunately not (I tried with /sys/devices/platform/dw_mmc/mmc_host/mmc0/mmc0 to).
I would like to retrieve my internal sdcard content.
Thank you in advance,
Bill
Ok after some investigations it is a known bug from 20130121 cyanogen nighties.
To get back internal sdcard :
Code:
su
echo mkdir /storage/sdcard0 > /data/local/userinit.sh
chmod 700 /data/local/userinit.sh
reboot
You can find more information here : http://forum.cyanogenmod.org/topic/63994-cm101-internal-sd-card-dont-mount/
Problem should be solved in future cyanogen nighties release https://github.com/cyanogenmod/android_system_core/commit/7cc503720f1a8a6aa9481c5f9fd4552bc463a501
Thanks for help
Bill
deleted
HELP!
my phone shows up on my computer but only my external sd card shows up, not my internal! help me fix it! ive attached some screenshots. btw, what are you guys using to run that code? (im a noob)
i ran the commands in terminal emulator but after reboot, everything remained the same?
billdangerous said:
Ok after some investigations it is a known bug from 20130121 cyanogen nighties.
To get back internal sdcard :
Code:
su
echo mkdir /storage/sdcard0 > /data/local/userinit.sh
chmod 700 /data/local/userinit.sh
reboot
You can find more information here : http://forum.cyanogenmod.org/topic/63994-cm101-internal-sd-card-dont-mount/
Problem should be solved in future cyanogen nighties release https://github.com/cyanogenmod/android_system_core/commit/7cc503720f1a8a6aa9481c5f9fd4552bc463a501
Thanks for help
Bill
Click to expand...
Click to collapse
I have the same problem and would like to get my phone back up and running.
How did you solve it?
I mean, where do I have to write those commands?
I'm a noobie, so please be so kind to explain
Peter.
kreatiir said:
I have the same problem and would like to get my phone back up and running.
How did you solve it?
I mean, where do I have to write those commands?
I'm a noobie, so please be so kind to explain
Peter.
Click to expand...
Click to collapse
If you have adb on your computer (and an usb cable to connect your phone to the computer), type these commands on a terminal window :
Code:
adb root
adb shell
then (as stated in pervious post) :
Code:
su
echo mkdir /storage/sdcard0 > /data/local/userinit.sh
chmod 700 /data/local/userinit.sh
reboot
If you do not have adb on your computer, you may download a terminal emulatror application on your android, then type the 2nd block of commands given above.
May the Force be with you !
Erm, if you have the problem with CM10.2 20130821, this solution is sadly not working...
SD card not mounting
I have got a symphony w125 from Bangladesh. It was running afterwards. After 2/3 months I rooted it from androidkothon.com . But after some days I got a notification... "Preparing phone memory
Checking for errors"
I neglected it and thought it'll be fine soon. But it won't. When I opened ES file manager, it showed me SD card unmounted. (Both for internal & external) .I tried my 16 GB m SD card inserting again. but it again showed the same notification . Then I did once "factory reset' and once "clear eMMC". Then also the same thing happened. While running suddenly shows system ui not responding automatically turns off. Then it doesn't start until I open the battery and insert it again. How to get my storage back now...?
sir i have a spreadtrum phone its board is sp6820gb_7620 and cpu id is 8810 cpu frequency is 1ghz and ram is 512mb with mali 300 gpu,
android version is 2.3.6 and kernal version is 2.6.35.7 [email protected] #7, software version is mocordroid2.3.6.w12.20_p20.01_20130715.130506, hardware version is 1.1.0. my problem is that my phone has only 128 mb of internal memory and when i tried to edit vold.fstab to swap its memory with memory card it stopped detecting sd card when turned on but when in recovery mode sd is shown present, i think its very similar to karbonn a1+ in hardware and software part so can you please help me with my phone?
[
Help me bro's please.
I swapped internal memory to sd card using vold.fstab file replacing.And now my int storage n sd card arent mounting ????
using karbonn smart a26 mobile
Internal and external sdcard unmounted
yj121 said:
i ran the commands in terminal emulator but after reboot, everything remained the same?
Click to expand...
Click to collapse
Accidently i formated my internal sd card and external sd card , now i am unable to mount it...
Plz help :angel:
---------- Post added at 05:23 PM ---------- Previous post was at 05:16 PM ----------
shailoo said:
Accidently i formated my internal sd card and external sd card , now i am unable to mount it...
Plz help :angel:
Click to expand...
Click to collapse
I ran all codes and my device is tablet micromax funbook P560....
Plz help
Code:
su
echo mkdir /storage/sdcard0 > /data/local/userinit.sh
chmod 700 /data/local/userinit.sh
reboot
Hi, i have this same problem with S3 mini, i can use this same command for my device or i will brick it?
I need mount internal storage, i have 0.00 bytes :/
Thanks!!
Hi
i am new to this and trying to fix my note 1 gt n7000
it was working fine till yesterday and suddenlly the internal memory the sdcard0 stopped
it does not mount and also when i turn the mobile on a pop up comes saying cannot download as not storage available.
there are some important photos in that which i would like to recover.
please help i tried the code mentioned below in terminal emulater but when i type
it says
not found and also for the latter commands it says permission denied.
i have rooted my device.
please help.
Code:
su
echo mkdir /storage/sdcard0 > /data/local/userinit.sh
chmod 700 /data/local/userinit.sh
reboot
If you do not have adb on your computer, you may download a terminal emulatror application on your android, then type the 2nd block of commands given above.
May the Force be with you ![/QUOTE]
same problem
yj121 said:
my phone shows up on my computer but only my external sd card shows up, not my internal! help me fix it! ive attached some screenshots. btw, what are you guys using to run that code? (im a noob)
Click to expand...
Click to collapse
I have the same problem. Please help me solve it
its not working for me
billdangerous said:
Hi,
Since my last upgrade of cynaogenmod nighties yesterday on my galaxy s2, my internal AND external sdcard are not mouting anymore
I tried to understand why and I found that my /storage folder was empty. I think it should have been populated by /init.smdk4210.rc script :
Code:
...
on early-init
export EXTERNAL_STORAGE /storage/sdcard0
export SECONDARY_STORAGE /storage/sdcard1
mkdir /storage 0775 system system
mkdir /storage/sdcard0 0775 system system
mkdir /storage/sdcard1 0775 system system
mkdir /storage/usbdisk0 0775 system system
...
I tried to mount /storage/sdcard0, but without success (in fact I am not sure to have the right method).
Extract of /system/etc/vold.fstab
Code:
...
# internal sdcard
dev_mount sdcard0 /storage/sdcard0 11 /devices/platform/dw_mmc/mmc_host/mmc0/mmc0 nonremovable,encryptable
...
I thought that
Code:
mount /devices/platform/dw_mmc/mmc_host/mmc0/mmc0 /storage/sdcard0
would have been sufficient, but unfortunately not (I tried with /sys/devices/platform/dw_mmc/mmc_host/mmc0/mmc0 to).
I would like to retrieve my internal sdcard content.
Thank you in advance,
Bill
Click to expand...
Click to collapse
i have tried to correct this bug on my ROM tried it hard .
its the only bug i have
so
billdangerous said:
Hi,
Since my last upgrade of cynaogenmod nighties yesterday on my galaxy s2, my internal AND external sdcard are not mouting anymore
I tried to understand why and I found that my /storage folder was empty. I think it should have been populated by /init.smdk4210.rc script :
Code:
...
on early-init
export EXTERNAL_STORAGE /storage/sdcard0
export SECONDARY_STORAGE /storage/sdcard1
mkdir /storage 0775 system system
mkdir /storage/sdcard0 0775 system system
mkdir /storage/sdcard1 0775 system system
mkdir /storage/usbdisk0 0775 system system
...
I tried to mount /storage/sdcard0, but without success (in fact I am not sure to have the right method).
Extract of /system/etc/vold.fstab
Code:
...
# internal sdcard
dev_mount sdcard0 /storage/sdcard0 11 /devices/platform/dw_mmc/mmc_host/mmc0/mmc0 nonremovable,encryptable
...
I thought that
Code:
mount /devices/platform/dw_mmc/mmc_host/mmc0/mmc0 /storage/sdcard0
would have been sufficient, but unfortunately not (I tried with /sys/devices/platform/dw_mmc/mmc_host/mmc0/mmc0 to).
I would like to retrieve my internal sdcard content.
Thank you in advance,
Bill
Click to expand...
Click to collapse
i know the problem has been solved but...
i had the same issue. what i did was run the command:
su
echo mkdir /storage/sdcard0 > /data/local/userinit.sh
chmod 700 /data/local/userinit.sh
reboot
but it only takes effect after a reflash of the rom. after reboot for me, it never fixed and would never mount, but after a clean flash of the rom i was using, it seemed to mount fine. so you must reflash, as reboot does not do anything.
Cannot mount internal sd card
I just flashed my honor 4x with flyme Custom ROM
but now my phone doesn't mount my internal sd card
I tried running these commands on shell using ADB, but it doesn't fix the issue
Pleasr help me out here
Thanks
My phone is a BluLifeOne 2015. One day it stopped booting past the logo so I tried to reflash stock with QFIL to no avail. I no longer can access recovery or OS but I can boot into fastboot and boot into TWRP with the command fastboot boot recovery.img. When I try and format the system it says 0mb and can't mount data, cache or system (argument invalid). The internal storage, data, cache and system are all showing as 0mb and I've tried to change file system on all of them but it does not change the size or give me access to the internal storage. I also tried to flash a zip file but same invalid arguments everytime. Can someone help.

[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

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?

Creating Symlink to ext SDCard, so internal has enough space left

Hello Everyone,
I want to create a folder symlink from my internal to my external sdcard, because my whatsapp folder takes too much space on my internal sdcard.
However when i put the ln command into the adb shell, i get an error, even though i am on the root user:
Code:
land:/ # ln -s /storage/self/primary/WhatsApp/ /storage/BECE-1BF7/WhatsApp/
ln: cannot create symbolic link from '/storage/self/primary/WhatsApp/' to '/storage/BECE-1BF7/WhatsApp//WhatsApp': Operation not permitted
Why can't i create the symlink?
Apps like FolderMount do also not work, because they rely on SuperSU and i am using the LineageOS root binary.
I am running LineageOS 14.1
Best regards
Typhoon

Categories

Resources