Closed jswinde closed 8 months ago
KernelSU_bugreport_2024-03-02_23_19.tar.gz +1 here having it on A13 though I hope we can get this issue sorted
logs attached
OnePlus 5 | KSU v0.8.1 | OrangeFox Recovery
If you need to backup, run ksud module shrink
first.
If you need to backup, run
ksud module shrink
first.
Where do you run this command? Terminal?
@tiann can you confirm 'where' in the code the sparse image is created?
I can see that the file is written here: https://github.com/tiann/KernelSU/commit/d7bc853bfc8ad44ba59927689efc12e131331d02#diff-585551bf35841dd58b217217af7af4a6946d512716cd1f88cb1f268abd455701R190
But there is no mention on sparse files there: it's just a file with the 'set_len' method called to force it to basically report 1TB, but it's not a sparse file.
From the command line:
$ file modules.img
/data/adb/ksu/modules.img: data
While with a sparse file (created with img2simg):
$ file test1tb.img
/sdcard/test1tb.img: Android sparse image v1.0, 1 4096-byte blocks (1 chunks)
Edit: to add more info, sparse images start with the '3aff 26ed' bytes (hexdump, xxd). I think this is the magic number of sparse images on Android. This is not the case of the modules.img file though, at least not on certain OnePlus devices.
Edit2: maybe there is 'a difference' between 'sparse images' and 'android sparse images', however as we are on Android..
If you need to backup, run
ksud module shrink
first.
After "ksud" command I can't install any module, I get the message that there is no space left on device. (os error 28)
Edit: After updating ksu 0.9.x the command works
android sparse images
Android Sparse Image is only used for flashing system in bootloader now and there is no official way to modify it unless converting to raw image
android sparse images
Android Sparse Image is only used for flashing system in bootloader now and there is no official way to modify it unless converting to raw image
But the issue remains, doesn't it?
I understand that 'theoretically' sparse images (like modules.img) should be supported and working fine, however most tools do not report the correct size on disk: for example, simply running 'ls -l' will report the img file to be 1TB. Note that this is an issue on all devices, not only Oneplus devices.
Same on Android userspace in most cases (maybe not always, maybe not the settings).
Android sparse images actually report the correct size (they use metadata and such).
This 'modules.img' thing is breaking all sizes calculations.
android sparse images
Android Sparse Image is only used for flashing system in bootloader now and there is no official way to modify it unless converting to raw image
But the issue remains, doesn't it?
I understand that 'theoretically' sparse images (like modules.img) should be supported and working fine, however most tools do not report the correct size on disk: for example, simply running 'ls -l' will report the img file to be 1TB. Note that this is an issue on all devices, not only Oneplus devices.
Same on Android userspace in most cases (maybe not always, maybe not the settings).
Android sparse images actually report the correct size (they use metadata and such).
This 'modules.img' thing is breaking all sizes calculations.
You can implement the library to modify Android Sparse Images and mount them like raw images. Also, sizes calculations in Settings on MIUI & HyperOS is still correct like before.
If you need to backup, run
ksud module shrink
first.Where do you run this command? Terminal?
tried that method cant solve the problem, why not delete image.img before backup, and do before every u need backup?
If you need to backup, run
ksud module shrink
first.After "ksud" command I can't install any module, I get the message that there is no space left on device. (os error 28)
i got same problem, just recreated from that shrink will be half of 1 TB, and then if u want to install a module it will be 1 TB with more times, i dont know how much time
Excuse me, could you clarify this doubt for me:
This problem of changing storage values does not affect performance, right?
Will I be able to install apps normally until I use all my storage (128 GB)?
du
should be used instead of ls
; as you can see, the sparse file only adjusts the file size with set_len
, and there are no other special operations. If the system's statistics are inaccurate, it is a problem with the system and should be fixed.du
to check the size, you will find that it does not occupy so much space; but you cannot copy this file using normal methods. If you want to back it up, you need to execute ksud module shrink
with a root shell first; also, if you update to this version: https://github.com/tiann/KernelSU/actions/runs/8136229760, it will automatically expand after you shrink it.@tiann Out of curiosity, how did you settle on 1 TB for the size of the sparse file? A smaller, potentially less problematic size would not be sufficient?
Excuse me, could you clarify this doubt for me:
- This problem of changing storage values does not affect performance, right?
- Will I be able to install apps normally until I use all my storage (128 GB)?
yes and no, if u install a module, then u cant install app, because occupied 1 TB used untill free 0 MB
In the FAQ i added a few weeks ago this problem since all Samsungs are also affected #1389
I have the same problem on xiaomi device.. I always make a rescue data backup with modules and everything so deleting the img isn't going to cut it.. and of course it's impossible to backup with the 1TiB size.. so right now the only solution for me is to only flash modules with manager 0.7.6 which doesn't have this compatibility issue until twrp, ofrp, samsung, oneplus, etc. devs change the size calculation method on their end.. On 0.7.6 my data partition average size in recovery is 7 GiB, the modules.img is about 300MiB and the size is reported correctly.. if I flash anything with 0.8.0 both modules.img and modules_update.img report 1 TiB each..
I have the same problem on xiaomi device.. I always make a rescue data backup with modules and everything so deleting the img isn't going to cut it.. and of course it's impossible to backup with the 1TiB size.. so right now the only solution for me is to only flash modules with manager 0.7.6 which doesn't have this compatibility issue until twrp, ofrp, samsung, oneplus, etc. devs change the size calculation method on their end.. On 0.7.6 my data partition average size in recovery is 7 GiB, the modules.img is about 300MiB and the size is reported correctly.. if I flash anything with 0.8.0 both modules.img and modules_update.img report 1 TiB each..
I don't know if this tutorial will be of any use to you, or to someone who follows this thread... https://www.youtube.com/watch?v=NYvCn_HnXLc
I have the same problem on xiaomi device.. I always make a rescue data backup with modules and everything so deleting the img isn't going to cut it.. and of course it's impossible to backup with the 1TiB size.. so right now the only solution for me is to only flash modules with manager 0.7.6 which doesn't have this compatibility issue until twrp, ofrp, samsung, oneplus, etc. devs change the size calculation method on their end.. On 0.7.6 my data partition average size in recovery is 7 GiB, the modules.img is about 300MiB and the size is reported correctly.. if I flash anything with 0.8.0 both modules.img and modules_update.img report 1 TiB each..
I don't know if this tutorial will be of any use to you, or to someone who follows this thread... https://www.youtube.com/watch?v=NYvCn_HnXLc
Perfect.. but when you install or remove modules it might be resized again to the hardcoded 1TiB value, maybe in kernelsu manager settings we could have the option to set the desired virtual img size and if trying to install a large module the manager would show a warning and ask the user to choose a larger size.. that way compatibility is kept and large modules are still supported based on the user choice with a simple setting in the gui, and the user choice is respected when installing new modules
I have the same problem on xiaomi device.. I always make a rescue data backup with modules and everything so deleting the img isn't going to cut it.. and of course it's impossible to backup with the 1TiB size.. so right now the only solution for me is to only flash modules with manager 0.7.6 which doesn't have this compatibility issue until twrp, ofrp, samsung, oneplus, etc. devs change the size calculation method on their end.. On 0.7.6 my data partition average size in recovery is 7 GiB, the modules.img is about 300MiB and the size is reported correctly.. if I flash anything with 0.8.0 both modules.img and modules_update.img report 1 TiB each..
I don't know if this tutorial will be of any use to you, or to someone who follows this thread... https://www.youtube.com/watch?v=NYvCn_HnXLc
Perfect.. but when you install or remove modules it might be resized again to the hardcoded 1TiB value, maybe in kernelsu manager settings we could have the option to set the desired virtual img size and if trying to install a large module the manager would show a warning and ask the user to choose a larger size.. that way compatibility is kept and large modules are still supported based on the user choice with a simple setting in the gui, and the user choice is respected when installing new modules
So, this process must be repeated every time you install a module? And, does this not affect the functionality of the module?
So, this process must be repeated every time you install a module? And, does this not affect the functionality of the module?
Yes.. by the way the command above is easier
Just input ksud module shrink
in termux with root and the image is resized to physical size.. but any time you install or update a module it will become 1TiB again, and after shrinking if some of your modules have a dynamic size they might fail
In the FAQ i added a few weeks ago this problem since all Samsungs are also affected #1389
should be added and custom rom and xiaomeme device
So, this process must be repeated every time you install a module? And, does this not affect the functionality of the module?
Yes.. by the way the command above is easier Just input
ksud module shrink
in termux with root and the image is resized to physical size.. but any time you install or update a module it will become 1TiB again, and after shrinking if some of your modules have a dynamic size they might fail
@adhammagdy after this cmd all modules get removed
Please check before submitting an issue
Describe the bug
Recoveries like TWRP show the Data partition as having 1 TB of data instead of the actual storage size. It is impossible to backup the ROM due to "insufficient space" available on the device.
To Reproduce
Expected behavior
TWRP and OrangeFox should display the actual storage size of the Data partition. Backing up the ROM in the recovery should be possible if the actual available storage size is adequate.
Screenshots
Logs
No response
Device info
Additional context
KSU Manager v0.7.6 shows the actual size of the Data partition when using A13 or A14 due to not creating the sparse image.