First of all, thanks so much to everyone for all the hard work creating and updating utilities for the Pixel C.
I have a rooted (but otherwise stock) Pixel C running the November update of Android 7/N (ryu-nrd91n) and am trying to:
1. Create an image of the userdata partition
2. Read/modify files
3. Re-flash the modified partition back to the Pixel C
So far I've been able to create a 24.8 GB image file using 'dd' but the file is unreadable, probably due to encryption.
I don't see any Developer Settings option to remove encryption or otherwise unencrypt the data partition.
What is the best approach?
jason_hanley said:
First of all, thanks so much to everyone for all the hard work creating and updating utilities for the Pixel C.
I have a rooted (but otherwise stock) Pixel C running the November update of Android 7/N (ryu-nrd91n) and am trying to:
1. Create an image of the userdata partition
2. Read/modify files
3. Re-flash the modified partition back to the Pixel C
So far I've been able to create a 24.8 GB image file using 'dd' but the file is unreadable, probably due to encryption.
I don't see any Developer Settings option to remove encryption or otherwise unencrypt the data partition.
What is the best approach?
Click to expand...
Click to collapse
Do you want to get rid of your encrypted data partition ?
- Format data (inside TWRP - and do not boot into system in between)
- Flash stock boot.img
- Install SuperSU.zip / or flash antother boot.img - with "encryptable" flag.
If you flash stock boot.img and boot into system your are encrypted again - automatically.
yes, "dd" will dump the complete partition including encryption ..
you may can "tar" the complete file system while decrypted .. similar to TWRP backup function.
Why do you want to "backup - modify - restore" at all ?
Why you don´t modify your files directly on data using root-explorer ?
Cheers
followmsi said:
Do you want to get rid of your encrypted data partition ?
- Format data (inside TWRP - and do not boot into system in between)
- Flash stock boot.img
- Install SuperSU.zip / or flash antother boot.img - with "encryptable" flag.
If you flash stock boot.img and boot into system your are encrypted again - automatically.
...
Why do you want to "backup - modify - restore" at all ?
Why you don´t modify your files directly on data using root-explorer ?
Click to expand...
Click to collapse
Thanks so much for the follow-up. The main goal is actually simply to be able to create images, and re-flash them reliably on a different Pixel C (replicating the exact system state). The modification step is simply to verify that it's working.
I was able to unencrypt /data using the method above -- Thanks, that's extremely helpful!
However, I'm still unable to mount/read the file produced by "dd if=/dev/block/mmcblk0p7"
Is there a better way you can recommend to make an image of the userdata partition?
How do you mount the unencrypted dd dump of data ?
mount -o loop dumped.data.img /mnt/data
As well you can untar all twrp backup files into one new data.img file.
Or tar the complete /data partition ... etc.
It's an ext4 partition ..
Of course, you can use the twrp backup files directly to restore on another pixel c device.
There is no modification needed at all.
Good luck!
Sent from my Nexus 10 using Tapatalk
That whole boot.img step.. is that why I always get stuck in a weird misplaced bootloop whenever I modify anything in TWRP? I just flash original boot.img in fastboot?
gnome9er said:
That whole boot.img step.. is that why I always get stuck in a weird misplaced bootloop whenever I modify anything in TWRP? I just flash original boot.img in fastboot?
Click to expand...
Click to collapse
The boot.img step to decrypt data ?
It's a one time task.
Once decrypted you always need to root after new boot.img flash.
If you don't root or don't use encryptable flag boot.img you will get encrypted.
Not really related to bootloops.
What are you changing when you are using TWRP ?
If I use backup then restore it loops. If I flash twrp it just boots to recovery. Now that i think about it i never did root this thing properly. Well i did with a toolkit but that doesnt count. I went beta then hated it lost root on restore then when i tried to do it again i kept running into bootloops. It says in the forums here that its common ans to just fastboot reboot but that dont work. I cant wait for the new nexus 7
gnome9er said:
If I use backup then restore it loops. If I flash twrp it just boots to recovery. Now that i think about it i never did root this thing properly. Well i did with a toolkit but that doesnt count. I went beta then hated it lost root on restore then when i tried to do it again i kept running into bootloops. It says in the forums here that its common ans to just fastboot reboot but that dont work. I cant wait for the new nexus 7
Click to expand...
Click to collapse
Depends what are you restoring
Do you backup / restore other partitions except the data partition ?
Pls don't
In general .. pls backup data partition only !
All other .img files should be taken freshly from image.
In systemless rooting world the su.img is placed on data.
You may have an older version inside your backup.
If you restore boot.img from backup, supersu ramdisk modifications will fail.
Flash what ever system.img, vendor.img and install twrp as recovery.
If you flash a boot.img, it should have stock ramdisk, to be able to let supersu.zip do the work for proper rooting.
At the same time the su.img on data will be refreshed too.
To summarize .. if you change something always install a fresh copy of your boot.img and run SuperSu.zip inside TWRP afterwards!
Hope this helps ..
followmsi said:
Depends what are you restoring
Do you backup / restore other partitions except the data partition ?
Pls don't
In general .. pls backup data partition only !
Click to expand...
Click to collapse
In this case, we're only looking to backup and restore the data partition.
Once we have the raw image created by dd, what would you say is the most reliable way to convert it to something that can be flashed by fastboot?
I've tried several different utilities to convert it to a "sparse image" but flashing it just erases data and doesn't copy anything from the image.
jason_hanley said:
In this case, we're only looking to backup and restore the data partition.
Once we have the raw image created by dd, what would you say is the most reliable way to convert it to something that can be flashed by fastboot?
I've tried several different utilities to convert it to a "sparse image" but flashing it just erases data and doesn't copy anything from the image.
Click to expand...
Click to collapse
Did you test img2simg as well ?
I use simg2img to convert the sparse to raw image, the other way around.
Or something like this below .. "s" defines sparse image.
make_ext4fs -s -l xxxxxxxx -a data data.img
Sorry, can't help you better now ..
followmsi said:
Did you test img2simg as well ?
Click to expand...
Click to collapse
Yes, unfortunately we've tried everything.
First we created the file data.dd using
Code:
dd if=/dev/block/mmcblk0p7
, which can be read as an ext4 image.
Then we tried using SparseConverter, ext2simg and img2simg to convert the raw image to a sparse image.
They all produce files of different lengths, and none of those files seem to flash successfully
They go through the flash process and report being successful, but the data isn't there.
Is there any way to debug this and figure out what's going wrong?
followmsi said:
Do you backup / restore other partitions except the data partition ?
Pls don't
In general .. pls backup data partition only !
Click to expand...
Click to collapse
Why should other partitions not be backed up? Is it not possible to flash the /data partition if you flash other partitions at the same time?
jason_hanley said:
Yes, unfortunately we've tried everything.
First we created the file data.dd using
Code:
dd if=/dev/block/mmcblk0p7
, which can be read as an ext4 image.
Then we tried using SparseConverter, ext2simg and img2simg to convert the raw image to a sparse image.
They all produce files of different lengths, and none of those files seem to flash successfully
They go through the flash process and report being successful, but the data isn't there.
Is there any way to debug this and figure out what's going wrong?
Click to expand...
Click to collapse
If you don´t get an error message from fastboot the sparse image seems to be valid.
How do you verify data partition after flashing ?
Are you able to mount and check ?
Also from recovery .. e.g. before you boot into system ?
For example on Nexus 7 flo there is still a userdata.img inside factory rom (6.0.1), but not for Pixel C anymore.
Maybe some permissions are required (file_contexts) - like on Nexus 7 flo too.
Sorry, no idea whats going wrong for you ..
---------- Post added at 12:49 PM ---------- Previous post was at 12:35 PM ----------
jogrimst said:
Why should other partitions not be backed up? Is it not possible to flash the /data partition if you flash other partitions at the same time?
Click to expand...
Click to collapse
You can backup all partitions you want .. but you should know the possible impact if you restore them.
And Yes - you can flash all partitions at the same time .. but normally you don´t flash data partition via fastboot - not on Pixel C.
In times of systemless rooting and monthly security releases there is no need for system.img backup anymore.
Unless you have special modifications inside your system.img.
If you were rooted before I recommend to use fresh boot.img and reinstall supersu.zip after change.
Just to prevent issues ...
followmsi said:
And Yes - you can flash all partitions at the same time .. but normally you don´t flash data partition via fastboot - not on Pixel C.
Click to expand...
Click to collapse
Why is userdata.img normally not flashed via fastboot on Pixel C?
jogrimst said:
Why is userdata.img normally not flashed via fastboot on Pixel C?
Click to expand...
Click to collapse
Because it will wipe your device.
cam30era said:
Because it will wipe your device.
Click to expand...
Click to collapse
Ok. Do you recommend creating a flashable ZIP file instead?
jogrimst said:
Ok. Do you recommend creating a flashable ZIP file instead?
Click to expand...
Click to collapse
Yep, pls use flashable zip for your purpose.
Hi all,
First of all be carefull, Nobody will be responsible for bricking your device but yourself.
I compiled twrp 3.0 for blu advance 4.0 l2 (A030U) https://drive.google.com/open?id=0Bw48RaTkRMm_eTRXVk84aWJTUjA here the sources https://github.com/contrerasojuanc/device_blu_advance_l2_A030U, thanks to @Dees_Troy and its guide on https://forum.xda-developers.com/showthread.php?t=1943625. So, in order to install it on this device, we will need to unlock bootloader (Factory reset needed), and flash TWRP recovery on recovery partition.
Settings -> About device -> Compilation number click multiple times to get new developer options menu.
Enable Unlock OEM.
On terminal:
Code:
adb reboot bootloader
On terminal:
Code:
fastboot oem unlock
On terminal:
Code:
fastboot flash recovery twrp_a030u.img
On terminal:
Code:
fastboot reboot
(Immediately press and hold Volumen + on device until custome recovery shows up.)
In order to achieve root on this device, we need to install from TWRP a Supersu system-mode, available thanks to @mauam, it can be get at https://forum.xda-developers.com/apps/supersu/v2-64-2-66-supersu-mode-t3286120 (I used SR3-SuperSU-v2.79-SYSTEMMODE.zip).
Note that maybe /system need to be mounted as writeable, so first mount System and then, on TRWP's terminal:
Code:
/system/bin/mount -o remount,rw /system
Hope, it can be useful somehow. Any questions, please let me know.
I did everything right but I can not get root
Could you give more detail on how you installed supersu in system mode? I used the command mount -o remount,rw /system (replacing /system with the actual system folder path I found using the mount command in twrp temrinal) BUT discovered system remained read-only and everywhere I searched says you need to have root access to mount it as re-writeable.
I installed the zip you used anyways but am now stuck at the BLU logo screen. What should I do now?
talesgs said:
I did everything right but I can not get root
Click to expand...
Click to collapse
Please give me more details of what was done, in order to try to help
4mand said:
Could you give more detail on how you installed supersu in system mode? I used the command mount -o remount,rw /system (replacing /system with the actual system folder path I found using the mount command in twrp temrinal) BUT discovered system remained read-only and everywhere I searched says you need to have root access to mount it as re-writeable.
I installed the zip you used anyways but am now stuck at the BLU logo screen. What should I do now?
Click to expand...
Click to collapse
The command I used for get writable /system was
Code:
/system/bin/mount -o remount,rw /system
exactly that one, remember that if you are in TWRP you have root access in recovery partition, so /system can be set as writeable from there. Probably you need to flash recovery and system partition again. I have those partitions from my stock device, let me know if want to give it a try.
Did you type any commands before that? I get the error "sh: /system/bin/mount: not found".
It would be great if you could link the stock partitions.
4mand said:
Did you type any commands before that? I get the error "sh: /system/bin/mount: not found".
It would be great if you could link the stock partitions.
Click to expand...
Click to collapse
No command before, this is what I did:
1. In TWRP tap Mount menu, then check "Mount system partition read-only" then check "System", then middle bottom button (Home). (So now we have /system partition mount but as RO)
2. Tap Advance menu, Terminal and type
Code:
/system/bin/mount -o remount,rw /system
3. Now if all goes alright, we should have /system writeable.
4. With /system writeable, tap on Install menu, select the Supersu file (Only this worked for me SR3-SuperSU-v2.79-SYSTEMMODE.zip).
5. Deviced rooted.
Ok, I'll try to upload the partitions tonight, while you could search the rom in web.
contrerasojuanc said:
No command before, this is what I did:
1. In TWRP tap Mount menu, then check "Mount system partition read-only" then check "System", then middle bottom button (Home). (So now we have /system partition mount but as RO)
2. Tap Advance menu, Terminal and type
Code:
/system/bin/mount -o remount,rw /system
3. Now if all goes alright, we should have /system writeable.
4. With /system writeable, tap on Install menu, select the Supersu file (Only this worked for me SR3-SuperSU-v2.79-SYSTEMMODE.zip).
5. Deviced rooted.
Ok, I'll try to upload the partitions tonight, while you could search the rom in web.
Click to expand...
Click to collapse
Yes, what you describe is exactly what I did on a previously stock device, but with the same issue on terminal I posted before. After ignoring that, and sideloading the supersu .zip you used, the device gets stuck on the second BLU logo screen on boot, no hope getting back to system. Hopefully it works the second time around with stock partitions...
4mand said:
Yes, what you describe is exactly what I did on a previously stock device, but with the same issue on terminal I posted before. After ignoring that, and sideloading the supersu .zip you used, the device gets stuck on the second BLU logo screen on boot, no hope getting back to system. Hopefully it works the second time around with stock partitions...
Click to expand...
Click to collapse
Also here
;-;
Blu Advance 4.0 L2 (A030U) rom partitions
Blu Advance 4.0 L2 (A030U) stock rom partitions
HTML:
https://ufile.io/j6925
Inside there is a scatter file to use with flashtools
contrerasojuanc said:
Blu Advance 4.0 L2 (A030U) rom partitions
HTML:
https://ufile.io/j6925
Inside there is a scatter file to use with flashtools
Click to expand...
Click to collapse
rooted? or stock?
talesgs said:
rooted? or stock?
Click to expand...
Click to collapse
Stock
I have a Blu Advance 4.0 L2 (A030L) device, I know it is different, but I dared, now I have a bricking device with this twrp 3.0. Anybody knows somethings about reverse it or if it is possible??
I already gave up doing root does not work
doni.zeti said:
I have a Blu Advance 4.0 L2 (A030L) device, I know it is different, but I dared, now I have a bricking device with this twrp 3.0. Anybody knows somethings about reverse it or if it is possible??
Click to expand...
Click to collapse
Hi, the only way I know would be to flash stock partitions of that device. If you manage to find them in the web, I could tell you how to flash it.
contrerasojuanc said:
Hi, the only way I know would be to flash stock partitions of that device. If you manage to find them in the web, I could tell you how to flash it.
Click to expand...
Click to collapse
thank you for your attention, I'm already trying your recommend, but no success yet. I have the stock, sp-flash and drivers (for win). I think it is any problem with drivers or sp-flash (v5.1712)...
Not working
Hi, I have a BLU Advance 4.0 L2 (A030U) and the TWRP doesn't work in my phone, it boots but the touchscreen isn't working, any suggestion?
UPDATE: I was booting twrp from fastboot because I wasn't able to flash it like is explained here, I think that is why my touchscreen wasn't working, anyways I managed to flash it through SP Flash Tools and It worked but now the root doesn't work, it softbrick the phone everytime I try, I'm able to mount system and all that stuff, everything is successfull but the phone does not boot.
Thank you
.It successfully helped root my Advance 4.0 L 2 A030L in yesterday.
I bad English.
I tried flash superuser.zip(superuser.phh.me_2016-09-23), Magisk-v14.0.zip, SR3-SuperSU-v2.79-SYSTEMMODE.zip, they could root my A030L(stock-V05_GENERIC)
if not fastboot reboot"(Immediately press and hold Volumen + on device until custome recovery shows up.)" , devices will replace your custom recovery automatically during first boot.
Other unimportant: Recovery in A030L also need remount / system, there is not read SDcard (update.zip can be imported in TWRP or OS to internal storage),can't backup userdate.can't input password to read userdate after Encrypted.
update:2017-1007 22:16
SR3-SuperSU-v2.79-SYSTEMMODE.zip looks not work...try next time
2017-1012
SuperSU. ---- Both of these are need: SuperSU-v2.76(or2..79).zip and SuperSU-v2.76(or2.79)-SYSTEMMODE.zip
BLU_A030L_V05_GENERIC i find it in
HTML:
https://plus.google.com/collection/cnwFTB
Ver-V05 can root both ok. Ver-V12 look like something wrong in boot.img,it can only root by Magisk. Maybe you should flash boot.img from ver-V05 if you want use V12.
i have a030u v12 rom. v5generic not work, after install result crash bootlogo loop same make option format... recovery not work! same press up button! after all process not enter in twrp. i test magisk not work customize boot.img flash to sp flash result crash boot! mtk droid not detect my phone too please help me.... very hard root this device!
TianNian said:
Thank you
.It successfully helped root my Advance 4.0 L 2 A030L in yesterday.
I bad English.
I tried flash superuser.zip(superuser.phh.me_2016-09-23), Magisk-v14.0.zip, SR3-SuperSU-v2.79-SYSTEMMODE.zip, they could root my A030L(stock-V05_GENERIC)
if not fastboot reboot"(Immediately press and hold Volumen + on device until custome recovery shows up.)" , devices will replace your custom recovery automatically during first boot.
Other unimportant: Recovery in A030L also need remount / system, there is not read SDcard (update.zip can be imported in TWRP or OS to internal storage),can't backup userdate.can't input password to read userdate after Encrypted.
update:2017-1007 22:16
SR3-SuperSU-v2.79-SYSTEMMODE.zip looks not work...try next time
2017-1012
SuperSU. ---- Both of these are need: SuperSU-v2.76(or2..79).zip and SuperSU-v2.76(or2.79)-SYSTEMMODE.zip
BLU_A030L_V05_GENERIC i find it in
HTML:
https://plus.google.com/collection/cnwFTB
Ver-V05 can root both ok. Ver-V12 look like something wrong in boot.img,it can only root by Magisk. Maybe you should flash boot.img from ver-V05 if you want use V12.
Click to expand...
Click to collapse
[/COLOR]
TianNian said:
Thank you
.It successfully helped root my Advance 4.0 L 2 A030L in yesterday.
I bad English.
I tried flash superuser.zip(superuser.phh.me_2016-09-23), Magisk-v14.0.zip, SR3-SuperSU-v2.79-SYSTEMMODE.zip, they could root my A030L(stock-V05_GENERIC)
if not fastboot reboot"(Immediately press and hold Volumen + on device until custome recovery shows up.)" , devices will replace your custom recovery automatically during first boot.
Other unimportant: Recovery in A030L also need remount / system, there is not read SDcard (update.zip can be imported in TWRP or OS to internal storage),can't backup userdate.can't input password to read userdate after Encrypted.
update:2017-1007 22:16
SR3-SuperSU-v2.79-SYSTEMMODE.zip looks not work...try next time
2017-1012
SuperSU. ---- Both of these are need: SuperSU-v2.76(or2..79).zip and SuperSU-v2.76(or2.79)-SYSTEMMODE.zip
BLU_A030L_V05_GENERIC i find it in
HTML:
https://plus.google.com/collection/cnwFTB
Ver-V05 can root both ok. Ver-V12 look like something wrong in boot.img,it can only root by Magisk. Maybe you should flash boot.img from ver-V05 if you want use V12.
Click to expand...
Click to collapse
---------- Post added at 07:13 AM ---------- Previous post was at 07:13 AM ----------
[/COLOR]
TianNian said:
Thank you
.It successfully helped root my Advance 4.0 L 2 A030L in yesterday.
I bad English.
I tried flash superuser.zip(superuser.phh.me_2016-09-23), Magisk-v14.0.zip, SR3-SuperSU-v2.79-SYSTEMMODE.zip, they could root my A030L(stock-V05_GENERIC)
if not fastboot reboot"(Immediately press and hold Volumen + on device until custome recovery shows up.)" , devices will replace your custom recovery automatically during first boot.
Other unimportant: Recovery in A030L also need remount / system, there is not read SDcard (update.zip can be imported in TWRP or OS to internal storage),can't backup userdate.can't input password to read userdate after Encrypted.
update:2017-1007 22:16
SR3-SuperSU-v2.79-SYSTEMMODE.zip looks not work...try next time
2017-1012
SuperSU. ---- Both of these are need: SuperSU-v2.76(or2..79).zip and SuperSU-v2.76(or2.79)-SYSTEMMODE.zip
BLU_A030L_V05_GENERIC i find it in
HTML:
https://plus.google.com/collection/cnwFTB
Ver-V05 can root both ok. Ver-V12 look like something wrong in boot.img,it can only root by Magisk. Maybe you should flash boot.img from ver-V05 if you want use V12.
Click to expand...
Click to collapse
Hi, in order to know what can be happening, first let's try to flash recovery partition, for that, please follow these steps:
Settings -> About device -> Compilation number click multiple times to get new developer options menu.
Enable Unlock OEM.
On terminal:
Code:
adb reboot bootloader
On terminal:
Code:
fastboot oem unlock
On terminal:
Code:
fastboot flash recovery twrp_a030u.img
On terminal: After write the next command, press enter on your computer and immediately press and hold Volumen + on device until custom recovery shows up.
Code:
fastboot reboot
Tools:
- nethunter-2023.1-bullhead-oreo-kalifs-full.zip
- twrp-3.2.1-0-fbe-4core-bullhead.img
- SR5-SuperSU-v2.82-SR5-20171001224502.zip
- forceencrypt_disabled_dm-verity_disabled (modified boot.img for my Oreo)
I have issues with my Nexus 5X being unable to mount /system partition due to encrypted data. Following several guides found online, I found a way around it by re-formatting /data to ext2 back to ext4 in TWRP.
This allowed me to successfully flash SuperSU and root my Stock Oreo ROM. The problem comes when I try to install Nethunter via TWRP.
I've tried:
1) Flashing both the Stock and force-encrypt-disabled Modified boot.img (neither of which decrypt the /system files in TWRP)
2) Unlock bootloader --> boot into TWRP --> Install Nethunter via ADB sideload (must use sideload since SD card is not mountable)
- This fails, probably because /system cannot be mounted
3) Unlock bootloader --> boot into TWRP --> Format /data to ext2 and back to ext4 --> Mount /system --> Drop Nethunter into SD Card --> Install via TWRP
- This fails due to "Data partition appears to be empty, run Android setup Wizard before installing Nethunter)
SO based on my findings online I can either decrypt /system or keep /data in-tact, but not both. But both appear to be required for the Nethunter installation? I know this is an old device but I am hoping SOMEONE out there has a potential solution.
Thanks in advance!
Same problem, still no solution found....
Last_Stupid said:
Same problem, still no solution found....
Click to expand...
Click to collapse
Hey buddy, sorry I didn’t update this sooner. But I found a solution after asking on Reddit and finally got it working. Here is what I did:
“
Nehunter needs to be installed through magisk. If you want to install a kernel, the provided packages are in AnyKernel3 format, which need to be flashed through the recovery environment.
Here's what I would do, I would reflash the stock ROM, install TWRP, wipe data, system, cache (-s) and install an AOSP based ROM like Lineage OS.
Then I would root using magisk, flashing the apk file as a zip (Don't forget to rename with a .zip extension)
And I would boot into android, download and install magisk, flash the nethunter zip as a magisk module and wait.
You should be done after this point.”