Android 11 has made several changes to sd cards relating to sdcardfs and some other things. I would like to know how to unmount and mount the sd card via a terminal command or shell script.​
umount /dev/block/vold/public:179,1
does not seem to work.
There is an sm command listed in this older thread (https://forum.xda-developers.com/t/...-sd-card-from-command-line-or-script.3386830/) :
sm unmount public:179
however following the guidenance three it does not work either.
Doing a mount command shows the sd card is mounted and remounted 7 or 8. What is the proper way to unount and remount an sdcard in Android 11 from the shell?
MOD ACTION:
Thread closed at the request of the OP since he has solved the issue and stated " the sm unmount command actually does work"
Related
Hello,
I'am looking for a solution to get the FAT32 partition access as an USB mass storage only by manipulating my PC (of course, after pluging my G1 on USB).
I don't want to use the notification system on my G1.
Through an adb command for example...
A perfect solution would be : an icon to mount, and another icon to unmount.
Any idea ?
I'm not so sure about this one. I'd imagine it would involve a script that begins running adb and mounting your Android's SD card through adb. THEN you'd have to have another icon that recognizes the currently mounted drive and unmount it. I could see how you can associate your SD card to only show up as a certain drive (I have mine set to always come up as the "B:" drive), but there's so much communication involved between your phone and PC it leads me to believe the rest of the process to be an impossiblity. You're sure asking your PC to do a LOT. Considering what you want this "program" to do, it's hardly worth the effort to even attempt writing it.
Simply put, it's like trying to train your dog to unlock and open your house for you when you come home instead of simply using your house key.
PartEdMagic is your key to a FAT32 formatted microSD card
The easiest way to FAT32 your SD card is to boot up your PC with the "gparted Magic" ISO/CD (can do in vmware even), mount your SD card (via phone may work, I used a micro-SD USB card reader) - delete your partition on the SD card and recreate as FAT32, then format it. All can be done in PartEd Magic.
Hope that helps
[email protected]
mattrophy:
... i don't think he wanted to format it
Christopher3712:
Asking his PC to do alot? This is in no way a hard task, it requires 2 calls to adb, thats all...
koxx:
To mount it from your pc run: "adb wait-for-device shell sdutil ums enable", and to unmount "adb shell sdutil ums disable".
So, if you want 2 icons doing that, just make a shortcut that executes the commands above (either with the full path to ADB, or with adb's directory in your PATH var).
Joushou said:
mattrophy:
... i don't think he wanted to format it
Christopher3712:
Asking his PC to do alot? This is in no way a hard task, it requires 2 calls to adb, thats all...
koxx:
To mount it from your pc run: "adb wait-for-device shell sdutil ums enable", and to unmount "adb shell sdutil ums disable".
So, if you want 2 icons doing that, just make a shortcut that executes the commands above (either with the full path to ADB, or with adb's directory in your PATH var).
Click to expand...
Click to collapse
Exactly, I don't want to format my card ... it's already done
Your command works fine ! Thank you very much !
To finish, do I need a windows command to synchronize data before unmount UMS ? (equiv of "windows unmount" operation)
My Phone:
Rooted Inspire 4g running Stock ROM -> Rooted using Easy Ace Root Tool
Running TWRP recovery and a stock ROM(unable to flash new ROM due to SD)
My Problem:
My phone(either fully booted, or in TWRP recovery) is not reading my MicroSD card.
TWRP gives the error E: failed to mount /sdcard
and when in the settings of the phone, it says to insert a SD card.
Logs:
This includes
-adb shell blkid
-adb shell ls /dev/block
-adb pull /tmp/recovery.log
Located at pastebin.org at /BTPcfc0w
What I've Done to try and fix it:
Okay so after quite a bit of searching I've found these solutions given most by people
Cleared and Factory reset everything under the sun on this phone.
Format the SD using a PC into the FAT32 filetype
Code:
On this, I used my MicroSD Adapter and plugged it in to a computer.
Since the phone isn't recognizing the SD card it is NOT giving me the option to mount USB
To reboot into fast boot, and run the following commads
Code:
fastboot oem enableqxdm 0
fastboot reboot
I haven't been able to find anything further, and nothing yet seems to of worked so;
Question:
Does anyone have any advice on what I might be able to do?
Have you tried the SD card in the computer without the phone. You may need a external Sd card reader or a laptop of some sort with a card reader. If neither of those work then you need a new SD Card
Hey all, i stuck with a problem:
I am trying to write a sd card image from my internal memory to an external sdcard with my galaxy tab 2 with terminal emulator. I am running cyanogenmod 10.2
I got all the commands ready but it wont write to the external card because it only has a read permission, but whatever i try, i cant mount it as read/write.
so my question: how can i remount my external sdcard with write permission in the terminal emulator?
thanx in advance?
p.s. location of my external sd card is /storage/sdcard1
try:
/extSdCard
or
/external_sd
instead of /storage/sdcard1
Android-Andi said:
try:
/extSdCard
or
/external_sd
instead of /storage/sdcard1
Click to expand...
Click to collapse
thanks for your reaction, but it still doesn't work. I still get the message" /extSdCard is opened for read only"
set root for apps & adb in developeroptions?
run as "su" ?
remounted as rw?
Android-Andi said:
set root for apps & adb in developeroptions?
run as "su" ?
remounted as rw?
Click to expand...
Click to collapse
Yest i have done both.
and if i remount as RW it gives the following error:
ro,dirsync,nosuid,nodev,noexec,noatime,nodiratime,uid=1000,gid=1023,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
My device is a BLU Studio 5.0S (GSM Arena link in my sig for the exact phone, model D570a
My ROM is a modified variant of the stock from BLU, that I made myself
The SD card in question is a 8GB SDHC Class 4 card.
When I physically take the card out of the phone, put it in an SD adapter, and put it in my laptop (running Ubuntu 13.10 64bit), it is just fine, and I can read, write, execute, etc. with no problems whatsoever.
When I hook the phone up to the computer via USB, I can get into the phone's memory (1.4GB) just fine, but when I try to mount the 8GB SD card, I just get this message:
Code:
Error mounting /dev/sr1 at /media/k2trf/8GB C4: Command-line `mount -t "vfat" -o "uhelper=udisks2,nodev,nosuid,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush" "/dev/sr1" "/media/k2trf/8GB C4"' exited with non-zero exit status 32: mount: block device /dev/sr1 is write-protected, mounting read-only
mount: /dev/sr1: can't read superblock
The only difference betwen the arguments on the internal storage and the SD is the GID -- for the internal storage it is 1023 (which doesn't coorespond to anything), but for the 8GB SD card it is 1015 (which is sdcard_rw).
Mounting it shows GID 1000 (which would be the group id for my account, 'k2trf' on the computer.
That's the only difference between the two I can see on the device. Since there are both entries for /dev/sr0 and /dev/sr1 in my /dev/, I can safely assume that sr0 is the internal memory (which is working perfectly), and sr1 is the SD card (which seems to have a bad superblock?).
This confuses me, because physically putting the SD card in the laptop, it's completely fine, and there's no super block issues that I've been able to find, so I have to assume that it's the superblock controlling the sdcard in the phone that's bad (/dev/block/void/179:33) -- is there a way I can go about rewriting the superblock somehow for just that partition?
I've already tried doing it like I would on the laptop for other flash memory (using mke2fs and e2fsck), but I guess busybox doesn't include those commands (which would make a bit of sense, I can't imagine those are simple or small functions).
My mobile device have
OS Android 6.0.1 Marshellow Processor Qualcomm Family cortex a53 Machine arrch 64 Architecture arm cortex a53 External memory card 64GB ROM 16 GB MOBILE NOT ROOTED
Click to expand...
Click to collapse
It have option to formatting external card as internal but when I install user apps and move not all apps move to the internal formatted external as card some installs still on internal card. And occupies internal memory.
I tried to partition Micro SD card from PC mini partition wizard and created two three partition
first one of 20GB Fat32 Second one 20GB ext2 Third one 20 GB ext2.
When I connected it to mobile it doesn't show any partition and asked.for.formatting in portable or internal when I said to format as internal it formatted and deleted all partitions.
After searching googling founded some posts and answers in many forums and found the commands for and shell or terminal all emulator
adb shell sm list-disks adoptable
sm partition disk:179:160 mixed 25
adb shell sm format private:179,3
adb shell sm mount private:179,3
adb shell pm set-install-location 2
adb shell pm get-install-location
But will these commands for partitioning 2 portions and I want 3 dedicated partitions
First fat32 one mountable viewable for photos videos of fat32 partion readable in Windows to
Second ext2 one as apps moving ext2 partition for fast apps functioning formatting it as adoptable internal storage
Third ext2 For backup of stock from or custom ROM a can't support more than 4gb file size
I tried these commands from Windows adb shell but 'SM' file not found error come
Now my queries are :-
Do SM & PM: command solve my problem to dedicated partitions for proper functioning. Of adoptable storage. In my case of Android 6.0.1
Does the SM & PM commands needs to be turned in terminal emulator or Windows DOS and shell
Does SM & PM command compatible in Android 6.01 do it function in it or not
Does SM & PM command need rooting the mobile first
Does super user command SU should be running before SM & PM command but sinus not functioning to do SU function without rooting.
Where to get binAry files SM & PM & SU commands and how can we infuse or download in mobile system folder or can work without infusing in mobile by running bootloader recovery tarp image can we run it .... command help please
How to mount and view browwse ext2 external partions in Android as whenever I format it in ext2 it's unreadable from file manager or any app which app or command we can view or mount the ext2 partitions from Android mobile
As I am novice and new to Android adb commands Linux commands to. So I need advice help to modify the command and precious advice. Kindly guide step by step?
Not all apps can get installed on external storage memory ( SD-card ). It depends on both the app itself allows this and the manufacturer doesn't deny this.
jwoegerbauer said:
Not all apps can get installed on external storage memory ( SD-card ). It depends on both the app itself allows this and the manufacturer doesn't deny this.
Click to expand...
Click to collapse
Can we edit app mainfest Android:install locTion from all editor
Starting with Android 6.0 the Install-To-SD feature isn't available anymore, means it's probably senseless to modify an app's AndroidManifest.xml like this
Code:
<!-- Note that needs to be inside the android config -->
<platform name="android">
<!-- Modify the android-manifest block and add the new property android:installLocation with value auto !-->
<preference name="android-manifest/@android:installLocation" value="auto" />
</platform>