Fastboot Flash vs Fastboot Erase - Android Q&A, Help & Troubleshooting

Was wondering if someone can explain the difference in the set of commands, as I see it on different guides in regards to flashing a new rom. does "Flashing" a partition technically erase it, overwrite it? Overwrite it leaving extra junk behind?
Code:
>fastboot erase boot
>fastboot erase recovery
>fastboot erase system
>fastboot flash system system.img
>fastboot flash boot boot.img
>fastboot flash recovery recovery.img
VS
Code:
>fastboot flash system system.img
>fastboot flash boot boot.img
>fastboot flash recovery recovery.img

Necro bump

morbid_bean said:
Was wondering if someone can explain the difference in the set of commands, as I see it on different guides in regards to flashing a new rom. does "Flashing" a partition technically erase it, overwrite it? Overwrite it leaving extra junk behind?
Code:
>fastboot erase boot
>fastboot erase recovery
>fastboot erase system
>fastboot flash system system.img
>fastboot flash boot boot.img
>fastboot flash recovery recovery.img
VS
Code:
>fastboot flash system system.img
>fastboot flash boot boot.img
>fastboot flash recovery recovery.img
Click to expand...
Click to collapse
Lemme see if I can shed a little light...
>fastboot erase boot - Tells fastboot to erase the boot partition
>fastboot erase recovery - Tells fastboot to erase the recovery partition
>fastboot erase system
>fastboot flash system system.img - Tells fastboot to flash the system partition with system.img
>fastboot flash boot boot.img - Tells fastboot to flash the boot partition with boot.img
>fastboot flash recovery recovery.img
Flashing a partition overwrites the existing contents. I should mention that using fastboot to install a ROM is a slow way to go. Fastboot is typically used for quick simple flashes or repairs, like changing your kernel/boot image. Also, fastboot makes a device practically unbrickable.

Yes they are different, read:
The flash command shouldn't erase the partition unless the host fastboot tool sends an erase command first. This allows flashing a very large partition in multiple smaller chunks using multiple sparse images that start with a "skip" block to seek over the already-written area. Creating these images on demand is already handled by the fastboot host side tool.
This is from https:// source.android.com/devices/bootloader/images
(fill in the space, they wouldnt let me post a url)

Related

[help]phone is bricked!!!

hi
so i was trying to install a custom rom on my phone because i couldnt root it with supersu.zip and twrp but i accidentaly wiped internal storage with twrp and when i try to install the custom rom although it says its successful it doesnt copy the files and says"unmount of system directory failed no such voulume",im really confused now, what can i do? any help is appreciated
also the internal storage is always empty and nothing gets copied in it
macszxc said:
hi
so i was trying to install a custom rom on my phone because i couldnt root it with supersu.zip and twrp but i accidentaly wiped internal storage with twrp and when i try to install the custom rom although it says its successful it doesnt copy the files and says"unmount of system directory failed no such voulume",im really confused now, what can i do? any help is appreciated
also the internal storage is always empty and nothing gets copied in it
Click to expand...
Click to collapse
Use a SD card to flash the ROM using TWRP. Also check on TWRP that the internal and external memory are mounted.
Sent from my XT1650 using XDA-Developers mobile app
Or ADB Sideload. Simple stuff
macszxc said:
hi
so i was trying to install a custom rom on my phone because i couldnt root it with supersu.zip and twrp but i accidentaly wiped internal storage with twrp and when i try to install the custom rom although it says its successful it doesnt copy the files and says"unmount of system directory failed no such voulume",im really confused now, what can i do? any help is appreciated
also the internal storage is always empty and nothing gets copied in it
Click to expand...
Click to collapse
Don't panic! As long as you can get to recovery or bootloader you aren't bricked
I would restore to stock and try everything again.
Here's the stock US ROM https://mega.nz/#!vtVmgAoI!J1cZtlRi0FjRHbxIJGA5U8CLx6RwUWQjwrCbjzf_Naw
There's a link around here for stock EU ROM if you need that instead.
Use these commands from an ADB prompt:
fastboot flash partition gpt.bin
fastboot flash motoboot boot.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash system system.img_sparsechunk.9
fastboot flash system system.img_sparsechunk.10
fastboot flash system system.img_sparsechunk.11
fastboot flash system system.img_sparsechunk.12
fastboot flash system system.img_sparsechunk.13
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot reboot
thx guys it worked with flashing stock rom
macszxc said:
thx guys it worked with flashing stock rom
Click to expand...
Click to collapse
I went through the exact same thing, wipe the whole system out, couldn't reboot even after flashing another ROM, then I figured, the boot.img must have gone missing, so I just fastboot flash boot boot.img (the one from within the stock ROM), then the phone booted
beaubin said:
I went through the exact same thing, wipe the whole system out, couldn't reboot even after flashing another ROM, then I figured, the boot.img must have gone missing, so I just fastboot flash boot boot.img (the one from within the stock ROM), then the phone booted
Click to expand...
Click to collapse
I'm ever more of the opinion that our Z is a device very hard to seriously brick...
Prfndhatrdofman said:
Don't panic! As long as you can get to recovery or bootloader you aren't bricked
I would restore to stock and try everything again.
Here's the stock US ROM https://mega.nz/#!vtVmgAoI!J1cZtlRi0FjRHbxIJGA5U8CLx6RwUWQjwrCbjzf_Naw
There's a link around here for stock EU ROM if you need that instead.
Use these commands from an ADB prompt:
fastboot flash partition gpt.bin
fastboot flash motoboot boot.img
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash system system.img_sparsechunk.9
fastboot flash system system.img_sparsechunk.10
fastboot flash system system.img_sparsechunk.11
fastboot flash system system.img_sparsechunk.12
fastboot flash system system.img_sparsechunk.13
fastboot flash modem NON-HLOS.bin
fastboot erase modemst1
fastboot erase modemst2
fastboot flash fsg fsg.mbn
fastboot erase cache
fastboot erase userdata
fastboot reboot
Click to expand...
Click to collapse
Hello, can you give me the EU stock rom, and please for god's sake don't give me this file factory link because this website is downloading slower to force me to buy their premium ****, thanks.

