Can you erase the sdcard (external storage) using fastboot? - Nexus S Q&A, Help & Troubleshooting

Does anyone know a way of erasing the sdcard (external storage) on the Nexus S using fastboot commands? i ask because i'm creating a cmd file that will return my phone back to stock using factory images and then relock the bootloader, the only problem is that the sdcard doesn't get erased when relocking the bootloader, so is there a fastboot command to erase the sdcard?

You can lock and unlock bootloader again. Then relock.
So lock->unlock->relock
Sent from my Nexus S using Tapatalk

Thanks for the quick reply, i had thought of that but i would prefer to just erase the sdcard (also for future reference), or, perform a relock that gives the same results as the unlock, eg: wipe sdcard, which would be better, my cmd entries are below.
fastboot flash bootloader bootloader-crespo-i9020xxkl1.img
fastboot reboot-bootloader
timeout /t 5 > nul
fastboot flash radio radio-crespo-i9020xxki1.img
fastboot reboot-bootloader
timeout /t 5 > nul
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot erase cache
fastboot oem lock
fastboot reboot
The only thing missing is a command to erase the sdcard.

d.chatten said:
Thanks for the quick reply, i had thought of that but i would prefer to just erase the sdcard (also for future reference), or, perform a relock that gives the same results as the unlock, eg: wipe sdcard, which would be better, my cmd entries are below.
fastboot flash bootloader bootloader-crespo-i9020xxkl1.img
fastboot reboot-bootloader
timeout /t 5 > nul
fastboot flash radio radio-crespo-i9020xxki1.img
fastboot reboot-bootloader
timeout /t 5 > nul
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot erase cache
fastboot oem lock
fastboot reboot
The only thing missing is a command to erase the sdcard.
Click to expand...
Click to collapse
Try fastboot erase sdcard?
Sent from my ice cream powered Nexus S

DarkhShadow said:
Try fastboot erase sdcard?
Click to expand...
Click to collapse
Thanks for the suggestion, but i have tried this and it doesn't seem to work with the Nexus S.

Anyone...?

d.chatten said:
Thanks for the suggestion, but i have tried this and it doesn't seem to work with the Nexus S.
Click to expand...
Click to collapse
You could try fastboot erase /dev/block/vold/179:3
Or boot it up and delete it via android
If they don't work don't lame me I'm a noob xD
Sent from my ARCHOS 80G9 using XDA Premium HD app

I think i'll just use the lock>unlock>lock method till i find something a bit more concrete, thanks for the suggestions though, much appreciated.

where can i find all this files?
d.chatten said:
Thanks for the quick reply, i had thought of that but i would prefer to just erase the sdcard (also for future reference), or, perform a relock that gives the same results as the unlock, eg: wipe sdcard, which would be better, my cmd entries are below.
fastboot flash bootloader bootloader-crespo-i9020xxkl1.img
fastboot reboot-bootloader
timeout /t 5 > nul
fastboot flash radio radio-crespo-i9020xxki1.img
fastboot reboot-bootloader
timeout /t 5 > nul
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash userdata userdata.img
fastboot erase cache
fastboot oem lock
fastboot reboot
The only thing missing is a command to erase the sdcard.
Click to expand...
Click to collapse
where can i find all this files?

You can download the factory images from here > https://developers.google.com/android/nexus/images, you'll need WinRAR, 7zip or similar installed to enable you to extract the files.

if i recall correctly, the command is "fastboot erase media"

TheMachoMidget said:
if i recall correctly, the command is "fastboot erase media"
Click to expand...
Click to collapse
Found this
Delete existing apps on Android SD
adb shell rm -r /system/sd/app
adb shell rm -r /system/sd/appprivate
Through Terminal Partition SD card
It will erase everything on your SD card
$ su
# cd /data
# wget http://64.105.21.209/bin/lib/droid/sdsplit4
# chmod 555 sdsplit
# /data/sdsplit -fs *size* (add -nc to the end for JFv1.5ADP)

Related

[Q] command to flash kernel for Kindle Fire?

