Partitioning an SD card through ADB (Android Debugging Bridge) - android

I've been trying to do this for 3 days now but i can't seem to get this to work.
So the gist of it is, I have an LG G6 running Android 8.0, with a 128Gb micro-SD card, I'm running out of internal space, and apparently LG and Samsung remove the adoptable storage feature from their android versions, I found a turn around to this which was to use ADB to partition the SD drive myself, and getting it to behave as internal memory, at first I had an issue with ADB even noticing my device, which I fixed by enabling USB tethering.
Past that everything seems to be going well, do the partition and reboot my phone,(speaking of which SD card is only detected after a reboot if I physically eject it and put it back in) all looks fine as per the screenshots
https://imgur.com/a/G7OJjFJ
(I was told memory misrepresentation was normal) until I get to the migrate data option which ALWAYS crashes the settings app, on top of that when I plug my phone into my computer I can only see the default internal storage of my device without any added memory.
I've reached a dead end and would appreciate anything at this point, even alternatives if you'd recommend I do something else (rooting or other methods i don't know about). Below are the sources I followed for this process, thanks in advance and if I missed any info let me know.
https://www.xda-developers.com/install-adb-windows-macos-linux/
https://www.androidpit.com/how-to-format-microsd-cards-as-internal-storage?fbclid=IwAR1pgqf6Ti2rSf_hbiyqLl0HufPewlPCHYmfBcfEzq_XRMhKxevwwq_mk28
https://www.modaco.com/news/android/heres-how-to-configure-adoptable-storage-on-your-s7-s7-edge-r1632/
Commands i entered by order as requested:
adb shell
sm list-disks
sm partition disk:179,0 private
And yes 179,0 IS the disk name on my phone as far as i can tell

I think that after the sm partition disk there is one thing that you didnt do. That is, sm set-force-adoptable false
After this jsut restart your phone and its gonna work most prob.

Related

How to extract files from an unrooted android (GT-N7000) which is stuck in boot logo?

I have a Samsung Galaxy note (1) which is stuck in boot logo when I turn it on. I can access Android recovery mode, and have tried wiping cache data and do a normal boot, but it didn't work. I'm trying to avoid factory setting reset before getting hands on data inside and saving them. I've tried to backup through adb backup command but it didn't work. adb does not give me permission to access data on data folder. I've also tried to update firmware in download mode using kies but it does not have it for GT-N7000.
P.S.: I've got a new battery but still the same.
Do "adb pull /data" hoepfully that should work, if not, report it here :).

How to turn a portable SD card into internal storage via ADB command?

