Extremely frustrating issue with Linux on Android - Nexus 7 (2013) Q&A

I have had the absolute worst time with getting Linux on Android to work on my Nexus 7. On 4.3 and 4.4, across many different Roms and kernels, the issue has persisted. Not a single other person on earth seems to have had this problem so i am going here as a last resort. For some infuriating reason, I am being denied permission to the mount -t command. The scripts always stop at mounting the image file to the loop device. I manually run the mount command, yes I am running as su, and I get this error: "Cannot execute -t: Permission denied" Why am I being denied permission when I am su? I even chmod 777 all the files associated with this command. There is absolutely no reason for this to happen, yet it does. I even do setenforce 0 to try and stop selinux from doing anything that could interfere.
Thanks if you can help.

What's the full command you;re trying to execute?

su mount -t ext4 /sdcard/kali/kali.img /dev/block/loop255
That's the line (minus su) that was in the bootscript that it was getting stuck on.

TheDoolster said:
su mount -t ext4 /sdcard/kali/kali.img /dev/block/loop255
That's the line (minus su) that was in the bootscript that it was getting stuck on.
Click to expand...
Click to collapse
Try adding -o rw,remount?
i.e. su mount -o rw,remount -t ext4 /sdcard/kali/kali.img /dev/block/loop255
If you're trying to get kali on android to use as a pwnpad, there is a thread here which walks one through it...it's a fully functional kali distro.

Related

los root acces

