[Q] Mounting to Adoptable Storage - Sony Xperia L

So, I installed CM13 Alpha4 and Enabled Adoptable storage for my card. I downloaded Minion Rush to understand what data it stores on the actual sdcard (sdcard1) vs on the internal storage (sdcard0). The app instead of being on /data is on the external sdcard. All the data the game downloads goes to /sdcard/Android/data which is still about 200MB(Internal Storage). So, apps like WhatsApp, Instagram, etc will create their usual folders on the tiny 4GB Internal storage (sdcard0). On lollipop, I used Foldermount to keep all these folders on the actual sdcard and mount them to internal.
So, I tried the same with Adoptable Storage in the picture. (First I tried foldermount and set up the external card as portable but it failed).
Symlinking wouldn't work as they're different devices. (Or can it?)
The adoptable storage is mounted to /mnt/expand/blablabla/
Using this command to symlink
Code:
ln -s /mnt/expand/99d984f9-04df-445f-992d-abda2b2bcc6a/Mounted /sdcard/Mount
It returns "Function not Implemented".
Then I tried
Code:
mount -o bind /mnt/expand/99d984f9-04df-445f-992d-abda2b2bcc6a/Mounted /sdcard/Mount
and it sorta worked. When in adb shell, cd-ind to /sdcard/Mount, using ls displays all the contents of the folder "Mounted" in the adopted sdcard. However, using a file explorer on the device says the folder is empty. Tried Solid Explorer and ES. Moreover, the folder "Mounted" in adoptable has just one mp3 file and it isn't displayed in the Music app either, after mounting. Creating a file or folder in /sdcard/Mount using ES or Solid, fails. Can anyone help me figure this out, and is this even possible? (Tried foldermount here too. Toggle doesn't go green)
Another thought was to have a sdcard with two partitions. Tried that but when converting to adoptable, It formats to one partition. Is it possible to repartition without losing data after it's formatted as adoptable? It is somewhat possible to read write the card in Linux - Decrypting Android M adopted storage
This is just an idea to make better use of Adoptable storage.
Cheers!
AgentFabulous

Use following to have mixed storage from your external sd card both as adopted and portable storage. This can be done via android terminal app or through adb from your pc.
$ sm list-disks adoptable
disk:179_64
$ sm partition disk:179_64 mixed 75
$
gives me 75% as portable storage.
However I advise a reboot after setting

Related

[Q] SD Card mounting internal/external default directory

*I have searched for this and only come up with posts related to the Galaxy S I9000*
if this is not development please advise and move, thanks
I do like and prefer "sdcard' and "sdcard2" method of mounting the internal and external sdcards instead of the emmc and sdcard method.
However
Can the cards mounting be reversed external sdcard be "sdcard" and the internal one be "sdcard2"
and
in doing this making the default directory for storage on the tablet to sdcard be the external card.
in all my current and past roms i have ran so far all my default storage for CWM, apps and downloads have been on the internal card or 'sdcard' and not the external or "sdcard2"
I for one and may be the only one who would prefer my storage for CWM, apps and downloads etc. to be on the external card and leave the internal card for extra storage and backups copied to etc.
if a Con to this method is that the internal card would then be hard to access via pc because the internal sdcard would not mount via usb then I already have a method to access both internal and external cards via pc and usb with two apps from Market so this Con is already solved
any other Pros, Cons or opinions?
would this be able to be changed via update.zip like format in recovery or no?
I am no ways near being a Dev and respect and appreciate what the Devs here are doing, and the moderators for keeping the peace between novices and Devs.
Thanks to all and any input you have on the matter
possible half-solution
my solution (running VEGAN) has been to install Multi Mount SD-Card and instead of using the typical native android mount, you create a widget on a home screen that allows you to mount your drives. In the app's settings, specify which card you want to mount (to further the confusion, the external microSD aka SDCARD2 is actually "SD-Card One" in this particular app), choose if you want it to auto-mount (I chose not to auto-mount), plug the G Tab into the mini-USB cable, click the aforementioned widget and the drive appears on my Windows PC.
The option of mounting both memory banks is available within the app's settings via "SD-Cards One & Two", however when I selected that option, I got a message "You can't mount your SDCards at the same time". I don't know if it's specific to the GTab or VEGAN or whatever, but you can't mount both cards simultaneously through this app. However, if you want need to mount internal memory (known to this app as SD-Card Two), you can just use the native android mount and you're not affected by the app.
As far as installing the apps to the external drive, I don't have any help for you on that one, although I'd love to know if it's possible to be done.

