One M9 flash system image


Question

Situation

Device: HTC One M9

Recovery: TWRP

Custom ROM: Android Revolution HD (Android 6.0)



Problem

I want to flash the stock rom without wiping anything (I don't want to lose anything). I can flash the stock recovery. I have extracted the system.img and boot.img from the official RUU in order to flash the system image to get rid of the Custom ROM.

When I use fastboot to flash the boot image everything seems fine.

However, when I flash the system image which is about 4.5 gigs big, it again says OK but it only takes around 30 seconds to flash.

When I try to boot after flashing the images, the htc logo appears but nothing more happens. Trying to install an OTA with the stock recovery fails with
"system partition has unexpected contents".

I assume that the flashing process wasn't really successful.



How can I correctly flash the system partition?

Or is there any other way to get back to the stock rom without wiping userdata?

And NO, it's not acceptable in any way to wipe (I know that aprox. 98% of android enthusiasts would answer: "Just wipe".)



Btw. the reason for all of this is that the custom rom might not be updated to android 7 so i want to install the ota.



[edit]:

I use htc's fastboot version since the system image is 4.5g big and it cannot be flashed with normal fastboot.


Answer

Usually large images are flashed in sparse (parts). To flash a full image that large, consider using the dd command in a shell to directly write the image to /system - that's the only approach I can think of that doesn't seem to have size issues.



[edit]:
dd worked (booted to twrp and opened adb shell):

dd if=/external_sd/system.img of=/dev/block/mmcblk0p66

where mmcblk0p66 is the system partition (in /dev/block/platform/<something>.sdhci/by-name you can find a list of all partitions)


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes