I can't figure out how to move an app I installed from the playstore to the system/app. I rooted and installed magisk. And the app I am using requires it is moved to the system partition. I tried mounting rw in root explorer. It says it was granted permission but nothing changes.
What do I need to do to move this app to the system?
Thanks in advance!
As of Android 10 the system partition is read-only, due to Google changing the file system to EXT4 dedup. So, you'll have to do without the app unless you can find or create a custom ROM that doesn't set the system partition to EXT4 dedup.
@phhusson
I have an issue with rw on Android 10 & 11 that you might know something about. It's my understanding that I can use your lptools to make this possible. The problem with that is, I can't find a copy of it that will work. I tried pulling the binary from your GSI, but it fails and throws an error because it's dependant on fs_mgr, which doesn't exist anywhere. Alternatively, I found this statement from you about using fastboot.
Code:
fastboot resize-logical-partition system $((2*1024*1024*1024))
I tried that command, and it just says "fastboot: invalid option --2". Not sure why it doesn't work. I think I should mention however, that the following does work.
Code:
mk2fs -E unshare_blocks /dev/block/dm-3
It's just the steps before, that I can't complete. If you have any insight or suggestions, I'd love to hear it.
Related
Ive had this prob now for a while and its driving me crazy! I have searched for queries
here but cant find the exact problem or working solution.
Problem:
I want to install a program from the Market. I click to install, but as soon as I hit the
button it throws me back to the main Market page. The download starts in
top Android bar. It downloads to 100% (Ive checked the data usage and it does download all)
but then disappears! No error message, nothing installed.
The funny thing is that if I 'open' the download icon on the top bar. I can see the green
download bar. If I click this there is no option to cancel the download(!) instead clikcing on it
it opens up another app on Android Market! Weird!
Same happens with wifi or on 3G. I have about 30mb free at moment.
I tried emptying all possible caches on all apps can think of
***Rebooted
***Unmounted SD card - tried download and install with or without SD card
***Taken SIM card out nad battery
***Cant downgrade Market, its 2.3.4 version
***Tried different apps, big and small. Nothing is installing now...
Nothing seems to help!
Depending on your Rom and hboot your /cache partition might be full, so you could try to reboot into recovery and wipe the cache-partition. If I recall correctly, that's where market usually (i.e. this depends on the rom you are using - some use the sd-card to cache market downloads to allow hboots with small /cache partion) downloads and stores the apps prior installation.
Also deleting market data and cache might be worth a try. Actually, try this first. ^^
Sent from my HTC Desire using xda premium
Hi Tillus. Thanks for quick reply!
Im on 'stock' rom. Gingerbread 2.3.3 the official one from HTC. Can I still go to the recovery mode?
I have emptied the Market data and cache dozens of times. I went even to android-secure folder deleting all the old unused stuff. Nothing seems to help... its weird: Market starts to download but it just vanishes after 100%!
hmm, I don't think, you can wipe the cache-partition when using stock-setup and I don't think /cache is the culprit, because in stock-setup the /cache-partition is quite large.
But you can still check: Download a terminal-app and check the output of 'df -h'. There is a line saying Filesystem: '\dev\block\mtdblock04' and Mounted on: \cache and the size, used and available space on this partition.
Edith Says: Download a terminal-app...
Can you install apks without using the play store?
Hi
Ive got a terminal app. How do I check the output df -h? Sorry im bit novice using it.
I typed in \dev\block\mtdblock04 but it says permission denied. Mind let me know what to type exactly?
Many thanks!
just type df -h . Let's see, if it works, without root-permissions.
Sry, my last post was confusing
Doesn't seem to work on my phone...
I tried:
df -h
No such file or directory
df-h
Permission denied
'df-h'
Permission denied
More ideas love to hear!
Hmm, I'm out. Sorry I couldn't help. :/
Code:
busybox df -h
Tillus said:
There is a line saying Filesystem: '\dev\block\mtdblock04' and Mounted on: \cache and the size,
Click to expand...
Click to collapse
jannen said:
Hi
I typed in \dev\block\mtdblock04 but it says permission denied.
Click to expand...
Click to collapse
Android is based on Linux. You dont use a backslash on Linux.
Hi
I tried that busybox df -h, but it says:
Busybox: permission denied
Is this because of stock Rom, or because a fault?
Atm I can't download and install any more apps from Market...
Menu>Settings>Applications>Market>Clear data
And try again after a restart.
This exact path doesnt exist: Menu>Settings>Applications>Market>Clear data
The following does: Menu-Settings-Applications-Manage Applications-All-Market->Clear data
This one I have done dozens of times now, as well as claering the Market Updater and Download Manager. Restarted, taken off battery, SIM, SD card.. nothing seems to help.
Im gutted...
Let me preface this by saying this is my first ever real post in a forum, so if im doing something wrong, please tell me. I would post this in the linux on android forum, but I am apparently not allowed to do that. Hopefully this helps some people out.
I have been experimenting with the ubuntu.sh script and various linux images. After getting an image to work I attempted to expand the image file by using dd. This would create a 12 gb (or whatever size) image, but on copying the file system from kali.img to the new .img, the new image failed to execute and ended up wiping my kali.img, my modified ubuntu.sh script and my new .img (my fault for rebooting with the images mounted). This and subsequent attempts all failed to create a 12 gb image that would run kali.
Before I go further, I should state that I'm mounting my images to /storage/extSdCard/mnt
So all this got me thinking on other ways to expand the file and I thought why not move ./usr to a folder on extSdCard and use mount to bind it to the kali.img file. That way you'd get about 2gb extra on the image and installed programs could be installed to space on the extSdCard. If this works it could be applied to the entire linux filesystem, and just use a small .img to mount everything to when you wanted to start it.
That being said I'm having difficulty implementing this. Kali will boot and I can execute commands from it after running:
busybox mount -o bind ../kali/usr/usr ./usr
And
busybox mount -o remount,exec ./usr
It would appear that things work, but I can't connect through vnc as vncserver isn't installed and I can't install things because of an error with dpkg: error setting ownership of ... Operation not permitted.
That is where I'm at right now. I figured I would make a post and hopefully get some more input on this, or maybe help someone out with the whole image file size thing.
Sent from my SM-N900V using xda app-developers app
I have made some progress, but this idea as a whole would appear to be impractical at this moment. The permission errors occur because of the exfat file system used on android devices. This implementation does work on ext(4) formatted sdcards, as tested by my linux box running backtrack. However, the android system, at least for the note3 does not easily support ext4 formatted anything, despite /system maybe being ext4. I haven't looked too far into that as it is read only and would also be a hassle to configure. This may become an effective means of running linux on android systems once ext4 is widely supported, but not likely until then.
If I were more skilled I would try to set up a raid system with ext4 image files, since exfat has a 4gb file size limit. Unfortunately though, I do not have the skill to do this at the moment nor the time to take on such a task.
I wish you all the best of luck with your projects.
Sent from my SM-N900V using xda app-developers app
On ASUS stock rooted system, we can make use of fdisk to create a primary partition then use make_exr4fs to format that partition to ext4.
Once done and the /dev/block/mmcblk1p1 partition mounted as /storage/MicroSD it is possible as root to interact with it, but as non root you can only read data from there, not write.
How do you set selinux permissions correctly to allow writing without root ? The folder is set to 777, it cannot be a file permissions problem, it leaves us selinux policies to fix.
I tried to apply the selinux policy used for exfat external volumes but it still failed for writing.
Thanks to @Chainfire and Red Hat selinux documentation, I was able to resolve this without modifying the system, patching rules, disabling selinux or anything like that.
A two lines script can take care of this, requiring supersu and tools that are already on the device.
su --mount-master -c "mount -t ext4 -o discard /dev/block/mmcblk1p1 /storage/MicroSD"
chcon -R ubject_r:media_rw_data_file:s0 /storage/MicroSD
I'm still unsure to what each things are related to at 100%, but the context source of 3rd party application can write to media_rw_data_file , and this is what is applied on user's media folder inside data partition.
Some applications may still fail at understanding this is the external storage, but as my favorite file manager Fx does, that's what I want needed.
For some reasons the lost+found folder remains inaccessible, but the recursive part of chcon should take care of it on next boot.
Hope this will be useful to someone else.
Will your script work with another stock-ROM too? I've a Sony phone. Never had a phone I could get an ext4-formated sdcard working. Only with cyanogenmod installed ext4-formated cards work out of the box.
I'm a noob so I don't about scripting or understand details of file systems.
It will depend on where the Sony custom built system is mounting the micro sd card, if it mounts it at the same place, it will work.
But your message should have been a comment to my answer and not an answer proposal as you don't bring an alternative solution
Guys, I'm having a tough time deleting a file or two that were recently installed in the root's /product folder and I guess I don't understand what I am doing wrong, or what security is in place to prevent me from doing this. I would greatly appreciate any help or suggestions here. I cannot change permissions to make the folder recursively rw. I first started with Root Explorer and Solid Explorer. Both are capable of changing permissions but failed saying it was a "system folder". I used terminal to setenforce to 0, and tried with su from terminal and could not manually change folder permissions using chmod either. I thought maybe TWRP would be the answer, so I booted recovery and tried mounting the data partition (I think it's on data) and used file manager to browse to the folder, but I cannot see the contents of the folder nor can I delete it. What am I missing here? Is the TWRP mount function busted atm? Last night I reflashed November's update with the -w thinking it might "overwrite" the folder, but there was no joy there either. I do have a couple of TWRP backups of the data folder and that is my next step. Before I apply the December image tonight, I'm going to restore the most recent /data partition backup. There has to be a way to get control of that folder and it's contents but so far it has eluded me.
Cheers and TIA.
As far as I'm aware, the only way currently to write to the product partition is to fastboot flash it. I've went as far as to modify TWRP fstab to mount it in recovery and use the file manager to replace the bootanimation only to have it either never write properly or for it to "correct" itself. Not sure which happened.
Sent from my Pixel 3 XL using Tapatalk
I appreciate the response... anything helps. Product is a folder in root also and that is what I am trying to access. Unless there is some kind of symlink linking that product folder to the product partition. I don't know. When I flashed the full image yesterday I would have thought that partition.img (nested in the zipfile) would have been flashed, too. Maybe I can try fastboot formating the product partition. Can't hurt. Thanks again!
Edit: Just found this thread where you also contributed. I'll try to flash that partition with the partition.img and see what happens. I just want to reset it to stock.
superchilpil said:
As far as I'm aware, the only way currently to write to the product partition is to fastboot flash it. I've went as far as to modify TWRP fstab to mount it in recovery and use the file manager to replace the bootanimation only to have it either never write properly or for it to "correct" itself. Not sure which happened.
Click to expand...
Click to collapse
I flashed product.img first and it rendered the phone unbootable... corrupt. I then went back into TWRP and wiped system and ran the flash-all script in fastboot and re-rooted. The net result is the product folder is unchanged. Everything is up and running just fine. That folder is just untouchable for me so far. Next I will format data and re-flash. I didn't fully understand what you meant about the custom kernel being the solution but so far EX is not working. May reach out to flar2 and see if he can make some kind of change to his kernel to support mounting this partition? Thanks again.
v12xke said:
I flashed product.img first and it rendered the phone unbootable... corrupt. I then went back into TWRP and wiped system and ran the flash-all script in fastboot and re-rooted. The net result is the product folder is unchanged. Everything is up and running just fine. That folder is just untouchable for me so far. Next I will format data and re-flash. I didn't fully understand what you meant about the custom kernel being the solution but so far EX is not working. May reach out to flar2 and see if he can make some kind of change to his kernel to support mounting this partition? Thanks again.
Click to expand...
Click to collapse
Yeah I have yet to be able to mount the product image to modify it, but I haven't tried all that much lately. I'm pretty sure it's fixable with a kernel edit but that's beyond my ability, and even if I could I have a 8 year old laptop that wouldn't be able to build it.
What are you trying to accomplish? The bootanimation?
Sent from my Pixel 3 XL using Tapatalk
superchilpil said:
Yeah I have yet to be able to mount the product image to modify it, but I haven't tried all that much lately. I'm pretty sure it's fixable with a kernel edit but that's beyond my ability, and even if I could I have a 8 year old laptop that wouldn't be able to build it. What are you trying to accomplish? The bootanimation?
Click to expand...
Click to collapse
No, I see boot animation in that folder, and yes we all used to use it, but this time it's just an apk from apkmirror that wrote to that system partition (don't ask me how) and now I can't uninstall or update it. com. breel.wallpapers18. I tried to uninstall it using pm uninstall, but it uninstalled it for user 0 so it remains as a system app, and not available to me. I can't uninstall it completely or upgrade... or even use it! It's just a fk'in set of Google live wallpapers I like, but now want to re-set. Waay too much time spent on this so I'm (just about) ready to flush and start over. Every year Google makes it harder for us (fans) to customize our own phones. wtf? Pissed.
Hey XDA, hope all is going as well as possible.
I'm hoping if you could provide some information.
So, I tried to move an app to the system partition, but, the system partition is full and , well, the attempt to move the app obviously was unsuccessful.
Is it possible to resize partitions without corrupting any data or something?
I didn't do any search just yet. I felt this was the first step being that this is the device I own and it's the question and answer sub.
Hope you're willing to help, thanks.
Which version of Android are you running? If it is 11 then you can't resize it. If you want to move a app to the system then you need to install systemizer module for magisk and install it with terminal. Though I haven't had much luck with that either.
What has worked for me 100% reliably is to make a module for magisk that will inject the app into system
Androids new Scoped storage format will not allow edit the system partition.
tha_mechanic said:
Which version of Android are you running? If it is 11 then you can't resize it. If you want to move a app to the system then you need to install systemizer module for magisk and install it with terminal. Though I haven't had much luck with that either.
What has worked for me 100% reliably is to make a module for magisk that will inject the app into system
Androids new Scoped storage format will not allow edit the system partition.
Click to expand...
Click to collapse
Thanks for the reply. I'm on 10.
I believe 10 is formatted the same way
As mentioned, it is not a space issue, the issue is that you cannot write to the system. If you want an app to act like a system app you would have to compile it that way or use a magisk module to mount it to system. You cannot directly put it in system otherwise.