How to use external sd as normal sd

Hello to all,
With my desire HD my sd is used for storage all my app and games data. The internal memory is for app and I have a lot of apps and I have a 32gb sd
With my Transformer 16gb with another 32gb sd I can't have the same storage capacity of my dhd since after the instalation of some games and the download of relative resources I have my internal sd full!!
So I have discovered gltosd but it works good for gameloft and data directories but for other games such as roc or dead space which download data on different directory I can't use my external sd as storage!
Also titanium backup can't backup on my external storage but only in internal and so... Is not a safe backup!
So my question is.... Is possible to make the internal sd as system memory and external sd as normal sd??
Of course I have root and custom ROM.
Thanks
Inviato dal mio Desire HD usando Tapatalk
mattiadj said:
Hello to all,
With my desire HD my sd is used for storage all my app and games data. The internal memory is for app and I have a lot of apps and I have a 32gb sd
With my Transformer 16gb with another 32gb sd I can't have the same storage capacity of my dhd since after the instalation of some games and the download of relative resources I have my internal sd full!!
So I have discovered gltosd but it works good for gameloft and data directories but for other games such as roc or dead space which download data on different directory I can't use my external sd as storage!
Also titanium backup can't backup on my external storage but only in internal and so... Is not a safe backup!
So my question is.... Is possible to make the internal sd as system memory and external sd as normal sd??
Of course I have root and custom ROM.
Thanks
Inviato dal mio Desire HD usando Tapatalk
Click to expand...
Click to collapse
You CAN set Titanium Backup to use the external MicroSD card, which is at "/Removable/MicroSD/TitaniumBackup/". I have 382 apps and games installed on my 32GB internal storage and still have 26.31GB available. I have no apps installed on the MicroSD card, only *.zip files for ROMS and kernels and such.
sidneyk said:
You CAN set Titanium Backup to use the external MicroSD card, which is at "/Removable/MicroSD/TitaniumBackup/". I have 382 apps and games installed on my 32GB internal storage and still have 26.31GB available. I have no apps installed on the MicroSD card, only *.zip files for ROMS and kernels and such.
Click to expand...
Click to collapse
Thanks but where you have the app resources? On internal or external sd?
Inviato dal mio Desire HD usando Tapatalk
The answer to your basic question (can I make the external micro-SD card the main SD card is): yes, if and only if you are rooted.
Before I explain how, let me explain how the "internal SD card" works on the Transformer. (If you just want to know what to do, you can skip this section).
How the "internal SD card" works on the EEE Pad Transformer
Normally on Android, /data and /sdcard point to two separate file systems, one internal, and the other external. However on devices with an internal "SD card" this changes.
The simplest way to have an internal "SD card" is to simply partition the storage into two file systems, one for /data, and the other for /sdcard. Several devices do just that. The downside is that if you put too much space in /data it is effectively wasted, while too little space in /data limits the number of apps that can be installed or how much data they can store "locally".
To solve that it is possible to store the "internal SD card" data in the same filesystem as /data. A new directory was created called /data/media, all the files in the "internal SD card" are actually just files in that folder. They both therefore have the same amount of free space and total space. [1] But Android insists that /sdcard must be a FAT32-compatible file system, while /data must not be. The solution is simple. Create a fake file system driver that pretends to be fat32, but simply reads from and writes to /data/media. That is what the transformer does.
The fake FAT32-compatible filesystem is actually mounted at /mnt/sdcard. Finally there is a symbolic link called /sdcard, which points to /mnt/sdcard. There is one logical reason for doing that, which is is to make it easy change /sdcard to point to an external card. Thanks ASUS for making our job simple.
How to use an external SD card as the primary SD card
Use [highlight]adb shell[/highlight] or the Terminal Emulator app from the market to open a shell.
If the prompt ends with a "#", skip to the next step. Otherwise type [highlight]su[/highlight] (followed by enter) to get a root shell.
Type [highlight]mount -o remount,rw /[/highlight] to ensure the root file system is mounted read/write.
Type [highlight]rm /sdcard[/highlight]
Type [highlight]ln -s /Removable/MicroSD /sdcard[/highlight]
reboot
That should do it. One last thing you may want to do is to to move the files from the "internal SD card" to the external one, or delete the files stored there to free up space. To do this you can use the built-in File Explorer. From the menu in the top right, uncheck the "hide system files" option. Now you can find the "internal SD card" at /mnt/sdcard. Delete the files or copy them to /sdcard as you see fit.
Footnote:
[1] Oddly this means that unless you do what I've outlined in this post, using the built-in apps2sd functionality simply wastes space.
Not OP, but appreciate the great explanation.
Sent from my Transformer TF101 using xda premium
jsmith45 said:
The answer to your basic question (can I make the external micro-SD card the main SD card is): yes, if and only if you are rooted.
Before I explain how, let me explain how the "internal SD card" works on the Transformer. (If you just want to know what to do, you can skip this section).
How the "internal SD card" works on the EEE Pad Transformer
Normally on Android, /data and /sdcard point to two separate file systems, one internal, and the other external. However on devices with an internal "SD card" this changes.
The simplest way to have an internal "SD card" is to simply partition the storage into two file systems, one for /data, and the other for /sdcard. Several devices do just that. The downside is that if you put too much space in /data it is effectively wasted, while too little space in /data limits the number of apps that can be installed or how much data they can store "locally".
To solve that it is possible to store the "internal SD card" data in the same filesystem as /data. A new directory was created called /data/media, all the files in the "internal SD card" are actually just files in that folder. They both therefore have the same amount of free space and total space. [1] But Android insists that /sdcard must be a FAT32-compatible file system, while /data must not be. The solution is simple. Create a fake file system driver that pretends to be fat32, but simply reads from and writes to /data/media. That is what the transformer does.
The fake FAT32-compatible filesystem is actually mounted at /mnt/sdcard. Finally there is a symbolic link called /sdcard, which points to /mnt/sdcard. There is one logical reason for doing that, which is is to make it easy change /sdcard to point to an external card. Thanks ASUS for making our job simple.
How to use an external SD card as the primary SD card
Use [highlight]adb shell[/highlight] or the Terminal Emulator app from the market to open a shell.
If the prompt ends with a "#", skip to the next step. Otherwise type [highlight]su[/highlight] (followed by enter) to get a root shell.
Type [highlight]mount -o remount,rw /[/highlight] to ensure the root file system is mounted read/write.
Type [highlight]rm /sdcard[/highlight]
Type [highlight]ln -s /Removable/MicroSD /sdcard[/highlight]
reboot
That should do it. One last thing you may want to do is to to move the files from the "internal SD card" to the external one, or delete the files stored there to free up space. To do this you can use the built-in File Explorer. From the menu in the top right, uncheck the "hide system files" option. Now you can find the "internal SD card" at /mnt/sdcard. Delete the files or copy them to /sdcard as you see fit.
Footnote:
[1] Oddly this means that unless you do what I've outlined in this post, using the built-in apps2sd functionality simply wastes space.
Click to expand...
Click to collapse
Woow!!!!
So if I wipe all and start from the beginning and before install any app I'll made this operation I will have ~16gb internal memory???
It's possible to make a zip to flash after the rom??
Inviato dal mio Desire HD usando Tapatalk
jsmith45 said:
The answer to your basic question (can I make the external micro-SD card the main SD card is): yes, if and only if you are rooted.
Before I explain how, let me explain how the "internal SD card" works on the Transformer. (If you just want to know what to do, you can skip this section).
How the "internal SD card" works on the EEE Pad Transformer
Normally on Android, /data and /sdcard point to two separate file systems, one internal, and the other external. However on devices with an internal "SD card" this changes.
The simplest way to have an internal "SD card" is to simply partition the storage into two file systems, one for /data, and the other for /sdcard. Several devices do just that. The downside is that if you put too much space in /data it is effectively wasted, while too little space in /data limits the number of apps that can be installed or how much data they can store "locally".
To solve that it is possible to store the "internal SD card" data in the same filesystem as /data. A new directory was created called /data/media, all the files in the "internal SD card" are actually just files in that folder. They both therefore have the same amount of free space and total space. [1] But Android insists that /sdcard must be a FAT32-compatible file system, while /data must not be. The solution is simple. Create a fake file system driver that pretends to be fat32, but simply reads from and writes to /data/media. That is what the transformer does.
The fake FAT32-compatible filesystem is actually mounted at /mnt/sdcard. Finally there is a symbolic link called /sdcard, which points to /mnt/sdcard. There is one logical reason for doing that, which is is to make it easy change /sdcard to point to an external card. Thanks ASUS for making our job simple.
How to use an external SD card as the primary SD card
Use [highlight]adb shell[/highlight] or the Terminal Emulator app from the market to open a shell.
If the prompt ends with a "#", skip to the next step. Otherwise type [highlight]su[/highlight] (followed by enter) to get a root shell.
Type [highlight]mount -o remount,rw /[/highlight] to ensure the root file system is mounted read/write.
Type [highlight]rm /sdcard[/highlight]
Type [highlight]ln -s /Removable/MicroSD /sdcard[/highlight]
reboot
That should do it. One last thing you may want to do is to to move the files from the "internal SD card" to the external one, or delete the files stored there to free up space. To do this you can use the built-in File Explorer. From the menu in the top right, uncheck the "hide system files" option. Now you can find the "internal SD card" at /mnt/sdcard. Delete the files or copy them to /sdcard as you see fit.
Footnote:
[1] Oddly this means that unless you do what I've outlined in this post, using the built-in apps2sd functionality simply wastes space.
Click to expand...
Click to collapse
Thanks for details, very nice and easy to understand. I do have a couple follow-up questions though.
- First to set the stage: I have the 16GB version of the TF, and right now have a 16GB external microsd installed. Rooted with stock ROM at present.
- Are there any issues or reasons why someone should not do this? Would the only reason for doing this be low internal memory?
- Your final footnote about apps2sd. Wasn't completely clear on this. Are you saying, that if I want to use apps2sd, I should do what you outlined?
- Essentially just want to determine if it is best to do this or not. I have a NookColor that is rooted and have used it fine for a year now, and have placed most apps/data on the external microsd, so am familiar with having that way, but am unsure about the TF.
Thanks again (gave you a thanks!)
surfmly said:
- Are there any issues or reasons why someone should not do this? Would the only reason for doing this be low internal memory?
Click to expand...
Click to collapse
Another reason of doing it is avoid mixing sd content in the internal memory and making clearer that /sdcard is the external memory. But yes, the main reason would be wasting 16Gb for Android system... There shouldn't been any problems with this change if you follow the instructions. The TF and Android can handle it.
surfmly said:
- Your final footnote about apps2sd. Wasn't completely clear on this. Are you saying, that if I want to use apps2sd, I should do what you outlined?
Click to expand...
Click to collapse
If you use apps2sd, you link /data/app to /sdcard, but since /sdcard is part of the internal memory and its also linked to /data, you will be wasting more internal memory. If you do the changes sugested by jsmith45 and use apps2sd, since /sdcard will now be pointing to the real external sd card, you will be using the external card to store all your apps.
surfmly said:
- Essentially just want to determine if it is best to do this or not. I have a NookColor that is rooted and have used it fine for a year now, and have placed most apps/data on the external microsd, so am familiar with having that way, but am unsure about the TF.
Click to expand...
Click to collapse
If you use the TF with a little head and move the heavy games/apps to the sdcard, you shouldn't get out of space soon and won't need this kind of change.
AzureusPT said:
If you use the TF with a little head and move the heavy games/apps to the sdcard, you shouldn't get out of space soon and won't need this kind of change.
Click to expand...
Click to collapse
however, as was previously said, as the transformer has its "internal SD card" data in the same filesystem as /data, moving apps to sd is just shuffling them about in the same file tree, it doesnt actually move them to the real external sd card.
using this mod would achieve that- my only concern being that if that card fails then a lot of important data is lost.
i also wonder how well this mod would work using CWM??
bob dylan said:
however, as was previously said, as the transformer has its "internal SD card" data in the same filesystem as /data, moving apps to sd is just shuffling them about in the same file tree, it doesnt actually move them to the real external sd card.
Click to expand...
Click to collapse
lol, thats true. I typed without thought...
Still, you have around 10Gb of usable space in /data. The point on doing the trick of restoring /sdcard to external should be if you have enough apps to get to that size. Note that many apps that download aditional data, many times they save it on the real sd card.
What I ment to say about using it with head was that its wise to use the external card to save the big files (that could be movies, music, etc), and handle the internal with apps.
BTW... just came to me now... with simple apps it is possible to get to 10Gb? I'm not talking about Let's Golf instalation (+1Gb), just the weight of the apk itself...
thanks guys
I have followed the tutorial but my sdcard folder links to internal memory and not to removable/microsd.
Infact all resource of apps are stored in Internal SD and not in External SD as i want.
I have tried with adb and terminal emulator...is the same. My rom is Revolver 3.11...help
Edit: the problem is after the reboot! if i don't reboot the symbolic link is present....I think i have to create and automatic script for every reboot
Now i have fixed the problem but i think the solution is not very perfect.
Ok sdcard folder links to removable/microsd but...mnt/sdcard is linked to internal sdcard!!! So apps installs it self on mnt/sdcard/data and games such as Race of champions download the resources on mnt/sdcard too.
I think the best way is to change the link to mnt/sdcard also to removable/microsd...
Any advice?
mattiadj said:
I have followed the tutorial but my sdcard folder links to internal memory and not to removable/microsd.
Infact all resource of apps are stored in Internal SD and not in External SD as i want.
I have tried with adb and terminal emulator...is the same. My rom is Revolver 3.11...help
Edit: the problem is after the reboot! if i don't reboot the symbolic link is present....I think i have to create and automatic script for every reboot
Now i have fixed the problem but i think the solution is not very perfect.
Ok sdcard folder links to removable/microsd but...mnt/sdcard is linked to internal sdcard!!! So apps installs it self on mnt/sdcard/data and games such as Race of champions download the resources on mnt/sdcard too.
I think the best way is to change the link to mnt/sdcard also to removable/microsd...
Any advice?
Click to expand...
Click to collapse
Now that I got around to trying this I am seeing the same problem. I have tried twice and it doesn't appear the link works. My External MicroSD is not being linked to when opening /sdcard in file explorer. Testing by taking a picture to see where new photo resides... it ends up in both /sdcard and /mnt/sdcard and not in /Removable/MicroSD....
So you need to do anything else like have a freshly formated MicroSD with proper folder structure (i.e. same folders currently in the /mnt/sdcard folder)?
Thanks.
---------- Post added at 03:27 PM ---------- Previous post was at 03:23 PM ----------
jsmith45 said:
How to use an external SD card as the primary SD card
Use [highlight]adb shell[/highlight] or the Terminal Emulator app from the market to open a shell.
If the prompt ends with a "#", skip to the next step. Otherwise type [highlight]su[/highlight] (followed by enter) to get a root shell.
Type [highlight]mount -o remount,rw /[/highlight] to ensure the root file system is mounted read/write.
Type [highlight]rm /sdcard[/highlight]
Type [highlight]ln -s /Removable/MicroSD /sdcard[/highlight]
reboot
Click to expand...
Click to collapse
jsmith - this doesn't appear to be working for me. The link doesn't point to /Remvoable/MicroSD per the terminal client commands I run per above, it is still /mnt/sdcard.
Anyone getting this to work properly on TF101 (I am running rooted .21 via Nachoroot/Vipermod). Thanks.
---------- Post added at 03:44 PM ---------- Previous post was at 03:27 PM ----------
By the way, I confirm that the symbolic link is working without reboot.
Also, for something like storing photos from the camera (and video recorder) I don't see option in camera or gallery to change save path. It shows the path for saved photos as /mnt/sdcard/......
So even without rebooting, with symbolic link working (i.e. opening /sdcard does open my external SD card), the camera is saving photos on the internal SD (at /mnt/sdcard).
I was thinking that we would be able to make the external SD card used for these types of things. Many apps should be installed on internal (runs better many times, etc) but extra stuff like music, photos, videos, etc should use the external card. Looks like this mod wouldn't necessarily change that.
Also, I noticed that on my HTC Inc2, the external card is at /mnt/sdcard (or /sdcard). So if any app is setup to use /mnt/sdcard, it will use the external SD card. However on the TF, even with the mod in this thread, the app would use /mnt/sdcard which is the internal SD. Only if an app uses /sdcard as the path would it use the external SD and I am not sure if most apps use /mnt/sdcard or just /sdcard.
Thoughts on best next steps to get the external card to be used more/better are welcome
People let see my thread on dev section.... Probably I have found the solution!
Inviato dal mio Desire HD usando Tapatalk
I would like to play with something like this too..
As i have wiped TB backup a few times by mistake when loading on new Rom..
As it backups to the internal not external.. thus I have to manually copy it back and forwards on each backup..
sent from yet another MikG HTC Evo

