su command to stop Android from writing to USB stick? Android 9, rooted - General Questions and Answers

Hello. This is a general Android 9 question (I think) but the device is a NinkBox TV box running Pie, Rock 3318 chip, 4GB/64GB, rooted, SU and developer options enabled.
I use it for watching files off a stick mainly, but when I install apps to the system, Android writes temp files to the USB stick instead of using its own 56GB of internal storage. I want it to use internal storage for everything, even temp files and folders, and not the stick. That is my preference.
I do not want to make the stick read-only in Windows because *I* have to write to it to put new files on, etc... I just don't want Android using it.
Is there any su command (or any other method) that will tell Android to ALWAYS use USB storage as read-only (or conversely to ONLY use internal storage for all write actions)? I do not know Android commands so if this is possible I will kindly need the steps spelled out. Thanks for reading...

Related

[Q] Copying .apk Files Directly to microSDHC Card

Hello,
I'm a long-time Linux user (since 1997) who is just stating to get into this newfangled Android thing. I've ordered a Nook Color from eBay, and in anticipation of its arrival next week, have been downloading deeper-blue's Honeycomb images, dd-ing them to microSDHC cards, and poking around just to get a feel for how the filesystem is organized. Now, let's say I've got a Honeycomb v03 image on a microSDHC card that's plugged into my computer, and accessible as /dev/mmcblk0. I have some .apk files that I've downloaded, and would like to put them on the microSDHC card so they're ready to start using once my NC arrives. All of the instructions I've seen talk about installing stuff with adb, but is there any reason that I couldn't just mount /dev/mmcblk0p2 (the system partition) on an empty directory on my Linux box, copy the .apk files to the app directory, adjust the permissions with chmod (seems like some things need setuid/setgid), unmount, and be good to go? Ditto for NuroSlam's modified su command... can I just copy that to the xbin directory? Most of the instructions I've found use adb push, or even cat to manipulate files on the Android device, which seems weird to me... any reason I can't just use trusty old cp?
Thanks,
Nate
Most of what you wrote is over my head, but I have never used adb to install an apk from my SD card. Just put the file on the card, find it with any of the free file explorers from the market, then click on it. Android will show the permissions and ask if you want to install. Just remember to allow 3rd party apps in the settings.
Evo running UD 2.5
Thanks for the quick reply. I guess it's a bit unusual to be a Linux expert but an Android newbie. I just want to make sure that all of my Linux skills still apply to this variant of the operating system, especially since the Android guys seem to have a completely different way of going about things than I'm used to.
Nate

[Q] Best way to run binaries in emulator on SD Card

So the other day I decided it might be fun to work on porting git for Android. This was surprisingly easy, however, I can't really test it on my tablet because it is still under warranty and I don't think it is worth it. I would like to test it in a emulator, the emulator I am using (4.2.x) seems to have su privileges built in, however, I can't seem to execute from the sdcard. I have tried copying it in an app to the /data/data directory but it has device space issues (I think this is because the actual install partition is actually smaller that the SD card).
Is there a way I can remount (not sure if that is what I want) the drive to allow execute access?
I apologize in advance if this is a duplicate.

[GUIDE] Photo Recovery from Internal Memory

