Coder Social home page Coder Social logo

Comments (23)

roberto-sartori-gl avatar roberto-sartori-gl commented on August 16, 2024 3

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.

from kernelsu.

tiann avatar tiann commented on August 16, 2024 1

If you need to backup, run ksud module shrink first.

from kernelsu.

Kellwaxx11 avatar Kellwaxx11 commented on August 16, 2024

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

from kernelsu.

jswinde avatar jswinde commented on August 16, 2024

OnePlus 5 | KSU v0.8.1 | OrangeFox Recovery

Terabyte _OF

from kernelsu.

jswinde avatar jswinde commented on August 16, 2024

If you need to backup, run ksud module shrink first.

Where do you run this command? Terminal?

from kernelsu.

roberto-sartori-gl avatar roberto-sartori-gl commented on August 16, 2024

@tiann can you confirm 'where' in the code the sparse image is created?

I can see that the file is written here:
d7bc853#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..

from kernelsu.

faoliveira78 avatar faoliveira78 commented on August 16, 2024

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

from kernelsu.

hamjin avatar hamjin commented on August 16, 2024

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

from kernelsu.

hamjin avatar hamjin commented on August 16, 2024

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.

from kernelsu.

zeta96 avatar zeta96 commented on August 16, 2024

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?

from kernelsu.

zeta96 avatar zeta96 commented on August 16, 2024

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

from kernelsu.

Insidevk18 avatar Insidevk18 commented on August 16, 2024

Excuse me, could you clarify this doubt for me:

  1. This problem of changing storage values does not affect performance, right?

  2. Will I be able to install apps normally until I use all my storage (128 GB)?

from kernelsu.

tiann avatar tiann commented on August 16, 2024
  1. The image file of KernelSU has been a sparse file since its inception, and this time it has been resized to 1T; so if your statistics are inaccurate now, the previous versions were actually inaccurate, but you didn't notice.
  2. When calculating file size, 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.
  3. When you use 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.

from kernelsu.

jswinde avatar jswinde commented on August 16, 2024

@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?

from kernelsu.

zeta96 avatar zeta96 commented on August 16, 2024

Excuse me, could you clarify this doubt for me:

  1. This problem of changing storage values does not affect performance, right?
  2. 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

from kernelsu.

Fede2782 avatar Fede2782 commented on August 16, 2024

In the FAQ i added a few weeks ago this problem since all Samsungs are also affected #1389

from kernelsu.

adhammagdy avatar adhammagdy commented on August 16, 2024

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..

from kernelsu.

Insidevk18 avatar Insidevk18 commented on August 16, 2024

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

from kernelsu.

adhammagdy avatar adhammagdy commented on August 16, 2024

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

from kernelsu.

Insidevk18 avatar Insidevk18 commented on August 16, 2024

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?

from kernelsu.

adhammagdy avatar adhammagdy commented on August 16, 2024

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

from kernelsu.

zeta96 avatar zeta96 commented on August 16, 2024

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

from kernelsu.

spidy2356 avatar spidy2356 commented on August 16, 2024

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

from kernelsu.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.