yashsingh1/xdaforums huggingface dataset:
[Kindle Fire Android Development] vbdss:
LIFT OFF, WE HAVE A LIFT OFF! Rom started, eveything seens to work.

I think it all started to work when i used fastboot erase cache, userdata, system, sdcard. Then could use fastboot oem format, run very fast, but done something to partitions. Next i could access USB Mass Storage trough TWRP.

Then i had access to TWRP UI, thats when parted and idme ? reported to work alright, like it should.

Then i played a bit with the start and end of data partition, to get out of the faulty block zone, then the cache and sdcard was only completed.

Using FFF 1.4a by Hashcode, TWRP 2.1.1, fastboot worked after i played a bit with drivers on windows.

Hashcode, Pokey9000, forest1971 and others that helped, thank you.

One final question, then i am all yours to ask and be more than a lab rat.

Is there anyway to find which blocks are fault so that i can pass only the ones faulty?
[Kindle Fire Android Development] forest1971:
Glad to see that re-partition workaround works :), after parted can be run. Congratulations!
[Kindle Fire Android Development] sthomas38:
Nice! :)
[Kindle Fire Android Development] lovejoy777:
as soon as i get back. thankyou:-)

edit:just backread posts well done guys.

vbdss great news mate.

ok im back ill post dev51 rules.
[Kindle Fire Android Development] vbdss:
Now i will start the digging process to try to find where the faulty blocks are, if i try to create a partition from 849 to 2500 and play with the start numbers only, i will be able to find the blocks right? This will not break anything?
[Kindle Fire Android Development] forest1971:
You can rm cache, data, and media partition and recreate them again and again.

Just need to make sure they maintain name and order so that the system can recognize them correctly.
[Kindle Fire Android Development] jsantiago.antonio:
congrats! i'm gonna work on mine later tonight when i get home from work and follow the steps vbdss did. Let's hope for the best :D!
[Kindle Fire Android Development] vbdss:
i understand it. but i dont wanna mess with them again, just wanna try to find the spot where the fault blocks are, so that then i can mess with the others.

I wanna try to create a partition from the space that i left alone on the resize

Remeber, the start of my data partition may not be the same of yours, so try other values
[Kindle Fire Android Development] lovejoy777:
# adb protocol for blaze / ottter (Amazon Kindle Fire)

SUBSYSTEM=="usb", ATTR{idVendor}=="1949", ATTRS{idProduct}=="0006", MODE="0666", OWNER="root", GROUP="androiddev", SYMLINK+="android%n"

is this correct?

just something i mentioned earlier and thought you may of missed it. but my fastboot was not working since i had to use usb firekit two weeks ago because fff1.4 put me in semi brick.

edit: this is my adb_usb ini file.

# ANDROID 3RD PARTY USB VENDOR ID LIST -- DO NOT EDIT.

# USE 'android update adb' TO GENERATE.

# 1 USB VENDOR ID PER LINE.

0x1949

this in .bashrc

fi

# Android tools

export PATH=$PATH:~/android-sdk-linux/tools

export PATH=$PATH:~/android-sdk-linux/platform-tools
[Kindle Fire Android Development] Hashcode:
Add this underneath that (in /etc/udev/rules.d/51-android.rules):

# Kindle Fire fastboot (Google ID)

SUBSYSTEM=="usb", ATTR{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
[Kindle Fire Android Development] vbdss:
Do we need a 1gb userdata partition? Now that i lost almost 1.3gb can i shrink the userdata partition?

The same question for cache, 256mb of cache is alright?
[Kindle Fire Android Development] lovejoy777:
thanks hash and sorry guys it was my fault i now have fastboot:-)

im going to start fastboot erase now.

i may need a few more pointers as vbdss seems a little sharper with all this.

i will backtrack and follow earlier posts. :-)))))

EDIT: any tips before i start?
[Kindle Fire Android Development] vbdss:
Maybe pray?

Just start with fastboot erase then oem format
[Kindle Fire Android Development] dangal:
Congratulations to all who have worked together to solve this problem, this is a team!
[Kindle Fire Android Development] lovejoy777:
steve@lovejoyub:~$ fastboot erase userdata

< waiting for device >

erasing 'userdata'... OKAY

steve@lovejoyub:~$ fastboot erase cache

erasing 'cache'... OKAY

steve@lovejoyub:~$ fastboot erase system

erasing 'system'... OKAY

steve@lovejoyub:~$ fastboot erase media

erasing 'media'... OKAY

steve@lovejoyub:~$ adb shell

* daemon not running. starting it now on port 5037 *

* daemon started successfully *

~ # idme ?

<================== idme nvram info ==================

Name	offset	value

----------------------------------|---|---|---|---|---|

steve@lovejoyub:~$ fastboot erase sdcard

< waiting for device >

erasing 'sdcard'... FAILED (remote: : partition doesn't exist)

steve@lovejoyub:~$

cache took 122s all the rest only took 1 second
[Kindle Fire Android Development] vbdss:
You forgot to run fastboot oem format

btw dont know what happened but after i run fastboot oem format again, suddenly some previous faulty part started to work again

EDIT: forget, wasnt right, now twrp cant mount cache and data
[Kindle Fire Android Development] lovejoy777:
steve@lovejoyub:~$ fastboot oem format

< waiting for device >

... OKAY

steve@lovejoyub:~$ fastboot erase userdata

erasing 'userdata'... OKAY

steve@lovejoyub:~$ fastboot erase cache

erasing 'cache'... OKAY

steve@lovejoyub:~$ fastboot erase system

erasing 'system'... OKAY

steve@lovejoyub:~$ fastboot erase media

erasing 'media'... OKAY

steve@lovejoyub:~$ fastboot erase sdcard

erasing 'sdcard'... FAILED (remote: : partition doesn't exist)

steve@lovejoyub:~$

did you do a reboot before issuing adb shell, idme ?. ?
[Kindle Fire Android Development] Hashcode:
vbdss: fastboot oem format will reset your partition tables so that it will try and use the entire area again.
[Kindle Fire Android Development] Hashcode:
I believe he ran parted next, then e2fsck?
[Kindle Fire Android Development] androidcues:
Not sure if this is relevant, but this was a big tool in the Dream/Sapphire days--

fastboot erase system -w

takes care of boot, system, data and cache.

It appears to be a more sterile wipe because you may miss the junk in the corners and in between partitions, (rhetorically speaking) It was a staple command in Firerat's CustomMTD development and to this day I use that on every device (provided it is S-OFF, which the KF obviously is)

btw - Just saw this thread, and its one of the best I have seen -- I almost want to brick my KF right now and dive in... which I will if you need more tests. I love fastboot and I have yet to lose a war with the KF drivers (they aggravate me to no end but I always get them!)
[Kindle Fire Android Development] vbdss:
Dont remember now, but try to reboot fastboot reboot

ok, just got back to where i were then, userdata, cache and media alright

I think i rebooted then tried parted /dev/block/mmcblk0 then print

and on adb shell idme ?

And i dont think that bricking the kindle the same way is a good idea now, i lost almost 1.3 gb of storage
[Kindle Fire Android Development] Stage:
This has been amazing to watch.
[Kindle Fire Android Development] kostos:
vbdss you are so lucky

mine

1. fastboot oem format

2. fastboot erase system -w

3. fastboot reboot (device doesn't reboot - only continously repeats OS sound of disconnecting/connecting to usb port)

4. powering off with the button and choosing recovery againg hungs at TWRP logo

I use TWRP 2.1.1 and FFF1.4A
[Kindle Fire Android Development] bowen873:
I'm in the same boat. I've been following the thread, but I'm not as technical. Maybe once someone else gets it they can document the steps in order and what tools are needed. I can run fastboot commands, but for some reason ADB doesn't see my device.
[Kindle Fire Android Development] vbdss:
If ADB and Fastboot doesnt work when using TWRP then its something with the drivers

Try in this order:

fastboot erase system

fastboot erase cache

fastboot erase userdata

fastboot erase data

fastboot erase sdcard

fastboot erase media

fastboot oem format

Then fastboot reboot

Then into adb shell

parted /dev/block/mmcblk0

then print

Should appear all partitions

then try on adb shell

idme ?

should appear everything too, not a blank table

But foremost you should try

dmesg | grep mmc0 to see if emmc still ok

i gotta go now
[Kindle Fire Android Development] kostos:
i think there should be another reason why vbdss won

someone else managed to restore with instructions of vbdss?
[Kindle Fire Android Development] lovejoy777:
bollax same here. (i got so excited, then came back down with a thud).
[Kindle Fire Android Development] kostos:
this commands are useless - such partitions don't present on KF, this is mount points of partitions userdata and media
[Kindle Fire Android Development] lovejoy777:
steve@lovejoyub:~$ adb shell

~ # dmesg | grep mmc0

<6>[ 2.329559] mmc0: new high speed DDR MMC card at address 0001

<6>[ 2.355316] mmcblk0: mmc0:0001 M8G2FA 7.20 GiB

~ #

what does this mean?
[Kindle Fire Android Development] kostos:
this means that your eMMC appeares to be ok
[Kindle Fire Android Development] Entropy512:
vbdss and others who experienced issues, IF you can get booted into a kernel with working ADB, can you try the following?

cat /sys/class/block/mmcblk0/device/name
cat /sys/class/block/mmcblk0/device/cid

and post the output of both?

I'm curious if the M8G2FA in parted is the same as the "name" above - because M8G2FA looks eerily similar to MAG4FA - and MAG4FA fwrev 0x19 has a known documented defect that causes symptoms similar to yours.
[Kindle Fire Android Development] kostos:
cat /sys/class/block/mmcblk0/device/name

M8G2FA

cat /sys/class/block/mmcblk0/device/cid

1501004d384732464111c00bcd769e87
[Kindle Fire Android Development] pokey9000:
From vbdss's cid posted earlier, and the field location on that other part, this would be fwrev 0x11

TIL my phone is affected...
[Kindle Fire Android Development] lovejoy777:
ok i have exhausted all attempts at vbdss's method, mine must be slightly different.

good luck all time for some zzzzzzzzzzzz. thanks again.
[Kindle Fire Android Development] Hashcode:
Entrophy pointed this out in the IRC channel and I felt it was good general knowledge for anyone who is now experiencing emmc issues:

http://xdaforums.com/showthread.php?t=1644364

We do not have matching emmc chips (from what i can tell) but this thread reads like our issue:

- Users of ICS-based CWMR (5.5.0.4) experience a lockup during factory reset and following that are unable to mount several partitions due to data corruption.

- The trigger for this "bad" behaviour: starting with ICS the recovery code that CWMR is based on was modified to be a bit more aggressive during data/cache formats.

There's a lot of detailed reading in there and I'm doing my best to sort of cobble together what I can.

Entrophy has sent me a set of changes which can supposedly prevent this corruption from happening, but does somewhat gimp the mmc a bit in the process (not sure of the side-affects).
[Kindle Fire Android Development] Entropy512:
The negative side effect is that you don't get the performance benefits of ERASE, and also, doing a factory wipe won't eliminate private data (this is why Google added the erase) - but TWRP already isn't doing this (if it were, it would be dangerous too).

If the device is running reliably with affected flash chips - most likely the ERASE command was never being used on it in the first place. So I don't believe an actual performance hit will be seen because in all "safe" configurations, the ERASE command wasn't being used to begin with.

So far it looks like all who had issues had M8G2FA - Did anyone who had issues have MMC08G like myself?

Seems like some people have Samsung eMMC chips, some people have others. (M8G2FA looks like a Samsung part - it's similar to MAG4FA)

Oh yeah - if it IS the same eMMC bug - a fastboot erase will not only not fix the problem (there is no known fix), it may make it worse, or trigger it for those who aren't yet encountering it. (Google discovered the bug initially doing fastboot erase cycles on Galaxy Nexus prototypes)
[Kindle Fire Android Development] Entropy512:
I just noticed you had an I777 - fortunately, so far, nearly every ICS kernel released for I777 was based on the I9100 Update4 sources, which are safe due to MMC_CAP_ERASE not being enabled. (Basically, removing that flag is the patch I pullreqed to Hashcode.)

The exception is the UCLD3 leak - I don't know if you remember the UCLD3 repack fiasco. That was this bug. UCLD4 is probably dangerous too, which is why all of the devs in the leak thread basically said "I'm not touching that kernel!" :)

Obviously, we can't guarantee that the patch I sent Hashcode is guaranteed since we don't know for sure that it's the exact same bug - but it really sounds, based on the trigger conditions, symptoms, and the similarity of M8G2FA to MAG4FA, that this is the same issue.
[Kindle Fire Android Development] MayfairDROID:
So for now, if we have hash's cwm, should we change back to twrp?
[Kindle Fire Android Development] lovejoy777:
i would but be carefull and i advise against doing a back up or anything. just reflash twrp.

it dosn't sound good:-(

vbdss you lucky sod:-) "by the skin of your teeth" lol
[Kindle Fire Android Development] Entropy512:
If you have a M8G2FA flash chip - ABSOLUTELY. Don't mess with it until hash rereleases with the kernel patch I sent him. (Even then - while it seems like it's the same problem as Samsung Superbrick, there's a possibility it's not and things will still go wrong.)

If you have MMC08G like myself - you may be safe, but no guarantees.
[Kindle Fire Android Development] MayfairDROID:
How can you tell what chip you have?
[Kindle Fire Android Development] androidcues:
several ways, but a few posts down below yours -- is a printout of {parted} so it was from running the parted script from GNU Parted. In that printout it says

(parted) print
print
print
Model: MMC [B][COLOR="Red"][SIZE="7"]M8G2FA[/SIZE][/COLOR][/B] (sd/mmc)
Disk /dev/block/mmcblk0: 7734MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 11.0MB 10.5MB dkernel
4 11.0MB 21

So now therefore... maybe find the next answer "how to do parted on an android device" which would be similar to #parted /dev/block/mmcblk0 and if successful the "Welcome to Parted" will pop out... and then you ask it to #print and it will tell ya.....
[Kindle Fire Android Development] vbdss:
I am sorry to hear that you guys couldnt make it.

I dont know what to say, i have pretty much tried everything everyone was saying to do.

But the only part that i remember that made difference were the fastboot erase and oem format.

Please everyone, read from the page 4 to now, try everything, i tried a lot of things, dont remember everyone of them

Go to this thread too and try the things that are in there.

http://xdaforums.com/showthread.php?t=1654498

I spent almost 3 days i think trying a lot of commands, fastboot, adb, format, and all of that to make my kindle fire return.

I am very sorry that i cant be more helpful.
[Kindle Fire Android Development] bowen873:
Thanks. I was getting ready to follow the steps vbdss posted on the previous page and then I saw this. I'm guessing it won't help at this point, but here are the outputs of the scripts I ran from that post:

parted /dev/block/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) print

print

print

Model: MMC M8G2FA (sd/mmc)

Disk /dev/block/mmcblk0: 7734MB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Number Start End Size File system Name Flags

1 131kB 262kB 131kB xloader

2 262kB 524kB 262kB bootloader

3 524kB 11.0MB 10.5MB dkernel

4 11.0MB 212MB 201MB ext4 dfs

5 212MB 229MB 16.8MB recovery

6 229MB 296MB 67.1MB ext4 backup

7 296MB 307MB 10.5MB boot

8 307MB 312MB 5243kB ext4 splash

9 312MB 849MB 537MB ext4 system

10 849MB 2041MB 1192MB userdata

11 2041MB 2309MB 268MB cache

12 2309MB 7690MB 5380MB fat32 media

~ # idme ?

idme ?

<================== idme nvram info ==================

Name offset value

----------------------------------|---|---|---|---|---|

serial 0x0000 D01EC0A0150419LF

mac 0x0030 F0A22518BC96

sec 0x0040 TB6DSF0QLAG4YF9C0D2C

pcbsn 0x0060

bootmode 0x1000 4000

postmode 0x1010

bootcounter 0x1020 3

=================== idme nvram info ==================>

~ # dmesg | grep mmc0

dmesg | grep mmc0

<6>[ 2.353576] mmc0: new high speed DDR MMC card at address 0001

<6>[ 2.366363] mmcblk0: mmc0:0001 M8G2FA 7.20 GiB
[Kindle Fire Android Development] vbdss:
now you have to make the filesystem to cache and userdata, as they appear with no filesystem.

Your media (sdcard) is Fat32, thats ok.

Return a few pages and see how to format the partition to ext2 then ext4
[Kindle Fire Android Development] forest1971:
For those who is still hanging in there and not totally give up:

my 2 cents:

1. If parted can see your partition table. Try to remove and recreate partitions 9, 10, 11 and 12, using the guide in some earlier posts.

If it stuck somewhere just try to choose a different block range to start again.

2. if parted does not show partition table: try to run below to correct it:

fastboot oem format

then run parted gain .

see how things go.
[Kindle Fire Android Development] lovejoy777:
when im bak im going to start from the begining again,

1 time when i tried usb fix (firekit) it rewrote xloader partition.
[Kindle Fire Android Development] Entropy512:
Read back a few posts, I gave the commands for pulling the name and cid without using parted
[Kindle Fire Android Development] james.shumaker:
Marginal success

Well, considering I had a full-on brick things took a turn for the better, but then went stale. After four days encompassing many hours of trial an error using virtually every method out there (to include Firekit's USB short method), I managed to the device to load a ROM into the system partition - this obviously means I can't get past the CM9 boot screen. The problem is that no matter what I do, parted simply cannot fix mmcblk 10 and mmcblk 11 - it stalls out at roughly 46% and 34% respectively with the standard superblock vomit. I tried to use parted to rm the partitions (successful) and write around these blocks to no avail, so I'm guessing at this point the nand has bad sectors on it somewhere, but there is no way to identify where they are exactly in order to work around them. Also both mmcblk 10 and mmcblk 11 have no system format (should be ext4, but comes up blank).

Any ideas here?
[Kindle Fire Android Development] forest1971:
Look like promising:

To make it easier I would use parted to remove partition 9, 10, 11 and 12

Then create them new, with partition 9 system from 2041 to 2550.

Then other partition.

The command in some earlier posts but let me know if you have difficulties finding them.

-----

--

It will be easier if you can run (parted) print and post the current partition table

---------- Post added at 10:01 PM ---------- Previous post was at 09:41 PM ----------

Try to make it rewrite the bootloader as well?
[Kindle Fire Android Development] bowen873:
Will you help me write the parted commands too (print is in post# 332)? And after that, is there anything else I need to try before flashing a ROM?
[Kindle Fire Android Development] james.shumaker:
Here's what I've got so far ...

Thanks for the reply. Note the blanks for pcbsn and the file system for mmcblk10 & mmcblk11 ... mmcblk09 is an easy fix, I have no problem with that partition.

<================== idme nvram info ==================

Name offset value

----------------------------------|---|---|---|---|---|

serial 0x0000 D01EA0A014462EGV

mac 0x0030 F0A225650B31

sec 0x0040 7T32KWD39JFIG8SD4B74

pcbsn 0x0060

bootmode 0x1000 4000

postmode 0x1010 0

bootcounter 0x1020 cb

=================== idme nvram info ==================>

parted /dev/block/mmcblk0

Model: MMC M8G2FA (sd/mmc)

Disk /dev/block/mmcblk0: 7734MB

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Number Start End Size File system Name Flags

1 131kB 262kB 131kB xloader

2 262kB 524kB 262kB bootloader

3 524kB 11.0MB 10.5MB dkernel

4 11.0MB 212MB 201MB ext4 dfs

5 212MB 229MB 16.8MB recovery

6 229MB 296MB 67.1MB ext4 backup

7 296MB 307MB 10.5MB boot

8 307MB 312MB 5243kB ext4 splash

9 312MB 849MB 537MB system

10 849MB 2041MB 1192MB userdata

11 2041MB 2309MB 268MB cache

12 2309MB 7690MB 5380MB ext4 media

dmesg | grep mmc0

<6>[ 2.448242] mmc0: new high speed DDR MMC card at address 0001

<6>[ 2.448669] mmcblk0: mmc0:0001 M8G2FA 7.20 GiB
[Kindle Fire Android Development] Hashcode:
I seem to recall doing an e2fsck and /or mkfs_ext4 in there as well, once the partitions are recognized again.

A couple of you who can now show partition tables and the idme values look to be in much better shape.
[Kindle Fire Android Development] forest1971:
Your partition 9,10,11 has no format.

Let us fix this in step by step manner

---------- Post added at 10:58 PM ---------- Previous post was at 10:56 PM ----------

Your partition 10, 11 has no format as well.

We will fix it together. I will post steps. next

-------

James:

~ # parted /dev/block/mmcblk0

then:

(parted) rm 9

(parted) rm 10

(parted) rm 11

That will remove three partitions

Then. To create new partitions 9:

Code:

(parted) mkpartfs primary ext2 312 849

(parted) name 9 system

this will give you an ext2 fs on partition 9. Now to convert to original ext4 do (one by one):

Code:

(parted) quit

~ # tune2fs -j /dev/block/mmcblk0p9

~ # e2fsck -fDp /dev/block/mmcblk0p9

~ # tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p9

~ # e2fsck -fDp /dev/block/mmcblk0p9

If e2fsck complains that it needs to be run manually, you should omit the -p flag. This happened to me the second time I ran through this process, but the first time it did not. I'm not entirely sure why. In that case, the e2fsck commands simply become:

Code:

~ # e2fsck -fD /dev/block/mmcblk0p9

Which will cause it to ask if you want to fix the group descriptors. Just answer 'Y' and let it run through.

see how it goes

----------

Bowen873:

~ # parted /dev/block/mmcblk0

then:

(parted) rm 10

(parted) rm 11

That will remove 2 partitions

Then. To create new partitions 10:

Code:

(parted) mkpartfs primary ext2 849 1192

(parted) name 10 userdata

this will give you an ext2 fs on partition 10. Now to convert to original ext4 do (one by one):

Code:

(parted) quit

~ # tune2fs -j /dev/block/mmcblk0p10

~ # e2fsck -fDp /dev/block/mmcblk0p10

~ # tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p10

~ # e2fsck -fDp /dev/block/mmcblk0p10

------

You can do them same with partition 11 as well.

If you encounter error, then just need to move a next block range to create the partition.

Most of the time when there are error somewhere then partition 12 will have to be removed [(parted) rm12] and recreate with smaller size so as give room for partition 9, 10, 11.

For partition 12, re-create it as below:

~ # parted /dev/block/mmcblk0

(parted) mkpartfs primary fat32 <startblock> <endblock>

(parted) name 12 media

Ok that all you need to know about repartition. Hope you can figure out. It is likely that you will encounter some error somewhere and loose some space, as the case with vbdss.

cheers