Stuck in the bootloop after flashing data.img on Pixel C device. - Pixel C Q&A, Help & Troubleshooting

Hi,
I am stuck in the bootloop after flashing data.img on Pixel C device.
I have done the following steps and have serached around in 100s of forums before posting this. Please bear with me.
My bootloader is unlocked and I have flashed my boot partition with dragon-boot-encryptable-rooted-01092016-1.img so that the data is not encrypted by default.
I have a freshly booted up (new setup) device with default apps installed. I installed one app so that the /data partition contains something. I am firing all commands as root on Ubuntu 14
I then flashboot into TWRP recovery so that I can access root shell through adb. This is not flashing the TWRP recovery, just booting into it.
#adb reboot bootloader
#fastboot boot twrp-3.0.0-0-dragon-ryu-02112016-1.img
#adb shell
~ # whoami
root
~ # df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 1420244 20 1420224 0% /dev
tmpfs 1420244 20 1420224 0% /tmp
/dev/block/mmcblk0p6 396744 452 388100 0% /cache
/dev/block/mmcblk0p7 55453060 304032 55132644 1% /data
/dev/block/mmcblk0p7 55453060 304032 55132644 1% /sdcard
Now, I am interested only in taking image backup of my /data partition which is at /dev/block/mmcblk0p7. I confirmed this by:
/dev/block/platform/700b0600.sdhci/by-name # ls -l
...
lrwxrwxrwx 1 root root 20 Oct 16 07:38 UDA -> /dev/block/mmcblk0p7
...
Now, I fire the make_ext4fs command to create the image.
~#umount /sdcard (optional)
~ # make_ext4fs -s -l 55453060K -a data mydata.img /data
SELinux: Loaded file_contexts contexts from /file_contexts.
Creating filesystem with parameters:
Size: 56783933440
Block size: 4096
Blocks per group: 32768
Inodes per group: 8176
Inode size: 256
Journal blocks: 32768
Label:
Blocks: 13863265
Block groups: 424
Reserved block group size: 1024
Created filesystem with 11/3466624 inodes and 263660/13863265 blocks
mydata.img is created. I do an adb pull on my Ubuntu and fetch the mydata.img and /file_contexts
#adb pull /file_contexts
#adb pull /mydata.img
# du *
20 file_contexts
140888 mydata.img
Now, I convert the mydata.img into raw image file with simg2img.
#./simg2img mydata.img mydata.img.raw
#ls -lrt
-rw-r--r-- 1 root root 17261 Oct 16 13:17 file_contexts
-rw-r--r-- 1 root root 144267780 Oct 16 13:18 mydata.img
-rw-r--r-- 1 root root 56783933440 Oct 16 13:21 mydata.img.raw
Now, I create a directory and mount my raw image into that directory.
#mkdir phonedata
#mount -t ext4 mydata.img.raw phonedata/
I navigate into phonedata and verify the contents. I can see that the app I installed in avaialable under /data/data.
Then, I re-create the image from phonedata mount using make_ext4fs, or I can use the mydata.img fetch by adb pull too.
If I re-create the image, I give file_contexts(fetched) as the -S option to make_ext4fs. One doubt here, if I am re-creating the sparse image, what value should be passed to -l paramtere now?
I got to fastboot and fire these commands.
#fastboot format userdata
#fastboot format data
#fastboot format cache
#fastboot flash data mydata.img { I am confused between data and userdata, which is the correct one. This is mydata.img from adb pull }
#fastboot flash vendor vendor.img { I read in one forum that vendor should be flashed again on a nexus device }
#fastboot reboot
All things take smoothly. When the tab reboot, it shows Google logo, then android flash animation, then it shows 'Android is starting', and then goes back to flash animation. That is, it's stuck in bootloop.
Kindly let me know if there is something with these steps. Or is there is any alternate way to do the same thing. My problem statement is, I need a flashable data.img. I can create TWRP backup and recovery fine, but that's not my requirement.
Thanks!
Edit 1:
I should add, at this point, if I hard boot to fastboot and do a fastboot format userdata followed by fastboot reboot, I am able to boot to device and perform new device setup.
I can also flash system,boot,vendor,recovery and cache.img and perform new device setup normally. This should mean my fastboot/adb are working fine.

Ummmmm

Did you try with smaller sparse image size ?
make_ext4fs -s -l 30000M -a data mydata.img /data
The sparse will grow until max partition size.
Did you play with "img2simg" as well ? (not simg2img)
img2simg mydata.img.raw mydata.img

Related

Unable to mount data & cache

Hi all, got my kindle fire brick. I think my partition is messed up. I bought a factory cable which able me to install twrp and i succefully(i guess) flashed energy ICS. But it prompt me "e:unable to mount '/data" e:unable to mount '/cache". I were to boot to normal boot it will just boot endlessly but i still can access to fff and twrp.i did some research on repartitioning for kindle fire but i need some guidance. Help is much appreciated
Sent from my GT-I9100 using xda app-developers app
Usually this is a fairly bad indication but do this go to the mount section in twrp and make sure there are no checks in the boxes of data and system if so uncheck them, I know you said data and cache but this should have a check in the box then try a reboot also were you previously using cwmr? If so you may have been bitten by the bug a very unsightly one that generally means the death of your kindle unless you know how to repartition around a broken emmc. What did you do prior to this that caused this to happen?
Also energy is not the best for good mounting just saying...
I was using fireparted to backup my partition when my pc suddenly shut down. Thats when everything screws up. Also my data and cache are not able to check or uncheck. I hope theres a kind soul to guide me through this process
Sent from my GT-I9100 using xda app-developers app
If you ask me I would say its toast but maybe someone knows a way to restore factory partitions I know many are looking for a solution for thier parts only kindle....
From what I understand...
Code:
fastboot oem format
...will rewrite your partition table to stock. And as long as you haven't messed with the partition sizes, your data will stay intact.
Enter:
Code:
shell cat /proc/partitions
To get a list of your current partitions and sizes to check to see if they even exist to begin with. And if so, it's likely just a case of broken or missing mountpoints.
Now, whether or not "fastboot oem format" will restore broken or missing mountpoints, I couldn't tell you for sure; I've never had to try it. But in your situation, it probably couldn't hurt to try.
You can also recreate mountpoints manually if needed.
[Edit:] It has just been explained to me that "fastboot oem format" won't do anything about mountpoints.
Assuming you can get into TWRP and run adb shell, execute the following command...
Code:
adb shell parted /dev/block/mmcblk0 unit b print
Note: version 2.2.0 is missing the parted binary, so you'll need to use 2.1.1
This will give you a detailed layout of your storage device and the filesystems for each partition. I'm running from memory here, but the right column should show the filesystem types it sees for that particular partition. For userdata (which is mounted as data) and cache, those should be ext4. If you don't see that, you need to remake those partitions.
Code:
adb shell mke2fs -T ext4 /dev/block/mmcblk0p10
adb shell mke2fs -T ext4 /dev/block/mmcblk0p11
Then you can repeat the parted command above and see if the commands worked. If the commands were successful, you can use the mount command or it's probably easier to just reboot into TWRP and it should do it automatically.
kinfauns said:
Assuming you can get into TWRP and run adb shell, execute the following command...
Code:
adb shell parted /dev/block/mmcblk0 unit b print
Note: version 2.2.0 is missing the parted binary, so you'll need to use 2.1.1
This will give you a detailed layout of your storage device and the filesystems for each partition. I'm running from memory here, but the right column should show the filesystem types it sees for that particular partition. For userdata (which is mounted as data) and cache, those should be ext4. If you don't see that, you need to remake those partitions.
Code:
adb shell mke2fs -T ext4 /dev/block/mmcblk0p10
adb shell mke2fs -T ext4 /dev/block/mmcblk0p11
Then you can repeat the parted command above and see if the commands worked. If the commands were successful, you can use the mount command or it's probably easier to just reboot into TWRP and it should do it automatically.
Click to expand...
Click to collapse
Pardon me for my Noob-ness, are the code to be execute on pc or on TWRP?
dean11 said:
Pardon me for my Noob-ness, are the code to be execute on pc or on TWRP?
Click to expand...
Click to collapse
Step back a bit and figure out how all of these things work together by reading the first 3 posts here...
http://forum.xda-developers.com/showthread.php?t=1552547
It will be a lot easier for you to understand what you are doing and why you are doing them. It will also explain how and where to run the commands.
kinfauns said:
Step back a bit and figure out how all of these things work together by reading the first 3 posts here...
http://forum.xda-developers.com/showthread.php?t=1552547
It will be a lot easier for you to understand what you are doing and why you are doing them. It will also explain how and where to run the commands.
Click to expand...
Click to collapse
OH MY GOOOOD!!!! MY KINDLE IS ALIVE!!!! THANK YOU SO MUCH @kinfauns!
kinfauns said:
Assuming you can get into TWRP and run adb shell, execute the following command...
Code:
adb shell parted /dev/block/mmcblk0 unit b print
Note: version 2.2.0 is missing the parted binary, so you'll need to use 2.1.1
This will give you a detailed layout of your storage device and the filesystems for each partition. I'm running from memory here, but the right column should show the filesystem types it sees for that particular partition. For userdata (which is mounted as data) and cache, those should be ext4. If you don't see that, you need to remake those partitions.
Code:
adb shell mke2fs -T ext4 /dev/block/mmcblk0p10
adb shell mke2fs -T ext4 /dev/block/mmcblk0p11
Then you can repeat the parted command above and see if the commands worked. If the commands were successful, you can use the mount command or it's probably easier to just reboot into TWRP and it should do it automatically.
Click to expand...
Click to collapse
I have the similar situation.
And when I use "parted" to check my kidle partition, there is no cache, and the userdata is ext2.
Number Start End Size File system Name Flags
1 131072B 262143B 131072B xloader
2 262144B 524287B 262144B bootloader
3 524288B 11010047B 10485760B dkernel
4 11010048B 212336639B 201326592B ext4 dfs
5 212336640B 229113855B 16777216B recovery
6 229113856B 296222719B 67108864B ext4 backup
7 296222720B 306708479B 10485760B boot
8 306708480B 311951359B 5242880B ext4 splash
9 311951360B 848822271B 536870912B ext4 system
10 848822272B 849000447B 178176B ext2 userdata
12 2448000000B 7748000255B 5300000256B fat32 media msftres
When I use the mke2fs to change the file system type, it returns this error
Not enough space to build proposed filesystem while setting up superblock.
Please help!
Thank you in advance!
june12 said:
I have the similar situation.
And when I use "parted" to check my kidle partition, there is no cache, and the userdata is ext2.
Number Start End Size File system Name Flags
1 131072B 262143B 131072B xloader
2 262144B 524287B 262144B bootloader
3 524288B 11010047B 10485760B dkernel
4 11010048B 212336639B 201326592B ext4 dfs
5 212336640B 229113855B 16777216B recovery
6 229113856B 296222719B 67108864B ext4 backup
7 296222720B 306708479B 10485760B boot
8 306708480B 311951359B 5242880B ext4 splash
9 311951360B 848822271B 536870912B ext4 system
10 848822272B 849000447B 178176B ext2 userdata
12 2448000000B 7748000255B 5300000256B fat32 media msftres
When I use the mke2fs to change the file system type, it returns this error
Not enough space to build proposed filesystem while setting up superblock.
Please help!
Thank you in advance!
Click to expand...
Click to collapse
I don't know who or what did that to your partition table, but partitions 10-12 are not right. It looks like mke2fs is complaining because your userdata partition is only ~178KB. I'm also a bit concerned that you've extended the media partition as far as you have. You might have some additional problems there.
The easiest way for you to get started on a fix is to get into fastboot mode with FFF and run...
Code:
fastboot oem format
That will bring your partition table back to stock, so you can run those mke2fs commands to remake those filesystems on the two partitions. You'll also have to remake the media partition in parted. You can find some instructions on how to do that here...
http://forum.xda-developers.com/showthread.php?t=1658885
Hey,
My current ROM is fine, but I can't mount data & cache in TWRP.
Nothing happens when I click mount data or mount cache in TWRP 2.6.3.1
I reflashed twrp two times and checked the md5sum.
When I try to backup my rom:
When I try a factory reset:
This is what I tried in fastboot:
Code:
fastboot oem format
...
OKAY [ 0.064s]
finished. total time: 0.065s
fastboot oem idme bootmode 4000
...
OKAY [ 0.081s]
finished. total time: 0.081s
fastboot reboot
rebooting...
finished. total time: -0.000s
adb shell cat /proc/partitions
major minor #blocks name
7 0 8348 loop0
179 0 7553024 mmcblk0
179 1 128 mmcblk0p1
179 2 256 mmcblk0p2
179 3 10240 mmcblk0p3
179 4 196608 mmcblk0p4
179 5 16384 mmcblk0p5
179 6 65536 mmcblk0p6
179 7 10240 mmcblk0p7
179 8 5120 mmcblk0p8
179 9 524288 mmcblk0p9
179 10 1164288 mmcblk0p10
179 11 262144 mmcblk0p11
179 12 5254144 mmcblk0p12
179 64 512 mmcblk0boot1
179 32 512 mmcblk0boot0
254 0 8347 dm-0
The parted command isn't working for me.
I have never repartitioned them as far as I know.
Wha't wrong with my partitions?

