3

I have a Google Nexus 7 (2012) which for no apparent reason entered an endless reboot loop. Trying to fix it with a fresh install of the OS via TWRP, I unintentionally messed up the partition table.

Now the device doesn't even show the Google startup screen. The screen stays bare dead whatever I try (power + volume down, up, upsidedown, usb plugged in, immersed in Coke, boiled...).

Is there a relatively inexpensive way to interact with an android device that has its partition table damaged? (Of course, it is not detected by adb.)

details

Probably they don't add much to the description of the problem, but for the sake of completeness, here are the latest steps of this tragedy.

Connected as root via adb I used parted to try and enlarge the size of the system partition (because the OS image didn't fit the system partition). It returned an error saying that it did not recognize the disk label.

/system/bin/sdparted # ./parted /dev/block/platform/sdhci-tegra.3/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
p
Error: /dev/block/mmcblk0: unrecognised disk label
(parted) quit
quit

So I reverted to fdisk, not really knowing what I was doing. It asked if I wanted to write a new label and it seemed a good idea to me to do so and I persisted the change. (In retrospective I see it wrote a DOS partition, which doesn't sound as good)

/system/bin/sdparted # fdisk -u /dev/block/mmcblk0
Device contains neither a valid DOS partition table, nor Sun, SGI, OSF or GPT disklabel
Building a new DOS disklabel. Changes will remain in memory only,
until you decide to write them. After that the previous content
won't be recoverable.


The number of cylinders for this disk is set to 481024.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
   (e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): write
The partition table has been altered.
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy

Then I switched back to parted, which had an apparently nicer output:

/system/bin/sdparted # ./parted /dev/block/platform/sdhci-tegra.3/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) p
p
Model: MMC HAG2e (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start  End  Size  Type  File system  Flags

(parted) quit
quit
/system/bin/sdparted # exit

I rebooted and from that moment on the tablet shows no signs of life.

Antonio
  • 131
  • 2
  • you probably don't read the disclaimer "Warning: Re-partitioning your Android may lead to a complete breakage of your device software and may render it unbootable!" – alecxs Jun 05 '19 at 16:25
  • try to get it in bootloader mode with the proper key combo. try to flash from fastboot https://developers.google.com/android/images – alecxs Jun 05 '19 at 16:29
  • Extending the partition seemed to be my only option, because for some reason the system partition was a few MB smaller than the (original!) image I was trying to reset to. – Antonio Jun 07 '19 at 07:39
  • And it doesn't get to bootloader mode, the screen looks dead. And the usb port doesn't respond well. Even if the OEM driver is up to date, Windows 10 returns a device descriptor request failed error. Playing with partitions I may have messed up things at a rather fundamental level... – Antonio Jun 07 '19 at 07:47
  • maybe you can use the tegra-uboot-flasher to get bootloader mode back, but this is out of my knowledge and just speculation https://android.stackexchange.com/questions/212832/is-there-a-way-to-enable-usb-debugging-from-fastboot/212838#comment272476_212838 – alecxs Jun 07 '19 at 12:34
  • Thanks for the hint and sorry for the late reply. I had no idea that fastboot can connect in cases when adb can't. I spent these days trying to let it connect with fastboot but with no success, the tablet doesn't even enter in bootloader mode. – Antonio Jun 13 '19 at 09:19
  • you need to flash/or exec U-Boot from tegrarcm via tegra-uboot-flasher-scripts – alecxs Jun 13 '19 at 10:12
  • thanks, I thought a prerequisite was entering in bootloader mode (which I can't). However, even if was able to do so, I have a Windows host (not Linux), and on top of that tegra-uboot requires a few dependencies which makes it a bit harder. I might use a virtualized Linux but my (poor) understanding of the situation indicates that the essential problem is the inability to connect via usb in any way. The device doesn't respond to my pc driver's request. I was able to put the table in APX mode so its driver deviceid is USB\VID_0955&PID_7330, but I cannot find any official APX driver for Windows. – Antonio Jun 19 '19 at 07:33
  • nope, you don't need bootloader mode. consider UNetbootin (bootable USB flash drive) https://unetbootin.github.io / here is a linux tutorial for nvflash: https://forum.xda-developers.com/showthread.php?t=1879228 – alecxs Jun 20 '19 at 11:31
  • ok, thanks. So no need for bootloader mode. I understand nvflash is not so straightforward. The XDA-developer's post you pointed at seems to fail in the end. Before flashing one need to have exported a few crucial files. I understand it is at the very least the BCT, a segment of code that enables the chipset to run the bootloader code. And I cannot find official Windows drivers for APX mode, which is the only way it promises to connect to my PC. (I'd rather not install unofficial drivers, for my PC's and tablet sake). – Antonio Jun 25 '19 at 08:05
  • you can set up a sandbox PC if you are afraid about unofficial drivers, or Xubuntu 18.04 live distro (via UNetbootin, as i wrote) – alecxs Jun 25 '19 at 08:27
  • Ok, I may use a "disposable" OS to help prevent malicious code from hacking my PC (and it is handy the UNetbootin you suggested), but what about code potentially injected in the tablet by the driver? Also, I am rather surprised that Asus or NVidia do not offer any easy-to-use solution to factory reset the device (at a level lower than fastboot and adb). But I see it is my fault in the end, I entered an area of which I have no clue... – Antonio Jun 25 '19 at 11:19
  • the default easy-to-use solution for factory reset is: complete bootable system image (read-only) = ROM / compared to a computer this is similar to BIOS. All apps and user content on userdata partition (wipe-able), similar to hard drive. You can expect the same support for bricked rooted phone, as you would expect for bricked mainboard with self-written BIOS. Thats why bootloader is locked – alecxs Jun 25 '19 at 12:03
  • Maybe this will help you a little N7 Unbricking Information here the link to the links (scroll down) https://forum.xda-developers.com/showpost.php?p=53554719&postcount=3 – alecxs Jul 04 '19 at 07:37
  • thanks, it turned up so complex... I feel I must me a firmware hacker to solve this. – Antonio Aug 27 '19 at 06:19

0 Answers0