Android 6.0 Marshmallow’s introduces Adoptable Storage, a feature that allows use a SD Card as internal storage.
Is it possible to activate adoptable storage via ADB shell commands?
I managed succesfully perform this operation on my LG K8 LTE. I want to notice there are "500 xxx Unknown disk" errors problems, and give solution to avoid this. Solution is very simple.
Proper steps in ADB would be:
adb shell
sm list-disks
// HERE YOU GET YOUR DISK ID, SOMETHING LIKE "disk:179,64" - REMEMBER THOSE NUMBERS
sm set-force-adoptable true
// IN NEXT LINE, SIMPLY PUT THOSE NUMBERS AFTER "disk:" AND ALSO AFTER WORD "mixed" TYPE PERCENTAGE OF SPACE LEFT AS EXTERNAL, SO IN MY CASE:
sm partition disk:179,64 mixed 60
// IT TAKES TIME. BE PATIENT. WITH THIS LINE I TRANSFORMED WHOLE EXTERNAL SD INTO 40% OF INTERNAL AND 60% OF EXTERNAL
sm set-force-adoptable false
BANG! That's it! Now go to storage and usb, there click on internal part of SD and expand options, click on "use as internal" or something like that, last option, (I cannot see what was that because I already clicked it and everything works) apps are finally going on SD with OBB files! ;)
Have a good day!
I have done somewhat extensive research on this question online. I can tell you the steps, and they seem to work for everyone but me. Try them and let me know if they work for you.
Back Up your SD card, as it will be wiped.
If you don't already have it, download and install Java SE Development kit. The website is www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html. I used version 8u101 for Windows x64.
If you don't already have it, download Android SDK Manager. The website is developer.android.com/studio/index.html. Scroll almost to the bottom where it has "Get just the command line tools" and select android-sdk_r24.4.1-windows.zip for Windows. When it downloads, extract all to a location where you want to keep the folder.
Open the Android SDK folder and run the SDK Manager. (If it fails to run, see question 14504325 in stackoverflow). Follow the instructions on www.howtogeek.com/125769/how-to-install-and-use-abd-the-android-debug-bridge-utility/ to get it up-and-running.
When you have the command prompt open per the how-to-geek website instructions, enter "adb shell"
Then enter "sm list-disks". This will return the name of your microSD card. The instructions I was following showed a disk labeled 179:160, but my computer showed the disks as 179,32. This is where I'm stuck.
Finally, enter "sm partition disk:179:160 private", where the numbers are the name of your disk from step 6, if you want to adopt your whole SD card as internal storage. Otherwise, enter "sm partition disk:179:160 mixed 25" where the last number is the percent of the card's space used for external storage. I have not been able to get this to work.
See http://www.modaco.com/news/android/heres-how-to-configure-adoptable-storage-on-your-s7-s7-edge-r1632/ for the original instructions.
P.S. I tried this on a Samsung Galaxy On5, so that might explain why it hasn't worked.
This has now been disabled on (at least) some Samsung tablets.
I have a galaxy tablet that has been running with a huge sd card formatted as internal storage.
I purchased another more recently and on this adb format command did not work (it just immediately returned to the command prompt).
I have had to do a factory reset on the older machine and now find that it too will not allow the SD card to be formatted as internal memory - it behaves just as the newer one does.
My guess would be that Google have updated android to 'respect' the settings of the suppliers UI.
This has (of course) completely messed up my system, as the backup/restore was based on main memory of over 100GB, not the 16GB the device actually has.

Android Tablet is restarting by itself

