USB mass storage for CM - Galaxy S 4 Mini Android Development

Hi,
because I have several binded mount points to my SD card and any of applications from Play store works properly.
I've desided to create small scripts, which unmount all mount points from SD card and enable USB mass storage mode.
Requirements:
Cyanogenmod installed or other CM based ROM - tested on CM10.2
BussyBox
Some tool which runs my scripts - I'm using Script Manager or you can run it by hands from terminal emulator/SSH/telnet/etc.
Installation:
Only unzip files from USB_scripts.zip and save it to /storrage/emulated/0/Scripts/
If you want to run it from hands by terminal/SSH/etc. you have to do this:
su
chmod 775 /storrage/emulated/0/Scripts/USB_mass_storage.sh
chmod 775 /storrage/emulated/0/Scripts/USB_mtp.sh
***********************************************************************************************************************
Turn on USB mass storage:
Start USB_mass_storage.sh
Note:
Now the SD card is unmounted and not visible on the phone! On the PC is visible as next drive.
***********************************************************************************************************************
Mounting SD card on the phone:
1. Go to: Setings>Storrage>Unmount SD card>OK
2. Wait a second.
3. Click to Mount SD card
Note:
Your mobile phone is still in USB mass stroage mode.
SD card is visible on the phone, but it is read only on your PC!
***********************************************************************************************************************
Switching back to MTP mode:
Run USB_mtp.sh
SD card is ready for read/write on the PC with MTP mode now. (It is in the same state as before you start USB_mass_storage.sh)
***********************************************************************************************************************
Question for developers:
Any idea how to remount SD card in USB_mtp.sh script "Android friendly"?
Download:
View attachment USB_scripts.zip
Screenshots:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

Hi,
I tried this script and with Smanager I got a permission denied error, even after enabling browse as root. I then tried Sh Script Runner and the script said it had completed successfully but the SD card was not visible in Finder on my Mac.
I'm using CM 11 M6 Snapshot. Would be great if I can get this to work since Android File Transfer is not working at all for me anymore. the only way to get the photos from my SD is to boot the phone into recovery and mount the SD card there... It's a bit of a pain!
Cheers,
Cameron

Related

[Q] Help!! Can't get 32 gb micro SD card to mount in my NC

I'm sure I'm an idiot and I'm sure I'm doing something wrong. Nevertheless, I can't get a 32 GB micro SD card to mount in my NC. I know this card works as I've been using it in my phone for 5-6 months with no issues. I decided I would transfer it to my NC and make better use of it.
I can't get the dang thing to mount in the NC. I copied all the files off it using my PC. I put it in the NC. I can't write to it in the NC. No biggie. I figured I would wipe it out altogether and format it. However when I put it in the NC and try to format it in the NC, I get a message that the format failed. When I put the card back in the PC, I see the 32 gb card as only having a 2 gb partition. I can format this in my PC and it sees the thing as 32 gb again. I still have the same issue when I put it in the NC. The card does not mount and asks me to format the card. When I do format it, I get a message that the format failed and once again I have a 2 gb partition on the card. What am I messing up here?
A. Nonymous said:
I'm sure I'm an idiot and I'm sure I'm doing something wrong. Nevertheless, I can't get a 32 GB micro SD card to mount in my NC. I know this card works as I've been using it in my phone for 5-6 months with no issues. I decided I would transfer it to my NC and make better use of it.
I can't get the dang thing to mount in the NC. I copied all the files off it using my PC. I put it in the NC. I can't write to it in the NC. No biggie. I figured I would wipe it out altogether and format it. However when I put it in the NC and try to format it in the NC, I get a message that the format failed. When I put the card back in the PC, I see the 32 gb card as only having a 2 gb partition. I can format this in my PC and it sees the thing as 32 gb again. I still have the same issue when I put it in the NC. The card does not mount and asks me to format the card. When I do format it, I get a message that the format failed and once again I have a 2 gb partition on the card. What am I messing up here?
Click to expand...
Click to collapse
Is this an SDXC? I think that the nook color can only read HC and normal micro sd cards.
I honestly have no clue. It's a 32 gb card I purchased from VZW to use with my phone. I think it's this guy here. It works just fine in my phone.
It says Micro SD HC on it. Pic of the actual card is right here.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}

SD card wont mount

I formatted my SD-card with FAT32 and it still is not mounting under CWM. I found out when I was trying to back up my rom. I tried to back it up to my external sd card however CWM couldnt mount it and created my image file on the internal sd.
I tried fixing permissions under CWM and that didnt help either. Any suggestions?
Is sd card working when phone is running?
You used your phone to format sd card or some pc card reader?
I was having some troubles with my sd card - wasn't able to flash new ROM from it (CWM cant flash ROM from internal memory). In my case formatting SD card (with g. note utility settings->memory->card->format etc) worked great.
But I know that some SD cards are not supported by phone kernel (but working fine when system is up) so maybe you need to try another card....
SD card is working fine when I boot in to the phone.
I used PC to format the card. For some reason "Format SD Card" under settings is greyed out. See the screen shot.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I am having this issue on my wife's phone too. Phone functions, she is getting a lot of FC's and CWM wont mount.
Sent from my White Nexus S using XDA Premium App
Update: I unmounted the SD card and formatted on the phone. SD card now mounts under CWM.
SD card needs to be formatted in the phone otherwise CWM will not mount it!
sti-06 said:
Update: I unmounted the SD card and formatted on the phone. SD card now mounts under CWM.
SD card needs to be formatted in the phone otherwise CWM will not mount it!
Click to expand...
Click to collapse
Exactly!

