Unable to Format Partitions in CWM Recovery - Sony Xperia P, U, Sola, Go

I've searched through the all the XS forums and Backup & Restore within CWM Recovery seems to work for everyone, on all the different ICS Based Kernels with Recovery except for me.
I get the error below whenever I try to format my /system partition through recovery; as the Restore tries to format the partition before restoring to it by restores always fail and I'm left with a /system partition that I can't mount. Only through restoring through Flashtool can I get the phone to boot again. Has anyone seen this before or have any idea what the problem is? Someone having a similar issue on the Samsung Galaxy Player had a similar issue and it was down to a corrupt partition table Galaxy Player Problem
Error From Recovery
Code:
Formatting /system...
E: format_volume: make_extf4fs failed on /dev/block/mmcblk0p12
Error formatting /system!
Error mounting /system!
My Partition Table (if it's any use)
Code:
Disk /dev/block/mmcblk0: 31.9 GB, 31910264832 bytes
4 heads, 16 sectors/track, 973824 cylinders, total 62324736 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 4096 2048 f0 Linux/PA-RISC boot
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 * 4097 5120 512 4d Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 8192 49151 20480 48 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 49152 61071359 30511104 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 50176 51199 512 46 Unknown
/dev/block/mmcblk0p6 53248 59391 3072 4a Unknown
/dev/block/mmcblk0p7 61440 67583 3072 4b Unknown
/dev/block/mmcblk0p8 69632 75775 3072 58 Unknown
/dev/block/mmcblk0p9 77824 88063 5120 70 Unknown
/dev/block/mmcblk0p10 90112 106495 8192 83 Linux
/dev/block/mmcblk0p11 106496 139263 16384 f0 Linux/PA-RISC boot
/dev/block/mmcblk0p12 139264 2236415 1048576 83 Linux
/dev/block/mmcblk0p13 2236416 2748415 256000 83 Linux
/dev/block/mmcblk0p14 2748416 6942719 2097152 83 Linux
/dev/block/mmcblk0p15 6942720 61071359 27064320 c Win95 FAT32 (LBA)
I was sondering if anyone had any suggestions, or could at least post their Partition Table to see if I need to sort mine out
(From ADB:
fdisk /dev/block/mmcblk0
U,
P
Then paste it here)
Cheers,
Andy

hello Andy..
mine partition table is just the same with you. but i can restore my backup (which include /system backup) just fine.whick kernel are you on?

It happened to me once. I formated data partition and it worked, don't know why

I've had the same problems with the FXP kernels ( both CM9 & CM10) ,Advanced Stock and SSpeed. I'm starting to wonder if the memory is actually damaged.
It's hit and miss as to which partitions it'll let me format, system and cache almost always fail, data sometimes works,but then frequently won't mount afterwards.
Sent from my LT26i using xda premium

Hi!
I've the same problems.
My phone has a srange behavior... Often can't ormat partitions, can't mount them, but after few retries i can manage it. And it's totally random..
You think is a software memory or a damaged memory ?
I never can't restore a nandroid backup because it give me an error restoring system partition.
Any ideas ?

mrscope said:
Hi!
I've the same problems.
My phone has a srange behavior... Often can't ormat partitions, can't mount them, but after few retries i can manage it. And it's totally random..
You think is a software memory or a damaged memory ?
I never can't restore a nandroid backup because it give me an error restoring system partition.
Any ideas ?
Click to expand...
Click to collapse
I've found a sort of work around. It appears to only be recoveries that use an ICS kernel that give me issues, so I loaded Doom's Advance Stock GB Kernel onto the phone and the recovery on that works flawlessly everytime. (it also has better features than regular CWM Recovery)
All the ICS kernel's that I tried will always successfully back up and restore the boot partition, so I use them to do that. Then restore DoomKernel (advanced restore, restore boot) then do all my backups, restores, and flashing with DooMRecovery. Then you can tidy everything up by moving the ICS Kernel BootPartion image into the DooMRecovery system/data backup folder, then insert the boot.img line from the checksum MD5 file at the start of the ICS MD5 file into the DooMRec MD5 file. (so you have all the correct files in the same folder, with the correct MD5 sum for each of the images in the folder). Then you can do a restore via DoomRecovery if you ever need to.
I grant you it's a bit messy and if the timestamps don't work properly a little confusing, but it does do the job, and it means you can easily swap between ROM's on the go.

sixdaysandy said:
I've found a sort of work around. It appears to only be recoveries that use an ICS kernel that give me issues, so I loaded Doom's Advance Stock GB Kernel onto the phone and the recovery on that works flawlessly everytime. (it also has better features than regular CWM Recovery)
All the ICS kernel's that I tried will always successfully back up and restore the boot partition, so I use them to do that. Then restore DoomKernel (advanced restore, restore boot) then do all my backups, restores, and flashing with DooMRecovery. Then you can tidy everything up by moving the ICS Kernel BootPartion image into the DooMRecovery system/data backup folder, then insert the boot.img line from the checksum MD5 file at the start of the ICS MD5 file into the DooMRec MD5 file. (so you have all the correct files in the same folder, with the correct MD5 sum for each of the images in the folder). Then you can do a restore via DoomRecovery if you ever need to.
I grant you it's a bit messy and if the timestamps don't work properly a little confusing, but it does do the job, and it means you can easily swap between ROM's on the go.
Click to expand...
Click to collapse
I had the same thing last week, couldn't restore a backup form CWM (on Xperia S/FXP CM10 207). Formatting cache and system 'manually' in CWM also failed. /data was OK.
I ended up formatting from adb (mkfs.ext2 -T ext4 /dev.... ) and mounting the partitions through CWM. Then I untarred the different partitions of my CWM-backup and everything was fine.
Is this a problem of CWM or my phone, or ...?
Thanks
Frank

I am having the exact same issue. I cannot -ever- format the cache . So every restore attempt ends in error.
I have rooted stock .55 , with locked bootloader.
Did anybody ever found a fix for this.
I have read the other recovery option but it requires kernel changing and possibly unlocked bootloader.
I created a thread with my issues, here
http://forum.xda-developers.com/showthread.php?t=2163141

Related

[Q] Backing up entire tablet partitions

I want to make sure I understand this. I know cwm will backup the OS, but what if I wanted to backup my entire nook? More specifically, what if I wanted to take a picture of my nook as when it was a fresh install. Here is my theory:
Code:
dd if=/dev/block/mmcblk0 of=/sdcard/backup.img
Will this work? Obviously I'd need an sdcard with a lot of storage, but will it backup everything so that, say, in the case all my tablet partitions get destroyed, I can just use dd to dump the img of the whole disk back onto the nook, and give me a squeaky clean nook? And how big would my sdcard have to be? at least 8gb? or at least 16gb? But yeah, my whole hypothesis behind this is to create a bootable sdcard that will do just that, backup everything from a complete stock, so that in the future if I messup my partitions, (like I did before), I can just dump images onto it, that will make it flawless.
At least I hope. Give me your thoughts. Thanks!
That would work, technically, but the CWM backup option does do a full backup AFAIK, at least, I have never had any issues with the backup missing something. Using dd is a way to ensure you get a bit for bit copy, I worry about size though. It has been a long time since I used that, if memory serves you get every bit even if that bit is free space. When I did this for backup on my Ubuntu box ages ago I had to run it through gzip or bzip2 to get the size reasonable. I'm not sure if that is possible on the Nook Tablet.
No is better if you backup partition one by one not the whole partition table. Anyways i don't recommend you to use dd as a "backup" method if there are other ways.
If you are looking for fresh install there are other ways to do it. like a normal standar user will do to "start-from-scratch" and root then boot into CWM from sdcard and backup your ROM. If you're advance user you will know how to pack it as a CWM flashable zip
I have a thread and use dd commands but for UNBRICK purposes not for "backup".
Be careful with what you do, just an advice.
~ Veronica
I would have to agree, I have personally also had issues restoring a partition table to a flash based device. You could end up with a useless backup.
Well, the reason I ask, is because for some weird reason, my partition table got corrupted. It was useless. i wish I would have backed up /rom. I got the serial number on the rom partition back, just not the mac address. but anyway, I had to clear the entire partition table and start anew. But I can't seem to get the partition table looking exactly like this:
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 16.3MB 15.7MB recovery
4 16.8MB 33.6MB 16.8MB boot
5 33.6MB 83.9MB 50.3MB fat32 rom
6 83.9MB 134MB 50.3MB fat32 bootdata
7 134MB 522MB 388MB ext4 factory
8 522MB 1164MB 642MB ext4 system
9 1164MB 1611MB 447MB ext4 cache
10 1611MB 2684MB 1074MB fat32 media
11 2684MB 15.6GB 12.9GB ext4 userdata
Click to expand...
Click to collapse
It never gets aligned correctly. And that's why xloader won't ever load. I can get into clockworkmod backup. But that's the reason why I want that backup of the table. Whatever type of table it is, you can't recreate it in gnuparted.
soshite said:
Well, the reason I ask, is because for some weird reason, my partition table got corrupted. It was useless. i wish I would have backed up /rom. I got the serial number on the rom partition back, just not the mac address. but anyway, I had to clear the entire partition table and start anew. But I can't seem to get the partition table looking exactly like this:
It never gets aligned correctly. And that's why xloader won't ever load. I can get into clockworkmod backup. But that's the reason why I want that backup of the table. Whatever type of table it is, you can't recreate it in gnuparted.
Click to expand...
Click to collapse
Actually you can recreate the partition table but that is very advanced.
About the command would be better:
Code:
# dd if=/dev/block/mmcblk0pX of=/sdcard/mmcblk0pX
* where X is a number 1 to 11 (partition #) but partitions 10 and 11 are media and userdata too big don't worry about those yet they can be recreated so backup from partition 1 to 9 better.
For big partitions like system, cache, factory, etc is better if you add bs=4096 at the end of the code:
Example: backing up SYSTEM partition
Code:
# dd if=/dev/block/mmcblk0p8 of=/sdcard/mmcblk0p8 bs=4096
INTERNAL PARTITIONS
xloader = mmcblk0p1
bootloader = mmcblk0p2
recovery = mmcblk0p3
boot = mmcblk0p4
rom = mmcblk0p5
bootdata = mmcblk0p6
factory = mmcblk0p7
system = mmcblk0p8
cache = mmcblk0p9
Click to expand...
Click to collapse
~ Veronica
lavero.burgos said:
Actually you can recreate the partition table but that is very advanced.
About the command would be better:
Code:
# dd if=/dev/block/mmcblk0pX of=/sdcard/mmcblk0pX
* where X is a number 1 to 11 (partition #) but partitions 10 and 11 are media and userdata too big don't worry about those yet they can be recreated so backup from partition 1 to 9 better.
For big partitions like system, cache, factory, etc is better if you add bs=4096 at the end of the code:
Example: backing up SYSTEM partition
Code:
# dd if=/dev/block/mmcblk0p8 of=/sdcard/mmcblk0p8 bs=4096
​
~ Veronica
Click to expand...
Click to collapse
How do you recreate the repartition table?
Code:
(parted) mklabel gpt
Because apparently Adam said it was different. But I dunno. I tried a gpt table. It didn't seem to work
soshite said:
How do you recreate the repartition table?
Code:
mklabel gpt
Because apparently Adam said it was different. But I dunno. I tried a gpt table. It didn't seem to work
Click to expand...
Click to collapse
http://forum.xda-developers.com/showthread.php?t=1562130
... @meghd00t is the man for that, check last 2 pages of that thread.
If you really have f&%# up your device then that is your thread for support
~ Veronica
lavero.burgos said:
http://forum.xda-developers.com/showthread.php?t=1562130
... @meghd00t is the man for that
~ Veronica
Click to expand...
Click to collapse
Eh... I tried that one. It didn't seem to fix anything.. I know it said it fixed the partitions but it actually didn't do anything. I was pretty surprised.
But the strangest part is this:
Code:
3 524kB 16.3MB 15.7MB recovery
4 16.8MB 33.6MB 16.8MB boot
/recovery ends at 16.3mb and /boot starts at 16.8mb. And I can't recreate this at all. parted automatically places the boot partition at 16.3mb. Have any clue on that?
how did you "clear the entire partition table" ?
... so you're device is bricked right? and if you really wiped all the partitions you will need high level support.
A story of what exactly you have done so far will be helpful and i would suggest not to try anything else until you explain.
~ Veronica
lavero.burgos said:
how did you "clear the entire partition table" ?
... so you're device is bricked right? and if you really wiped all the partitions you will need high level support.
A story of what exactly you have done so far will be helpful and i would suggest not to try anything else until you explain.
~ Veronica
Click to expand...
Click to collapse
Part of it is on my dead nook topic:
http://forum.xda-developers.com/showthread.php?t=1597155
But then, my partition table was corrupt. It wouldn't work at all. So I made a new partition table in parted:
Code:
(parted) mklabel gpt
Which pretty much deleted everything. Which is what I wanted. But. It's hard to recreate the exact same partitions in parted. for example, MLO starts at 131kb and ends at 262kb. But when I make the partition:
Code:
(parted) mkpart primary () 131kb 262kb
** where () denotes unformatted filesystem
It says the file size is 132kb, whereas the xloader partition should actually be 131kb. How the heck does that happen? Because the xloader partition is meant to be super secure, then that partition doesn't pass consistency check. And if I make it end at 261kb, it still won't pass the consistency check.
I don't know what B&N did with their partition table. It really is a strange table.

[Q] Corrupt GPT?

I think after running wrong exit_recovery.zip, I managed to trash partition table/GPT - or some other combination of stupidity - hoping someone can help..
CWM Recovery Log
Starting recovery on Mon Jun 25 21:11:17 2012
can't open /dev/tty0: No such file or directory
framebuffer: fd 3 (1280 x 800)
ClockworkMod Recovery v5.8.2.0
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null) 0
1 /system ext4 /dev/block/mmcblk0p1 (null) 0
2 /cache ext4 /dev/block/mmcblk0p2 (null) 0
3 /misc emmc /dev/block/mmcblk0p3 (null) 0
4 /staging ext3 /dev/block/mmcblk0p4 (null) 0
5 /data ext4 /dev/block/mmcblk0p8 (null) 0
6 /boot emmc /dev/block/mmcblk0p10 (null) 0
7 /recovery emmc /dev/block/mmcblk0p9 (null) 0
W:Unable to get recovery.fstab info for /datadata during fstab generation!
W:Unable to get recovery.fstab info for /emmc during fstab generation!
W:Unable to get recovery.fstab info for /sdcard during fstab generation!
W:Unable to get recovery.fstab info for /sd-ext during fstab generation!
I:Completed outputting fstab.
Irocessing arguments.
...
[recovery session] Fdisk
/tmp # fdisk -l /dev/block/mmcblk0
Disk /dev/block/mmcblk0: 63.5 GB, 63577260032 bytes
4 heads, 16 sectors/track, 1940224 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Disk /dev/block/mmcblk0 doesn't contain a valid partition table
[recovery session] Parted
/tmp # ./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) p
p
Error: /dev/block/mmcblk0: unrecognised disk label
Hypothesis
By doing exit recovery opt 1a http://forum.xda-developers.com/showthread.php?t=1514088 I was able to bring up the virtuousprime ROM boot, but virtuous failed (reboot) after trying to format /data.
I dd'd the first 8096 bytes of mmcblk0 and they are all zeros?
From CWM, I am able to mount partitions mmcblk0p1, mmcblk0p3, mmcblk0p5.
So from all that, I am thinking I need to flash MBR, replace GPT on LBA 1? If this is correct, does anyone have a stock GPT for the tf201?
I can then format /data (mmcblk0p8) and I think my ROMs will then work.
kind regs,
Based on the information here: https:// en.wikipedia.org/wiki/GUID_Partition_Table#Partition_table_header_.28LBA_1.29, replacing LBA 1 will only fix the GPT header. Since you said that the first 8096 bytes were all zeros, it would seem that those would fall into LBA 2, 3, etc., corrupting the partition table.
But since you said that CWM can mount your partitions, you might be able to use GPT fdisk's recovery features to fix the problem. I don't know if anyone has compiled it for Android though Please note that the regular fdisk cannot handle GPT, only MBR.
When you said "flash MBR", what exactly do you mean? GPT and MBR are two different partition structures and if you replace either one with the other, the partition table will be lost and you won't be able to mount any partition.
Was thinking about building LBA0 and LBA 1 separately, was going from that Wikipedia article, "...Legacy MBR information is contained in LBA 0, the GPT header is in LBA 1.." and I thought - perhaps naively - that an fdisk command with /mbr option would sort out LBA0, then I worry about GPT in LBA1, but maybe I am confusing fdisk /mbr option with another command (old DOS)?
I have all the partition offsets and disk size from backup (/sys/devices/platform/sdhci-tegra.3/mmc_host/mmc0/mmc0:0001/block/mmcblk0/..) and know what the partition table should look like; there was no "Partition 9", I made this up because there was 1024 unaccounted bytes after mmcblk0p8 (/data) ends:
Disk size: 1241744336 bytes
Partition 1 (/system): start 74752; End 1123328; Size 1048576
Partition 2 (/cache): start 1123328; End 1999872; Size 876544
Partition 3 (/misc): start 1999872; End 2003968; Size 4096
Partition 4 (/staging): start 2003968; End 3096576; Size 1092608
Partition 5 (/btmac): start 3096576; End 3106816; Size 10240
Partition 6 (/?): start 3106816; End 3107840; Size 1024
Partition 7 (/?): start 3107840; End 3118080; Size 10240
Partition 8 (/data): start 3118080; End 124173312; Size 121055232
Partition 9: start 124173312; End 124174336; Size 1024
Given that /system mounts, I think if I had a stock dump from a tf201 of bytes 0-74752 might also be an alternative - I could verify the GPT table against above before I put it in.
Another option I can think of, comes from reference I see to a "backup GPT" held in last sector of GPT disks? If you look at partition offsets above, there is 1024 bytes at the end where I may get this information - but I think injecting in a dump of those first 74k bytes into mmcblk0 - as above - would be safer.
damonbrisbane said:
Was thinking about building LBA0 and LBA 1 separately, was going from that Wikipedia article, "...Legacy MBR information is contained in LBA 0, the GPT header is in LBA 1.." and I thought - perhaps naively - that an fdisk command with /mbr option would sort out LBA0, then I worry about GPT in LBA1, but maybe I am confusing fdisk /mbr option with another command (old DOS)?
Click to expand...
Click to collapse
I wouldn't suggest doing that. That would create a hybrid MBR. When a hybrid MBR disk is read using MBR, only the first four partitions can be visible (after redefining the partition table in LBA0). If the disk is read using GPT, all the partitions will be visible. I don't know if Android and Linux prefer MBR over GPT, but if they do, you might lose access to partitions 5-8.
By the way, the '/mbr' option is for the diskpart tool from MSDOS and Windows
damonbrisbane said:
Another option I can think of, comes from reference I see to a "backup GPT" held in last sector of GPT disks? If you look at partition offsets above, there is 1024 bytes at the end where I may get this information - but I think injecting in a dump of those first 74k bytes into mmcblk0 - as above - would be safer.
Click to expand...
Click to collapse
You're absolutely right. I had forgotten about this. Do you happen to know if those mmcblk0p# partitions are visible when the tablet is plugged into a Linux computer? If so, GPT fdisk can restore the partition table and GPT header from the backup GPT.
You would run something like this to restore the backup GPT:
http://paste.kde.org/488054/
EDIT: I found a version of gdisk compiled for Android by meghd00t (http://forum.xda-developers.com/showpost.php?p=24805392&postcount=74). You may be able to restore the backup GPT directly from the tablet
Download link from the post: http://dl.dropbox.com/u/64885133/gptfdisk.zip
Thanks Chen, i plan to try the gptfdisk tonight when I get home from work and can post the result.
One thing i'm not sure about is access mmcblk0 from linux - does this mean I can access the internal mmcblk0 of the tf201 directly through a linux device? Right now I access mmcblk0 solely through adb shell to CWM recovery.
damonbrisbane said:
Thanks Chen, i plan to try the gptfdisk tonight when I get home from work and can post the result.
One thing i'm not sure about is access mmcblk0 from linux - does this mean I can access the internal mmcblk0 of the tf201 directly through a linux device? Right now I access mmcblk0 solely through adb shell to CWM recovery.
Click to expand...
Click to collapse
No problem There's also an option to backup the GPT header and partition table to file. I'd suggest doing that just in case anything goes wrong.
I'm not entirely sure if the internal memory can be accessed directly from Linux. But from what I've been reading in the forums today, it seems that it might not possible (I'm pretty new to Android).
Hopefully gptfdisk will work via adb shell
Whew, we're off life support! and more importantly - my wife wont kill me for an Unauthorised Brick to The Birthday Device
Steps Performed
ADB - Write backup GPT to LBA1 mmcblk0
~ # ./gdisk /dev/block/mmcblk0
GPT fdisk (gdisk) version 0.8.4
Unsupported GPT version in backup header; read 0x00000000, should be
0x00010000
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present
Creating new GPT entries.
Command (? for help): r
Recovery/transformation command (? for help): ?
b use backup GPT header (rebuilding main)
c load backup partition table from disk (rebuilding main)
…
? b
Recovery/transformation command (? for help):
? c
Warning! This will probably do weird things if you've converted an MBR to
GPT form and haven't yet saved the GPT! Proceed? (Y/N): Y
Caution! After loading partitions, the CRC doesn't check out!
Recovery/transformation command (? for help): p
Disk /dev/block/mmcblk0: 124174336 sectors, 59.2 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 2E8491CC-AFFC-43B9-B1C4-97D2F258BE1C
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 124174302
Partitions will be aligned on 2048-sector boundaries
Total free space is 75709 sectors (37.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 74752 1123327 512.0 MiB 0700 AP
2 1123328 1999871 428.0 MiB 0700 CC
3 1999872 2003967 2.0 MiB 0700 MC
4 2003968 3096575 533.5 MiB 0700 UP
5 3096576 3106815 5.0 MiB 0700 PR
6 3106816 3107839 512.0 KiB 0700 YU
7 3107840 3118079 5.0 MiB 0700 CA
8 3118080 124173311 57.7 GiB 0700 UA
Recovery/transformation command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): Y
OK; writing new GUID partition table (GPT) to /dev/block/mmcblk0.
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot.
The operation has completed successfully.
~ #
ADB/CWM - Exit recovery and attempt Virtuousprime ROM install
I then did exit recovery as per 1a http://forum.xda-developers.com/showthread.php?t=1514088
Upon reboot Virtuousprime wouldn't go as far as it got before. I went back into adb shell and did wipe data:
Wipe data/factory reset
Formatting /data
Error mounting /data !
Skipping format...
Formatting /cache
Formatting /sd-ext
Formatting /sdcard/.android_secure...
Error mounting /sdcard/.android_secure!
Skipping format...
Data wipe complete
Note the error on /data. Could not format /data either using the CWM mounts and storage menu. I named the partitions I knew about and formatted /data (mmcblk0p8) from adb shell:
Number Start End Size File system Name Flags
1 38.3MB 575MB 537MB ext4 system
2 575MB 1024MB 449MB ext4 cache
3 1024MB 1026MB 2097kB misc
4 1026MB 1585MB 559MB ext3 staging
5 1585MB 1591MB 5243kB fat32 btmac
...
8 1596MB 63.6GB 62.0GB ext4 data
mke2fs -t ext4 /dev/block/mmcblk0p8
I then found that CWM data/factory reset went through without errors:
Wipe data/factory reset
Formatting /data
Formatting /cache
..
Data wipe complete
And subsequently exit recovery and virtuous prime rom have installed OK, tested across reboot and shutdown
Cheers!
damonbrisbane said:
Whew, we're off life support! and more importantly - my wife wont kill me for an Unauthorised Brick to The Birthday Device
Click to expand...
Click to collapse
Haha, I'm glad I was able to help

[Q] Another possible way to Install CWM restore partition

UPDATE: Just found information at the following link, see below. Looks like you can't get better backup capability without unlocking the boot loader first. Doing so would destroy the DRM keys (No more Netflix's etc...) Guess I will live with my ROOTED Atrix 4G for now..
http://android.stackexchange.com/questions/15314/cant-boot-to-clockwork-recovery-on-atrix-several-methods-tried
My Atrix 4G phone is currently rooted but does NOT have the bootloader unlocked. I do not plan to (at least for the forseeable future) installing different ROM's but I would like to install (if possible) the CWM restore partition. Unlocking the bootloader wipes the device (backups can be performed to restore the wiped information); likewise, the DRM keys are removed during the bootloader unlocking procedure and there MIGHT be ways to restore them (watching streaming video is important to me).
From what I have read on this forum and others, I should be able to load the CWM restore partition WITHOUT unlocking the bootloader. There are a few methods documented to install the CWM werewithall onto the restore partition BUT would something like the following also work?
From an SSH connection to the rooted phone or an "adb shell" command window (via a USB connection between the Atrix and PC) perform the following:
Backup the current restore partition delivered my Motorola via the following command in case something goes wrong.
dd if=/dev/block/mmcblk0p10 of=/sdcard-ext/recovery.img
Copy the recovery.img file to your PC for additional safe keeping.
Zero out the restore partition before installing the new CWM recovery image.
dd if=/dev/zero of=/dev/block/mmcblk0p10
Copy the new cwm.img image to the recovery partition using the following command:
Note the replacement cwm image file can NOT be larger than 8192 blocks with each block being 512 bytes.
8192 * 512 * 2 = 8,388,608 bytes. If the cwm image is to big, I am not sure if the following dd command would write into the p11 boot partition (NOT good). Verify cwm.img size BEFORE issuing the following DD command.
dd if=/sdcard-ext/cwm.img of=/dev/block/mmcblk0p10
In the avent of a problem, you should be able to restore the original Motorola recovery.img to the /dev/block/mmcblk0p10 partition with the following command:
dd if=/sdcard-ext/recovery.img of=/dev/block/mmcblk0p10
FYI follows are the md5sums from my "Atrix 4g" as delivered original factory boot.img and recovery.img
/mnt/sdcard-ext/root_recovery_orig # cat md5sums.txt
bc6c254bd80bed5a9c0d3c7cd5c77b07 boot.img from /dev/block/mmcblk0p11
7580ad9c3bca264a563c13741162d9b8 recovery.img from /dev/block/mmcblk0p10
/mnt/sdcard-ext/root_recovery_orig # ls -al *.img
----rwxr-x 1 system sdcard_r 8388608 Nov 15 13:20 boot.img
----rwxr-x 1 system sdcard_r 8388608 Nov 15 13:19 recovery.img
I assume the factory LOCKED bootloader located on the first partition /dev/block/mmcblk0p1 does NOT effect booting into the new cwm recovery partition via the "adb reboot recovery" command or by holding the volume down while powering on the phone?
When booting into the new CWM recovery partition, what /dev/block/mmcblk0 partitions are mounted? If any partitions are mounted, are they mounted read-only?
Booting from the content of the CWM recovery partition, can I backup/restore the entire /dev/block/mmcblk0 device (all 18 partitions)? Nothing like creating a full device image (with nothing mounted r/w) for when disaster strikes.
Assuming any of the above is valid, I need get the cwm dd image for somewhere (pointers welcome)
Issuing DD commands can be VERY-VERY-VERY dangerous if done wrong. If you do not understand how dd works, PLEASE do NOT attempt anything you read in this post. Until other forum members comment on this post content, I do NOT plan do anything (neither should anyone else!!!!)
Regards, Ron
Request for info from someone with CWM installed in recovery partition
Could I get someone who has CWM working on their Atrix 4G to please run the following command from the su prompt on the smartphone and post the output.
# fdisk -lu /dev/block/mmcblk0
Also please indicate if you have the bootloader unlocked or not.
Regards Ron
rrolsbe said:
My Atrix 4G phone is currently rooted but does NOT have the bootloader unlocked. I do not plan to (at least for the forseeable future) installing different ROM's but I would like to install (if possible) the CWM restore partition. Unlocking the bootloader wipes the device (backups can be performed to restore the wiped information); likewise, the DRM keys are removed during the bootloader unlocking procedure and there MIGHT be ways to restore them (watching streaming video is important to me).
From what I have read on this forum and others, I should be able to load the CWM restore partition WITHOUT unlocking the bootloader. There are a few methods documented to install the CWM werewithall onto the restore partition BUT would something like the following also work?
From an SSH connection to the rooted phone perform the following:
Backup the current restore partition delivered my Motorola via the following command in case something goes wrong.
dd if=/dev/block/mmcblk0p10 of=/sdcard-ext/recovery.img
Copy the recovery.img file to your PC for additional safe keeping.
Zero out the restore partition before installing the new CWM recovery image.
388,608
dd if=/dev/zero of=/dev/block/mmcblkp10
Copy the new cwm.img image to the recovery partition using the following command:
Note the replacement cwm image file can NOT be larger than 8192 blocks with each block being 512 bytes.
8192 * 512 * 2 = 8,388,608 bytes. If the cwm image is to big, I am not sure if the following dd command would write into the p11 boot partition (NOT good). Verify cwm.img size BEFORE issuing the following DD command.
dd if=/sdcard-ext/cwm.img of=/dev/block/mmcblk0p10
In the avent of a problem, you should be able to restore the original Motorola recovery.img to the /dev/block/mmcblk0p10 partition with the following command:
dd if=/sdcard-ext/recovery.img of=/dev/block/mmcblk0p10
I assume the factory LOCKED bootloader located on the first partition /dev/block/mmcblk0p1 does NOT effect booting into the new cwm recovery partition via the "adb reboot recovery" command or by holding the volume down while powering on the phone?
When booting into the new CWM recovery partition, what /dev/block/mmcblk0 partitions are mounted? If any partitions are mounted, are they mounted read-only?
Booting from the content of the CWM recovery partition, can I backup/restore the entire /dev/block/mmcblk0 device (all 18 partitions)? Nothing like creating a full device image (with nothing mounted r/w) for when disaster strikes.
Assuming any of the above is valid, I need get the cwm dd image for somewhere (pointers welcome)
Issuing DD commands can be VERY-VERY-VERY dangerous if done wrong. If you do not understand how dd works, PLEASE do NOT attempt anything you read in this post. Until other forum members comment on this post content, I do NOT plan do anything (neither should anyone else!!!!)
Regards, Ron
Click to expand...
Click to collapse
Another question/Observation
It might be possible that the factory supplied locked bootloader checks the "Digitial Signature" of the recovery partition before booting into recovery mode is allowed??? If this is true, the signature check of the CWM image would FAIL thus requiring an unlock of the boot loader! Hopefullly, dd'ing the original saved recovery.img back onto the recovery partition would at least get back to factory configuration (IE.. allow booting into factory supplied recovery mode)!!
Again, Thanks for any help regarding this post!
Regards, Ron
rrolsbe said:
Could I get someone who has CWM working on their Atrix 4G to please run the following command from the su prompt on the smartphone and post the output.
# fdisk -lu /dev/block/mmcblk0
Also please indicate if you have the bootloader unlocked or not.
Regards Ron
Click to expand...
Click to collapse
Code:
[B]# fdisk -lu /dev/block/mmcblk0[/b]
Disk /dev/block/mmcblk0: 15.9 GB, 15914762240 bytes
1 heads, 16 sectors/track, 1942720 cylinders, total 31083520 sectors
Units = sectors of 1 * 512 = 512 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1024 8191 3584 83 Linux
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 8192 9215 512 83 Linux
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 9216 13311 2048 83 Linux
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 13312 31005695 15496192 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 14336 16383 1024 83 Linux
/dev/block/mmcblk0p6 16384 17407 512 83 Linux
/dev/block/mmcblk0p7 17408 18431 512 83 Linux
/dev/block/mmcblk0p8 18432 20479 1024 83 Linux
/dev/block/mmcblk0p9 20480 24575 2048 83 Linux
/dev/block/mmcblk0p10 24576 40959 8192 83 Linux
/dev/block/mmcblk0p11 40960 57343 8192 83 Linux
/dev/block/mmcblk0p12 57344 712703 327680 83 Linux
/dev/block/mmcblk0p13 712704 2285567 786432 83 Linux
/dev/block/mmcblk0p14 2285568 2326527 20480 83 Linux
/dev/block/mmcblk0p15 2326528 3637247 655360 83 Linux
/dev/block/mmcblk0p16 3637248 7831551 2097152 83 Linux
/dev/block/mmcblk0p17 7831552 8538111 353280 83 Linux
/dev/block/mmcblk0p18 8538112 31005695 11233792 83 Linux
As far as installing custom recovery with locked bootloader goes, I'm pretty sure that won't work, or else someone would've come up with that long long time ago.
Thanks!!
ravilov
Thanks for the information in your post. Since it appears that some owners have replaced their recovery partition with CWM having only rooting, I was hoping that the recovery partition might NOT be signed by Motorola and checked during the recovery boot process. BTW, my Atrix 4G is an International carrier unlocked version. I have another Atrix 4G on order, I might try DD'ing to the recovery partition and if that fails roll back the recovery.img backup. If the recovery partition is actually signed and checked during the boot process, returning the partition bit-for-bit with the original SHOULD revert to factory. From my reading, it some cases the recovery partition is NOT signed even though the bootloader/boot partition IS signed.
Again, Thanks Very Much for your post
Regards, Ron

[Q] Partitioning the internal memory

Hi,
I'm trying to figure out the partitioning on my phone (Acer E2 V370).
With fdisk I have this layout
Code:
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 65 64 2147483647+ 5 Extended
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 1665 2944 10240 83 Linux
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 2945 4224 10240 83 Linux
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 5825 6592 6144 83 Linux
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 8385 110784 819200 83 Linux
/dev/block/mmcblk0p6 257985 64 2145420287+ 83 Linux
This doesn't make a lot of sense. 2145420287 blocks means 1039.something Gigabytes ?
Using parted for my SDCard gives me neatly two partitions with their respective sizes and fstype,
but using it on my internal memory, gives me errors, stating that the partitions can't be outside the disk.
This necessarily doesn't mean anything's wrong though, the phone (used to) boot(s) just fine,
and I noticed other people getting the same error message because they gparted the internal memory by accident
What actually went wrong, is that I reformatted the internal sdcard with ext3 using gparted while my phone was connected by UMS.
Since then it won't mount in android or on my linux box.
The reason I wanted to do this, is to use that internal storage as the location for link2sd.
I accidently wiped pretty much everything on my SD-Card (32Gb)
and the backup from my previous ROM (4.2.2) doesn't restore properly,
so nothing more can go wrong.
I can always repush the images back onto the phone using fastboot, right ?
Can anyone help me out, maybe by posting the results of fdisk -l /dev/block/mmcblk0 ?
oneindelijk said:
Can anyone help me out, maybe by posting the results of fdisk -l /dev/block/mmcblk0 ?
Click to expand...
Click to collapse
Code:
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 5 757760 6062048 c Win95 FAT32 (LBA)
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 757761 1003520 1966080 c Win95 FAT32 (LBA)
Partition 2 does not end on cylinder boundary
kalpetros said:
Code:
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 5 757760 6062048 c Win95 FAT32 (LBA)
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 757761 1003520 1966080 c Win95 FAT32 (LBA)
Partition 2 does not end on cylinder boundary
Click to expand...
Click to collapse
Thanks !
That looks like your sdcard is on mmcblkp0, like I've seen with other devices.
Which device is this ?
It's a Galaxy S I9000.
mmcblk0p8
Hi,
I'm still trying to figure out this whole partition-mess.
I've found out by using parted on each partition in mmcblk0
that mmcblk0p8 is about 1.7 Gb.
This is the partition I'm looking for, but why is fdisk /dev/mmcblk0 only showing 6
(And parted is just throwing an error, because the boundaries are out of bounds...)
Is there a way to make a full backup of my whole device, so I can restore it when messing up ?
(Perhaps dd each partition and the bootsector somehow ?)
oneindelijk said:
Hi,
I'm still trying to figure out this whole partition-mess.
I've found out by using parted on each partition in mmcblk0
that mmcblk0p8 is about 1.7 Gb.
This is the partition I'm looking for, but why is fdisk /dev/mmcblk0 only showing 6
(And parted is just throwing an error, because the boundaries are out of bounds...)
Is there a way to make a full backup of my whole device, so I can restore it when messing up ?
(Perhaps dd each partition and the bootsector somehow ?)
Click to expand...
Click to collapse
Yes you can use the recovery (CWM) to backup your device.
CWM
kalpetros said:
Yes you can use the recovery (CWM) to backup your device.
Click to expand...
Click to collapse
Or TWRP is just as well I suppose ?
I already make several backups, but will these store the size of the partitions as well ?
oneindelijk said:
Or TWRP is just as well I suppose ?
I already make several backups, but will these store the size of the partitions as well ?
Click to expand...
Click to collapse
Yes the size of the partition will be stored.
You can use TWRP too.

Internal memory structure - what are those hidden partitions?

I've been digging around the memory of a 8Gb device, and have a couple of outputs, slightly edited for clarity (df and parted). See below.
Now, follow up questions:
1) there is significant mismatch in size between df and parted, is there some heavy error correction included in sizes reported by parted?
2) It seems that /cache is this large in order to store OTA updates. But if we are done with OTAs in order to keep root, should not one be able to shrink /cache, and add the space to /data even from within a working system (one could backup /data first, unmout it and /cache, resize both, etc) ?
3) with boot and recovery partitions, how does one boot into Amazon "recovery" then? Has this ever been discovered in terms of how to use it? I assume the regular boot happens from "boot" ?
4) cannot one just write custom recovery into "recovery" via a simple "dd" command ?
Thoughts?
Update: Of course, there is recovery mode! Pressing "Power" and "Volume up" buttons from off state will boot into a very limited Amazon recovery giving 2 options, Reboot, and Reset to factory defaults. So could not we jam something into that "recovery" partition, and try to boot it?
[email protected]:/ # df
df
Filesystem Size Used Free Blksize
/system 1.1G 1.1G 31.9M 4096
/cache 852.4M 1.2M 851.2M 4096
/data 5.0G 3.3G 1.7G 4096
/persistbackup 10.8M 196.0K 10.6M 4096
[email protected]:/ #parted /dev/block/mmcbkl0 print
Model: MMC SEM08G (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 32.8kB 164kB 131kB PRO_INFO
2 1049kB 5243kB 4194kB PMT
3 5243kB 10.5MB 5243kB TEE1
4 10.5MB 15.7MB 5243kB TEE2
5 15.7MB 16.3MB 524kB UBOOT
6 16.3MB 24.6MB 8389kB boot
7 24.6MB 33.0MB 8389kB recovery
8 33.0MB 34.1MB 1049kB KB
9 34.1MB 35.1MB 1049kB DKB
10 35.1MB 35.7MB 524kB MISC
11 35.7MB 52.4MB 16.8MB ext4 persisbackup
12 52.4MB 1311MB 1258MB ext4 system
13 1311MB 2233MB 923MB ext4 cache
14 2233MB 7808MB 5574MB ext4 userdata
bibikalka said:
2) It seems that /cache is this large in order to store OTA updates. But if we are done with OTAs in order to keep root, should not one be able to shrink /cache, and add the space to /data even from within a working system (one could backup /data first, unmout it and /cache, resize both, etc) ?
Click to expand...
Click to collapse
Thats highly dangerous. Unmounting /data while booted might cause an immediate reset. Not to sure. But messing with /cache and partition changes on a booted system is a HUGE risk
bibikalka said:
3) with boot and recovery partitions, how does one boot into Amazon "recovery" then? Has this ever been discovered in terms of how to use it? I assume the regular boot happens from "boot" ?
4) cannot one just write custom recovery into "recovery" via a simple "dd" command ?
Click to expand...
Click to collapse
Bootloader is locked.
If we got fastboot, could we use fastboot oem unlock? Or is that only for certian devices
ryanyz10 said:
If we got fastboot, could we use fastboot oem unlock? Or is that only for certian devices
Click to expand...
Click to collapse
And where would you get the oem unlock code? The fastboot is available, but so what ...
Btw, given how large and empty /cache is, one could use something like *Directory Bind* to redirect some of the app folders from /data to /cache.

Categories

Resources