/sdcard storage

Sorry if this has been asked before but what is the deal with the /sdcard directory on the tab? I have no sdcard in but there is already a directory on the internal storage for it. Is this for programs that automatically store data on /sdcard (if you don't have a card in the tab)? Can this later be changed? For example ES File explorer opens to /sdcard by default, can that be changed as well?
Any further info on this would be great thanks!
ICS uses an internal /sdcard directory on primary storage, and yes, partly for compatibility. If you put a microSD card in, it will be (on a stock ROM) at /mnt/extsdcard (I believe), though some custom ROMs are now providing a simpler symlink.

How to record 4k with stock CM11s camera on external usb?

Of course it's not possible directly and I know it. But most weird thing, that I can't use mount -o bind to mount my DCIM folder to external usb. If I do this, when I enter my DCIM folder in file manager, I can see files from external usb storage. So to test, I started movie recording, then stopped, unmounted my external usb and then what? I noticed that my movie was saved in internal phone memory, not usb storage.
I also tried to manually unmount mounted usb storage (with umount command in terminal). Then I mounted in on my DCIM folder manually (using mount command). Result was similar - no movie saved on external usb, it was saved in internal phone memory instead.
What the hell? Do you have any ideas? Really, 4k dci movies are so huge so I want they to be saved on external usb.Unfortunately I can't use any other camera app because only stock CM 11s camera is able to record 4k. Also I can't simply do ln -s because internal memory and external usb are both vfat (actually I can format my external storage to ext4, but still internal memory is vfat).
So what to do?
Bump.... anybody?

[How-To] Split an SD Card adopting part of it as internal, part as external storage

Hi everybody.
Angry with few apps, like Plex in example, I was searching on how to solve the issue caused by an app that doesn't recognize an SD Card adopted as internal memory by Android 6.*
Well, I found THIS BLOG POST and I saw the light!
We need an SD card formatted as external storage and ADB access to our device.
I did what our friend in that post says:
Code:
$ adb shell sm list-disks adoptable
disk:179_64
disk:179_64 is our SD card that can be made adoptable, if we want 75% as external SD:
Code:
$ adb shell sm partition disk:179_64 mixed 75
And BUM!!! My phone has both adopted and external! Believe me, no more battles to try to transfer data of an app not yet compatible with this new Marsh Mallow feature.
Being a Mac user, I have the problem that Android File Transfer doesn't recognize the adopted part of the SD card ... but I don't care: at the moment, what I earn with this trick, is a lot more heavy than what I loose

Categories

Resources