5,606,347 Members 33,316 Now Online
XDA Developers Android and Mobile Development Forum

[ICS-JB][Samsung] Safe No Brick Wipe Data/System/Cache/Dalvik from recovery

Tip us?
 
kenshinjar
Old
#11  
kenshinjar's Avatar
Senior Member
Thanks Meter 31
Posts: 144
Join Date: Jul 2012
Location: Nha Trang
Hi Phil3759,
can I use this for Note GT-N7000, which official Rom or custom Rom?
waiting for your reply. thanks
JELLY BEAN 4.1.2
 
Phil3759
Old
#12  
Phil3759's Avatar
Recognized Developer - OP
Thanks Meter 27569
Posts: 8,519
Join Date: May 2012

 
DONATE TO ME
Yes, it will be safe on the note, no format commands issued

Sent from my GT-I9100 using Tapatalk 2
>PhilZ Touch Recovery: Main thread and Download links
> Support IRC Channel: freenode - #PhilZ-Touch
>Root ICS/JB for all phones: link
>CWM6 Temporary: i9100, n7000
>Busybox Uninstaller: safely remove +600 files
>Safe Wipe Data/System/Cache/Dalvik: i9100/n7000
>CF-Root in Stock Recovery: dead project
The Following User Says Thank You to Phil3759 For This Useful Post: [ Click to Expand ]
 
Entropy512
Old
#13  
Senior Recognized Developer
Thanks Meter 23433
Posts: 12,794
Join Date: Aug 2007
Location: Owego, NY

 
DONATE TO ME
Quote:
Originally Posted by Phil3759 View Post

Code:
ui_print("***************************");
ui_print("Wipe data-cache-system");
ui_print("Samsung Phones Only");
ui_print("***************************");
show_progress(1.000000, 0);

ui_print("Checking Samsung Phone...");
assert(getprop("ro.product.manufacturer") == "samsung");
set_progress(0.100000);

ui_print("Mounting partitions");
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
mount("ext4", "EMMC", "/dev/block/mmcblk0p7", "/cache");
mount("ext4", "EMMC", "/dev/block/mmcblk0p10", "/data");
set_progress(0.200000);

ui_print("Delete Cache Partition");
delete_recursive("/cache");
set_progress(0.400000);

ui_print("Delete Data Partition");
delete_recursive("/data");
set_progress(0.600000);

ui_print("Delete System Partition");
delete_recursive("/system");
set_progress(0.900000);

###############################################################################
############################ Formatting partitions ############################
#### You need to unmount (ALL?) partitions before formatting one partition ####
# unmount("/cache");
# unmount("/data");
# unmount("/system");
# format("ext4", "EMMC", "/dev/block/mmcblk0p9", "0");

#### Then remount if you intend to use it later in teh script ####
# mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
# mount("ext4", "EMMC", "/dev/block/mmcblk0p7", "/cache");
# mount("ext4", "EMMC", "/dev/block/mmcblk0p10", "/data");

#### wipe dalvik-cache ####
# mount("ext4", "EMMC", "/dev/block/mmcblk0p10", "/data");
# delete_recursive("/data/dalvik-cache");
# unmount("/data");
#### wipe dalvik-cache done ####

#### Mount in busybox ####
# run_program("/sbin/mount", "/dev/block/mmcblk0p7", "/cache");
# run_program("/sbin/mount", "/dev/block/mmcblk0p10", "/data");
# run_program("/sbin/mount", "/dev/block/mmcblk0p9", "/system");
#### internal sd ####
# run_program("/sbin/mount", "/dev/block/mmcblk0p11", "/sdcard");
###############################################################################

ui_print("Unmounting Partitions");
unmount("/cache");
unmount("/data");
unmount("/system");
set_progress(1.000000);
show_progress(1.000000, 0);

ui_print("Wipe complete!");
ui_print("Reboot in download mode");
ui_print("Flash a full ROM in Odin");
ui_print("by Phil3759@xda-developers.com");
delete_recursive can leave the filesystem in an unclean state. Using this workaround is not advisable.

It is better to use an update-binary that has been rendered safe by building with BOARD_SUPPRESS_EMMC_WIPE.

Run this to check an update-binary for safety:
Code:
strings update-binary |grep MMC
It should return:
Code:
warning: %s: Wipe via secure discard suppressed due to bug in EMMC firmware
Any update-binary versions that have that string are safe to use.
*so much sig updating needed*

My Github profile - Some Android stuff, some AVR stuff

An excellent post on "noobs vs. developers"

A few opinions on kernel development "good practices"

Note: I have chosen not to use XDA's "friends" feature - I will reject all incoming "friend" requests.

Code:
<MikeyMike01> Smali is a spawn of hell
<shoman94> ^^^ +!
Code:
<Entropy512> gotta be careful not to step on each other's work.  :)
<Bumble-Bee> thats true
<jerdog> compeete for donations
The Following 2 Users Say Thank You to Entropy512 For This Useful Post: [ Click to Expand ]
 
Phil3759
Old
#14  
Phil3759's Avatar
Recognized Developer - OP
Thanks Meter 27569
Posts: 8,519
Join Date: May 2012

 
DONATE TO ME
Quote:
Originally Posted by Entropy512 View Post
delete_recursive can leave the filesystem in an unclean state. Using this workaround is not advisable.