Boot Loop

Hi guys, I've tried all the threads so far and have got no where. I unlocked my device and flashed a custom rom, that worked fine. I then noticed no way to go back to stock so I tried the odexed version with no luck. Now any rom I flash does not boot, just loops back to twrp. I would like to get as close to stock as possible even if it's another region. Has anyone had any luck on getting their phones booting after this?
I've tried flashing stock firmware from 6.0.1 then flashing ota through side load
Flashing other countries firmware (which always ends in fail messages)
I've tried multiple rom from the forum which just loop.
I've spent about 6 hours trying different combinations of recovery, boot and other images with no luck.
Any help is appreciated.
Sent from my iPhone using Tapatalk
criptix said:
Hi guys, I've tried all the threads so far and have got no where. I unlocked my device and flashed a custom rom, that worked fine. I then noticed no way to go back to stock so I tried the odexed version with no luck. Now any rom I flash does not boot, just loops back to twrp. I would like to get as close to stock as possible even if it's another region. Has anyone had any luck on getting their phones booting after this?
Sent from my iPhone using Tapatalk
Click to expand...
Click to collapse
I have gotten stuck with bootloops a couple times now, for me re-flashing a backup or custom rom or custom kernel didn't fix it either. Keep in mind that you cannot go back to 6.0.1 once you have flashed 7.0, the bootloader won't allow it. I have had to flash back to a stock firmware from https:// firmware.center/firmware/Motorola/Moto%20Z/Stock/XT1650-03/ (remove the space after https:// ) and re-fastboot flash TWRP, re-root, and restore my Titanium Backups to get going again.
It's extremely helpful if you create a servicefile.bat to flash all the firmware parts in the right order. This is the one I made for flashing the RETMX 7.0 image (the main difference I noticed between different firmwares from that link is the number of sparsechunks, so add or delete lines as necessary. I'm sure all this info is available elsewhere, but I didn't manage to find it all in one shot. So I figured I would post it to help others out that are in the same boat. Also note that even though you are re-flashing the bootloader.img it does not re-lock your bootloader.
Code:
echo off
fastboot getvar max-sparse-size
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase modemst1
fastboot erase modemst2
fastboot flash bluetooth BTFM.bin
fastboot flash dsp adspso.bin
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash system system.img_sparsechunk.9
fastboot flash system system.img_sparsechunk.10
fastboot flash system system.img_sparsechunk.11
fastboot flash system system.img_sparsechunk.12
fastboot flash system system.img_sparsechunk.13
fastboot flash system system.img_sparsechunk.14
fastboot flash system system.img_sparsechunk.15
fastboot flash system system.img_sparsechunk.16
fastboot flash oem oem.img
fastboot erase carrier
fastboot oem fb_mode_clear
pause
fastboot reboot
exit
Copy the above text and paste it into a new text file and change the name to "servicefile.bat" without quotes (not servicefile.bat.txt), and drop it in with the extracted firmware files. Then either copy-paste your adb and fastboot files into that folder or drop all that folder's contents into your Users/*YOURNAME*/App Data/Local/Android/sdk/platform-tools/ folder. Or better yet, add "%USERPROFILE%\AppData\Local\Android\sdk\platform-tools" to your Path in your system's Environment Variables. The latter will make adb and fastboot work from any command prompt window, then you can just press shift+right-click in the folder that already has the firmware files and choose "Open command window here" and then just type servicefile.bat and press enter. Hope this helps! Good Luck and Happy Flashing!
HippieFlasher said:
I have gotten stuck with bootloops a couple times now, for me re-flashing a backup or custom rom or custom kernel didn't fix it either. Keep in mind that you cannot go back to 6.0.1 once you have flashed 7.0, the bootloader won't allow it. I have had to flash back to a stock firmware from https:// firmware.center/firmware/Motorola/Moto%20Z/Stock/XT1650-03/ (remove the space after https:// ) and re-fastboot flash TWRP, re-root, and restore my Titanium Backups to get going again.
It's extremely helpful if you create a servicefile.bat to flash all the firmware parts in the right order. This is the one I made for flashing the RETMX 7.0 image (the main difference I noticed between different firmwares from that link is the number of sparsechunks, so add or delete lines as necessary. I'm sure all this info is available elsewhere, but I didn't manage to find it all in one shot. So I figured I would post it to help others out that are in the same boat. Also note that even though you are re-flashing the bootloader.img it does not re-lock your bootloader.
Code:
echo off
fastboot getvar max-sparse-size
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.img
fastboot flash modem NON-HLOS.bin
fastboot flash fsg fsg.mbn
fastboot erase modemst1
fastboot erase modemst2
fastboot flash bluetooth BTFM.bin
fastboot flash dsp adspso.bin
fastboot flash logo logo.bin
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img_sparsechunk.0
fastboot flash system system.img_sparsechunk.1
fastboot flash system system.img_sparsechunk.2
fastboot flash system system.img_sparsechunk.3
fastboot flash system system.img_sparsechunk.4
fastboot flash system system.img_sparsechunk.5
fastboot flash system system.img_sparsechunk.6
fastboot flash system system.img_sparsechunk.7
fastboot flash system system.img_sparsechunk.8
fastboot flash system system.img_sparsechunk.9
fastboot flash system system.img_sparsechunk.10
fastboot flash system system.img_sparsechunk.11
fastboot flash system system.img_sparsechunk.12
fastboot flash system system.img_sparsechunk.13
fastboot flash system system.img_sparsechunk.14
fastboot flash system system.img_sparsechunk.15
fastboot flash system system.img_sparsechunk.16
fastboot flash oem oem.img
fastboot erase carrier
fastboot oem fb_mode_clear
pause
fastboot reboot
exit
Copy the above text and paste it into a new text file and change the name to "servicefile.bat" without quotes (not servicefile.bat.txt), and drop it in with the extracted firmware files. Then either copy-paste your adb and fastboot files into that folder or drop all that folder's contents into your Users/*YOURNAME*/App Data/Local/Android/sdk/platform-tools/ folder. Or better yet, add "%USERPROFILE%\AppData\Local\Android\sdk\platform-tools" to your Path in your system's Environment Variables. The latter will make adb and fastboot work from any command prompt window, then you can just press shift+right-click in the folder that already has the firmware files and choose "Open command window here" and then just type servicefile.bat and press enter. Hope this helps! Good Luck and Happy Flashing!
Click to expand...
Click to collapse
Dude, you are awesome. Worked like a charm. Was missing fastboot getvar max-sparse-size andbfastboot oem fb_mode_set plus I was flashing the modem after the chunks. Thanks again!
Sent from my iPhone using Tapatalk
Anytime! Glad I could help!