Hey guys, I've found a way to recover files from the INTERNAL Memory of the Samsung Galaxy S4.
A lot of people have said that it's not possible, but I'm here to prove them wrong.
You have to have rooted your phone before carrying out these steps. Don't post here asking for help rooting, there's plenty of other threads that can help you with that.
I hold zero liability in the event that you make a nice brick out of your phone. If you do not feel comfortable working with these commands, then please don't follow them.
You're going to need an SD Card that's at least the size of the internal memory on the phone. A smaller one would work, but keep in mind not all the files are going to be recovered.
If the SD Card is brand spanking new, you can skip step number 1.
Format the SDCard with a layer of 0's. This is done so that none of the old data will interfere with your recovery. This step is optional.
Root the Device
Install Terminal Emulator
Insert the SDCard
In Terminal Emulator run the command to gain super user privileges
Code:
su
Grant Terminal Emulator super user privileges
Run this command,
Code:
dd if=/dev/block/mmcblk0p29 of=/storage/extSdCard/raw.dd
Wait. Leave your phone plugged into an AC Adapter, and go grab a can of pop. This command will take a looong time. Couple hours to a day.
Once the command is finished running, shutdown your phone.
Remove the SDCard, and connect it to a computer
Download TestDisk
Open PhotoRec
Select the SDCard and press enter
Use the first option of "Unknown"
Then press "Other"
Select the Directory to backup the files to
Profit
'
How it works:
By dd'ing the internal memory to a file on the SDCard, you're doing a raw copy of the data.
Once the data is copied onto the SDCard, PhotoRec will scan the SDCard for deleted data, doing so will scan the raw file for photos. Not just photos, all files can be recovered using this method.
This method works on all rootable phones, provided you can figure out where the dev block for the internal memory is.
Hope you guys get your files recovered. I know I did
Or just install a file recovery app from play store on a rooted phone and follow app instructions...
Worked a charm for me. lol
jamieridler said:
Or just install a file recovery app from play store on a rooted phone and follow app instructions...
Worked a charm for me. lol
Click to expand...
Click to collapse
Any app you recommend in particular?
Bingley said:
Any app you recommend in particular?
Click to expand...
Click to collapse
Tbh I just downloaded the first app I came across that was free and had half decent reviews, can't remember what one, it was a little while ago, but there are loads of them in the store.
jamieridler said:
Or just install a file recovery app from play store on a rooted phone and follow app instructions...
Worked a charm for me. lol
Click to expand...
Click to collapse
A lot of those apps are for the external SD Card, only support the FAT filesystem, and not as robust as PhotoRec from TestDisk.
Newer devices(Such as the S4) have an ext3 filesystem I believe, and a few paid apps claim to offer support for it.
... Not to mention TestDisk is Open Source :angel:
zzarzzur said:
A lot of those apps are for the external SD Card, only support the FAT filesystem, and not as robust as PhotoRec from TestDisk.
Newer devices(Such as the S4) have an ext3 filesystem I believe, and a few paid apps claim to offer support for it.
... Not to mention TestDisk is Open Source :angel:
Click to expand...
Click to collapse
Although some might well be limited to FAT filesystem, some are not, its up to the user to check before downloading and installing. After that rather simple search and install, I managed to recover every img file on my phone, current and deleted, and back it all up to external memory, all with a free app, which offers img file recovery for free and any other file type of your choice for a small, one off, cost, if you needed it. I recovered almost 1gb of img files in under 10 minutes.
Am I correct in assuming your method copies the entire contents of the internal memory, or a portion of it, to an SD card before starting the search for deleted files? I'm just an amateur with little knowledge trying to figure out how your method works. Sorry don't mean to bash your method of doing it either, just commenting on this as your post suggest no one has ever been able to do this before and your method is the one and only way it can be done.
But if the device is factory reset, will you be able to get files? If i sell my device i don't want anyone sneaking on my photos.
problems
zzarzzur said:
Hey guys, I've found a way to recover files from the INTERNAL Memory of the Samsung Galaxy S4.
A lot of people have said that it's not possible, but I'm here to prove them wrong.
You have to have rooted your phone before carrying out these steps. Don't post here asking for help rooting, there's plenty of other threads that can help you with that.
I hold zero liability in the event that you make a nice brick out of your phone. If you do not feel comfortable working with these commands, then please don't follow them.
You're going to need an SD Card that's at least the size of the internal memory on the phone. A smaller one would work, but keep in mind not all the files are going to be recovered.
If the SD Card is brand spanking new, you can skip step number 1.
Format the SDCard with a layer of 0's. This is done so that none of the old data will interfere with your recovery. This step is optional.
Root the Device
Install Terminal Emulator
Insert the SDCard
In Terminal Emulator run the command to gain super user privileges
Code:
su
Grant Terminal Emulator super user privileges
Run this command,
Code:
dd if=/dev/block/mmcblk0p29 of=/storage/extSdCard/raw.dd
Wait. Leave your phone plugged into an AC Adapter, and go grab a can of pop. This command will take a looong time. Couple hours to a day.
Once the command is finished running, shutdown your phone.
Remove the SDCard, and connect it to a computer
Download TestDisk
Open PhotoRec
Select the SDCard and press enter
Use the first option of "Unknown"
Then press "Other"
Select the Directory to backup the files to
Profit
'
How it works:
By dd'ing the internal memory to a file on the SDCard, you're doing a raw copy of the data.
Once the data is copied onto the SDCard, PhotoRec will scan the SDCard for deleted data, doing so will scan the raw file for photos. Not just photos, all files can be recovered using this method.
This method works on all rootable phones, provided you can figure out where the dev block for the internal memory is.
Hope you guys get your files recovered. I know I did
Click to expand...
Click to collapse
So i've followed your guidelines to a 'T' with a brand new 64g (huge, i know) Sd card, but the command line responds with, "writer error: file to large". Any advice as to how to proceed?
Really appreciate your efforts on this issue, btw!

Recover lost data

(phone: Moto G 3rd gen, 5.1.1)
Hello,
I've been looking to recover lost data from wechat (images) for the past few days, and am still looking for a decent application/way to do this.
For example "Dr. Fone" and variants all allow you to select the same kind of stuff, but they only scan some specific folders. I would need to scan the whole internal memory.
Next step was to find out how to access the internal memory as a USB mass storage device, but that doesn't seem to work in my Android OS.
Interestingly enough "Dr. Fone" did some kind of quick-root (non destructive root) and was running a simple program on the phone itself for scanning.
I assume they rooted because the windows application said so and because from what I gathered is that Google now uses MTP by default because of a host of difficulties to simultaneous access files/partitions if you're using USB instead of MTP.
Furthermore these wechat images are located under /tencent/micromsg/WeChat, so I don't know if they are taking into account when scanning the phone.
What I'm looking for is an application like Recuva, but than for MTP devices. From what I gather is that this is not possible due to MTP.
So the next question would be: how do I gain temporary root on my device so I can for example install a USBMS enabler? After that I can use Recuva to go through it.
Or another question would be what application allows me to not only select the default categories, but just give me a folder structure and/or list of files (preferably with a filetime and a preview)?
Thanks!
No way to root it without unlocking the bootloader, and unlocking the bootloader = wipe.
No unlocked bootloader means no root, temporary or not... File recovery on a non-rooted device is nearly impossible since mass storage went away and MTP is the only real external access to the storage.
Sent from my XT1575 using Tapatalk

Modified LG E400-boot from external sd?

Hi guys! Sorry if I'm posting in the wrong place, I'm new here. So basically, i have an LG E400 (i know its a really old phone, i don't use it as my regular phone) which has been modified so it can not be used in the regular way (i wont go into the reasons its been modified, its complicated). The USB port has been modified so it cant be connected with a pc (it will only charge), the cell and wifi chips have been removed so it cant be connected to the internet and the system modified so i cant install new apps (if i try to install apks it says the application google play store (process com.android.vending has stopped unexpectedly. Also, its somehow made to boot and run off external sd, if i take out the sd the screen goes blank, if i try to switch on without sd it just shows the LG logo. Recently i installed linux file systems for windows by paragon software on my pc and using it when i put the sd card in my pc it shows 2 hidden linux volume partitions or whatever its called. in there is the entire system or root or whatever it is (sorry, if this doesn't make sense, I'm new to all this stuff).
So basically i have 3 questions.
1. How was it made to run from sd card?
2. Can install apps by putting the apks in the root or sd or whatever it is? i googled about it and it seems to be possible but i would have to change permissions, is it possible to do that on pc?
3. Can i fix the google verification thing so i can install apks in the regular way?
thanks in advance!
AFAIK it's not possible to boot Android from an external SD-card this because when the phone powers up the Boot ROM code starts executing from a predefined location on NAND which is hardwired in ROM, and you can't change that.
Are you saying that my phone is impossible? what about a custom rom? i don't know if it has a custom rom but if i go into about phone, it shows build number palmoid 2 which as far as i know doesn't exist so could it be a custom rom made the company that modified the phone?

Categories

Resources