Storage view in settings is totally broken, moving apps to SD does basically nothing.

I was starting to get seriously annoyed with that ungodly notification that pops up telling you to move stuff even though you already moved everything and there is nothing else to move, so I went into the storage options to check out the situation. I noticed several things wrong with it.
1. Phone says I have 2,66Gb free, but if I connect the phone to my PC and check out the properties on internal storage it says I have 1,34Gb free
2. It says I have 32Mb in Download but I have literally no files under download, and if I click on download it shows an empty list
3. Moving apps to SD does pretty much nothing. Moved all of my moveable apps to SD and the memory page under settings shows the following data
Device Memory:
2,86Gb FREE
6,03GB APPS
SD Card:
7,36Gb FREE
Moved all apps back into device memory and this is the situation:
Device Memory:
2,29Gb FREE
5,82Gb APPS (WHAT???)
SD Card:
7,97Gb FREE
4. Wrong informations on app storage data. For example, 3DMark has the following data:
220Mb Total
43Mb App on Device
176Mb data on SD card
I searched on the SD card to see where these 176Mb of data were and they are nowhere to be found. On the other hand there's a folder under /storage/emulated/0/android/data which contains a folder related to 3DMark that takes up exactly 176Mb of data.
5. Nothing gets moved to SD card when you move apps to SD card.
Before moving 3D Mark I noted the free and used space by phone and PC.
PC: 1,34 Free on device and 7,92 free on SD Card
Phone: 2,66 free on device and 7, 98 free on SD Card
App size: 5,82
After moving
PC: 1,34 Free on device and 7,92 free on SD Card
Phone: 2,69 free on device and 7, 95 free on SD Card
App size: 5,83
What's going on with this dumb phone? This is on .28 Lollipop.
Man i posted something similar about this phone too. You may not get a response on this board. Seems like if the app itself does not support move to sd then it really only gets moved into some virtual sd card i believe. I received similar results in storage size after moving apps back and forth. That message is killing me also. The things I'll do for XCOM...
Wish i had more insight into this for ya.
Sent from my D5803 using Tapatalk
The most annoying part is this image and the 2gb of cache i can't identify/clear/get rid of.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Sent from my D5803 using Tapatalk

Format SD cards as internal, HUGE Problem HELP

I formated my SD Card 64 GB Samsung Evo, as internal using Files by Google - Storage Option - Format SD as Internal and moved media to sd card.
Result - Internal Storage Missing. SD card is set as default Internal Storage. Used Diskinfo app to check the partition. The Partition "Data" is not visible, where as SD Card (Internal) is only shown. How to fix this???
Also FYI , in setting it is shown Storage as 128 GB but with interal storage as fully occupied. And when I expand it . Only shows 64GB space.
Issues facing 28 gb of internal space missing
Cant update the MIUI, Cant download system files to update
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
One_life said:
I formated my SD Card 64 GB Samsung Evo, as internal using Files by Google - Storage Option - Format SD as Internal and moved media to sd card.
Result - Internal Storage Missing. SD card is set as default Internal Storage. Used Diskinfo app to check the partition. The Partition "Data" is not visible, where as SD Card (Internal) is only shown. How to fix this???
Also FYI , in setting it is shown Storage as 128 GB but with interal storage as fully occupied. And when I expand it . Only shows 64GB space.
Issues facing 28 gb of internal space missing
Cant update the MIUI, Cant download system files to update
View attachment 5598943
Click to expand...
Click to collapse
Hello! I face the exAct same problem. Did you find any solution?

Question Unable to encrypt the SD card?

Hi, I'd like to encrypt the SD card, but (as shown in the following screenshot) the only option available is for encrypt the internal memory only.
In facts, if I unplug the SD card and I attach it to computer, I can access/see all the files.
On my Sony Xperia instead, I have the option for encrypt also the SD card (see the second screenshot), and in facts, If i insert the SD card to computer, all the files on such SD card are unaccessible ( I mean that I cannot see images and read text) . Am I miss something?
Encrypt option on Redmi Note 10 Pro:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Encrypt options on Sony Xperia:
Mister_Dave said:
Hi, I'd like to encrypt the SD card, but (as shown in the following screenshot) the only option available is for encrypt the internal memory only.
In facts, if I unplug the SD card and I attach it to computer, I can access/see all the files.
On my Sony Xperia instead, I have the option for encrypt also the SD card (see the second screenshot), and in facts, If i insert the SD card to computer, all the files on such SD card are unaccessible ( I mean that I cannot see images and read text) . Am I miss something?
Encrypt option on Redmi Note 10 Pro:
View attachment 5710939
Encrypt options on Sony Xperia:
View attachment 5710941
Click to expand...
Click to collapse
Afaik you can't encrypt SD Card on Xiaomi devices. In fact, this is the first time I encountered this option to encrypt SD Cards. You can, however, format your SD Card to be a part of your main storage (Option is called Format as Internal) which does what it says. And if you remove the SD card and plugged it in to other devices, they can't access the data, only the phone you used that "Format as Internal" can read it. I don't recommend it though as SD Cards have slower read/write and it can't keep up, like apps will load slower.

Categories

Resources