Flashed Device With FastBoot Now Internal Storage Shows 0.00b

Hello. I wanted to flash a stock ROM on my Xiaomi Mi3 (Not Mi3W) and I downloaded an official stock ROM and flashed it using Fastboot.
Here's where I think I messed up. I used the "fastboot erase userdata" on the phone and when it booted up, The system storage is showing fine when I go to settings > storage but the internal storage is showing up as 0.00b and I cannot install any applications.
I've tried reflashing but nothing is working. Any ideas on how I can get it to work? Thanks.
Try to flash again with fastboot but with following comands:
Enter the following commands below by order:
fastboot erase cache
fastboot erase userdata
fastboot erase system
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot reboot-bootloader
boot.img ,recovery.img and system.img it should be inside your stock firmware.
Teddy Lo said:
Try to flash again with fastboot but with following comands:
Enter the following commands below by order:
fastboot erase cache
fastboot erase userdata
fastboot erase system
fastboot flash boot boot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot reboot-bootloader
boot.img ,recovery.img and system.img it should be inside your stock firmware.
Click to expand...
Click to collapse
After much Googling, I was finally able to 'reset' the whole android partition system by flashing a CWM recovery, booting into it, and using ADB to fix it all.
Thank you for bothering to reply my at all. You're amazing.
You Welcome