Corrupt data partition, no network, bootloops

I'm posting this in the hope that it will help someone else. The problems I've had are different enough from other threads that this story could provide some clues for someone else. I am also using a mac, so I'm using Heimdall instead of Odin.
I have an sph-l900, galaxy note 2, on Credo Mobile which is on the Sprint network - obviously.
1. My phone started acting strangely and at some point no longer had a carrier. Red X next to the signal meter.
2. Under Status, IMEI and everything else was unknown.
Everything I read said to reset the phone to a stock rom.
Since I had TWRP, I just tried flashing the usual way from the external sdcard. What I noticed is that I was getting an error on wipe,
'can not mount /data' - this is the big clue I didn't see for a while. It's the cause of bootloops after a flash from TWRP and the cause
of the lost network.
This meant that no matter what I did, When I flashed from TWRP I got a bootloop because the Dahlvik cache was not wiped.
I had to resort to putting the phone in odin mode, and use heimdall to flash all the images.
I made a shell command out of this:
heimdall flash --RECOVERY recovery.img --CACHE cache.img --HIDDEN hidden.img --SYSTEM system.img --TOMBSTONES tombstones.img --RADIO modem.bin --BOOT boot.img --PARAM param.bin --TZSW tz.img --BOOTLOADER sboot.bin --no-reboot --verbose
You can use 'heimdall print-pit' to find out what your partition names are. They are probably uppercase like mine.
Finally I'm booting, but still no carrier. I put TWRP back and tried to mount /data. Still no good.
This means that this rom is where I'm stuck until I can get /data mounting again.
Then I added --repartition --pit T0LTE.pit to my heimdall command. This failed every time. Although repartition was clearly what I needed.
Finally, I removed the --repartition, got it working without /data so I could connect using ADB shell to try repairing /data.
1. cd /etc
2. df to see the file systems. /data is clearly missing.
/etc # df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 916024 136 915888 0% /dev
tmpfs 916024 20 916004 0% /tmp
tmpfs 916024 0 916024 0% /storage
tmpfs 916024 0 916024 0% /mnt/secure
tmpfs 916024 0 916024 0% /mnt/fuse
/dev/block/mmcblk0p12
1290112 40712 1249400 3% /cache
3. cat fstab or vold.fstab on older systems -- shows the mountpoints. So I could determine that /data was /dev/block/mmcblk0p16
/etc # cat fstab
/dev/block/mmcblk0p12 /cache ext4 rw
/dev/block/mmcblk0p16 /data ext4 rw
/dev/block/mmcblk0p13 /system ext4 rw
/dev/block/mmcblk0p14 /preload ext4 rw
4. Try to run file system check.
/etc # /sbin/e2fsck /dev/block/mmcblk0p16
e2fsck 1.41.14 (22-Dec-2010)
/sbin/e2fsck: Superblock invalid, trying backup blocks...
/sbin/e2fsck: Bad magic number in super-block while trying to open /dev/block/mmcblk0p16
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
4. Get info about the file system. with make file system.
/etc # /sbin/mke2fs -n /dev/block/mmcblk0p16
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
5136 inodes, 20480 blocks
1024 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=20971520
3 block groups
8192 blocks per group, 8192 fragments per group
1712 inodes per group
Superblock backups stored on blocks:
8193
5. Try file system check with the superblock backup.
/etc # /sbin/e2fsck -b 8193 /dev/block/mmcblk0p16
e2fsck 1.41.14 (22-Dec-2010)
/sbin/e2fsck: Invalid argument while trying to open /dev/block/mmcblk0p16
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
6. I have no choice but to try to restore the superblocks. mke2fs with -S will try to do that. I added the block size and groups
from the previous report, but I don't think they were necessary.
etc # mke2fs -b 1024 -g 8192 -S /dev/block/mmcblk0p16
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=
OS type: Linux
Block size=1024 (log=0)
Fragment size=1024 (log=0)
Stride=0 blocks, Stripe width=0 blocks
5136 inodes, 20480 blocks
1024 blocks (5.00%) reserved for the super user
First data block=1
Maximum filesystem blocks=20971520
3 block groups
8192 blocks per group, 8192 fragments per group
1712 inodes per group
Superblock backups stored on blocks:
8193
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 37 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
7. Run file system check again to repair any damage. Answer y to any questions.
/etc # /sbin/e2fsck /dev/block/mmcblk0p16
e2fsck 1.41.14 (22-Dec-2010)
/dev/block/mmcblk0p16 contains a file system with errors, check forced.
Resize inode not valid. Recreate<y>? y
yes
Pass 1: Checking inodes, blocks, and sizes
Root inode is not a directory. Clear<y>? yes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Root inode not allocated. Allocate<y>? y
yes
/lost+found not found. Create<y>? yes
Pass 4: Checking reference counts
Pass 5: Checking group summary information
Block bitmap differences: +(1--298) +(8193--8489) +(16385--16600)
Fix<y>? y
yes
Free blocks count wrong for group #0 (7893, counted=7892).
Fix<y>? yes
Free blocks count wrong (19667, counted=19666).
Fix<y>? y
yes
Inode bitmap differences: +1 +(3--10)
Fix<y>? yes
Free inodes count wrong for group #0 (1711, counted=1701).
Fix<y>? y
yes
Directories count wrong for group #0 (1, counted=2).
Fix<y>? yes
Free inodes count wrong (5135, counted=5125).
Fix<y>? y
yes
/dev/block/mmcblk0p16: ***** FILE SYSTEM WAS MODIFIED *****
/dev/block/mmcblk0p16: 11/5136 files (0.0% non-contiguous), 814/20480 blocks
8. Mount data and check to see everything is ok.
/etc # mount /data
/etc # df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 916024 136 915888 0% /dev
tmpfs 916024 20 916004 0% /tmp
tmpfs 916024 0 916024 0% /storage
tmpfs 916024 0 916024 0% /mnt/secure
tmpfs 916024 0 916024 0% /mnt/fuse
/dev/block/mmcblk0p12
1290112 40712 1249400 3% /cache
/dev/block/mmcblk0p16
19827 161 18642 1% /data
9. Exit, reboot to Odin mode, Reflash the ROM with heimdall/odin just like before. - leave off the --repartition --pit...
10. Reboot.
I now have an almost working phone. It actually has a network connection. It would be safe at this point to call your phone service
tech support and have them walk you through setting up your phone again.
I do not know what it takes for other phones, but with the note 2, I removed the battery while it was booted up to force an network update.
This gave me a new PRL and set my phone number along with everything else. I now had a working phone,
but for some reason no data service.
11. Turn off wifi, update profile. I get session in progress error.
12. Remove battery while booted, wifi off.
13. Reboot. update profile again. data network established.
That's pretty much it. In a nutshell, I had a corrupt filesystem on /data. The initial indicator of this was no carrier signal with an X on it.
This also caused bootloops when reflashing from TWRP/CWM.
Restoring the /data filesystem and flashing a stock rom restored the carrier and allowed a PRL and Profile update to get the phone working again.
Don't turn on wifi right away, let the phone update the PRL and Profile, and get everything working first.