It is better to use an update-binary that has been rendered safe by building with BOARD_SUPPRESS_EMMC_WIPE.

Run this to check an update-binary for safety:
Code:
strings update-binary |grep MMC
It should return:
Code:
warning: %s: Wipe via secure discard suppressed due to bug in EMMC firmware
Any update-binary versions that have that string are safe to use.
Thank you a lot for the input.

However, Chainfire just answered me in his CF-Root for the n7000 that using format commands in update.zip could still brick an unsafe kernel whatever recovery (patched or non patched) it uses. Now, you say that a patched binary in update.zip will make it safe what ever kernel/recovery combo it is

If you confirm it, I will update my post. CF disagree the use of format commands in update.zip (yes, I know, if there are FS errors, they will not be fixed without format)
>PhilZ Touch Recovery: Main thread and Download links
> Support IRC Channel: freenode - #PhilZ-Touch
>Root ICS/JB for all phones: link
>CWM6 Temporary: i9100, n7000
>Busybox Uninstaller: safely remove +600 files
>Safe Wipe Data/System/Cache/Dalvik: i9100/n7000
>CF-Root in Stock Recovery: dead project
The Following User Says Thank You to Phil3759 For This Useful Post: [ Click to Expand ]
 
shoey63
Old
(Last edited by shoey63; 14th October 2012 at 10:30 AM.)
#15  
shoey63's Avatar
Recognized Contributor
Thanks Meter 1242
Posts: 2,095
Join Date: Jun 2012
Location: Somewhere in Oz...
Good news Phil! Ran Entropys command on Temp CWM Touch 6.0.12 update-binary and got this "ubuntu@ubuntu:~/Desktop/binary$ strings update-binary |grep MMC
warning: %s: Wipe via secure discard suppressed due to bug in EMMC firmware
EMMC
EMMC:" Unfortunately doesn't produce same result in update-binary for ur wiping script. So simply swap update binary, change "delete-recursive" to "format", re-sign file and job done right? (That's assuming u trust Entropy, and who doesn't?)
 
Phil3759
Old
#16  
Phil3759's Avatar
Recognized Developer - OP
Thanks Meter 27569
Posts: 8,519
Join Date: May 2012

 
DONATE TO ME
Update 08.10.2012:
Quote:
Following Entropy512 recommendations, I updated the binary-update to a safe one.
Now format commands are used in script instead of delete_recursive.
This makes the wipe much clean if some file system errors are present

Special thanks to shoey63 for his contribution
>PhilZ Touch Recovery: Main thread and Download links
> Support IRC Channel: freenode - #PhilZ-Touch
>Root ICS/JB for all phones: link
>CWM6 Temporary: i9100, n7000
>Busybox Uninstaller: safely remove +600 files
>Safe Wipe Data/System/Cache/Dalvik: i9100/n7000
>CF-Root in Stock Recovery: dead project
 
shoey63
Old
#17  
shoey63's Avatar
Recognized Contributor
Thanks Meter 1242
Posts: 2,095
Join Date: Jun 2012
Location: Somewhere in Oz...
Well it's one thing to contribute theoretical information, but it's another to actually go ahead and do it! I hope Entropy is right, I'm about to use script to do factory reset based on his assertion that "format" commands in zips with update binarys that contain "secure discard supressed" are safe.

---------- Post added at 07:54 PM ---------- Previous post was at 07:10 PM ----------

Entropy's right! No problems whatsoever Flashed factory reset, format commands and all. and the patched update-binary prevented my Note from bricking! It only took seconds (Man.... that was a wild ride)
The Following User Says Thank You to shoey63 For This Useful Post: [ Click to Expand ]
 
albertorodast2007
Old
#18  
albertorodast2007's Avatar
Senior Member
Thanks Meter 47
Posts: 594
Join Date: Oct 2010
Location: Guatemala
There's no updated binaries zip file for wiping dalvik right?

Sent from my GT-I9100 using xda premium
iMate sp3i > AT&T Tilt Kais100 > T-MoUS HD2 > HTC Desire CDMA > LG G2x > Samsung GT-I9100/SGH -I777 > S4 Pro Krait
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Phone: Samsung I9100 Galaxy S II
ROM: AOKP JB 4.1.1 Unofficial OCt-9-12
Kernel: Dorimanx 7.1 MALI
Baseband: I9100XXlPQ
 
shoey63
Old
#19  
shoey63's Avatar
Recognized Contributor
Thanks Meter 1242
Posts: 2,095
Join Date: Jun 2012
Location: Somewhere in Oz...
Quote:
Originally Posted by albertorodast2007 View Post
There's no updated binaries zip file for wiping dalvik right?

Sent from my GT-I9100 using xda premium
Looks like PhilZ forgot. Im sure he will get around to it. The old one is safe too. Just wont work if there is file corruption.


Sent from my GT-N7000 using xda app-developers app
 
mayekk
Old
#20  
Junior Member
Thanks Meter 4
Posts: 24
Join Date: Dec 2008
nice and simple, great work !

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes