[GUIDE] Universal guide for making your partitions inside super read-writable again. - Android Software Development

Disclaimer: I'm not responsible for any result of these operations. Please be careful and well prepared. Always have your important data backed up safely on other place.
Hello everyone!
As far as 2022 and Xiaomi gets their new phones updated to MIUI13 and Android 12, they implement the new read-only filesystem "EROFS" on the logical partitions inside super partition. EROFS is a filesystem initial developed by Huawei and then Google select it as a new standard to use in read only logical partition inside super partition from Android 12. The "EROFS", is the short for "Extendable (or Enhanced?) Read-Only Filesystem", conveying that this filesystem is a one-time cooked filesystem and cannot be changed without extracting and re-cooking. With erofs we cannot modify the logical partition anymore so I found a new way to unlock these partitions.
I just faced and managed to solve the "lock" and I would like to share the solution, which may help more people.
My device: Xiaomi 12 (cupid).
System: Stock MIUI13 (Android 12).
Logical partitions with read-only lock inside super partition: system, vendor, product, system_ext, odm, vendor_dlkm. All of them are erofs filesystem.
Be aware that this device is virtual a/b and the _b partitions inside super are 0k blank files. No need to do anything with them.
In theory, all devices shipping with erofs partitions inside super are compatible with this method. Feedbacks are always welcome!
Before we start: This guide is for Android power users that wish to make their Android 12+ read-only system/vendor.... partitions with EROFS filesystem inside super read-writeable again to remove the bloatware and do more customizations to their device.
Credits:
@Yuki1001 - EROFS Guide, research, new rw discoveries.
@lebigmac - a couple of rw slogans, some binaries, inspiration.
Requirements:
1. Your phone must be unlocked as you must flash your new super.img through fastboot command. Root is required to run any command in a terminal (win cmd or linux terminal).
2. 20GB+ free space on your phone and PC.
3. The toolkit needed.
4. A clever brain and courage.
So in short, the tutorial contains these part:
(1) Dump and extract your super image.
(2) Pull the folder with partition images extracted from super image to the PC.
(3) Convert these erofs images to ext4 images (Extract and Rebuild). These new images are in the same folder.
(4) Push the folder to the phone and fix any errors of new generated ext4 images.
(5) Merge them into a new single sparse super image and pull it to the PC.
(6) Flash the new image through fastboot command.
(7) Check the rw capability of the logical partitions and do anything you want!
Let's start now!
1. Get your super image by dumping your current super partition. We can find our super partition in this way:
Code:
su
cd /dev/block/bootdevice/by-name
ls -al | grep "super"
You will get the output like this:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Then we knows the super partition block number and path immediately. Let's dump its data to a file.
Code:
dd if=%PATH_TO_SUPER_BLOCK% of=/data/local/tmp/super_orig.img bs=4096
Wait for the data transfer done and we can get the super image. DO NOT forget to replace "%PATH_TO_SUPER_BLOCK%" with your own super block path!
2. Now we can do things with the super_orig.img: Extract logical partitions inside super partition to a folder. I will use Google's official tool: lpunpack. For example, I extract these partitions inside super to "sup_unpack" folder. Give all binaries in tools folder with executive permission in advance.
Code:
./tools/lpunpack ./super_orig.img sup_unpack
Now check with the folder to confirm whether these partitions insider super are extracted. If so, we can transmit the folder to the PC with adb pull. Extract my unlock-super folder in advance and we need to place the pulled out folder in it.
Code:
adb pull /data/local/tmp/sup_unpack
Now the "sup_unpack" folder exists in the platform-tools folder. Move it to the "unlock-super" folder.
3. Extract these erofs images one by one with erofsUnpackRust.exe and repack them into ext4 image. Check the folders' size to determine how big space does the new ext4 filesystem need. I'd like to recommend you to preset some free space for every new ext4 images for further modifications.
You are required to remove all _a suffix for the images in order to make the following program works properly. For example: system_a.img --> system.img. You have been warned!
For example:
Code:
erofsUnpackRust sup_unpack/system.img system
erofsUnpackRust sup_unpack/vendor.img vendor
erofsUnpackRust sup_unpack/product.img product
.... (and so on)
You will get the output like these screenshots:
For building a new image, we need to set a timestamp for all files included. I use 1230764400 as it equals the original file timestamp in erofs image. DO NOT forget to replace %FS_SIZE% with your real fs size you want. So go with the following command:
Code:
***DO NOT COPY!***
Example:
System:
make_ext4fs -J -T 1230764400 -S system/config/system_file_contexts -l %FS_SIZE% -C system/config/system_fs_config -L system -a system system_a.img system/system
Vendor:
make_ext4fs -J -T 1230764400 -S vendor/config/vendor_file_contexts -l %FS_SIZE% -C vendor/config/vendor_fs_config -L vendor -a vendor vendor_a.img vendor/vendor
For odm, product, system_ext, vendor_dlkm...... and other partitions, use the same step.
You should get the output like these screenshots:
When you completed the steps above you should have the images in ext4 format. Then make a folder named "new_ext4" and move the new image files (_a suffix) to the new_ext4 folder. Make sure all partitions' images are correctly rebuilt.
Copy the _b blank files toghether with new built _a images:
4. Push the folder that contains your image to /data/local/tmp again. In my case use this command:
Code:
adb push new_ext4 /data/local/tmp/new_ext4
Then check whether the new folder exists in the correct place. DO NOT forget to use e2fsck -yf to fix any errors of the new images before joining them into a super image.
5. Now we have all partitions unlocked and corrected but we need to join them into a single "super_new.img" for flashing. Use the lpmake tool to create the new "super_new.img". Again, DO NOT forget to replace %SUPER_SIZE% with your super partition's physical size (the size of super_orig.img) , and replace mulitiple %SIZE% with the real size of your new built ext4 images (with _a suffix) .
Code:
***DO NOT COPY!***
cd /data/local/tmp/new_ext4
../tools/lpmake --output super_new.img --sparse --metadata-size 65536 --super-name super --metadata-slots 2 --device super:%SUPER_SIZE% --group slot_a:%SUPER_SIZE% --group slot_b:0 --partition system_a:none:%SIZE%:slot_a --image system_a=./system_a.img --partition vendor_a:none:%SIZE%:slot_a --image vendor_a=./vendor_a.img --partition product_a:none:%SIZE%:slot_a --image product_a=./product_a.img --partition system_ext_a:none:%SIZE%:slot_a --image system_ext_a=./system_ext_a.img --partition odm_a:none:%SIZE%:slot_a --image odm_a=./odm_a.img --partition vendor_dlkm_a:none:%SIZE%:slot_a --image vendor_dlkm_a=./vendor_dlkm_a.img --partition odm_b:none:0:slot_b --image odm_b=./odm_b.img --partition system_b:none:0:slot_b --image system_b=./system_b.img --partition vendor_b:none:0:slot_b --image vendor_b=./vendor_b.img --partition product_b:none:0:slot_b --image product_b=./product_b.img --partition system_ext_b:none:0:slot_b --image system_ext_b=./system_ext_b.img --partition vendor_dlkm_b:none:0:slot_b --image vendor_dlkm_b=./vendor_dlkm_b.img
In the command we use --sparse parameter to let the new joined super image sparse, for the following fastboot flash.
6. Pull the new super_new.img to the computer. Do the fastboot flash. Erase the super partition and flash the new image.
Code:
adb pull /data/local/tmp/new_ext4/super_new.img
fastboot erase super
fastboot flash super super_new.img
Now the partitions inside super should already have full r/w capability. Reboot the phone to check whether they can be mounted as r/w.
Voila!
All tools are provided as attachments.
Password: super-rw
If you think it's useful, please click the "Like" button. Thanks!

Reserved floor #2.

Reserved floor #3.

\unlock-super>erofsUnpackRust Download/product.img product
erofsUnpack 1.3.211216
<E> erofs: cannot find valid erofs superblock
thread '<unnamed>' panicked at 'read erofs super block failed', src\lib.rs:168:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

getting this error in vendor extracting
C:\unlock-super>erofsUnpackRust Download/product.img product
erofsUnpack 1.3.211216
<E> erofs: cannot find valid erofs superblock
thread '<unnamed>' panicked at 'read erofs super block failed', src\lib.rs:168:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

now this is
unlock-super>make_ext4fs -J -T 1230764400 -S system/config/system_file_contexts -l 626733056 -C system/config/system_fs_config -L system -a system system_a.img system/system
loaded 3141 fs_config entries
Creating filesystem with parameters:
Size: 626733056
Block size: 4096
Blocks per group: 32768
Inodes per group: 7664
Inode size: 256
Journal blocks: 0
Label: system
Blocks: 153011
Block groups: 5
Reserved block group size: 39
error: ext4_allocate_best_fit_partial: failed to allocate 4720 blocks, out of space?
Failed to create image system_a.img, removing it

Mr Hassan said:
now this is
unlock-super>make_ext4fs -J -T 1230764400 -S system/config/system_file_contexts -l 626733056 -C system/config/system_fs_config -L system -a system system_a.img system/system
loaded 3141 fs_config entries
Creating filesystem with parameters:
Size: 626733056
Block size: 4096
Blocks per group: 32768
Inodes per group: 7664
Inode size: 256
Journal blocks: 0
Label: system
Blocks: 153011
Block groups: 5
Reserved block group size: 39
error: ext4_allocate_best_fit_partial: failed to allocate 4720 blocks, out of space?
Failed to create image system_a.img, removing it
Click to expand...
Click to collapse
The size setting of your new ext4 img is too small. Consider a larger value.
EDIT: Normally, your files maybe 2GB+ larger than the erofs img. Check your files' real size and give a good value to -l parameter.

Yuki1001 said:
The size setting of your new ext4 img is too small. Consider a larger value.
EDIT: Normally, your files maybe 2GB+ larger than the erofs img. Check your files' real size and give a good value to -l parameter.
Click to expand...
Click to collapse
My ext have around 900mb
And vendor something like 1400mb
And both are getting same error
I thought maybe big size i just try remove some file but still same
If its small size issue then how can increase or large it?
Or should i merge both partitions on same but i don't think it'll be possible

Mr Hassan said:
My ext have around 900mb
And vendor something like 1400mb
And both are getting same error
I thought maybe big size i just try remove some file but still same
If its small size issue then how can increase or large it?
Or should i merge both partitions on same but i don't think it'll be possible
Click to expand...
Click to collapse
Would you like to take some screenshots of your extracted folder's size and the original image's size?
PS: After calculating all your files' total size, I recommend you to reserve at least 500MB+ free space inside your new ext4 image.

Mr Hassan said:
My ext have around 900mb
And vendor something like 1400mb
And both are getting same error
I thought maybe big size i just try remove some file but still same
If its small size issue then how can increase or large it?
Or should i merge both partitions on same but i don't think it'll be possible
Click to expand...
Click to collapse
You on oos 11 ?oos 11 have no erofs
Oos 12 have erofs

ChrisFeiveel84 said:
You on oos 11 ?oos 11 have no erofs
Oos 12 have erofs
Click to expand...
Click to collapse
Ofcourse I'm in os12

Yuki1001 said:
Would you like to take some screenshots of your extracted folder's size and the original image's size?
PS: After calculating all your files' total size, I recommend you to reserve at least 500MB+ free space inside your new ext4 image.
Click to expand...
Click to collapse
Sure tomorrow I'll send you the screen shot of unpack and img both images

Yuki1001 said:
Before we start: This guide is for Android power users that wish to make their Android 12+ read-only system/vendor.... partitions with EROFS filesystem inside super read-writeable again to remove the bloatware and do more customizations to their device.
Click to expand...
Click to collapse
Yuki1001 said:
Now the partitions inside super should already have full r/w capability. Reboot the phone to check whether they can be mounted as r/w.
Click to expand...
Click to collapse
Hi @Yuki1001
Please keep up the great work! The more people have RW access to their own devices the better for the open source community!
If you want to integrate your erofs fix into my script please contact me! Of course you will be properly credited!

Well its not looks like yours kind of
But you know better
But its good thing if he helping people's with a different way
I personally like this thread becoz i just want to make one vendor rw
And then I'm able to boot after flash
edited remove quote on @
Yuki1001 request​

and today its not even unpack dont know where doing mistake
unlock-super>erofsUnpackRust Download/vendor.img vendor
erofsUnpack 1.3.211216
<E> erofs: cannot find valid erofs superblock
thread '<unnamed>' panicked at 'read erofs super block failed', src\lib.rs:168:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Reserved floor#16.

Mr Hassan said:
and today its not even unpack dont know where doing mistake
unlock-super>erofsUnpackRust Download/vendor.img vendor
erofsUnpack 1.3.211216
<E> erofs: cannot find valid erofs superblock
thread '<unnamed>' panicked at 'read erofs super block failed', src\lib.rs:168:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Click to expand...
Click to collapse
I had problems extracting my vendor.img using others' erofs unpack tools. Only the erofsunpackrust.exe works. Maybe your vendor.img is special? (which means you need to try other erofs unpack tools for luck)

Yuki1001 said:
I had problems extracting my vendor.img using others' erofs unpack tools. Only the erofsunpackrust.exe works. Maybe your vendor.img is special? (which means you need to try other erofs unpack tools for luck)
Click to expand...
Click to collapse
but same thing i used before and works for me and you see upper results
anyway now is there any other erofs avaliable to test?

Yuki1001 said:
Would you like to take some screenshots of your extracted folder's size and the original image's size?
PS: After calculating all your files' total size, I recommend you to reserve at least 500MB+ free space inside your new ext4 image.
Click to expand...
Click to collapse
here,s the size of vendor unpack and repack

Mr Hassan said:
View attachment 5716687View attachment 5716689
here,s the size of vendor unpack and repack
Click to expand...
Click to collapse
So you could to set the ext4 vendor image to 2G. 2G = 2147483678 bytes. Try to set the -l parameter to 2147483648.

Related

[RAM] S2 Partitioning of RAM