What's the command to flash a kernel for the Kindle Fire? I've tried several fastboot commands to flash the kernel or boot.img, but it always ends up being stuck in Fastboot Mode. The commands I've tried (IIRC):
Code:
fastboot -i 0x1949 boot boot.img
fastboot -i 0x1949 flash boot boot.img
fastboot -i 0x1949 boot zImage ramdisk.gz
fastboot -i 0x1949 boot zImage
These commands appear to indicate success (by displaying "OKAY"), but they leave the device stuck at Fastboot. I've even tried setting Normal mode and rebooting:
Code:
fastboot -i 0x1949 oem idme bootmode 4000
I also tried setting the base address, which apparently overwrote my recovery.img because I couldn't get into TWRP after that (had to reflash recovery.img):
Code:
fastboot -b 0x80000000 -i 0x1949 flash boot boot.img [COLOR="Red"][B](DON'T RUN THIS LINE)[/B][/COLOR]
The only workaround I have is to include the zImage inside the source tree of CM9, and rebuild CM9 in order to package the custom kernel inside update.zip. Then, I flash that from TWRP. This takes quite a while (about 15 mins) even with no changes to CM9 source. There must be a way to create a flash-able update.zip with only the kernel (and ramdisk), but I haven't discovered it. Even better would be a way to do this all from the command line, so I can script it instead of using TWRP. Any ideas? Thanks

[Q] Problem flashing recovery.

Hi guys.
I have been trying to root my HTC One S for hours now without any luck.
I have been using this guide,(http://forum.xda-developers.com/showthread.php?t=1583427) and have managed to get all the way to the last step in the "recovery"-section.
But when I try to flash the recovery, this is what I get:
c:\fastboot>fastboot recovery clockwork-touch.img
usage: fastboot [ <option> ] <command>
commands:
update <filename> reflash device from update.zip
flashall flash boot + recovery + system
flash <partition> [ <filename> ] write a file to a flash partition
erase <partition> erase a flash partition
getvar <variable> display a bootloader variable
boot <kernel> [ <ramdisk> ] download and boot kernel
flash:raw boot <kernel> [ <ramdisk> ] create bootimage and flash it
devices list all connected devices
continue continue with autoboot
reboot reboot device normally
reboot-bootloader reboot device into bootloader
help show this help message
options:
-w erase userdata and cache
-s <serial number> specify device serial number
-p <product> specify product name
-c <cmdline> override kernel commandline
-i <vendor id> specify a custom USB vendor id
-b <base_addr> specify a custom kernel base address
-n <page size> specify the nand page size. default:
2048
How can this be?
Thanks in advance for your help
Type the following command
c:\fastboot>fastboot recovery recovery clockwork-touch.img
Thanks for your reply, frazzeld.
It didn't work. Sorry. Still the same text coming up.
Maybe there is something wrong with have a managed my fastboot-folder.
Because I am a new member I cant post a picture of my folder :/
But it is set up like this:
(folder)add-ons
(Folder)platforms
Folder)tools
adb
adbWinapi.dll
AVD Manager
clockwork-touch.img
fastboot.exe
SDK Manager
SDK Readme
Unlock-code
Never mind.
It worked after all. Don't know what I did wrong the first 50 times.
Thank you
which clockwork are you trying to install?
Edit: I see you've sorted it now
Are you in fastboot mode? Also the recovery image has to be in the same folder as fastboot.exe is.
To point to the correct folder its "cd"
e.g.
cd c:\fastboot
And the correct command is;
fastboot flash recovery name_of_the_recovery.img
Thats all i can see from what you've posted
edit: too slowwww, glad you got it sorted
Big_Den said:
...
fastboot flash recovery name_of_the_recovery.img
...
Click to expand...
Click to collapse
This.
Just in case someone else stumbles across this thread.
Unconn said:
This.
Just in case someone else stumbles across this thread.
Click to expand...
Click to collapse
From the proper directory. It's not C:\ for everyone... Some have their fastboot.exe in C:\Android and some even C:\Android\platform-tools for example.
Point being, make sure u know where your fastboot.exe is located
Sent from my HTC VLE_U using xda premium

Fastboot Driver

I am trying to put a ROM on the TF300. I have Unlocked the tablet and installed the ADB driver. When I boot into recovery and the USB icon it asks for a driver for fastboot. I can't seem to get that anywhere. I have the Android SDK installed and java etc. Where is the driver located? I look in the USB driver folder but its not in their...
If you need just fastboot, use this guide, that you will find in the index for tf300 (General & Dev forums)
HELP FOR FLASH MORE FASTER WHEN YOU USE FASTBOOT LINE COMMAND​
If you have got a problem with your adb or fastboot or recovery....it's very simply and faster
use this:
Download this file "fastboot.zip"
Install this file somewhere in one folder which is named "fastboot" on your PC
=> disk C: root
Unzipped this file on the folder "fastboot" and you will find 3 files:
- adb.exe
- AdbWinApi.dll
- fastboot.exe
and when you need to push something by the bootloader, you can use it.
Don't forget to push on this folder the file that you need. For exemple: boot.img or a recovery.img, etc...
The line command is :
Code:
c:\fastboot>
Enter
Code:
c:\fastboot>fastboot flash recovery recovery.img
Enter
If you want to flash the "recovery.img" file
******************************************************************
******************************************************************
If you want to know all lines of command
Code:
c:\fastboot>fastboot
Code:
usage: fastboot [ ]
commands:
update reflash device from update.zip
flashall flash boot + recovery + system
flash [ ] write a file to a flash partition
erase erase a flash partition
getvar display a bootloader variable
boot [ ] download and boot kernel
flash:raw boot [ ] create bootimage and flash it
devices list all connected devices
continue continue with autoboot
reboot reboot device normally
reboot-bootloader reboot device into bootloader
help show this help message
options:
-w erase userdata and cache
-s specify device serial number
-p specify product name
-c override kernel commandline
-i specify a custom USB vendor id
-b specify a custom kernel base address
-n specify the nand page size. default: 2048
And if you have some problems with your drivers, you can use this : How to install Universal Naked Drivers
Sent from my N7 3G with DroiDevs premium between sky and earth.
I got it to work thanks!

My OPO died after trying to flash factory image

Hi everybody.
I'm new here, in OPO forum.
I got my OPO 6 months ago and I first get a big issue now.
My OPO can't boot even to bootloader or recovery.
Before that, I'm running the latest Bliss Rom with TWRP recovery.
Everything's running fine till I decide to flash back to CM-12.0-YNG1TAS17L.
I downloaded the file "cm-12.0-YNG1TAS17L-bacon-signed-fastboot_64GB.zip" from Oneplus.net forum.
After extracted the zip file, I used batch file call "flash-all.bat" which look like normal script that we use to flash the rom.
fastboot flash modem NON-HLOS.bin
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash sbl1 sbl1.mbn
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash dbi sdi.mbn
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash aboot emmc_appsboot.mbn
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash rpm rpm.mbn
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash tz tz.mbn
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash LOGO logo.bin
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot flash oppostanvbk static_nvbk.bin
fastboot reboot-bootloader
ping -n 5 127.0.0.1 >nul
fastboot -w update cm-12.0-YNG1TAS17L-bacon-signed-fastboot.zip
Click to expand...
Click to collapse
I let it runs... but unfortunately after flashing rpm.mbn... my OPO doesn't boot anymore.
Anybody has seen this before?
Much appreciated for your help.
Who wrote that script? It's the "fastboot reboot bootloader" command between each flash that has caused your problem. It's completely unnecessary and has been known to cause bricks. I'd like to know who the author is please. Anyway, your only hope is this:
http://forum.xda-developers.com/oneplus-one/help/guide-unbrick-oneplus-one-t3013732
THNX
Heisenberg said:
Who wrote that script? It's the "fastboot reboot bootloader" command between each flash that has caused your problem. It's completely unnecessary and has been known to cause bricks. I'd like to know who the author is please. Anyway, your only hope is this:
http://forum.xda-developers.com/oneplus-one/help/guide-unbrick-oneplus-one-t3013732
Click to expand...
Click to collapse
Thank you Heisenberg.
The script comes with the zip file, so I'm not sure who made it.
But I tried to look for many sources about restoring back to stock image.
Then I followed this http://webtrickz.com/how-to-flash-cm12-lollipop-factory-image-on-oneplus-one-using-fastboot/.
Anyway, I'll try your recommendation.
Thanks a lot.
Work like CHARM!
I followed the link above and now my OPO's alive!
Thanks a lot #Heisenberg.

How To Guide Guide to flash images in Linux

as we known, there's a famous tool called Tiny Script Tool to flash our custom systems. but i hate windows, is there a way to flash images in linux? at lease in linux there's no driver needs to all adb devices, thats perfect!
this guid will led you to do it in linux.
as Moto edge s is a dynamic partition device, these options suite to all devices with super block.
maybe YOU HAVE TO USE ROOT OR SUDO TO ACCESS YOUR DEVICE. change to root user if you can't access your device in linux.
# automatic tool:
i've wrote it as a script tool, see https://github.com/superiums/TrinyFlashScript
# manually steps:
## 刷机步骤
1. 备份app
Bash:
#!/bin/bash
backdirs='/dev/shm/app_backup/'
if [ ! -d "$backdirs" ]; then
mkdir $backdirs
fi
# user 0
backdir='/dev/shm/app_backup/0/'
if [ ! -d "$backdir" ]; then
mkdir $backdir
fi
adb shell pm list packages --user 0 -3 -f |awk '{ORS="\n";sub(/package:/,"adb pull ");sub(/apk=/,"apk '$backdir'");print($0".apk;");print("")}' >$backdir'dolist.sh'
sh $backdir'dolist.sh'
# ----------back app for user 10, if you have insular installed in your phone, this is needed!!! ********otherwise, skip.*******
backdir='/dev/shm/app_backup/10/'
if [ ! -d "$backdir" ]; then
mkdir $backdir
fi
adb shell pm list packages --user 10 -3 -f |awk '{ORS="\n";sub(/package:/,"adb pull ");sub(/apk=/,"apk '$backdir'");print($0".apk;");print("")}' >$backdir'dolist.sh'
sh $backdir'dolist.sh'
# ---------------------------------------------------------------------------------------------------------------------
2. 备份数据
Bash:
adb pull /sdcard/Downlad .
3. 重启到fastboot模式,刷写非动态分区
> **非动态分区包括**:
>
> - vbmeta
> - vbmeta_system
> - boot
> - vendor_boot
> - dtbo
Bash:
adb reboot bootloader
# 或 volumne- & power 开机
# 验证是否fastbootd模式
fastboot getvar is-userspace
# 应返回 no
fastboot flash [partition][_slot] [image]
# clear userdata and meta
fastboot -w
4. 重启到fastbootd模式,刷新动态分区
> **super分区包括**:
>
> - system
> - system_ext
> - vendor
> - product
Bash:
fastboot reboot fastboot
# 验证是否fastbootd模式
fastboot getvar is-userspace
# 应返回 yes
fastboot flash [partition][_slot] [image]
6. 双清
Bash:
fastboot erase userdata
#或
fastboot -w
#完成,重启到新系统
fastboot reboot
7. 设置系统
Bash:
#-------------for chinese users only, because they are blocked by the GFW and not able to connect to google.--------------
#Android 7及之后的版本输入如下两个命令,设置网络检测地址:
adb shell settings put global captive_portal_http_url http://www.google.cn/generate_204
adb shell settings put global captive_portal_https_url https://www.google.cn/generate_204
#可以输入如下命令, 禁止检测网络连接状态.
adb shell settings put global captive_portal_detection_enabled 0
#---------------------------------
#---------- if you are concern to your private data, this is usefull.
#强制开启分区存储
adb shell sm set-isolated-storage on
9. 恢复软件及数据
Bash:
cd 0
ls -1 *.apk | xargs -ti -n 1 adb install --user 0 {}
#------------- after install insular--------------------
cd 10
ls -1 *.apk | xargs -ti -n 1 adb install --user 10 {}
adb push ./Downloads/* /sdcard/Downloads/
hopes this help.
the insular mentioned above is this package: com.oasisfeng.island.fdroid.apk
which will create sperate user space for your storage , called "work profile".
if you bricked your device, try these options:
(Every flash lover should backup a stock image for future!)
RSA solution, flash back to stock firmware. follow Skip to content for windows, follow these commands for Linux:
Bash:
command
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash vbmeta_system vbmeta_system.img
fastboot flash vbmeta vbmeta.img
fastboot flash radio radio.img
fastboot flash bluetooth BTFM.bin
fastboot flash dsp dspso.bin
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash vendor_boot vendor_boot.img
fastboot flash dtbo dtbo.img
fastboot flash super super.img_sparsechunk.0
fastboot flash super super.img_sparsechunk.1
fastboot flash super super.img_sparsechunk.2
fastboot flash super super.img_sparsechunk.3
fastboot flash super super.img_sparsechunk.4
fastboot flash super super.img_sparsechunk.5
fastboot flash super super.img_sparsechunk.6
fastboot flash super super.img_sparsechunk.7
fastboot flash super super.img_sparsechunk.8
fastboot flash super super.img_sparsechunk.9
fastboot erase userdata
fastboot erase ddr
fastboot oem fb_mode_clear
fastboot reboot
Blank Flash, both windows and linux tools and image contained.
download stock firmware for motorola edge s (nio, XT2125) here: https://mirrors.lolinet.com/firmwar...ubsidy-DEFAULT_regulatory-DEFAULT_CFC.xml.zip
download blankFlash tool here:
https://mirrors.lolinet.com/firmware/motorola/nio/blankflash/blankflash_nio_RRTS31.Q1-84-24-3-6.zip
MSM Xextend is very powerfull, so many custom settings, love and great appreciate !
I've wrote a automatic script tool for this, see
https://github.com/superiums/TrinyFlashScript

Categories

Resources