I have a custom android tablet and we have created an application which is used for home automation.I have installed the application in it and it works fine. I got the comments from the client saying that the tablet restarts by itself at night. I tried to catch the log by connecting it to eclipse but it didnt happend here. Will the tablet restart by itself under any circumstances ? , The tablet is a samsung ARM with 512mb ram and 4gb sdcard in it which runs on android version 2.2.
You have not provided any code, which leads me to assume the following. Unless you have the permission of PowerManager, you app has no control over the device's off/on state.
You also mentioned, on testing, you were not able to pinpoint the issue that the client talked about. This is very important information, and it helps strengthen my conclusion. Again, if the above criterion is correct (you don't have powermanager) then, it could be the clients tablet is just messed up...
The reebooting is actually a common problem:
http://forums.androidcentral.com/samsung-galaxy-tab-pro-8-4/453390-why-my-tablet-randomly-rebooting-resetting.html
Here, user B. Diddy states:
It's hard to say. Random reboots can happen because of problems with
the firmware, but can also be due to some app you installed that is
making the system unstable, or perhaps some bad bit of data that is in
the system cache. A corrupt SD card can also cause problems. Here are
some things you can try:
Unmount your SD card in Settings>Storage, remove it, and reboot. Use the tablet for a while (like a few days) without the SD card and
see if the random reboots recur. If they don't, plug it back in again,
and see if the reboots start again.
Boot into Safe Mode, which temporarily disables all 3rd party apps: Safe mode: Samsung Galaxy Tab 4 | T-Mobile Support. (I couldn't find
steps specifically for the Tab Pro, so I'm assuming the steps for the
Tab 4 are the same.) This might not be an effective troubleshooting
method if the random reboots don't occur very often, because it's hard
to expect anyone to use their tablet for several days in Safe Mode,
thus being unable to access any of the 3rd party apps you installed.
Boot into Recovery Mode and wipe the cache partition, which doesn't erase any personal data. Follow the steps in this video, and make sure
you select Wipe Cache Partition, and not Wipe Data/Factory Reset.
So, let me know if your app uses the PowerManager permission. If it doesn't you're good to go, and it is probably a faulty tablet.
Ruchir

Android phone reboots on uninstall

I am developing an app and when I uninstall the phone kind of semi-reboots.
This is my old post:
I have a strange problem with my phone. I am using SAMSUNG GALAXY 5
(GT-I5500) with Android 2.2 on it (not rooted).
I am an android developer and I have been doing pretty advanced apps.
However, sometimes when I am testing and installing an application the
phone reboots.
I'm starting it trough Eclipse but I do not know what exactly what
causes the phone to reboot.
It is not heat for sure, as I keep my phone cool enough.
It is not from the app source itself as the phone doesn't reboot while I am using the application but on installing time
It is not storage I think, because I have 26 MB internal and 1GB external memory free and the app is no more than 2 MB.
So my question is what could cause the phone to reboot?
In this context I define "reboot" as the phone showing the initial SAMSUNG screen, like normal booting but without the prompt for PIN. This is why I conclude it is something like semi-reboot or I do not exactly know.
Having experienced the same problem, I found that deleting dalvik cache and formatting cache partition helped - I can't tell which one of those two did the trick, but I can now happily uninstall apps again, without the device spontaneously rebooting.
Both operations I was able to perform in recovery mode, using ClockWorkMod rescue system, and they are non-destructive. No actual data or apps are lost, only next reboot takes longer, due to dalvik cache being rebuilt.
Today, close to a month later, that problem showed again, so I was able to test which of those two action fixes it. Turns out it was erasing the cache. Dalvik cache was left alone, deletion was possible afterwars nevertheless.
I have this exact problem with my LG G4. Whenever I try to uninstall an app the phone will just reboot. Luckily there is a way to remove unwanted apps if your phone has an expandable memory option through micro SD. Just transfer the unwanted app on the SD card then remove the card. The app will no longer exist on your phone. You can then just delete the app from your SD card using a PC. This doesn't help resolve the actual OS issue on your device but at least it's a quick fix for anyone who's looking to free up some space. Hope it helps!
Spontaneous reboots under unclear conditions, one of the "fun" things you get for free with Android. Not on each and every device, OS version or combination thereof, but quite too often.
With the following instructions you will loose all your data on your phone.
Try this: Get into the recovery mode (adb reboot recovery or start the phone with pressing (and holding) volume down, then press and hold the center key, then power on), then wipe data/factory reset, wipe cache partition.
(I experienced similar reboots but not with an I5500, so I don't know if this will help in this situation. It helped with a Motorola Milestone/Droid after upgrading to Android 2.2.)
I was able to fix this problem by wiping the davilk-cache thanks to Deleted User's experience. However, wiping the cache partition was not necessary in my case. I'm rooted stock Android 4.4.2 KitKat on a Galaxy Tab 3 SM-T210R.

fake a sdcard device with a loopback device on android

Yesterday I decided to fix the internal front speakers of my "HTC Desire Z" (aka. G2). While I was able to fix them, I broke the connector for the microSD slot (the left one). After trying to fix it for several hours, I gave up. It isn't in the scope of my hardwareskills :-(
Well, since I have like 600mb left on /data and my device is rooted, I tried to find a software solution i.e. "emulate" a SDcard device (because many applications require one to work properly, e.g. the camera app). I found here http://www.android-x86.org/documents/sdcardhowto a description how to create a vfat image and mount it as loopback.
While this is exactly what I want, I don't get it to work:
I don't know how to modifiy /proc/cmdline, or
how the entry in /etc/vold.fstab should look like.
dev_mount sdcard /mnt/sdcard auto /data/sdcard.img
didn't work for me. according to logcat, I have this version: I/Vold ( 2368): Vold 2.1 (the revenge) firing up
btw, just mounting the loopback device to /mnt/sdcard didn't work too. For example, the camera app still claims there isn't a SD card inserted.
edit: I also asked this on xda -> http://forum.xda-developers.com/showthread.php?t=1393395
There's no way for an Android application (constrained within the application sandbox) to create a loopback device.
Anything outside of this is not a developer question, and should be posted to another forum (e.g. https://superuser.com/).
I don't agree. Hanitaro Tide and PlasmaSoundHD both have created loop devices on my phone, all by themselves. On an x86 device it's even easier to fake an sdcard.img.p

Categories

Resources