nexus with broken file system, cannot wipe

Hi everybody,
I'm in deep troubles with my nexus (maguro).
Yesterday, it started to reboot after showing for about 5-10 seconds the lock screen.
the phone is rooted, Iand the last rom (cyanogenmod) was running stable in the last 6 months.
twrp 2.8.0.1 was installed, so I Rebooted to fastboot to flash the 2.8.6.0.
And then the weird part begins:
it's like every partition is read only, but from the mount command it doesn't look like it.
flashing the new recovery is a success, but after reboot the 2.8.0.1 is still there.
factory reset successful, and everything is like before.
wiping sdcard, nothing happens.
if I try to create a backup in twrp, it fails after 20 seconds or so. (I've copied everything to the pc using the pull command in adb).
Try to fix or to change the partitions filesystem in twrp doesn't change anything.
I tried also to change the file system in parted, through the adb shell,this happens:
Code:
~ # ←[6nparted /dev/block/mmcblk0p12 mkfs ext2
parted /dev/block/mmcblk0p12 mkfs ext2
Warning: The existing file system will be destroyed and all data on the
partition will be lost. Do you want to continue?
parted: invalid token: ext2
Yes/No? yes
yes
yes
Partition number? 1
1
1
File system type? [ext2]?
Error: File system was not cleanly unmounted! You should run e2fsck. Modifying
an unclean file system could cause severe corruption.
Ignore/Cancel? i
i
i
Error: File system has an incompatible feature enabled. Compatible features are
has_journal, dir_index, filetype, sparse_super and large_file. Use tune2fs or
debugfs to remove features.
You found a bug in GNU Parted! Here's what you have to do:
Don't panic! The bug has most likely not affected any of your data.
Help us to fix this bug by doing the following:
Check whether the bug has already been fixed by checking
the last version of GNU Parted that you can find at:
...
Please check this version prior to bug reporting.
If this has not been fixed yet or if you don't know how to check,
please visit the GNU Parted website:
...
for further information.
Your report should contain the version of this release (1.8.8.1.179-aef3)
along with the error message below, the output of
parted DEVICE unit co print unit s print
and the following history of commands you entered.
Also include any additional information about your setup you
consider important.
Error: SEGV_MAPERR (Address not mapped to object)
Aborted
and of course nothing changes.
so, I have access to adb in recovery and to fastboot, there is a way to wipe completely the filesystem and start from scratch, or load a different kernel, that would help?
If I send with adb push a new rom to the sdcard, twrp fails and at the next reboot the files disappear.
this is my mount result:
Code:
~ # ←[6nmount
mount
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,seclabel,nosuid,relatime,mode=755)
devpts on /dev/pts type devpts (rw,seclabel,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,seclabel,relatime)
selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime)
tmpfs on /tmp type tmpfs (rw,seclabel,relatime)
/dev/block/mmcblk0p11 on /cache type ext4 (rw,seclabel,relatime,user_xattr,barri
er=1,data=ordered)
/dev/block/mmcblk0p12 on /data type ext4 (rw,seclabel,relatime,user_xattr,barrie
r=1,data=writeback)
/dev/block/mmcblk0p12 on /sdcard type ext4 (rw,seclabel,relatime,user_xattr,barr
ier=1,data=writeback)
/dev/block/mmcblk0p10 on /system type ext4 (rw,seclabel,relatime,user_xattr,barr
ier=1,data=ordered)
and remounting in rw the partitions has no effect.
Even the parted, e2fsck, etc files disappear from /sbin after each reboot.
thank you
edit:
Having a second nexus, I could take a look at the partitions, and the difference seems to be the data=writeback options.
I'm looking for a procedure to make them "ordered" as the other phone.
edit2:
Code:
/tmp # ←[6ntune2fs -l /dev/block/mmcblk0p12 | grep features
tune2fs -l /dev/block/mmcblk0p12 | grep features
__bionic_open_tzdata: couldn't find any tzdata when looking for localtime!
__bionic_open_tzdata: couldn't find any tzdata when looking for GMT!
__bionic_open_tzdata: couldn't find any tzdata when looking for posixrules!
Filesystem features: has_journal ext_attr resize_inode filetype needs_recov
ery extent sparse_super large_file
/tmp # ←[6ne2fsck -f /dev/block/mmcblk0p12
e2fsck -f /dev/block/mmcblk0p12
e2fsck 1.42.9 (28-Dec-2013)
/dev/block/mmcblk0p12: recovering journal
Superblock needs_recovery flag is clear, but journal has data.
Run journal anyway<y>? y
y
yes
e2fsck: unable to set superblock flags on /dev/block/mmcblk0p12
/dev/block/mmcblk0p12: ********** WARNING: Filesystem still has errors *********
*
/tmp #
/tmp # ←[6ntune2fs -O ^has_journal /dev/block/mmcblk0p12
tune2fs -O ^has_journal /dev/block/mmcblk0p12
tune2fs 1.42.9 (28-Dec-2013)
The needs_recovery flag is set. Please run e2fsck before clearing
the has_journal flag.
Stuck here at the moment, cannot set superblock flags..
edit3:
Tested every possible superblock position, no luck.
I'm starting to think that the internal memory could be dead, but the phone in fastboot and recovery mode works fine.
I forgot to say that I've tried also the fastboot -w command, it works a lot (about 270 seconds) but no effect.

