yashsingh1/xdaforums huggingface dataset:
[Magisk] zgfg:
There is substantial difference between Magisk v25 and v26, see my post #56297 (earlier on this page):

https://xdaforums.com/t/magisk-general-support-discussion.3432382/post-88617909

On v26, you can no more write to /system/(x)bin

---

And of course, on Magisk v25 and earlier, you write to, Magisk mounts but the mount is lost on next reboot (SAR is not changed/affected)

That is, you can put your changes for /system/bin to a module, service.sh script and Magisk will always mount on the next reboot

But it doesn't work that way in Magisk v26 anymore, since writing to /system/(x)bin will fail (in that service.sh script), hence Magisk will not mount anything there

---

Oops, sorry - I see you tested with my example from that post, so you did read that post,😁

---

PS:

Or read-write mount was just something specific to Magisk Delta?
[Magisk] bnsmb:
Hi

I tested the same with Magisk v26.2 and can confirm that /system/bin is not writable mounted anymore.

AFAIK Magisk itself did never change files in /system/bin -- it always uses bind mounts (that's why it didn't work with very early Android versions that didn't support bind mounts)

And bind mounts will work with any filesystem that supports them -- even if the filesystem is mounted read-only.

ASUS_I006D:/ # magisk -V
26100

ASUS_I006D:/ # touch /system/bin/xx.$$
touch: '/system/bin/xx.5000': Read-only file system
1|ASUS_I006D:/ #

1|ASUS_I006D:/ # mount | grep "/system "

1|ASUS_I006D:/ # mount | grep "/system/bin "
worker on /system/bin type tmpfs (ro,seclabel,relatime,size=3700224k,nr_inodes=925056,mode=755)
ASUS_I006D:/ #

ASUS_I006D:/ # cp /system/etc/passwd /data/adb/passwd
ASUS_I006D:/ #
ASUS_I006D:/ # ls -l /system/etc/passwd /data/adb/passwd

-rw-r--r-- 1 root root 0 2023-06-07 10:35 /data/adb/passwd
-rw-r--r-- 1 root root 0 2009-01-01 01:00 /system/etc/passwd
ASUS_I006D:/ #

ASUS_I006D:/ # vi /data/adb/passwd
ASUS_I006D:/ #

ASUS_I006D:/ # ls -l /system/etc/passwd /data/adb/passwd
-rw-r--r-- 1 root root 42 2023-06-07 10:35 /data/adb/passwd
-rw-r--r-- 1 root root 0 2009-01-01 01:00 /system/etc/passwd
ASUS_I006D:/ #

ASUS_I006D:/ # cat /system/etc/passwd
ASUS_I006D:/ #

ASUS_I006D:/ # cat /data/adb/passwd
# This is a dummy passwd for Magisk tests
ASUS_I006D:/ #

ASUS_I006D:/ # mount -o bind /data/adb/passwd /system/etc/passwd
ASUS_I006D:/ #

ASUS_I006D:/ # ls -l /system/etc/passwd /data/adb/passwd
-rw-r--r-- 1 root root 42 2023-06-07 10:35 /data/adb/passwd
-rw-r--r-- 1 root root 42 2023-06-07 10:35 /system/etc/passwd
ASUS_I006D:/ #

ASUS_I006D:/ # cat /system/etc/passwd
# This is a dummy passwd for Magisk tests
ASUS_I006D:/ #

Using bind mounts is the reason why you can always "restore" the original files by removing the Magisk module

IMHO a very cool and clever idea and one of the best features of Magisk.

regards

Bernd
[Magisk] zgfg:
I'm still not sure if /system/(x)bin was writable on the official Magisk v25 and earlier, or it was specific to Delta (since HuskyDG worked on a module for dynamical mounting during the run-time)

Nevertheless, about the second part - it's not only good that when you boot without Magisk all mounts/changes will be gone but that is also necessary for new devices - originally released with A11, where SAR (all System paths) are read-only on the file system level (hence even with root, you could not change them). Therefore, temporary mounting can only work

You can inspect your /vendor/etc/fstab to see if /system or / are defined as "ro"

Btw, in that case, size of the SAR is full up to the last block (only few KBs might be unused) - hence even if it would be writable (on the file system level) nothing additional could be stored

Eg, (system/)/etc/hosts file with blocking domains for ad sites would not fit (no space left on /system) - and that's why Systemless hosts is also needed
[Magisk] bnsmb:
Hi

I tested with the official Magisk v25 release

Tests with Magisk v24.2 do have the same result:

ASUS_I006D:/ # magisk -V
24200
ASUS_I006D:/ #
ASUS_I006D:/ # mount | grep "/system/bin "
tmpfs on /system/bin type tmpfs (rw,seclabel,relatime,size=3700224k,nr_inodes=925056)
ASUS_I006D:/ #
ASUS_I006D:/ # touch /system/bin/xxx.$$$
ASUS_I006D:/ #
ASUS_I006D:/ # ls -l /system/bin/xxx.$$$
-rw-r--r-- 1 root root 0 2023-06-07 13:17 /system/bin/xxx.4613$
ASUS_I006D:/ #

regards

Bernd
[Magisk] Sh0X31:
Hi,

Do someone already try to root the new Android Beta?
[Magisk] Lughnasadh:
Both Stable 26.1 and Canary 26102 working fine on my Pixel 6 Pro and Pixel 7 Pro running A14B3.
[Magisk] Sh0X31:
thanks bro, how is the Battery Life on the Beta compare to the A13?
[Magisk] Lughnasadh:
You're welcome. Have no idea. Only been running it for 4-5 hours.
[Magisk] ipdev:
Pixel 3aXL

Lineage 19.1 (20230603)

OpenGApps 12L (nano?)

Magisk - Current version.

I ran your test script.

I thought it might work on Lineage.

Sorry to say it did not. 😞

---

Custom ROMs that do not include GApps, leave extra room in system for GApps.

Size of the rom and the installed gapps package, determines how much free space you have left in system.

AdAway in root-mode, will write to system/etc/hosts but, the file will be truncated if you run out of free space.

The updated hosts file will remain even if you boot a non-Magisk patched boot image.

Magisk patched boot image.

[ip@lost 3aXL]$ adb shell
bonito:/ $ magisk -c
5e2ef1b7f-ip:MAGISK:R (26102)
bonito:/ $ su -c ls -la /data/adb/modules/
total 30
drwxr-xr-x 10 root root 3488 2023-06-04 11:48 .
drwx------ 11 root root 3488 2023-06-04 11:48 ..
drwxr-xr-x 3 root root 3488 2023-06-04 11:46 busybox-ndk
drwxr-xr-x 2 root root 3488 2023-06-03 17:45 iReddit
drwxr-xr-x 2 root root 3488 2023-05-27 10:39 iyt
drwxr-xr-x 2 root root 3488 2023-05-27 12:54 iytm_arm64
drwxr-xr-x 3 root root 3488 2023-06-04 11:48 nano-ndk
drwxr-xr-x 3 root root 3488 2023-04-22 18:03 safetynet-fix
drwxr-xr-x 5 root root 3488 2023-04-24 18:40 zygisk_lsposed
drwxr-xr-x 3 root root 3488 2023-06-04 11:48 zygisk_shamiko
bonito:/ $
bonito:/ $ ls -la /system/etc/hosts
-rw-r--r-- 1 root root 287489 2023-06-04 13:58 /system/etc/hosts
bonito:/ $ cat /system/etc/hosts | grep "#"
# This hosts file has been generated by AdAway on: 2023-06-04 13:58:55
# Please do not modify it directly, it will be overwritten when AdAway is applied again.
# This file is generated from the following sources:
# - AdAway official hosts:https://adaway.org/hosts.txt
# - Pete Lowe blocklist hosts:https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext
bonito:/ $ exit

Stock boot image.

[ip@lost 3aXL]$ adb reboot bootloader; fastboot boot 20230603/boot-lineage-19.1-20230603-nightly-bonito-signed.img
< waiting for any device >
Sending 'boot.img' (65536 KB) OKAY [ 2.755s]
Booting OKAY [ 6.935s]
Finished. Total time: 9.739s
[ip@lost 3aXL]$ adb shell
bonito:/ $ magisk -c
/system/bin/sh: magisk: inaccessible or not found
127|bonito:/ $ su -c ls -la /data/adb/modules/
/system/bin/sh: su: inaccessible or not found
127|bonito:/ $ ls -la /system/etc/hosts
-rw-r--r-- 1 root root 287489 2023-06-04 13:58 /system/etc/hosts
bonito:/ $ cat /system/etc/hosts | grep "#"
# This hosts file has been generated by AdAway on: 2023-06-04 13:58:55
# Please do not modify it directly, it will be overwritten when AdAway is applied again.
# This file is generated from the following sources:
# - AdAway official hosts:https://adaway.org/hosts.txt
# - Pete Lowe blocklist hosts:https://pgl.yoyo.org/adservers/serverlist.php?hostformat=hosts&showintro=0&mimetype=plaintext
bonito:/ $ exit
[ip@lost 3aXL]$ adb reboot

Cheers. :cowboy:

PS.

I remember commits/messages about changing to 'ro' only but, I could not find the one(s) I was thinking of.

Maybe @pndwal could chime in 😉
[Magisk] Unspec:
Hi all, I am on a Pixel 6 Pro, just updated to the May update. For some reason, on both stable 26.1 and canary 26102, I am getting a crash as soon as I get to my login screen, I'll see the screen appear as normal but then crash 1-2 seconds later. It'll then go into a boot loop with the usual "Could not load Android system" etc etc, but once I re-flash the stock boot.img it works again. I'm unsure what modules I have installed, and at this point I'm unsure how to even uninstall them to see if it's a module misbehaving. Any help would be appreciated, thanks!
[Magisk] zgfg:
If you were able to write eg hosts file, your system partitions are not formatted and defined ro = read-only in the /vendor/etc/fstab.* (of course, it has nothing to do with Magisk)

Eg, on my Xiaomi (from 2021), released initially with A10, all system partitions are formatted ext4 read-only barrier=1:

system /system ext4 ro,barrier=1,discard wait,slotselect,logical,first_stage_mount
system_ext /system_ext ext4 ro,barrier=1,discard wait,slotselect,logical,first_stage_mount
product /product ext4 ro,barrier=1,discard wait,slotselect,logical,first_stage_mount
vendor /vendor ext4 ro,barrier=1,discard wait,slotselect,logical,first_stage_mount
odm /odm ext4 ro,barrier=1,discard wait,slotselect,logical,first_stage_mount

See eg:

https://www.kernel.org/doc/Documentation/filesystems/ext4.txt

Mounting Partitions Early | Android Open Source Project

source.android.com
[Magisk] pndwal:
Not sure, but I believe custom ROMs themselves have preset space in /system for GApps etc... Most (all?) seem not to use shared blocks / dynamic partitioning generally used in stock from A10...

I can confirm that Adaway in root mode works fine without systemless hosts with A11 LOS on Xiaomi Mi Pad 4... Can't do this with stock MIUI on Redmi Note 8T.

Nb. SAR devices are generally only LV A9, but Pixel had SAR from A7... Google don't really regard LV A10+ (2SI) as SAR although it is a form of SAR inasmuch as rootdir is system in 2nd stage... ( In true SAR, rootdir is always system)

Seems early mount is done for required first stage operations and is not affected by SAR... Shared blocks and dynamic partitioning schemes available from A10 (coinciding with 2SI) generally mean system is locked as ro by OEMs in 2nd stage as I understand it however... I've posted methods developed to reformat device and use these ROMs w/ rw system here, but it's not for the faint hearted...

Also, system is ro by default on my A11 LOS Xiaomi Mi Pad 4, but can easily be mounted as rw and confirm I can write files to both /bin and /xbin...

A while ago we got issues fixed with:

Mount with original option …

Fix #5481, close #5486

topjohnwu committed on Mar 2, 2022

Recently we had:

Make magisk node ro as well

yujincheng08 authored and topjohnwu committed on Amay 10, 2023

Thinking of this?... I don't know what it

does... You will likely know... 🙂 PW
[Magisk] pndwal:
Likely a module incompatibility... Booting to safe mode should fix (disables modules and Zygisk, but Magisk daemon key combo detection is not always reliable... See official Magisk FAQs for this and other options... 🤠 PW
[Magisk] Unspec:
Safe mode fixed it! However...it was none of the modules? I enabled all the modules one by one and rebooted each time, and every one of them is running. GOOD OL' TECHNOLOGY!

Oh well. I'm not questioning it, I'll take it.
[Magisk] badabing2003:
It could also be one of your root apps.

I know I had a similar issue with Greenify.
[Magisk] Unspec:
Maybe? None of my root apps lost root after the safe mode reboot. All I know is booting into safe mode, then restarting, fixed my issues.
[Magisk] badabing2003:
And you re-enabled all your modules after the safe mode?
[Magisk] chiteroman:
Guys I update my module, can you check if it works in your devices? https://xdaforums.com/t/spoof-locked-bootloader-attestationspoofer-lsposed.4586251/post-88623807
[Magisk] Unspec:
Yep. And it's all working fine now. Super strange.
[Magisk] J.Michael:
Any chance that while enabling modules one by one you also updated a module?
[Magisk] badabing2003:
Yeah, strange, unless what @J.Michael says.
[Magisk] Unspec:
Oh, maybe? The only one I re-installed was the Magisk built-in BusyBox since it said an update was available. The others were a simple enable.
[Magisk] bnsmb:
Hi

fyi

cd $(which $TB | rev | cut -c 7- | rev)

rev is not installed per default (at least in the OmniROM) and that is ugly code ... better use something like this:

TBP=$( which $TB )
echo ${TBP%/*}
cd ${TBP%/*}

and to list the symbolic links something like this:

ls -l | cut -c50- | cut -f1 -d " "

regards

Bernd
[Magisk] zgfg:
Given code was tried to be 'minimalistic' hence 'ugly' or not is subjective

Btw, some bashisms are not supported by other shells and eg, cannot be used in the scripts (customize.sh, post-fs-data.sh, service.sh, uninstall.sh in the modules since Magisk does not run them from the bash shell. And this was ad-hoc glued and based on the code Im using in the modules

Interesting if you don't have rev utility

Nevertheless, do you have toybox, in /system/bin, which version and how many applets if not a secret please
[Magisk] bnsmb:
ASUS_I006D:/system/bin # getprop ro.system.build.fingerprint
asus/omni_zenfone8/zenfone8:13/TQ2A.230505.002.A1/26:user/release-keys
ASUS_I006D:/system/bin #

ASUS_I006D:/system/bin # ./toybox --version
toybox 0.8.6-android
ASUS_I006D:/system/bin #

ASUS_I006D:/system/bin # ls -l | grep toybox | awk '{ print $8 }' | wc -l
176
ASUS_I006D:/system/bin #

Spoiler content hidden.
[Magisk] Karl Brunton:
I have rooted note 10+ SM-N976B with Magisk in order to recover old pictures. I have root and Magisk is able to grand SU permissions.

Problem I have is that when using file recovery apps like Diskdigger it can't find a single file.

All memory partitions seem to have been renamed. Example /dev/apnfitdolj.magisk/mirror/data instead of just data which is what it should be.

Is there something I can do here as I lost a lot of memorable photos that I really want to recover.

I haven't installed a custom recovery as recovery was already in the magisk file that was flashed.

Would custom recovery resolve this?
[Magisk] J.Michael:
Where are you hoping to find these "lost" pictures?

If you deleted them by accident, their space could have been overwritten by now.

If they used to be accessible from a PC, they are probably in the area called /sdcard, unless they were on an external SD-card. If an external SD-card, remove it from your device and read it directly on a PC.

If you want to know which partition is "/data", check the output of "mount". (My tablet has /dev/block/mmcblk0p69 mounted on /data) Or run a partition program like "fdisk -l". ("fdisk" is not in my toybox, but it is in @osm0sis' busybox.)

If there is a good custom recovery for your device I don't think it offers you anything you don't have right now. It would just be a different way to run Android with root privilege. Unless something like TWRP can be counted on to not touch /data without being told to, which might be of some value to avoid overwriting any more of these pictures, assuming they were deleted.
[Magisk] zgfg:
Don't know your phone and ROM and a particular app you mention but I use MiXPlorer on my rooted phones and I can go with root to /data and read/write to all folders with no problem, and with no need to use any /dev mounts, mirrors or so

Also, Internal memory is always /sdcard

Like on PC, if folders were deleted, their space might have been overwritten

Regarding to custom Recoveries, be aware that new Android versions (it has nothing with Magisk) encrypt Data and Internal storage, hence they can not recognize folders and files if they don't support decryption (you must enter your same Android unlock pin/pass), bcs it is an input parameter required for decryption
[Magisk] Karl Brunton:
I upgraded to the Z fold 4 from the note 10+ and I didn't copy all pictures over before doing a factory reset on the device.

Thought I'd try rooting and recovery that way to get them back. You need root for apps like diskdigger to scan the root of the device.

Since unlocking bootloader and rooting not a single file is found.

I upgraded to the Z fold 4 from the note 10+ and I didn't copy all pictures over before doing a factory reset on the device.

Thought I'd try rooting and recovery that way to get them back. You need root for apps like diskdigger to scan the root of the device.

Since unlocking bootloader and rooting not a single file is found.

It's the /data partition on the internal storage that is what im trying to recover from but seems to be without success. I'll be gutted if I've lost these photos forever as I had lots from the birth of my children along with many other memorable photos which unfortunately weren't backed up anywhere
[Magisk] Karl Brunton:
It's a galaxy note 10+ with stock rom rooted with Magisk.

You mention encryption. I haven't set up a screen unlock since rooting.

Is it possible that if I set up a password to unlock the device that it'll decrypt these partitions enabling me to recover the photos?
[Magisk] zgfg:
If you don't set unlock pin then Android uses some default but random/unique key it creates and secretly stores on the first reboot after factory resetting (formatting Internal storage).

Since the Google constantly changes and improves protections/privacy with the new Android versions, it causes delays and takes additional efforts for TWRP developers to breake and to make TWRP to be also able to decrypt and read/write to Data and Internal storage

It's all about protecting the user's data (that can be also now the photos of your children) in case of lost or stolen phone

Therefore, whatever you do now will not help.(and Magisk and root cannot help you) to recover (random key used as default for encryption during your previous life, ie, before you factory reset the phone).

And btw, unlocking BL usually includes the mandatory factory reset

You had to regularly backup your data (photos are the most easiest part - connect the phone by USB cable to PC, use MTP and copy the /DCIM/Camera folder to PC) and specially before unlocking BL and/or factory resetting
[Magisk] J.Michael:
Have you checked your Google account? (Not on the phone, on a PC, in a browser.) If you let Google "sync" your phone, they might have backed up your pictures.

Otherwise, I would guess there is nothing for you to recover. Like @zgfg said, the "wipe data / factory reset" is intended to destroy the previous data. It's not likely Google left that data where an enterprising thief (or desperate father) could find it.
[Magisk] Karl Brunton:
So due to random encryption keys there is no hope of recovering anything?

Wish I knew before.

What I need to know is can root be done without this problem?

A lot of what I've lost could be on my previous note 9 too (deleted obviously after factory reset) but I don't want to be stuck in the same situation.

This is true. Never used to be the case. I've had this issue in the past before the whole bootloader unlocking thing and a factory data reset when flashing new software still enabled you to recover deleted files.

Still never learnt my lesson. I never backup because I usually have way more than the standard 15gb to backup. I should really start regularly backing up files and photos, videos etc to my laptop really to prevent this issue in future.
[Magisk] zgfg:
It has nothing to do with root - if by root you mean installing Magisk

It has with unlocking Bootloader - that triggers factory reset

And if you decide to switch to a custom ROM, and later to another custom ROM, every time you will also have to factory reset (when switching from one custom ROM to another, not when upgrading the same custom ROM - but again, that is not rooting, it has nothing to do with Magisk)

For all that you must have your Bootloader unlocked, but you unlock Bootloader only once, and later you may thousand times install and uninstall Magisk (that's really the rooting and un-rooting), but installing/uninstalling Magisk will not affect your data

IDK how is all that for Samsung but eg for Xiaomi, user is clearly warned that unlocking BL will immediately factory reset his Internal memory before he initiates the process. And he is warned once again the last moment right before pushing the 'red button'

And on all forums, guides, everywhere there are warnings bout

Hence if somebody still ignores all that, he clearly did not do his homework. And unfortunately, that's not really a topic for this Magisk thread (afaik, even the official Magisk Installation guide on GitHub describes that a precondition for installing a Magisk is the unlocked Bootloader. And that before unlocking BL, one has to backup the data he wants to save)
[Magisk] Karl Brunton:
Sorry don't think I'm complaining at magisk for this because I'm not. What I am saying is that in the past when rooting etc, before bootloader unlocking was a thing factory reset never wiped all the data completely. Files were still recoverable. That's where I guess i was a bit naive, because I haven't rooted phones for a long long time I didn't realise that a factory reset now actually does completely destroy all data making nothing recoverable.

Apologies if my last reply came across the wrong way.

This is just something I was not expecting as when i last played with this sort of stuff a factory reset wasn't as in depth as it clearly is now
[Magisk] zgfg:
Yeah but technologies constantly change. You probably jumped from some phone that was originally released with A9 or maybe even older Android version (hence actually a phone model several years old) to a phone based on A10 or A11 - everytime there is a technology shift and what was valid earlier, may be different for that newer generation 😒
[Magisk] kevinco1:
This had to be it, 1.0.5 made my device bootloop but once 1.0.6 was released all went back to normal.

In fact, the changelog for 1.0.6 states that the release was to fix bootlooping devices

My detective work is done, case solved
[Magisk] duckdown:
This thing is so confusing, it's my first time using it and I'm finding it super complicated

I already have Lineage OS 20 installed on my Pixel 2 Walleye with unlocked bootloader

These installation instructions are atrocious. Why is this all so complicated and confusing?

I don't understand what I'm supposed to do. The Magisk APK is installed but what's with this patching stuff ?
[Magisk] pndwal:
Are you referring to official GitHub Instruction page?

Generally that's sufficient and frankly covers the essentials in a logical and concise fashion.

Start at the top of that page...

Please ask here with specific points you want clarification on; We don't want to rehash general instructions here, but you should understand that the App is simply the Magisk package until you a) install it which gives you only the UI used to configure Magisk, patch boot images etc, and b) install Magisk itself by flashing the boot image patched to install magiskinit and binaries in ramdisk... 👍 PW
[Magisk] J.Michael:
Why are you doing this? What is your end goal?

Take a look at PixelFlasher. It might handle the part you find confusing.
[Magisk] pndwal:
Magisk/OP Autobiographical Stuff (For the history buffs only) + some Tech stuff (for Tech-heads)

https://xdaforums.com/t/magisk-general-support-discussion.3432382/post-83707709

Just noticed I'd updated this back in March... For any interested. 👀 PW