hi all. after restoring to original rom routed from http://forum.xda-developers.com/showthread.php?t=616991 9the second one, I lost the root access. I was trying the following commands
adb shell mount /system
adb push su /system/bin/
adb shell chmod 4755 /system/bin/su
adb push Superuser.apk /system/app/
adb shell reboot
but I got this :
what can I do in order to restore my root access? I was trying to re flash with FlashRek, but use less. I still have the Recovery Image when I boot in recovery mode......Help
try in recovery, instead of "mount /system" use "mount -a".
This doesn't necessarily mean you lost root.
It's not an error, for example, "permission denied". You just need an additional parameter, in this case, the mtdblock device (mtdblock3)
To facilitate your life if you mount/umount often, add the appropriate entries to the fstab, ergo, create one.
This is a full valid entry:
/dev/block/mtdblock3 /system yaffs2 rw
or, if you want it your way:
adb shell mount -t yaffs2 -o rw /dev/block/mtdblock3 /system (you might not need -o rw, since it's mounted as rw by default)

[Q] Correct path in Terminal Emulator?

I have spent hours trying to find an answer to what I thought was a simple question, but I just can't seem to find it...
I wanted to familiarize myself more with Terminal Emulator, so I used it to delete a system app that needed to go.
I used these commands:
$ su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblk3 /system
# rm /system/app/xxx.apk
It appears to have worked perfectly after a reboot, but my question is: what is the correct code to mount your system partition in TE? I have seen several variations of the line I used. Often they vary at 'mtdblk3.' I have seen it 'mtdblock5,' for example. Is there a particular line I should use for my specific device? Is it dependent on what I am specifically trying to do?
Any information is greatly appreciated; even/especially a link toward my answer. Thank you very much.
I've always used 'mount -o remount,rw /dev/block/mmcblk0p25 /system'
as far as 'correct' code I don't think there is as such. But I think different devices would have different partitions and mount points for system.
-Nipqer
I think it will depend on where your system is mounted, although I don't know why that would vary for the G2. It might be different for the DZ and certainly for other devices.
You can type "mount" in the terminal to see where everything is mounted.
Ditamae said:
I have spent hours trying to find an answer to what I thought was a simple question, but I just can't seem to find it...
I wanted to familiarize myself more with Terminal Emulator, so I used it to delete a system app that needed to go.
I used the code:
$ su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblk3 /system
# rm /system/app/xxx.apk
It appears to have worked perfectly after a reboot, but my question is: what is the correct code to mount your system partition in TE? I have seen several variations of the line I used. Often they vary at 'mtdblk3.' I have seen it 'mtdblock5,' for example. Is there a particular line I should use for my specific device? Is it dependent on what I am specifically trying to do?
Any information is greatly appreciated; even/especially a link toward my answer. Thank you very much.
Click to expand...
Click to collapse
i use this command:
# mount -w -o remount /dev/block/mmcblk0p25 /system
Thanks for the replies... I see now, that the path I should have used is: /dev/block/mmcblk0p25 /system. And that "code" was the wrong word. I was asking about commands & paths not code. Sorry - still learning.
edit: If anyone knows of a good and thorough resource of Terminal commands, I'd love it if you'd share... I've found bits and pieces of info, but something more comprehensive would be great. Thanks again.
Wow you guys are going about it using the long hand method. If you're just deleting a system app, to mount the /system as rw just enter:
Code:
$su
#mount -o remount,rw /system
#rm -f /system/app/xxxx.apk
The -f command isn't really needed but I use it to make sure the job gets done. Not sure if the pm uninstall command is used anymore. I'll have to look into that. I know some phones required you to mount yaffs and mmcblockXX but for just deleting an app I don't believe it's required. Never had an issue not typing that.
Here's the correct way to delete the app:
mount -o rw,remount /system
rm /path/to/app
reboot
Click to expand...
Click to collapse
Or you could use remount,rw. It's the same command. I threw reboot in there to reload the app list in your launcher correctly.

[ROOT ICS] The hard way && Digging for roots

For anyone that doesn't want to root the hard way crossix has come up with a double click root for Windows forum.xda-developers.com/showpost.php?p=23052186&postcount=105
Update 2/26/12
/system can now be mounted writable see the bottom of this post.
So the old Honeycomb exploit has now been patched in ICS. But there was an exploit found in the newer ICS kernels. Written by saurik,: called mempodroid
There is an offset needed as an argument to the binary, for the a100 we'll use what has worked for the a200 as noted in sauriks github linked above.
The issue with this is mounting /system as writable. I'm not sure if it's something in ICS, but it appears to be write protected. As noted here and here we will loop mount the system partition.
The tools needed are:
1. mempodroid under Usage Instructions, download pre-compiled
2. busybox 1.20 snapshot 3-10-12
3. su the latest from androidsu.com, extract from system/bin
4. mount.txt script
After downloading and extracting place them all in a folder called tools.
This must be done with adb. Issue the following from cmd or a terminal:
Code:
$ adb shell mkdir /data/local/tools
$ adb push tools /data/local/tools ; adb shell
$ cd /data/local ; chmod 755 tools/*
$ cd tools ; ./mempodroid 0xd9f0 0xaf47 sh
If all went well you should be at a hash # prompt. This is temp root.
mount /system rw the new way:
Code:
# PATH=$PWD:$PATH
# sh mount.txt -o remount,rw /system
Copy su and busybox to /system
Code:
# ./busybox cp busybox /system/xbin; ./busybox cp su /system/xbin/
# chmod 6755 /system/xbin/su
Install busybox
Code:
# cd /system/xbin
# for i in $(busybox --list); do ln -s busybox $i; done; sync
Copy the mount script
If busybox is updated this step must be run again
Code:
# cp /data/local/tools/mount.txt /system/bin/mount
# cp /data/local/tools/mount.txt /system/xbin/mount
Done your a100 should be rooted
the old way:
Now lets loop mount /system
Code:
[b]This is no longer needed[/b]
# ./busybox losetup -o $((512 * 51200)) /dev/block/loop7 /dev/block/mmcblk0
Code:
# ./busybox losetup /dev/block/loop7 /dev/block/mmcblk0p3
# mkdir loop ; mount -t ext4 /dev/block/loop7 loop
Copy su and busybox to the new mount point.
Code:
# ./busybox cp su loop/xbin/ ; ./busybox cp busybox loop/xbin/
# chmod 6755 loop/xbin/su ; sync
If it worked your a100 is fully rooted. Make sure to install SuperUser from the Market.
Either get busybox installer from the market, and install it to /data/local/tools/loop/xbin
Or:
Code:
# cd loop/xbin
# for i in $(busybox --list); do ln -s busybox $i; done; sync
The mount point won't survive a reboot so in order to write to /system again run:
Code:
# busybox losetup /dev/block/loop7 /dev/block/mmcblk0p3
# mount -t ext4 /dev/block/loop7 /data/local/tools/loop
[update 2/26/12]
To mount /system as writable do the following from adb. We'll just make a directory called /data/loop for easy access.
Code:
$ adb shell
$ su
# stop
[b]your screen will go black[/b]
# mkdir /data/loop
[b]skip this if the loop is already set up
# busybox losetup /dev/block/loop7 /dev/block/mmcblk0p3[/b]
# mount -t ext4 /dev/block/loop7 /data/loop
# mount -o bind /data/loop /system
# start
You can write to /system with any app but /system can't be remounted ro then back to rw.
This can be added to /etc/install-recovery.sh to make it permanent
Code:
busybox losetup /dev/block/loop7 /dev/block/mmcblk0p3
mount /dev/block/loop7 /data/loop
mount -o bind /data/loop /system
Thanks to crossix as the first to get temp root, and Icewyng for pointing out the exploit and helping with the magic number.
Ill be testing this when I get home, if it works Ill attempt to write a 1 command script to do it.
Sent from my MB860 using XDA App
OK...
Testing this out and found there were a couple of bugs.
You didn't have a "loop" folder created so I made one in the "tools" folder.
and, when mounting, you need to specify -t ext4.
Here are the revised commands for # mount /dev/block/loop7 loop
mkdir loop;mount -t ext4 /dev/block/loop7 /data/local/tools/loop
I noticed that the files /data/local/tools/loop/xbin/su and /data/local/tools/loop/xbin/busybox don't exist on /system/xbin until after a restart.
Finally, the busybox we are using to install doesn't seem to make all of the links to all of the nice commands we are used to, so things like grep, cp, etc... they won't work. I'm trying to figure out how to re-run the GUI busybox installer and point it to the loop folder, but haven't had much success.
danifunker said:
OK...
Testing this out and found there were a couple of bugs.
You didn't have a "loop" folder created so I made one in the "tools" folder.
and, when mounting, you need to specify -t ext4.
Here are the revised commands for # mount /dev/block/loop7 loop
mkdir loop;mount -t ext4 /dev/block/loop7 /data/local/tools/loop
I noticed that the files /data/local/tools/loop/xbin/su and /data/local/tools/loop/xbin/busybox don't exist on /system/xbin until after a restart.
Finally, the busybox we are using to install doesn't seem to make all of the links to all of the nice commands we are used to, so things like grep, cp, etc... they won't work. I'm trying to figure out how to re-run the GUI busybox installer and point it to the loop folder, but haven't had much success.
Click to expand...
Click to collapse
You beat me to the punch... was about to point it out.
Not sure what version of busybox this is but I will try with 1.19.2 and see how it goes.
Edit: Got root! It works great... for Busybox, use Busybox Installer to be able to get the latest version (1.19.4) I confirm that system is R/O for now.
danifunker said:
OK...
Testing this out and found there were a couple of bugs.
You didn't have a "loop" folder created so I made one in the "tools" folder.
and, when mounting, you need to specify -t ext4.
Here are the revised commands for # mount /dev/block/loop7 loop
mkdir loop;mount -t ext4 /dev/block/loop7 /data/local/tools/loop
I noticed that the files /data/local/tools/loop/xbin/su and /data/local/tools/loop/xbin/busybox don't exist on /system/xbin until after a restart.
Finally, the busybox we are using to install doesn't seem to make all of the links to all of the nice commands we are used to, so things like grep, cp, etc... they won't work. I'm trying to figure out how to re-run the GUI busybox installer and point it to the loop folder, but haven't had much success.
Click to expand...
Click to collapse
I did have some typos, think it's right now. That is an old busybox, it was just a quick find and it includes losetup but it's not one to use full time. Maybe sync is needed at the end so files are written properly. I didn't have to use -t ext4 with HC, but Ill add it to the OP
[edit] you have to use "busybox cp or busybox grep" I didn't include a way to add all the symlinks. Wow I have typos everywhere it's the end of the day for me, working nights.
Ok ... Got root!
Titanium works, Busybox Installer works, Superuser works, Root Explorer works...
Only thing is that System is R/O but we will work on it.
Waiting for a R/W system...and then, no one will stop my update
I can't get it to root :-(
It say not found
Sent from my A100 using xda premium
jondi23 said:
I can't get it to root :-(
It say not found
Sent from my A100 using xda premium
Click to expand...
Click to collapse
At what point, need some more details.
The tools folder gets pushed (the 3 files are copied) but then it says there is no such folder.
edit: never mind - i created the folder manually and pushed the files into the folder
edit2: rooted - thakns guys
Brilliat work, will try this later (need to get the sdk all set up again, I've been distro swapping). Got a pool match tonight too, so will try as soon as I can, will give whatever feedback I can later.
myprecious27 said:
The tools folder gets pushed (the 3 files are copied) but then it says there is no such folder.
edit: never mind - i created the folder manually and pushed the files into the folder
Click to expand...
Click to collapse
I forgot adb can't push a whole directory, it instead only copies the files within the directory.
wait how is it rooted if it's r/o I thought point of root was to make the file system r/w... er is root just allowing you to view all directories? Sorry for a noobish question, but you gotta start somewhere right?
rando152 said:
wait how is it rooted if it's r/o I thought point of root was to make the file system r/w... er is root just allowing you to view all directories? Sorry for a noobish question, but you gotta start somewhere right?
Click to expand...
Click to collapse
Well I think if we have su working we will be able to mount /system rw in some way if not directly. I cant imagine not being able to.
In any case though being able to write to /data as root is very useful. Example: Hulu flash fix.
You can't view /data if you're not root. That's one thig. Also, other functions may require root, like advanced networking things, etc.
I agree, not being able to write to /system is a major inconvenience, but most of the root programs will still work, as long as you're not writing to /system.
Since this is a temp root, does it mean that I will have to reroot every time I reboot? Will apps like Adfree work on this?
better yet is there a way we can do this solely on the tab? im away for work for another 4 weeks and only have my cell and a100 with me :-(
Sent from my SGH-I897 using xda premium
I get
Code:
255|[email protected]:/data/local/tools # mount -t ext4 /dev/block/loop7 /data/local
/tools/loop
lock/loop7 /data/local/tools/loop <
mount: Invalid argument
simoneser said:
I get
Code:
255|[email protected]:/data/local/tools # mount -t ext4 /dev/block/loop7 /data/local
/tools/loop
lock/loop7 /data/local/tools/loop <
mount: Invalid argument
Click to expand...
Click to collapse
I noticed the same thing happen after you root it and restart... not sure what to do next. Are you at temp loop?
simoneser said:
I get
Code:
255|[email protected]:/data/local/tools # mount -t ext4 /dev/block/loop7 /data/local
/tools/loop
lock/loop7 /data/local/tools/loop <
mount: Invalid argument
Click to expand...
Click to collapse
danifunker said:
I noticed the same thing happen after you root it and restart... not sure what to do next. Are you at temp loop?
Click to expand...
Click to collapse
try:
Code:
# busybox losetup -d /dev/block/loop7
# busybox losetup -o $((512 * 51200)) /dev/block/loop7 /dev/block/mmcblk0
# mount -t ext4 /dev/block/loop7 /data/local/tools/loop
The first line may produce
losetup: /dev/block/loop7: No such device or address
If it's not looped
After you are rooted the above can be run without adb from a terminal as su.
The mount point can be anywhere ex. /sdcard/loop instead of /data/local/tools/loop

System remount?

Has anyone been able to remount /system as rw? FX File Explorer says it's successful but then switches automatically back to read only
I'm also trying to remount /system as rw. It seems that the patched Magisk boot file provided in this post preserves dm-verity, which disallows system partition modifications and makes it unable to remount as rw. The mount command will complain that '/dev/block/dm-8' is read-only.
Having tried repatch the boot image with unchecked 'preserve AVB 2.0/dm-verity' in the Magisk app, but resulted in a crash during boot (QUALCOMM CrashDump Mode). Can succesfully boot with that option checked. It would be fine if dm-verity can be disabled in other ways.
ichimei said:
I'm also trying to remount /system as rw. It seems that the patched Magisk boot file provided in this post preserves dm-verity, which disallows system partition modifications and makes it unable to remount as rw. The mount command will complain that '/dev/block/dm-8' is read-only.
Having tried repatch the boot image with unchecked 'preserve AVB 2.0/dm-verity' in the Magisk app, but resulted in a crash during boot (QUALCOMM CrashDump Mode). Can succesfully boot with that option checked. It would be fine if dm-verity can be disabled in other ways.
Click to expand...
Click to collapse
Have you tried fastboot?
fastboot oem disable_dm_verity
If it causes problems, replace disable with enable to get back to current state, but it shouldn't
I don't like to disable dm verity for performance concerns, but for now it would be okay until a new root method comes out
Josh McGrath said:
Have you tried fastboot?
fastboot oem disable_dm_verity
If it causes problems, replace disable with enable to get back to current state, but it shouldn't
I don't like to disable dm verity for performance concerns, but for now it would be okay until a new root method comes out
Click to expand...
Click to collapse
FAILED (remote: 'unknown command')
Finished. Total time: 0.004s
Click to expand...
Click to collapse
It was worth a shot
blackknightavalon said:
It was worth a shot
Click to expand...
Click to collapse
Are you able to flash with TWRP by any chance?
Josh McGrath said:
Are you able to flash with TWRP by any chance?
Click to expand...
Click to collapse
TWRP doesn't mount /system at the moment on anyone's devices
Correct me if I'm wrong,but devices released with Android 10 out if the box will not allow making changes to the system( i.e it will remain read-only only)
WillSmith89 said:
Correct me if I'm wrong,but devices released with Android 10 out if the box will not allow making changes to the system( i.e it will remain read-only only)
Click to expand...
Click to collapse
That's what I'm working on. I tried a workaround but got this
mount -o rw,remount /
'/dev/block/dm-8' is read-only
Click to expand...
Click to collapse
I'm trying other things as I think of them, and I have a few ideas
blackknightavalon said:
That's what I'm working on. I tried a workaround but got this
I'm trying other things as I think of them, and I have a few ideas
Click to expand...
Click to collapse
Do you know if stock Oneplus recovery will flash unsigned zips?
Not sure. Got one I can flash via Fastboot?
blackknightavalon said:
Not sure. Got one I can flash via Fastboot?
Click to expand...
Click to collapse
Maybe, let me go through my old files cause I think I have dmverity disabler for stock recovery zip
Okay, I'm getting closer. Typing in
mount -o rw,remount /system
Click to expand...
Click to collapse
as usual gives me the "not in /proc/mounts" thing, but typing in
mount -o rw,remount /product
Click to expand...
Click to collapse
gives me the "/product is read only" error.
What we need is a kernel that'll let us mount /product in order for us to REALLY start playing with this device
------------------------------------------------------------------------------------
Okay, here's the Terminal results of my latest attempts. Maybe someone can have better luck than me
OnePlus7T:/ $ su
OnePlus7T:/ # mount -o rw,remount /sbin/.magisk/block/system_root
'/sbin/.magisk/block/system_root' is read-only
OnePlus7T:/ # mount -o rw,remount /dev/block/dm-11
'/dev/block/dm-11' is read-only
OnePlus7T:/ # mount -o rw,remount /dev/block/dm-9
'/dev/block/dm-9' is read-only
OnePlus7T:/ # mount -o rw,remount /dev/block/dm-8
'/dev/block/dm-8' is read-only
OnePlus7T:/ # mount -o rw,remount /dev/block/dm-8 /system
mount: '/system' not in /proc/mounts
1|OnePlus7T:/ # mount -o rw,remount /dev/block/dm-8 /system/product
mount: '/system/product' not in /proc/mounts
1|OnePlus7T:/ # mount -o rw,remount /product
'/dev/block/dm-9' is read-only
OnePlus7T:/ # mount -o rw,remount /super
mount: '/super' not in /proc/mounts
1|OnePlus7T:/ # mount -o rw,remount /product
'/dev/block/dm-9' is read-only
OnePlus7T:/ # ls -l /dev/block/by-name/super
lrwxrwxrwx 1 root root 16 1970-01-12 02:43 /dev/block/by-name/super -> /dev/block/sda15
OnePlus7T:/ # mount -o rw,remount /dev/block/sda15
mount: '/dev/block/sda15' not in /proc/mounts
1|OnePlus7T:/ # mount -o rw,remount /dev/block/by-name/super
mount: '/dev/block/by-name/super' not in /proc/mounts
1|OnePlus7T:/ # mount -o rw,remount /init
mount: '/init' not in /proc/mounts
1|OnePlus7T:/ # mount -o rw,remount /system/etc/init
'/sbin/.magisk/block/system_root' is read-only
OnePlus7T:/ #
Click to expand...
Click to collapse
Okay, I have an idea but I'll have to wait for the next official build to test it
Any news on this? Really want to uninstall Google Pay and install an older version of it.
blackknightavalon said:
Okay, I have an idea but I'll have to wait for the next official build to test it
Click to expand...
Click to collapse
I'm not much help but wanted to throw some ideas out thee. have you also tried changing read/write via fastboot or terminal emulator with (I think) chmod 777?
Josh McGrath said:
I'm not much help but wanted to throw some ideas out thee. have you also tried changing read/write via fastboot or terminal emulator with (I think) chmod 777?
Click to expand...
Click to collapse
Tried it through Terminal commands via Terminal Emulator AND ADB. Haven't tried it through fastboot. I'm downloading the OTA now (been in Florida on vacation, leaving back for NYC this afternoon)
I tried to change font, but I cant remount system. any idea? ( the mogule font_changer has remove of programmer, my device is root without twrp.
You cant mount system as r/w because android 10 is read only

Install MicroG on S20

I am using an SM-G9810, which is a Snapdragon (I did not know that when I purchased it or first started trying to do this). I downgraded the firmware using Odin to Android 11 (R), the latest one, December 2021 (G9810ZHS3DUL3, CSC TGY for Hong Kong). Then, I installed Magisk and patched the AP file. Then, like found in https://forum.xda-developers.com/t/...wrp-for-galaxy-s20-series-snapdragon.4157901/, steps 1-5, I installed Magisk. I performed step 6, but I believe the multidisabler flash failed. So, while I had root, I could not finish install. afaneh92 told me to run the following commands (pick which one applies, I could not find a comma in TWRP command line, so I used adb shell):
# mount r/w in twrp
adb shell mount /dev/block/mapper/system /system_root
adb shell mount /dev/block/mapper/vendor /vendor
# mount r/w in twrp terminal
mount -o remount,rw /vendor
mount -o remount,rw /system_root
# mount r/w in booted system
adb shell su -c mount -o remount,rw /vendor
adb shell su -c mount -o remount,rw /
With that done, I could then proceed with Niall's guide, https://forum.xda-developers.com/t/...sed-privacy-reconfigure-step-by-step.4402337/
I started with step 9. I found I could not remove Chrome, Gmail, youtube, and a few others. However, since I was rooted, I could uninstall with System app remover root needed_v7.2_apkpure.com.apk
Until I did the mount / remount, I was unable to write the patched services.jar or org.spoofing.org. However, it seems to be working now.
I am posting because maybe someone who knows a whole lot more will be able to help others to locate the apps to uninstall with adb like Chrome and GMS. I still got it done with the System app remover, but I still am not sure I got it all. However, MicroG is working and passes all checks, and Aurora is able to install apps. That's what I wanted, but it took many, many steps and errors to get there (with many factory resets and flash back to stock firmware). If someone else has a much better complete step by step instructions it would really help others.
Many thanks to those who did all the threads I referenced or contributed to them. I also used https://forum.xda-developers.com/t/...android-12-one-ui-4-1-stock-firmware.4394629/ as I never got the magisk key combination to give me toot access, which is what Niall did in his guide (never worked for me, I tried about a hundred times).
What I could not find or uninstall from Niall's guide was
rm /system/priv-app/ConfigUpdater/ConfigUpdater.apk
rm /system_root/system/app/Chrome/Chrome.apk
rm /system_root/system/app/Gmail2/Gmail2.apk
rm /system_root/system/app/GoogleLocationHistory/GoogleLocationHistory.apk
rm /system_root/system/app/YouTube/YouTube.apk
rm /system_root/system/priv-app/GalaxyAppsWidget_Phone_Dream/GalaxyAppsWidget_Phone_Dream.apk
rm /system_root/system/priv-app/GmsCore/GmsCore.apk
rm /system_root/system/priv-app/Phonesky/Phonesky.apk
rm /system_root/system/priv-app/Velvet/Velvet.apk

Categories

Resources