Trying to flash a dd image I took from the system partition

Long-time UNIX guy here, but relatively new to the world of Android.
I have recently purchased an Asus MemoPAD (ME103K) ; I then became root, and took a `dd` image of the read-only `system` partition to the external SD card:
Code:
$ su
# dd if=/dev/block/platform/msm_sdcc.1/by-name/system \
of=/storage/MicroSD/system.img bs=1M
# ls -l /storage/MicroSD/system.img
-rw-r--r-- 1 root root 2147483648 Sep 27 13:15 system.img
The size (exactly 2GiB) was a bit suspicious - could it be that this was because of the FAT32 partition on the SD card?
No, it was not - `tune2fs -l` revealed that this was indeed, a valid EXT4 image, exactly sized at 2GiB, which passed `fsck -f` with no errors at all.
And `fastboot` (from the linux machine attached to the tablet) concurred, after an `adb reboot bootloader`:
Code:
linuxbox# fastboot getvar all
(bootloader) version-bootloader: 3.03
(bootloader) version-hardware: rev_c
(bootloader) variant: LEOPARDCAT 16G
(bootloader) version-baseband: H00_0.16.F_0521
(bootloader) serialno: 0a3dXXXX
...
(bootloader) partition-type:system: ext4
(bootloader) partition-size:system: 0x0000000080000000
That size, is indeed 2GB:
Code:
linuxbox# python2 -c 'print 0x0000000080000000'
2147483648
So, all is good - I have a backup of the image. Now to test restoring it.
I try to flash the system.img back to the tablet - to make sure I can recover from anything, the sort of bullet-proof backup we do in the Unix world (*e.g. restore contents of a drive via `dd if=backup.image of=/dev/sdXXX`*).
Everything related to `adb` and `fastboot` work flawlessly - so I try...
Code:
linux_box# fastboot devices
0a3dXXXX fastboot
linux_box# mount /dev/sdcard /mnt/sdcard
linux_box# cp /mnt/sdcard/system.img .
linux_box# fastboot flash system system.img
error: cannot load 'system.img'
Hmm. I download and build the `android-tools-5.1.1` of my distribution from sources, adding debug information - and step in the debugger, to see this failure:
Code:
# gdb --args fastboot flash system system.img
...
(sorry, can't paste links yet - see this image: http i stack imgur com 9bIEM.png
Interesting - even though I am in a 64bit machine, apparently there are issues that turn the file size "negative" (in a 32bit world, the file size of my image, 2^31, is indeed considered negative - to be exact, `-2147483648`.
OK, fine - how do they flash large image files in Android?
Googling, searching - turns out they use this `make_ext4fs` tool, that creates flashable images. In fact it is part of what I just compiled, so I might as well use it:
Code:
# mkdir /system
# mount -o loop,ro system.img /system
# ls -l /system
total 208
drwxr-xr-x 106 root root 8192 Sep 17 22:24 app
drwxr-xr-x 3 root 2000 8192 Sep 26 21:08 bin
-rw-r--r-- 1 root root 6847 Sep 12 16:59 build.prop
drwxr-xr-x 19 root root 4096 Sep 26 21:08 etc
drwxr-xr-x 2 root root 4096 Aug 11 22:27 fonts
drwxr-xr-x 4 root root 4096 Sep 12 16:56 framework
drwxr-xr-x 10 root root 16384 Sep 12 16:59 lib
drwxr-xr-x 2 root root 4096 Jan 1 1970 lost+found
drwxr-xr-x 3 root root 4096 Aug 11 22:18 media
drwxr-xr-x 59 root root 4096 Aug 11 22:29 priv-app
-rw-r--r-- 1 root root 126951 Aug 1 2008 recovery-from-boot.p
drwxr-xr-x 3 root root 4096 Aug 11 21:02 scripts
drwxr-xr-x 3 root root 4096 Aug 11 21:02 tts
drwxr-xr-x 11 root root 4096 Sep 26 21:08 usr
drwxr-xr-x 8 root 2000 4096 Aug 11 22:29 vendor
drwxr-xr-x 2 root 2000 4096 Sep 26 21:09 xbin
# ../extras/source/extras/ext4_utils/make_ext4fs \
-l 2048M new_system.img /system
Creating filesystem with parameters:
Size: 2147483648
Block size: 4096
Blocks per group: 32768
Inodes per group: 8192
Inode size: 256
Journal blocks: 8192
Label:
Blocks: 524288
Block groups: 16
Reserved block group size: 127
Created filesystem with 2666/131072 inodes and 375014/524288 blocks
Cool - so I can apparently build system images from plain old folders. The sky will be my limit - I'll be able to add anything I want to this image.
Let's burn it...
Code:
# fastboot flash system new_system.img
erasing 'system'...
OKAY [ 0.064s]
sending 'system' (2088960 KB)...
^C
I waited for 1h before hitting that Ctrl-C. And had to power-cycle the tablet, which booted back in fastboot mode.
This is not looking good.
What if I build a smaller image? Maybe the 2GB are somehow an issue, and this partition is not used to full capacity - it has free space:
Code:
# ../extras/source/extras/ext4_utils/make_ext4fs \
-l 1536M new_system.img /system
# ./fastboot flash system system.img
erasing 'system'...
OKAY [ 0.065s]
sending 'system' (1572864 KB)...
OKAY [ 51.039s]
writing 'system'...
OKAY [235.080s]
finished. total time: 286.183s
OK, this looks very promising (and only took 5 min). I guess I can now reboot back and everything should be normal, yes?
No
(sorry, can't paste links yet - see this image: http i stack imgur com U7wiX.png
I don't mind a temporarily bricked device, as long as I **do** get to control it in the end (machines that I am not a master of, are machines I don't care to operate
Any ideas on what I did wrong and what I can do to fix this?
Thanks in advance.
P.S. I checked the Asus support page for my tablet - they only provide the sources for the kernel, and the Over-the-air .zip file. That in turn contains a file-system level backup from the root - i.e. the `system` folder exists in there as just a folder, not an image, not a `system.img` that I can flash - so that doesn't really help me.
[SOLVED] Booted from external sd.
I documented how I solved it in android stack exchange, article 124344 (can't post links - the url is formed from .... http android.stackexchange.com questions 124344 trying-to-flash-a-system-img-i-took-with-dd-failing )
Executive summary - I edited my custom boot image /fstab.qcom to point /system to the external SD card, and dd-ed my image there.

Pixel 3 XL softbricked after Android 12 update. TWRP stuck at splashscreen. How to rescue data?

Hi,
today, I received an OTA update for my Pixel 3 XL (I had rooted and unlocked it before). The phone boots up, but right before the PIN/fingerprint screen appears, the UI flickers a few times and apparently crashes, causing the device to reboot infinitely. A similar problem is reported here:
Does anyone have a serious bug in the Lock Screen since android 12 was installed? Using Pixel 5 - Google Pixel Community
support.google.com
I guess the problem would be solved if I flashed with -w (a full factory reset), but I do not want to wipe before saving some important data such as WhatsApp backup. I have my WhatsApp backup at Google, but on Google Drive it shows me a gray triangle with an exclamation mark next to the entry for WhatsApp (see attachment) and according to some users on Reddit, restoring the backup did not work for some people who had that gray triangle. Can somebody confirm that the backup did work despite having that gray triangle? (In Google Drive, click the gear symbol on the right top and go to "Applications", then scroll down to WhatsApp).
I tried re-flashing the factory image of android 12 (without -w) without success.
I also tried flashing the factory image of android 11, but after that I only get an infinite google logo loading screen.
I also downloaded the most recent TWRP and flashed it (fastboot flash boot twrp.img), but it is always stuck at the splashscreen. In this state, however, I can at least enter the adb shell. I have root access to the system, but I cannot mount the data partition (probably it is encrypted somehow). "twrp mount" fails with the error message saying that TWRP is not running (which is probably true since it is stuck at the splashscreen).
Code:
1|crosshatch:/ # twrp mount
TWRP does not appear to be running. Waiting for TWRP to start . . .
Press CTRL + C to quit.
Contents of /etc/fstab
Code:
/dev/block/dm-0 /system_root ext4 ro 0 0
/dev/block/dm-1 /vendor ext4 ro 0 0
/dev/block/dm-2 /product ext4 ro 0 0
/dev/block/sda20 /metadata ext4 rw 0 0
/dev/block/sda21 /data f2fs rw 0 0
/auto0 vfat rw 0 0
/dev/block/sdf2 /persist ext4 rw 0 0
ls /dev/block:
Code:
crosshatch:/ # ls /dev/block/by-name
ALIGN_TO_128K_1 aop_a boot_b cmnlib_b dip fsg keystore misc modemst2 product_b sdc splash storsec_b tz_b vendor_a xbl_config_b
ALIGN_TO_128K_2 aop_b cdt ddr dtbo_a hyp_a klog modem_a msadp_a qupfw_a sdd spunvm system_a uefivar vendor_b
ImageFv apdp_a cmnlib64_a devcfg_a dtbo_b hyp_b limits modem_b msadp_b qupfw_b sde ssd system_b userdata xbl_a
abl_a apdp_b cmnlib64_b devcfg_b frp keymaster_a logfs modemcal persist sda sdf sti toolsfv vbmeta_a xbl_b
abl_b boot_a cmnlib_a devinfo fsc keymaster_b metadata modemst1 product_a sdb sec storsec_a tz_a vbmeta_b xbl_config_a
I assume the "userdata" device (which symlinks to /dev/block/sda21) to contain my data, however I'm not sure about it.
The normal mount command does not work either:
Code:
crosshatch:/ # mount -o rw /dev/block/bootdevice/by-name/userdata /data
mount: /dev/block/bootdevice/by-name/userdata: need -t
1|crosshatch:/ # mount -t ext4 -o rw /dev/block/bootdevice/by-name/userdata /data
mount: '/dev/block/bootdevice/by-name/userdata'->'/data': Invalid argument
1|crosshatch:/ # mount -t f2fs -o rw /dev/block/bootdevice/by-name/userdata /data
mount: '/dev/block/bootdevice/by-name/userdata'->'/data': Invalid argument
I executed:
Code:
adb pull /dev/block/bootdevice/by-name/userdata userdata.img
This succeeded and I got a ~50GB file. Can I mount or decrypt this somehow on my PC?
Thanks and have a nice day!

Categories

Resources