---------------------Better question, whats your plan? You can use them for example to extract some library, some apps... etc. You can mount them now like this:
mkdir rr
mount -t ext4 -o,ro system.ext4 rr
Take a look here https://forum.xda-developers.com/t/...-superrw-featuring-makerw-read-write.4247311/ , those script doing the same but also convert it back to super image---------------------
Bro, how can I convert these three files into one (super.bin) file. I want to flash this file via fastboot. Please help me.
Yeah, I edited these files, removed some apps. But, don't know how to convert these three files into one (super.bin) file. Please help me, have a good day bro.
![]()
You no need losetup, that tool is used for mount partitions on the fly without extracting them. In your case you have partitions extracted allready, so skip losetup and try the rest of commands. And sorry I do not have free time for this, further questions I will probably ignore sorry. Thats a very easy and basic tool and everybody who have at least basic linux skills and C skills is able to understand whats going on, I can't help and don't have free time for this thread, in short explanation:https://github.com/munjeni/super_image_dumper/blob/master/superrepack.cpp#L276
But what should I use instead the %s (losetup --offset=%s --sizelimit=%s %s %s) ?
partition_1_name = system_a
attributes = 0x1
first_extent_index = 0x0
num_extents = 0x1
group_index = 0x1
partition_group = somc_dynamic_partitions_a
extent num_sectors = 0x336390 (0x66c72000 bytes total)
extent target_type = 0x0
extent target_data = 0x800 (dumping offset = 0x100000)
extent target_source = 0x0
Filetype EXT4. EXT4 size = 0x6526c000
Dumping system_a.ext4 ...
losetup --offset=0x100000 --sizelimit=0x66c72000 super.img /dev/loop0
mkdir system_a
mount /dev/loop0 system_a
.... etc... etc
Thx for losetup! My recovery can't mount logical partitions (/system, /vendor etc).You no need losetup, that tool is used for mount partitions on the fly without extracting them. In your case you have partitions extracted allready, so skip losetup and try the rest of commands. And sorry I do not have free time for this, further questions I will probably ignore sorry. Thats a very easy and basic tool and everybody who have at least basic linux skills and C skills is able to understand whats going on, I can't help and don't have free time for this thread, in short explanation:
You got output for example like this:
Code:partition_1_name = system_a attributes = 0x1 first_extent_index = 0x0 num_extents = 0x1 group_index = 0x1 partition_group = somc_dynamic_partitions_a extent num_sectors = 0x336390 (0x66c72000 bytes total) extent target_type = 0x0 extent target_data = 0x800 (dumping offset = 0x100000) extent target_source = 0x0 Filetype EXT4. EXT4 size = 0x6526c000 Dumping system_a.ext4 ...
To convert this to losetup %s would be:
extent target_data x 512 = 0x800 x 512 = 0x100000
extent num_sectors x 512 = 0x336390 x 512 = 0x66c72000
Code:losetup --offset=0x100000 --sizelimit=0x66c72000 super.img /dev/loop0 mkdir system_a mount /dev/loop0 system_a .... etc... etc
Free space = 0x66c72000 - 0x6526c000 = 0x1A06000
Resize your partition to 0x66c72000 because e2fsck unshare blocks feature reguire increased partition size because clone blocks is performed while unsharing blocks. Unsharing blocks is reguired to convert from dynamic partition to normal partition. so some extra free space is needed for that, but not to exceed maximum partition size in our case extent num_sectors x 512 . In short this is explanation how my tool work. My choice for using losetup is because I no need to extract partition, instead I have virtualy mounted every each partition on the fly trought offset and size calculation, in that case we know where is start and end of the every each partition. For further understanding how I have done all that things on the fly take a look at source code of my tool to understand it better, there is everything you need to know! Hope this help!
[email protected] /media/hdd/sony/rom # /media/hdd/sony/rom/e2fsck/sbin/e2fsck -y -E unshare_blocks -E clone=zero -E shared=preserve ./system_a.ext4
e2fsck 1.46.5 (30-Dec-2021)
/: clean, 6470/6720 files, 478069/487572 blocks
[email protected] /media/hdd/sony/rom # mount -t ext4 -o,rw system_a.ext4 rr
[email protected] /media/hdd/sony/rom # ls -R1A rr | wc -l
7369
[email protected] /media/hdd/sony/rom # 7370
bash: 7370: command not found
[email protected] /media/hdd/sony/rom # ls rr/system/apex/com.android.vndk.current.apex
ls: cannot access 'rr/system/apex/com.android.vndk.current.apex': No such file or directory
actually there is very simple way to do things with super partition - run Ubuntu from termux as rootYes thats it! Notice that how losetup is an powerfull tool! Android losetup do not have those two parameters and who have plan to use losetup must compile an true linux losetup from source code. I have booth precompiled https://github.com/munjeni/super_image_dumper/tree/master/include . When I decide t buy next phone it will be probably inevitably with included dynamic partition table, and I will than definitelly complete our tool to fully working one click solution. E2fsck need to be modified to get it work with low free space, that will prevent partition repair coruption because of lack of free space for clone block while unsharing blocks, and that's all that needs to be applied to make this tool work properly! If someone already had an idea how to do this, I would be happy to implement it in my tool!
Edit:
This need to be tried https://patchwork.ozlabs.org/project/linux-ext4/patch/[email protected]/
Some discusion https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=956509 , https://www.mail-archive.com/[email protected]/msg2333701.html
Thank you for the explanation.You no need losetup, that tool is used for mount partitions on the fly without extracting them. In your case you have partitions extracted allready, so skip losetup and try the rest of commands. And sorry I do not have free time for this, further questions I will probably ignore sorry. Thats a very easy and basic tool and everybody who have at least basic linux skills and C skills is able to understand whats going on, I can't help and don't have free time for this thread, in short explanation:
You got output for example like this:
Code:partition_1_name = system_a attributes = 0x1 first_extent_index = 0x0 num_extents = 0x1 group_index = 0x1 partition_group = somc_dynamic_partitions_a extent num_sectors = 0x336390 (0x66c72000 bytes total) extent target_type = 0x0 extent target_data = 0x800 (dumping offset = 0x100000) extent target_source = 0x0 Filetype EXT4. EXT4 size = 0x6526c000 Dumping system_a.ext4 ...
To convert this to losetup %s would be:
extent target_data x 512 = 0x800 x 512 = 0x100000
extent num_sectors x 512 = 0x336390 x 512 = 0x66c72000
Code:losetup --offset=0x100000 --sizelimit=0x66c72000 super.img /dev/loop0 mkdir system_a mount /dev/loop0 system_a .... etc... etc
Free space = 0x66c72000 - 0x6526c000 = 0x1A06000
Resize your partition to 0x66c72000 because e2fsck unshare blocks feature reguire increased partition size because clone blocks is performed while unsharing blocks. Unsharing blocks is reguired to convert from dynamic partition to normal partition. so some extra free space is needed for that, but not to exceed maximum partition size in our case extent num_sectors x 512 . In short this is explanation how my tool work. My choice for using losetup is because I no need to extract partition, instead I have virtualy mounted every each partition on the fly trought offset and size calculation, in that case we know where is start and end of the every each partition. For further understanding how I have done all that things on the fly take a look at source code of my tool to understand it better, there is everything you need to know! Hope this help!
I see that you have losetup vendor.img, thats wrong, you need to losetup super.img ! Vendor.img you no need losetup, instead directly mount with mount commandThank you for the explanation.
I don't know if I missed something or the fact that the vendor.img I use is in f2fs format but I cannot seem to be able to mount the resulted vendor.img (result after running v15 tool).
Is there a specific command to mount f2fs partitions besides -t f2fs options in mount command?
I can mount vendor.img using udisksctl loop-setup -f vendor.img but the mounted image is read-only.
Thanks.
do something like thisBut, if I use mount for vendor, I cannor modify anything inside this image as is always mounted read-only.
You even can't modify anything since thats dynamic partition! If you delete one file you will delete a lot off files without knowing that! See how dynamic partition work! Option is to resize partition first than perform unshare blocks, that will convert your dynamic partition to normal, after that you can do whatever you need. Wait a bit I will tell you step by step how to reconstruct whole super image with an example in details!But, if I use mount for vendor, I cannor modify anything inside this image as is always mounted read-only.