Venue 8 T02D003 can't boot

My Venue 8 started with a whiter bar at the bottom of the screen. I've updated it as this link "opensource.dell.com/releases/Venue_8_3840_Merrifield". It's ok but slowly. So I edit some line in "P802_flash_device_wifi_only.bat". I added 2 line "fastboot erase config" and "fastboot erase factory" in partitioning command. After that, my Venue can't boot. After Dell logo, screen is black. It still can go to fastboot. I try flash rom again with original "P802_flash_device_wifi_only.bat" but there is no diffrence. May 2 lines I added cause this problem? If so, how to resolve the problem? Please help me.
original "P802_flash_device_wifi_only.bat"
Code:
fastboot oem start_partitioning
fastboot flash /tmp/partition.tbl partition.tbl
fastboot oem partition /tmp/partition.tbl
fastboot erase system
fastboot erase cache
fastboot erase data
fastboot erase logs
fastboot oem stop_partitioning
fastboot flash boot boot.img
fastboot flash fastboot droidboot.img
fastboot flash recovery recovery.img
fastboot flash system system.img
fastboot flash splashscreen_7 oemlogo_7.bin
fastboot flash splashscreen_8 oemlogo_8.bin
fastboot flash dnx dnx_fwr_PRQ.bin
fastboot flash ifwi for_product_ifwi_PRQ.bin
pause
fastboot reboot

Question how to remove a custom operating system from a Motorola g power (2021) phone?

how to remove a custom operating system from a Motorola g power (2021) phone?
jazzybird2009 said:
how to remove a custom operating system from a Motorola g power (2021) phone?
Click to expand...
Click to collapse
If you did a nandroid backup (e.g., TWRP etc.), do a full 'clean restore (i.e., wipe cache, Dalvik cache, system AND format data > Yes (important).
If not, do the same full wipe, reboot to fastboot and flash the stock rom. You could also try the Motorola "Rescue and Smart Assistant" but I'm not sure it will work in your particular case.
If you want to go back to stock ROM or "OS" consider this method unofficial works on RETCA not sure about other devices, Verizon for sure needs its own software, The requirements of this method are Windows 10/11, Motorola's USB Drivers and a working Fastboot. Download the stock ROM from here https://mirrors.lolinet.com/firmware/motorola/borneo/ match the model of the device, Extract the firmware guessing it's in Downloads folder open that folder in the Terminal here's an example "cd C:\Users\smoke\Downloads" then here are commands to flash converted from the xml files
fastboot getvar max-sparse-size
fastboot oem fb_mode_set
fastboot flash partition gpt.bin
fastboot flash bootloader bootloader.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 dtbo dtbo.img
fastboot flash recovery recovery.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 carrier
fastboot erase userdata
fastboot erase metadata
fastboot erase ddr
fastboot oem fb_mode_clear
fastboot reboot
This has worked for me never had a problem don't expect the same outcome, I would read the terms and services you agreed to when unlocking the bootloader.
Mind if I ask what custom ROM you were using? I haven't seen any for this phone yet

Categories

Resources