I run a pure ICS ROM, with all the Samsung apps and addons removed.
But I still have a 500Mb partition mounted under "/preload". Samsung stuff.
This renders 500Mb of RAM useless since the "pure" ICS does not store anything there. This could be used for /data instead.
Now, can anyone point me to a .pit file I can use that does not have that partition included, or better still, how do I edit or create my own .pit file. I tried fdisk but with no luck.
[email protected]:/ # df -kh
Filesystem Size Used Available Use% Mounted on
tmpfs 415.3M 32.0K 415.3M 0% /dev
tmpfs 415.3M 0 415.3M 0% /mnt/asec
tmpfs 415.3M 0 415.3M 0% /mnt/obb
/dev/block/mmcblk0p9 503.9M 282.1M 221.8M 56% /system
/dev/block/mmcblk0p7 98.4M 4.1M 94.4M 4% /cache
/dev/block/mmcblk0p1 19.7M 8.2M 11.5M 42% /efs
/dev/block/mmcblk0p10 2.0G 368.6M 1.6G 18% /data
/dev/block/mmcblk0p12 503.9M 8.4M 495.6M 2% /preload
You shouldn't be trying to mess with PIT. Believe me.
Also, you misspelled Storage. That's not RAM.
Sent from my GT-I9100 using XDA App
Sorry, storage ofcourse.
My basic plan was to just backup /data, remove the /preload & /data partition and recreate /data with a size of 2.5Gb. But nooo... fdisk does not want me to do this.
Been using Linux for 15 years so I thought that would work.
Are there no recoveries with partitioning tools out there? Like CWM but not only with sdcard-partitioning.
This kind of worries me too, it seldom is good... fdisk output:
The number of cylinders for this disk is set to 1923584.
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): p
Disk /dev/block/mmcblk0: 15.7 GB, 15758000128 bytes
1 heads, 16 sectors/track, 1923584 cylinders
Units = cylinders of 16 * 512 = 8192 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 1923456 15387647+ ee EFI GPT
Partition 1 does not end on cylinder boundary
Command (m for help): v
Partition 1 does not end on cylinder boundary
Partition 1: sector 0 greater than maximum 16
2048 unallocated sectors
Command (m for help):
Let me explain it straight : Bootloader and PIT are tightly linked together. PIT is set by samsung and mapped directly to the bootloader initialization. If you bork the PIT, the bootloader is borked too, leading to device not booting at all (even in download mode).
Just leave that partition alone and enjoy your phone. You certainly won't even use those 500MB.
And by the way, a phone's storage partitionning is not a hard drive. You don't just fdisk like on a computer.
bodhisattva99 said:
Sorry, storage ofcourse.
My basic plan was to just backup /data, remove the /preload & /data partition and recreate /data with a size of 2.5Gb. But nooo... fdisk does not want me to do this.
Been using Linux for 15 years so I thought that would work.
Are there no recoveries with partitioning tools out there? Like CWM but not only with sdcard-partitioning.
This kind of worries me too, it seldom is good... fdisk output:
The number of cylinders for this disk is set to 1923584.
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): p
Disk /dev/block/mmcblk0: 15.7 GB, 15758000128 bytes
1 heads, 16 sectors/track, 1923584 cylinders
Units = cylinders of 16 * 512 = 8192 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 1923456 15387647+ ee EFI GPT
Partition 1 does not end on cylinder boundary
Command (m for help): v
Partition 1 does not end on cylinder boundary
Partition 1: sector 0 greater than maximum 16
2048 unallocated sectors
Command (m for help):
Click to expand...
Click to collapse
If it were that easy, someone would have done it already. I suggest just symlinking the partition to a folder if you really want to use the extra space... If you're adventurous, find a way of using it for Dalvik.
XpLoDWilD said:
Let me explain it straight : Bootloader and PIT are tightly linked together. PIT is set by samsung and mapped directly to the bootloader initialization. If you bork the PIT, the bootloader is borked too, leading to device not booting at all (even in download mode).
Just leave that partition alone and enjoy your phone. You certainly won't even use those 500MB.
And by the way, a phone's storage partitionning is not a hard drive. You don't just fdisk like on a computer.
Click to expand...
Click to collapse
Thanks for a great answer. Case closed I guess.
I moved dalvik there by soft linking it and so far everything seems to work fine.
After a reboot the filesystem is mountrd RO. Not quite sure where to change that. Something like /etc/fstab.... Anyone?
EDIT: Found it, init.rc....
OK, next dumb question, as the init.rc gets overwritten on reboot, where is the original?
bodhisattva99 said:
OK, next dumb question, as the init.rc gets overwritten on reboot, where is the original?
Click to expand...
Click to collapse
I believe it's in initramfs packed with the kernel.
oinkylicious said:
I believe it's in initramfs packed with the kernel.
Click to expand...
Click to collapse
OK, that sucks since I cannot recompile it.
I solved it by a script in /system/etc/init.d/ , its an ugly 5-minuter but it does the job.
Works on every reboot, if the dalvik is already moved nothing happens, I just get some stderr. Takes a few seconds the first time.
Will extend tomorrow if a "wipe dalvik-cache" is done from recovery. It wont handle that right now.
----- script -----
mount /preload -o remount,rw,nosuid,nodev,noatime,noauto_da_alloc
chmod 0771 /preload
mv /data/dalvik-cache /preload/
ln -s /preload/dalvik-cache /data/dalvik-cache
----- script -----
Ahh, no more wasted space!
bodhisattva99 said:
OK, that sucks since I cannot recompile it.
Click to expand...
Click to collapse
Sure you can, it's pretty straightforward. [GUIDE]Unpack/Repack initramfs in zImage (i9100)
XpLoDWilD said:
You shouldn't be trying to mess with PIT. Believe me.
Also, you misspelled Storage. That's not RAM.
Sent from my GT-I9100 using XDA App
Click to expand...
Click to collapse
You can tell people this multiple times mate but they tend not to listen until one day you see a post: "Halp, ma fone.. it b0rk"
oinkylicious said:
Sure you can, it's pretty straightforward. [GUIDE]Unpack/Repack initramfs in zImage (i9100)
Click to expand...
Click to collapse
Many thanks! Some play for to tomorrow then.
Intratech said:
You can tell people this multiple times mate but they tend not to listen until one day you see a post: "Halp, ma fone.. it b0rk"
Click to expand...
Click to collapse
OK, OK, I got the message...
Sorry wasn't directed at you... was just a general statement.
Intratech said:
Sorry wasn't directed at you... was just a general statement.
Click to expand...
Click to collapse
No prob, better than I learn it the hard way...
You boy have a heart of a Jedi. Full respect. Hopefully no one will cry like an Ewok soon
Sent from my GT-I9100 using xda premium
Sorry for all the stupid questions but I only had the S2 for three days.
OK, here goes... nothing...
Seems to repack fine. Lets just hope I did the scripting OK.
Will upload once I've tried it out myself...
[email protected] ~/work/android/initramfs-tools $ ./repack boot.img initramfs-bodhisattva99_v1.0.cpio
---------------------------kernel repacker for i9100---------------------------
Extracting gzip'd kernel from boot.img (start = 17972)
CPIO compression type detected = gzip | offset = 193180
CPIO image MAX size:1921884
Head count:2115064
Making head.img ( from 0 ~ 193180 )
Making a tail.img ( from 2115064 ~ 10031364 )
Current ramdsize using cat : 3272192 with required size : 1921884 bytes
Current ramdsize using gzip -f9 : 1916756 with required size : 1921884 bytes
gzip -f9 accepted!
Merging [head+ramdisk] + padding + tail
Now we are rebuilding the zImage
Image ---> piggy.gzip
piggy.gzip ---> piggy.gzip.o
Compiling head.o
Compiling misc.o
Compiling decompress.o
Compiling lib1funcs.o
Create vmlinux.lds
head.o + misc.o + piggy.gzip.o + decompress.o + lib1funcs.o---> vmlinux
vmlinux ---> zImage
New zImage size:5740672
Padding new zImage to 8388608 bytes
Padding sufiles to new_zImage
new_zImage has been created
Cleaning up...
finished...
Haha... lets try it!
Well,all this is nice and you have my respect for being fearless with these matters,but some months ago there was another interesting idea for the proper use of the hidden partition.A hidden porn stash.Works like a charm.
I don't remember who proposed that,but kudos to him.
OK, can someone explain to me how to build a CWM flashable .zip with the new zImage?
Been searching forum for 2 hours and I can only find how to build application zips, not kernel...
It should also prefferably have a script in it that runs the following after updating the kernel/boot.img
rm -rf /data/dalvik-cache
ln -s /preload/dalvik-cache /data/dalvik-cache
bodhisattva99 said:
OK, can someone explain to me how to build a CWM flashable .zip with the new zImage?
Been searching forum for 2 hours and I can only find how to build application zips, not kernel...
It should also prefferably have a script in it that runs the following after updating the kernel/boot.img
rm -rf /data/dalvik-cache
ln -s /preload/dalvik-cache /data/dalvik-cache
Click to expand...
Click to collapse
Flash with mobile odin
Sent from my GT-I9100 on CM9 using Tapatalk

[Q] Semi-soft hard non-brick - just looking for ideas

Anyway, I was using Miui V3 2.4.20 [2.6.35], and Google maps wasn't very happy with it. So I decided it was time to move on to the .32 kernal version, since the developer was going that way too. Downloaded a stock rom with .32 kernal, went to the pink screen and flashed, and then boot loop.
Luckily, I'm awesome, so my phone won't die on me. Tried flashing some roms through clockwork, no bootloop, just stuck at huawei logo. Tried flashing some stock roms, and at about 98% done flashing it goes error. Some parts get flashed causing my recovery reverts to stock, but I'm still stuck at the huawei logo.
Also, in clockworkmod I get errors mounting data and emmc, so that might be a problem. Other partitions mount fine.
I'm sure I'll find a solution eventually, so there's no rush. I've been in similar situations before. Just wanted to see what other people had used for similar situations. So if you know of something that would help, please let me know.
Found these through search (I'll do a better search again later), i will try them tomorrow:
http://forum.xda-developers.com/showpost.php?p=18944228&postcount=4
http://forum.xda-developers.com/showthread.php?t=1683249
http://forum.xda-developers.com/showthread.php?t=1689469
http://forum.xda-developers.com/showthread.php?t=1682501
http://forum.xda-developers.com/showthread.php?t=1011527
After reading a lot of threads, attempting to flash a lot of roms (stock and others), replacing all kinds of images, and offering a sacrifice to the cellphone gods, still at the same problem:
To reiterate problem:
1) Stuck/reboots at Huawei logo
2) Flashing stock roms via pink screen never finish installing, get error message at ~95% finished (During install, unpacks fine)
3) Flashing roms via recovery say they installed, but still boot problem
4) This problem occurred while trying to downgrade from .35 to .32
My next step is to try using Linux to put the Dload folder on the internal SD card and try installing from there. I have a feeling it is related to the partitions having problems. I used both the "get back pink screen" and "data partition resize," maybe something went wrong with them that only appeared when I tried to go back to stock. I'll find out more when I install linux and can see if the partitions are OK or not.
I've always wanted to try linux, and now that my phone is broke I have found the motivation to do so. So a word of advice for people for people wanting to try linux but are too lazy to download the linux file: Soft-brick your phone, it gives you motivation.
UPDATE: I'm pretty sure my partition table is broke pretty bad. In adb shell, df gives me:
Filesystem Size Used Free
/dev 173M 64K 172M
/system 203M 200M 2M
/cache 127M 4M 123M
and that's it. No /HWUserData, /.cust_backup, /mnt/asec, /mnt/obb, or /data.
Would someone be as kind as to tell me how to fix the partition table? I've got a soldering iron, duct tape and super glue. Also, I'm not afraid to buy a "box" to do some Jtag stuff.
Anybody know what Blefish uses to format the phone memory? I read on his tumbler page and his github that he has altered the partition table (he split the /hwuserdata into three sections, which means he has the ability to create partitions) If I can get that tool, then I have a plan:
0) If my understanding is correct, the updates don't install because the needed partitions are missing, which causes an error. I guess the updates won't create partitions, just alter them.
1) Use the tool blefish used to setup the partition table as described in this thread: http://forum.xda-developers.com/showthread.php?t=1504488
2) Once the partitions are back, i should at least be able to get the blue screen, if I'm good, then I can put all right files in /dev/sdb1, which will get me the pink screen.
3) Using the blue/pink screen, I can install stock firmware, which should correct any problems that the partition table has. Maybe even install android.
4) Do the happy dance
5) ???
6) Profit
I've done my homework, searched the forums, made a plan, and cleaned my room. Someone please give me some feedback and at least let me know if I'm heading in the right direction.
typci said:
Anybody know what Blefish uses to format the phone memory?
Click to expand...
Click to collapse
I am using fdisk, the main partitioning tool for MBR table. You can check the table by doing fdisk /dev/block/mmcblk0 and then "p" which should print the current partition table. From there, you can also modify the partitions.
Sent from my U8800 using Tapatalk 2
Blefish said:
I am using fdisk, the main partitioning tool for MBR table. You can check the table by doing fdisk /dev/block/mmcblk0 and then "p" which should print the current partition table. From there, you can also modify the partitions.
Sent from my U8800 using Tapatalk 2
Click to expand...
Click to collapse
Awesome. I used to use fdisk back in the dos days, so I just need to brush up on my skills and learn the adb specifics. I really need to take the time to go learn all the commands associated with adb.
INTERESTING UPDATE: If I flash a rom with locked boot loader, I still get the pink screen but it doesn't work, i.e. I can't access the image folder via windows. If I flash a rom without a locked boot loader, pink screen works. Granted none of these roms actually fully flash, I still get the error near the end.
Fdisk = Permission denied, su = permission denied. Rooted boot image prevents me from getting into recovery, which means adb won't work. Any other way to get root? I'll try flashing a custom rom when I can get clockworkmod working again. For some reason I can't get recovery to load via vol+ & power.
Also something weird is going on. When it boots, it reboots once, then goes to stock recovery, tries to do a factory reset, gets errors on formating. Also in windows two removable disks appear, but I can access them. I take it that they represent the internal SD card and maybe the pink screen image folder partition. Tomorrow I'll try linux and see what happens.
UPDATE:
1) I can't use FDISK because SU won't work. I'm not sure how SU/root works on a software/partition bricked phone.
2) Rooted boot.img won't boot into recovery. SuperOneClick won't work because it can't find the data partition (probably because I don't have one).
3) I was going to try flashing a custom rom but for some reason I can't get clockworkmod working again. The phone will boot into stock recovery on it's own, after a couple of reboots. However, if I change the boot.img or recovery.img to anything else, it gets stuck at huawei logo or boot loop.
4) Unbuntu LiveCD won't work (says it can't find the kernal) even though I used the installer from the website and tried it both via cd and flash drive. Working on installing a dual-boot system now.
I'm really striking out here. Couple of questions if anyone would care to answer.
1) Besides recovery, how else can I establish an adb connection? Pink screen and huawei logo give me device not found.
2) Is there a root exploit available that doesn't require a data partition or is there a root exploit I can modify so it doesn't require a data partition? It's OK if it's a manual exploit, while I'm new with android/adb, I got plenty of experience with command prompt input from back in the dos days.
Also learned there is a HuaWei office in my town. Don't know what they do there, but if I don't make any progress after I couple more days, I'll go find out.
typci said:
UPDATE:
1) I can't use FDISK because SU won't work. I'm not sure how SU/root works on a software/partition bricked phone.
2) Rooted boot.img won't boot into recovery. SuperOneClick won't work because it can't find the data partition (probably because I don't have one).
3) I was going to try flashing a custom rom but for some reason I can't get clockworkmod working again. The phone will boot into stock recovery on it's own, after a couple of reboots. However, if I change the boot.img or recovery.img to anything else, it gets stuck at huawei logo or boot loop.
4) Unbuntu LiveCD won't work (says it can't find the kernal) even though I used the installer from the website and tried it both via cd and flash drive. Working on installing a dual-boot system now.
I'm really striking out here. Couple of questions if anyone would care to answer.
1) Besides recovery, how else can I establish an adb connection? Pink screen and huawei logo give me device not found.
2) Is there a root exploit available that doesn't require a data partition or is there a root exploit I can modify so it doesn't require a data partition? It's OK if it's a manual exploit, while I'm new with android/adb, I got plenty of experience with command prompt input from back in the dos days.
Also learned there is a HuaWei office in my town. Don't know what they do there, but if I don't make any progress after I couple more days, I'll go find out.
Click to expand...
Click to collapse
On pink screen, your device is just like any other mass storage device. So you can still use fdisk on ubuntu with the correct /dev/sdX path. You can also format the data/system/cache using other tools if you need to.
Sent from my U8800 using Tapatalk 2
Sweet, so I just need to get Unbuntu working. I still can't figure out why the live CD/flash drive didn't work. Oh, well. When I get off of work I'll get to installing the dual-boot system. Thanks for your help.
typci said:
Sweet, so I just need to get Unbuntu working. I still can't figure out why the live CD/flash drive didn't work. Oh, well. When I get off of work I'll get to installing the dual-boot system. Thanks for your help.
Click to expand...
Click to collapse
i actually understood nothing from your posts but i would like to congratulate you for being a user who does research before asking ppl something
and I gladly give you a bump
JaymzBond said:
i actually understood nothing from your posts but i would like to congratulate you for being a user who does research before asking ppl something
and I gladly give you a bump
Click to expand...
Click to collapse
Thanks. Unfortunately the project is on hold for a couple of days. My electric motorcycle has been having some problems and I've been repairing it. Also, I think I found out why linux wasn't working. Apparently the "alternative" downloads aren't useable as a live CD, which is why the kernal wasn't there. Anyway, it's been a great learning experience. Maybe after I "break" my phone enough times I'll learn enough to become a developer.
Doing some research before getting back to working on the phone.
Looks like Blefish is talking about using linux's fdisk, when I was trying to use adb's fdisk. That would certainly allow me to bypass the su problem with adb. I think I got all the correct files for my linux livecd, so that shouldn't be a problem. After I'm done with my workout, I'll try it out and see how it goes. It's time to learn how to use linux.
Update: Got unbuntu working. Storage devices are all /media instead of /dev like I was expecting. But I think I'm not looking in the right place.
Plugged in phone via pink screen and 3 drives came up:
System - has system stupp (app, bin, etc, fonts, ...) - sdb12
256 MB File system - image folder with all the .img and .mbn files - sdb1
136 MB File system - has fotapkg, lost+found, recovery folders- filesystem type ext3/ext4 - I'm not sure what this is, maybe sdb6? If it was data (sdb13) then I wouldn't get the error in recovery, If it was the internal SD card the filesystem should be vfat. If someone knows better, please let me know.
For some reason I don't have permission to access the lost+found folder, or so Unbuntu tells me.
Tried to used fdisk with system, got error: I don't know how to handle files with mode 40755
Also found some recovery log files in the fotapkg and recovery folders. I'll post it here incase someone can get some more useful information out of it. Does anyone know what all these (null) mean?
Tomorrow I'll get to work on learning how to use unbuntu and fdisk.
Starting recovery on Sun Jan 6 00:03:50 1980
can't open /dev/tty0: No such file or directory
framebuffer: fd 3 (480 x 800)
recovery filesystem table
=========================
0 /tmp ramdisk (null) (null)
1 /boot vfat /dev/block/mmcblk0p1 (null)
2 /fat vfat /dev/block/mmcblk0p1 (null)
3 /cache ext4 /dev/block/mmcblk0p6 (null)
4 /data_pseudo ext4 /dev/block/mmcblk0p13 (null)
5 /misc emmc /dev/block/mmcblk0p7 (null)
6 /recovery vfat /dev/block/mmcblk0p1 (null)
7 /HWUserData vfat /dev/block/mmcblk0p14 (null)
8 /system ext4 /dev/block/mmcblk0p12 (null)
9 /sdcard vfat /dev/block/mmcblk1p1 /dev/block/mmcblk1
I:cmdline: console=ttyDCC0 androidboot.hardware=huawei androidboot.localproppath=hw/default androidboot.emmc=true androidboot.image=recovery androidboot.mode=user androidboot.baseband=msm
Ita_move_command_file
I:Got arguments from boot message
Command: "recovery" "--wipe_data" "--wipe_cache"
Formatting /cache...
Creating filesystem with parameters:
Size: 136314880
Block size: 4096
Blocks per group: 32768
Inodes per group: 4160
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 33280
Block groups: 2
Reserved block group size: 15
Created filesystem with 11/8320 inodes and 1585/33280 blocks
E:failed to mount /data_pseudo (No such file or directory)
E:failed to mount /data_pseudo (No such file or directory)
Formatting /data...
Need size of filesystem
E:format_volume: make_extf4fs failed on /dev/block/mmcblk0p13
E:failed to mount /data_pseudo (No such file or directory)
E:failed to mount /data_pseudo (No such file or directory)
Formatting /cache...
Creating filesystem with parameters:
Size: 136314880
Block size: 4096
Blocks per group: 32768
Inodes per group: 4160
Inode size: 256
Journal blocks: 1024
Label:
Blocks: 33280
Block groups: 2
Reserved block group size: 15
Created filesystem with 11/8320 inodes and 1585/33280 blocks
Data wipe failed.
wipe internal sdcard fail.
It could be that the data partition (originally mmcblk0p13) got wiped out and now mmcblk0p13 is internal sd card. Here's the original partition table:
Code:
Disk /dev/block/mmcblk0: 3959 MB, 3959422976 bytes
1 heads, 16 sectors/track, 483328 cylinders
Units = cylinders of 16 * 512 = 8192 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 30721 245760 b Win95 FAT32 CUST
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 * 30721 30783 500 4d Unknown SBL1
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 30783 31158 3000 46 Unknown TZ
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 31158 483328 3617363+ 5 Extended EBR
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 32769 34304 12288 59 Unknown OEMINFO/BOOTLOADER IMAGES
/dev/block/mmcblk0p6 40961 57600 133120 4c Unknown CACHE
/dev/block/mmcblk0p7 65537 65599 500 5a Unknown MISC
/dev/block/mmcblk0p8 73729 74112 3072 58 Unknown FSG?
/dev/block/mmcblk0p9 81921 82795 7000 50 Unknown ADSP
/dev/block/mmcblk0p10 90113 90496 3072 4a Unknown MODEM_ST1
/dev/block/mmcblk0p11 98305 98688 3072 4b Unknown MODEM_ST2
/dev/block/mmcblk0p12 106497 134656 225280 83 Linux SYSTEM
/dev/block/mmcblk0p13 139265 216064 614400 83 Linux USERDATA
/dev/block/mmcblk0p14 221185 483328 2097152 69 Unknown INTERNAL_SD
The sdb6 is indeed cache, and it is used for recovery communication between Android.
If everything would be ok, it would mount sdb1, sdb6, sdb12, sdb13 and sdb14 inside Ubuntu, so it seems that something is wrong at the end.
If you have 14 partitions, use disk utility from Ubuntu and try manually formatting the 13 for ext4 and 14 for vfat. Taking ownership is not needed, it should work either way.
Blefish, thanks for the help. Got unbuntu up and working along with fdisk and identified the phone.
I have 13 partitions (including one empty one) , not 14. Here's the print out:
[email protected]:~$ sudo fdisk /dev/sde
omitting empty partition (13)
Command (m for help): p
Disk /dev/sde: 3959 MB, 3959422976 bytes
1 heads, 62 sectors/track, 124729 cylinders, total 7733248 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000
Device Boot Start End Blocks Id System
/dev/sde1 1 491520 245760 b W95 FAT32
/dev/sde2 * 491521 492520 500 4d QNX4.x
/dev/sde3 492521 498520 3000 46 Unknown
/dev/sde4 498521 7733247 3617363+ 5 Extended
/dev/sde5 524288 548863 12288 59 Unknown
/dev/sde6 655360 921599 133120 4c Unknown
/dev/sde7 1048576 1049575 500 5a Unknown
/dev/sde8 1179648 1185791 3072 58 Unknown
/dev/sde9 1310720 1324719 7000 50 OnTrack DM
/dev/sde10 1441792 1447935 3072 4a Unknown
/dev/sde11 1572864 1579007 3072 4b Unknown
/dev/sde12 1703936 2154495 225280 83 Linux
Comparing with your partition table I see two differences:
1) the ending block of sde1 is 491520 on mine and on the original it is 30721, however the blocks are the same, so that is probably not a problem
2) sde13 is empty, and sde14 is missing.
This actually makes sense. When I was using MIUI, I reduced the size of the internal sd to near zero, since MIUI could only either the internal or external sd, not both. After trying to downgrade, I had a problem, so I tried to restore the internal sd card back to stock size, just to bring my phone back to stock. Something must have gone when I did that.
So if I understand the problem correctly, to fix this I need to:
1) Split sde13 into 2 partitions
2) Format sde13 to ext4 and sde14 to vfat
3) Try installing adroid again
Do I need to name the partitions a certain name or do anything else?
In the mean time I'll be looking into how to use disk utility and fdisk to deal with sde13 and sde14.
Had an idea that I only need sde13 (data) to get things working again, the system shouldn't need sde14 (internal sd) to work.
So I went to disk utility, found Qualcomm MMC storage and tried to format the free 2.9GB at the end. Got an error:
Error creating partition: helper exited with exit code 1: In part_add_partition: device_file=/dev/sde, start=1103101952, size=2856000000, type=0x83
Entering MS-DOS parser (offset=0, size=3959422976)
MSDOS_MAGIC found
looking at part 0 (offset 512, size 251658240, type 0x0b)
new part entry
looking at part 1 (offset 251658752, size 512000, type 0x4d)
new part entry
looking at part 2 (offset 252170752, size 3072000, type 0x46)
new part entry
looking at part 3 (offset 255242752, size 3704180224, type 0x05)
Entering MS-DOS extended parser (offset=255242752, size=3704180224)
readfrom = 255242752
MSDOS_MAGIC found
readfrom = 255243264
MSDOS_MAGIC found
readfrom = 255243776
MSDOS_MAGIC found
readfrom = 255244288
MSDOS_MAGIC found
readfrom = 255244800
MSDOS_MAGIC found
readfrom = 255245312
MSDOS_MAGIC found
readfrom = 255245824
MSDOS_MAGIC found
readfrom = 255246336
MSDOS_MAGIC found
readfrom = 1140842496
No MSDOS_MAGIC found
Exiting MS-DOS extended parser
Exiting MS-DOS parser
MSDOS partition table detected
containing partition table scheme = 1
got it
Error: Invalid partition table on /dev/sde -- wrong signature 0.
ped_disk_new() failed
So, my partition table is corrupt? I'll need to figure out how to fix this.
Here's some options I've found:
http://forum.xda-developers.com/showpost.php?p=21572216&postcount=12
ksatta mentions a couple of ideas:
1) If someone backed up their phone using dd, I could use that to restore my phone.
Here's a link on how to do it: http://linuxpoison.blogspot.com/2009/04/creating-backuprestore-images-using-dd.html
dd if=/dev/sdX | gzip > /home/sdX.bin.gz
where sdX is the U8800
2) I could clone someone's partition table. If someone could give me a copy of their MBR that should work.
Here's a link on how to do it: http://embraceubuntu.com/2005/10/20/backing-up-the-mbr/
Create a backup of your MBR by doing a:
dd if=/dev/sdX of=MBR-backup bs=512 count=1
That should read “create a disk dump of the input file, which is /dev/sdx (change to hda, or hdb or sda, depending on where the MBR is on your computer), and save it in the output-file MBR-backup in the directory from where the command is issued. Backup the first sector only, while you are at it”.
3) gparted - it's some kind of partition tool. Might be able to use it to fix the error. Not sure how to use it though.
For now I'm going to look into gparted for Ubuntu. If someone can help me out with a dd backup or cloning the partition table that would be awesome.
UPDATE: For people following this thread, and to keep me more organized, I'll start adding more of the important resources I find. They may one day help you fix your phone.
https://bugs.launchpad.net/ubuntu/+source/gparted/+bug/434463
Seems a guy fixed his the same error with gparted. However it wasn't on a phone. Also I'm seem a lot of people refer to sfdisk. I'll need to learn more about it.
https://answers.launchpad.net/ubuntu/+question/113539
"I got an answer in a forum, which looks easy.
Do a
sudo fdisk /dev/sda
then type
w
to write partition table, without any modification of it.
The signature should be fixed."
Is this safe to do to my phone? I know I'll have to write the MBR eventually, but I have to get it right the first time. If I screw up, I may not be able to connect to ubuntu anymore. Anyway, the guy said it fixed the error with his harddrive, so it's worth a try.
http://www.thegeekstuff.com/2010/09/linux-fdisk/
How to use fdisk, in case anyone needs to know
So my new plan is to:
1) dd Backup and MBR backup - in case I break it worse than it is
2) try to fix with fdisk w or gparted
I think the change in start and end is caused by Ubuntu using cylinders/sectors/blocks. Should not too much difference though.
Using MBR restore would not work here, as it restores the main 4 partitions list. MBR uses EBR aswell, which is located at the beginning of every extended partition. So we would have to copy the EBR of every partition.
I'd suggest deleting sde13, adding sde13 and sde14.
When adding sde13, note that starting block should be at the end of sde12, so simply insert last block of sde12 there. If it gives error, simply press enter as it automatically finds free block after the last one. End block could be for example +500M so fdisk automatically finds the correct end block. Do the same for sde14, but note the start block again. sde14 end block should be the last block there is on the card.
After you've done that, do w to write and if it tells you to restart or something, unplug the phone, take out the battery and restart to pink screen again. Then try to use disk utility again or gparted (have not tested this) to reformat sde13 and sde14 to ext4 and vfat.
You should be safe until you don't mess with the primary partitions, especially the mmcblk0p2 and mmcblk0p3.
Thanks again for the reply, Blefish. I may have just fixed it. I'll know soon enough.
I did two things:
1) sudo fdisk /dev/sde12 followed by w
2) sudo fdisk /dev/sde followed by w
After that it enabled me to add the 13 and 14 partition. I used disk utility so I didn't have to worry about the blocks. Afterwards they mounted in ubuntu like they should.
UPDATE: Not quite fixed, but the rom installed without error. So I think the partition problem is fixed.
Now I just have a boot loop. I'll go back to ubuntu, clear the cache, and try installing from the internal sdcard
2nd UPDATE: Stock recovery gives and error about mounting the cache partition. However CWM mounts it fine. My partition problems may not be over.
3rd UPDATE: genokolar's "Custom you partition" file to return to stock file deletes my partition 13 and 14. Had 13 and 14 back working, used the file as per instructions, afterwards ubuntu drive utililty shows 13 and 14 as "free." So that is where part of my problem comes from.
4th UPDATE: Fixed the problem with stock recovery. Turns out froyo doesn't like ext4 partitions. Changed cache partition to ext3, no more error.
Here are some exerts from the CMW log when I tried to flash cyanongen. Can anyone tell me if any of these errors are problems, and if they are what they mean?
W:Unable to get recovery.fstab info for /datadata during fstab generation!
W:Unable to get recovery.fstab info for /sd-ext during fstab generation!
I:Checking for extendedcommand...
I:Skipping execution of extendedcommand, file not found...
failed to open /sys/class/android_usb/android0/state: No such file or directory
-- Installing: /sdcard/CM7-070512.zip
Finding update package...
I:Update location: /sdcard/CM7-070512.zip
Opening update package...
Installing update...
unmount of /system failed; no such volume
package_extract_file: no backup_initd.sh in package
set_perm: chown of /tmp/backup_initd.sh to 0 0 failed: No such file or directory
set_perm: chmod of /tmp/backup_initd.sh to 777 failed: No such file or directory
about to run program [/tmp/backup_initd.sh] with 2 args
run_program: execv failed: No such file or directory
run_program: child exited with status 1
Pass 5: Checking group summary information
/dev/block/mmcblk0p12: 11/56448 files (0.0% non-contiguous), 7142/225280 blocks
mount: failed to mount /dev/block/mmcblk0p12 at /system: Invalid argument
set_perm: chown of 0750 to 0 2000 failed: No such file or directory
set_perm: chmod of 0750 to 755 failed: No such file or directory
set_perm: chown of /system/etc/init.qcom.post_boot.sh to 0 2000 failed: No such file or directory
set_perm: chmod of /system/etc/init.qcom.post_boot.sh to 555 failed: No such file or directory
set_perm: chown of /system/xbin/apply_firewall to 0 0 failed: No such file or directory
set_perm: chmod of /system/xbin/apply_firewall to 6755 failed: No such file or directory
set_perm: chown of /system/xbin/apply_theme to 0 0 failed: No such file or directory
set_perm: chmod of /system/xbin/apply_theme to 6755 failed: No such file or directory
set_perm: chown of /system/xbin/dumplog to 0 0 failed: No such file or directory
set_perm: chmod of /system/xbin/dumplog to 6755 failed: No such file or directory
set_perm: chown of /system/xbin/mv2sd to 0 0 failed: No such file or directory
set_perm: chmod of /system/xbin/mv2sd to 6755 failed: No such file or directory
set_perm: chown of /system/xbin/ota to 0 0 failed: No such file or directory
set_perm: chmod of /system/xbin/ota to 6755 failed: No such file or directory
Updating BOOT Image...
about to run program [/tmp/backup_initd.sh] with 2 args
run_program: execv failed: No such file or directory
run_program: child exited with status 1
Installation complete!script result was [Installation complete!]
Install from sdcard complete.
failed to open /sys/class/android_usb/android0/state: No such file or directory
My phone is fixed. I have no idea how it became fixed, but it is fixed.
I placed b518 on the internal sd card, and installed it. Then bootloop. So I held both volume keys+power to try another rom. It installed again. Went to recovery, it did a factory reset. Bootloop. Went back to recovery to see if I could wipe the sd card. No option for it, so I did another factory reset and rebooted my phone. I left my phone bootlooping for a minute while I looked online for a Huawei service center, and then my phone booted. I gues it got scared and didn't want to go to a service center.
This been a great learning experience, although at times a major headaches. I want to thank blefish for all his help. Thanks to this, i've bee reading his blog and other stuff, and now will follow some of his other projects.
Now to downgrade back to 2.2!!!!
UPDATE: All official roms are working correctly (b136, b138, b518, b528), recovery (5.0.2.6) works. However I haven't been able to get a single custom rom to work. Tried a couple .32 MIUI and CM, but they all stick at the huawei logo. Did factory reset and dalvik wipe, get error can't mount /sd-ext during dalvik wipe, and still doesn't boot.
Maybe I need to try a newer verison of CWM? I tried the newer versions before, and I didn't like them. Buggy and often wouldn't find my sd card.
This thread must be made sticky because it consists of pure information about dealing with soft-bricks. Thanks a lot for your curiosity, you're my hero.

[Q] Plz help unbricking my nook

I have formatted my nook via minitool partitiion manager accidentally... The only backup i have is a 79mb image file i made with roadkil diskimage and reading the threads, i am realising this is not a good backup... indeed i tried restoring this backup via roadkil diskimage but my nook still cannot boot. it says "install failed"
So I am following the instructions here: http://forum.xda-developers.com/showthread.php?t=2104145 and http://forum.xda-developers.com/showthread.php?t=2004630 in the hope of recovering my nook but I am stucked/unsure for some steps... here are the steps i followed in detail below with questions in red:
I made a backup of my nook disk using dd (this tutorial http://forum.xda-developers.com/showthread.php?t=1142983)
But my backup image is 2,000,683,008 bytes instead of 1958739968 bytes as noted in http://forum.xda-developers.com/showthread.php?t=1142983
Is this a problem?
My nook disk looks like this in minitool partition manager:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I used partition recovery to check for my deleted partitions with the following settings
Scanning Range : Full Disk
Full scan
It detected the following partitions... (I don't see the Factory partition and which partitions should I recover?)
I was thinking about recovering the following checked partitions:
Below is how it looks like (I haven't apply changes yet) but this does not match the partitions described in http://nookdevs.com/Nook_Simple_Touch_stock_partition_table
How do i copy the partitions and which partitions should i copy to my sdcard?
Do i need the file Nook Simple Touch Glowlight Image (without Rom partition): goo.gl/W4OYy (280.74mb) from http://forum.xda-developers.com/showthread.php?t=2104145 (The link does not work anymore)
I am stuck now... i don't want to continue without proper guidance... i don't want to mess up... Please take a look at my questions and guide me what to do next. thx in advance
First recover the /rom partition.
16 Meg is the correct size.
Copy all the files to someplace safe.
Make it read-only, burn a CD, whatever.
Make sure that you have sane files.
It would be best if you restore the partition table using nookpart.sh
You need to either use a Linux system and noogie or else get Clockwork Mod Recovery and ADB working and use that shell.
ok thx i have been able to recover the ROM partition. I restored it and save it an sd card. then i wrote the Nook Simple Touch Glowlight Image (without Rom partition) to the internal storage... it have all the partitions. I restored the ROM partition and it booted fine...
only issue i have now is the NST does not recognise the storage/NOOK partition as pointed out in http://forum.xda-developers.com/showthread.php?p=48019675#post48019675
I have run nookpart.sh and here's the result: Does not seem that it has corrected my partition table:
/dev/block/mmcblk0p2 39 46 15360 c Win95 FAT32 (LB
A)
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(9, 175, 39) logical=(38, 0, 1)
Partition 2 has different physical/logical endings:
phys=(11, 153, 14) logical=(45, 63, 32)
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 47 141 194560 83 Linux
Partition 3 has different physical/logical beginnings (non-Linux?):
phys=(11, 185, 47) logical=(46, 0, 1)
Partition 3 has different physical/logical endings:
phys=(35, 242, 15) logical=(140, 127, 32)
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 142 926 1607680 f Win95 Ext'd (LB
A)
Partition 4 has different physical/logical beginnings (non-Linux?):
phys=(35, 242, 16) logical=(141, 0, 1)
Partition 4 has different physical/logical endings:
phys=(236, 24, 44) logical=(925, 127, 32)
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 142 285 294896 83 Linux
/dev/block/mmcblk0p6 286 405 245744 c Win95 FAT32 (LB
A)
/dev/block/mmcblk0p7 406 525 245744 83 Linux
/dev/block/mmcblk0p8 526 926 821232 83 Linux
Command (m for help): 3: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Command (m for help): 1: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): No free sectors available
Command (m for help): e: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Command (m for help): 9: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): No free sectors available
Command (m for help): e: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Command (m for help): 2: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): No free sectors available
Command (m for help): e: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Command (m for help): 4: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): No free sectors available
Command (m for help): e: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Command (m for help): 5: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): No free sectors available
Command (m for help): e: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Command (m for help): 9: unknown command
Command Action
a toggle a bootable flag
b edit bsd disklabel
c toggle the dos compatibility flag
d delete a partition
l list known partition types
n add a new partition
o create a new empty DOS partition table
p print the partition table
q quit without saving changes
s create a new empty Sun disklabel
t change a partition's system id
u change display/entry units
v verify the partition table
w write table to disk and exit
x extra functionality (experts only)
Command (m for help): Partition number (1-8): Hex code (type L to list codes):
Command (m for help): Partition number (1-8): Hex code (type L to list codes):
Command (m for help): Partition number (1-8): Hex code (type L to list codes):
Command (m for help): Partition number (1-8):
Command (m for help):
Disk /dev/block/mmcblk0: 2000 MB, 2000683008 bytes
128 heads, 32 sectors/track, 954 cylinders
Units = cylinders of 4096 * 512 = 2097152 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 38 77808 c Win95 FAT32 (LB
A)
Partition 1 has different physical/logical beginnings (non-Linux?):
phys=(0, 0, 33) logical=(0, 1, 1)
Partition 1 has different physical/logical endings:
phys=(9, 175, 38) logical=(37, 127, 32)
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 39 46 15360 c Win95 FAT32 (LB
A)
Partition 2 has different physical/logical beginnings (non-Linux?):
phys=(9, 175, 39) logical=(38, 0, 1)
Partition 2 has different physical/logical endings:
phys=(11, 153, 14) logical=(45, 63, 32)
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 47 141 194560 83 Linux
Partition 3 has different physical/logical beginnings (non-Linux?):
phys=(11, 185, 47) logical=(46, 0, 1)
Partition 3 has different physical/logical endings:
phys=(35, 242, 15) logical=(140, 127, 32)
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 142 926 1607680 f Win95 Ext'd (LB
A)
Partition 4 has different physical/logical beginnings (non-Linux?):
phys=(35, 242, 16) logical=(141, 0, 1)
Partition 4 has different physical/logical endings:
phys=(236, 24, 44) logical=(925, 127, 32)
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 142 285 294896 83 Linux
/dev/block/mmcblk0p6 286 405 245744 c Win95 FAT32 (LB
A)
/dev/block/mmcblk0p7 406 525 245744 83 Linux
/dev/block/mmcblk0p8 526 926 821232 83 Linux
Command (m for help): The partition table has been altered.
Calling ioctl() to re-read partition table
fdisk: WARNING: rereading partition table failed, kernel still uses old table: D
evice or resource busy
#
Click to expand...
Click to collapse
I have the same problem!
yeahman45 said:
ok thx i have been able to recover the ROM partition. I restored it and save it an sd card. then i wrote the Nook Simple Touch Glowlight Image (without Rom partition) to the internal storage... it have all the partitions. I restored the ROM partition and it booted fine...
only issue i have now is the NST does not recognise the storage/NOOK partition as pointed out in http://forum.xda-developers.com/showthread.php?p=48019675#post48019675
I have run nookpart.sh and here's the result: Does not seem that it has corrected my partition table:
Click to expand...
Click to collapse
I have the same problem... I have a nook simple touch and I wrote in it a nook simple touch glowlight backup image, is that the problem?
The phrase "install failed" is still appearing.
i HAVE BEEN LOOKING FOR A SIMPLE TOUCH BACKUP IMAGE.
OHH PLEASE.. i THINK i'M CLOSE to recover it!
marya.a said:
I have the same problem... I have a nook simple touch and I wrote in it a nook simple touch glowlight backup image, is that the problem?
The phrase "install failed" is still appearing.
i HAVE BEEN LOOKING FOR A SIMPLE TOUCH BACKUP IMAGE.
OHH PLEASE.. i THINK i'M CLOSE to recover it!
Click to expand...
Click to collapse
what nook simple touch glowlight image did you write onto it?
1) Do you have a backup?
2) First thing to do before making any change is to backup, Use this guide to make a proper backup : http://forum.xda-developers.com/showthread.php?t=1142983
How did you exactly got the "install failed" problem?
I know that link, but it doesnt work right know, my nook is bricked.
I wrote a nook sp glowlight backup that I found in a forum from here. It has around 79 mb (http://forum.xda-developers.com/showthread.php?t=1836188&page=4) and I know I need a 1.82gb backup.
Well, my problem is---> I deleted all paritions from my nook when I was rooting it. I have two backups but any of these works. The first one I made has 79mb (as the file I downloaded from this page) but I think I made it in wrong way; and a second one wich has 1.82gb I think I had made it AFTER I deleted the partitions, because it has anything. But, as I told you, I've made a lot of tries with noogie, and the file I downloaded is the only one that works....so when I wrote the file of the link, the "install failed" appears.
What can I do?
The only solution I see now is: find out a COMPLETE nook sp backup, but I have read that the "complete backups" of 1.82gb have personal information about the reader or something like that, and one wants to share it.
What do u know about it?
marya.a said:
I know that link, but it doesnt work right know, my nook is bricked.
I wrote a nook sp glowlight backup that I found in a forum from here. It has around 79 mb (http://forum.xda-developers.com/showthread.php?t=1836188&page=4) and I know I need a 1.82gb backup.
Well, my problem is---> I deleted all paritions from my nook when I was rooting it. I have two backups but any of these works. The first one I made has 79mb (as the file I downloaded from this page) but I think I made it in wrong way; and a second one wich has 1.82gb I think I had made it AFTER I deleted the partitions, because it has anything. But, as I told you, I've made a lot of tries with noogie, and the file I downloaded is the only one that works....so when I wrote the file of the link, the "install failed" appears.
What can I do?
The only solution I see now is: find out a COMPLETE nook sp backup, but I have read that the "complete backups" of 1.82gb have personal information about the reader or something like that, and one wants to share it.
What do u know about it?
Click to expand...
Click to collapse
1) First thing to do before making any change is to backup, Use this guide to make a proper backup : http://forum.xda-developers.com/show....php?t=1142983
2) Then, with minitool partition manager, use partition recovery (full scan) to recover your partitions especially the ROM partition (the essential partition). Copy the ROM partition to an unallocated space on your harddrive or usb drive.
3) Follow this guide http://forum.xda-developers.com/show....php?t=2104145 for more details, it works!
I have been able to fix my problem with nook partition not mounted correctly.. but i have one issue remaining.... I can mount my /system folder as writable via adb shell... it remains read only.. so i have to use root explorer to move my files into that folder... I am trying to replace the .ttf for unicode support but i often get boot issues when doing so... sometimes my nook does not boot anymore if i had replaced fonts in the /system/fonts ..... any idea? (I didn't have this problem before withe the exact same files i am replacing)
@marya.a
ur only problem that u must have ROM partitions files .... then everything else is fine ..... cuz u just need an nook Image (my last update since i was here the partitioning if NSTwG same as NST) and empty all partitions from any files .... then copy ur Uniq ROM Partition files to ur ROM partition now on ur nook .... get 1.2.1 update ....Re-zipped it with they way u unzipped ...... use CWM .... install the Re-zipped update .... and done ur nook is work
Remember ... the Important files on nook only ROM files ... cuz is unique and if u lost it .....u wont able use wifi and u can just cuz ur nook only with no wifi
Good Luck
@yeahman45
try get another image 1st and then try it and if not workin with u try last thing check (Bad sector on ur internal memory).... Renate is best in Partitioning/mounting nook partition .... she already did that for me once "Big THX to her " , w8 her replay
good luck
yeahman45 said:
I have run nookpart.sh and here's the result: Does not seem that it has corrected my partition table:
Click to expand...
Click to collapse
Unfortunately, there are no good, standardized scripting disk partitioners.
The only thing we have in busybox and CWR is fdisk.
That is interactive.
You can feed it a response script.
The problem is that if anything gets out of sync it will plow ahead with wrong responses.
Unfortunately, that's what your log is showing.
nookpart.sh assumes that all partitions have been deleted.
You must first delete all the partitions manually. (This does not delete any file data.)
Code:
fdisk -C 934 -H 128 -S 32 /dev/block/mmcblk0
Type p to display the current state of things.
Type d and then the partition number to delete it.
Type w to write your changes and exit.
Then try running nookpart.sh again.
Note: Just to be clear, if you are restoring a full (~1.9GB backup) then the partition tables are in the backup.
There is no need to configure the partitions in that case.
yeahman45 said:
I can mount my /system folder as writable via adb shell... it remains read only..
Click to expand...
Click to collapse
Huh? That's confusing. Which way did you mean?
Code:
mount -o rw,remount /dev/block/mmcblk0p5 /system
yeahman45 said:
I am trying to replace the .ttf for unicode support but i often get boot issues when doing so.
Click to expand...
Click to collapse
Huh? The Nook is already fully UTF-8.
Do you mean adding the glyphs for some language?
Which files are you trying to replace?
Are you doing this over ADB or in a file manager?
Safest way: Use ADB, use the stop command to shut down the Android subsystem, copy the files, then use the reboot command.
Renate NST said:
Unfortunately, there are no good, standardized scripting disk partitioners.
The only thing we have in busybox and CWR is fdisk.
That is interactive.
You can feed it a response script.
The problem is that if anything gets out of sync it will plow ahead with wrong responses.
Unfortunately, that's what your log is showing.
nookpart.sh assumes that all partitions have been deleted.
You must first delete all the partitions manually. (This does not delete any file data.)
Code:
fdisk -C 934 -H 128 -S 32 /dev/block/mmcblk0
Type p to display the current state of things.
Type d and then the partition number to delete it.
Type w to write your changes and exit.
Then try running nookpart.sh again.
Note: Just to be clear, if you are restoring a full (~1.9GB backup) then the partition tables are in the backup.
There is no need to configure the partitions in that case.
Click to expand...
Click to collapse
yup i have already succeeded in re-creating the partitions thx! i deleted the partitions(using create partition table in GParted) and run your script and it's ok now! thx!
problem now is :
I cannot mount my /system folder as writable via adb shell... it remains read only.. so i have to use root explorer to move my files into that folder... I am trying to replace the .ttf for unicode support but i often get boot issues when doing so... sometimes my nook does not boot anymore if i had replaced fonts in the /system/fonts ..... any idea? (I didn't have this problem before withe the exact same files i am replacing)
I used glownooter previously(before my bricking story lol) and was able to mount /system and add files to it with no issues...but this time(after having recovered from my bricking story) i rooted with nook manager... do you think it's related to the rooting methods or my partitions are still not ok?
Renate NST said:
Huh? That's confusing. Which way did you mean?
Code:
mount -o rw,remount /dev/block/mmcblk0p5 /system
Huh? The Nook is already fully UTF-8.
Do you mean adding the glyphs for some language?
Which files are you trying to replace?
Are you doing this over ADB or in a file manager?
Safest way: Use ADB, use the stop command to shut down the Android subsystem, copy the files, then use the reboot command.
Click to expand...
Click to collapse
yup i am using mount -o remount,rw /system in shell, even used su but the system remains readonly.. no idea why...
trying to add fonts with chinese support.. since i can't push it via adb, i am using root explorer to replace the ttf files... but sometimes it freezes my nook and it does a bootstuck... cannot reboot... I had it two times, one i pasted a font and my nook freezed and another one when i tried to move an apk to system/app ... first time i solved bootstuck by restoring the system/fonts with original.. second time it did not worked.. i had to do a dd restore image... and root again...
Some infos
using grep:
# mount | grep system
mount | grep system
/dev/block/mmcblk0p5 /system ext2 rw,errors=continue 0 0
trying to push a font
adb push Y:\nook\fonts\Caecilia.ttf \system\fonts
failed to copy 'Y:\nook\fonts\Caecilia.ttf' to '\system\fonts': Read-only file system
edit: tried booting with noogie and replace my fonts on linux but i got some weird error : Error splicing file: no space left on device... i have deleted the whole fonts folder and pasted an original stock backup, still getting that error : Error splicing file: no space left on device (although i should have plenty of space as i have deleted the /fonts folder) ... and my nook does not boot anymore once again...
edit2: please help i am getting desperate... my nook does not boot anymore again after i have replaced the fonts with it.. is it a problem with my partition? what are the commands i need to run to see if everything's ok with my partition.. should i try another root method .. i bought the nook to offer it as a gift to someone who reads chinese.. that's why i am trying to install chinese fonts on it before giving it. Did i messed up with the partitions permanently when i deleted all the partittions?
Check how much space you have:
Code:
df
/system: 285583K total, 216938K used, 68645K available (block size 1024)
Check the mount (again):
Code:
mount
/dev/block/mmcblk0p5 /system ext2 rw,errors=continue 0 0
Check the permissions:
Code:
ls -l /
drwxr-xr-x root root 2012-12-22 10:21 system
ls -l /system
drwxr-xr-x root root 2013-03-19 20:18 fonts
Check writing a file:
Code:
cd /system/fonts
echo Hello > hello.txt
cat hello.txt
Hello
where should i execute these commands? in linux via noogie? whenever i put something in /system via noogie and linux, my nook does not boot anymore ... is that normal?
I have rooted once again using glownooter vs nookmanager this time and i am now able to push to the /system folder! finally lol ... i suppose nookmanager did not root it properly.. will stick with glownooter for now but i miss nook mod manager and its patches (any idea how to apply them with glownooter?)
Problem again! It does not boot again .. but last time i was stuck at "Reading forever", now it gets past this screen and when showing the progress dots, the dots move but the screen flashes each time and this cycle goes on forever.. any idea? is this normal that i get these booting issues when replacing fonts in /system/fonts???
edit: do i get adb with cwm? where's the settings for enabling adb in cwm?
Your Nook should re running in Nook alright before you start trying to change fonts.
You should have ADB running.
As you probably know, it's not normal for the dots to flash and restart.
You need ADB and logcat to see what it doesn't like.
It will tell you what the problem is.
I have never tried noogie with Linus or Nookmanager or Glownooter or Modmanager.
ok thx so adb should run even at boot time? i just need to connect it via usb? adb is not detecting it atm

Corrupt partition /data

Okay so I recently updated my s4(att) from cyanogen 12 to cyanogen 13 (latest nightly). I went to settings/security and chose encrypt phone. After about 30 minutes of encrypting it reboot and got stuck in a bootloop. I thought no problem Ill just reflash. I go to reflash my backup and it says error mounting /data. I try formating data, factory reset, and installing the rom from scratch. It seems my data partition corrupt. So I figure fastboot. Yet upon loading fastboot I cant get adb to see my device. I think I got the right drivers installed. But nothing. Any help would be greatly appreciated.
Edit: fixed.
Solution:
I found this and was able to shell in via adb and format the partition.
f you wish to wipe the /data partition completely (including media like photos), follow the below instructions:
Boot into recovery.
Run adb shell in a terminal (Linux) or Command Prompt ("CMD", Windows). After a few seconds, you should see a line containing ~ #.
WARNING. Triple-check the command that you are entering here. White space and capitalization are important. Make any mistake here and you may accidentally wipe your whole flash memory including recovery images.
NOTE: if you want to encrypt your partition later, you have to leave 16KiB unallocated space on the end of the partition.
In the adb shell, run the command mke2fs -t ext4 /dev/block/mmcblk0p12. Substitute /dev/block/mmcblk0p12 and ext4 according to the recovery filesystem table (for /data). Output when running the command:
~ # mke2fs -t ext4 /dev/block/mmcblk0p12
mke2fs 1.41.14 (22-Dec-2010)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
755904 inodes, 3022848 blocks
151142 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=3095396352
93 block groups
32768 blocks per group, 32768 fragments per group
8128 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 34 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
(Optional) Install new firmware (E.g. CM 10.1).
Reboot.
(Optional) In order to encrypt the partition while clearing your whole data partition, run vdc cryptfs enablecrypto wipe PIN_OR_PASSWORD (before Android 5.0) or vdc cryptfs enablecrypto wipe password PASSWORD_IN_HEX (since Android 5.0, see this post for details).
Reconfigure device, choose language, enter name, install apps, etc.
source: android .stackexchange. com/questions/33398/cannot-factory-reset-after-encrypting
(sorry cant post links yet)
of course always check your formatting the correct partition first

Help Needed Modifying System Image

Hello XDA, I was attempting to do some experimentation with what I could do on the device via modifying init.rc files and the like. Rather than building and flashing a custom ROM for each run which is time consuming I thought I could just mess with the existing system images.
What I was hoping would work:
1. Download the October 007 (patch) stock binaries from Google
2. Extract the flame_xxxxx.zip image file
3. Convert the sparse system image file to a raw image file
- $ simg2img system.img system.raw
4. Mount the ext2 filesystem to a loopback device
- $ mount -o loop -t ext2 system.raw temp_dir
5. Edit the init file (e.g. init.rc) and save it
6. Unmount the ext2 filesystem
7. Create sparse system image
- Still don't quite know how to do this
8. Flash the sparse image from fastboot
- $ fastboot flash system system.img
So my question to the community at large is, is this track of work even logically correct. If so, how does one do it?
I have been trying to run these steps against image-flame-qd1a.190821.007.zip
My machine is running Ubuntu 19.10
For example Step 4 (mounting the ext2 system is failing for me)
Code:
$ losetup --list
....
/dev/loop8 0 0 1 1 /path/system.raw 0 512
....
$ sudo mount /dev/loop8 sys_mount
mount: /pathsys_mount: wrong fs type, bad option, bad superblock on /dev/loop8, missing codepage or helper program, or other error.
Also not working for Step 4
Code:
$ file system.raw
system.raw: Linux rev 1.0 ext2 filesystem data, UUID=4729639d-b5f2-5cc1-a120-9ac5f788683c (extents) (large files) (huge files)
$ sudo mount -o loop -t ext2 system.raw sys_mount
mount: /pathsys_mount: wrong fs type, bad option, bad superblock on /dev/loop8, missing codepage or helper program, or other error.
Thanks for the help.
I have since built my own AOSP build and have the same issue in that I can't mount the resulting system.img file from the AOSP build either.
Not sure if that matters or not, but I found it odd.

Categories

Resources