I am seeking your help to clear up some of my confusion in solving a problem with my HTC ONE X. I tried flashing a custom ROM on my HTC Android phone but all the files and partitions got messed up that every time it boots up, it is on a bootloop. I know the cause to this is due to a mixture of inconsistent (boot, recovery)partitions libraries that I have on the phone.

Therefore, I want to FULLY WIPE OF ALL the data on the phone's storage and reinstall a clean set of libraries and stock rom. However, before I wipe off all data and install the new stock rom, I want to know all the commands that I can issue to correct this problem but the problem I have is that the stock zip has a boot.img, hboot.img and recovery.img along with a set of folders (System and Meta-inf folders) and I don't know the command that I can issue to push the folders I mentioned in the right partition, "/system" partition. Moreover, I cannot boot into any recovery modes (CWM or TWRP) so everything has to be done via fastboot commands, I think.

I know I can execute the following commands if everything was an .img file but for the folders I do not know how to push them onto my phones storage.

For example to push the boot content on the boot partition, I issue the following command to flash the device

fastboot erase boot 
fastboot flash boot boot.img 

and the following for the rest of the partitions:-

fastboot erase recovery 
fastboot flash recovery recovery.img

and so on..

So what would be the solution to push those folders that are non image related onto the right partitions?

Lastly, the phone is unlocked, CID: 11111111, Hboot: 1.09 and can only boot into fastboot mode for now. I also tried running the automatic RUU files via zip and exe formats but always fail due to signature or some other missing file error.

  • What files are in this "system" folder in your zip file? You can ignore the META-INF directory: it's part of the zip file, not part of the ROM image.
    – Dan Hulme
    Feb 12 '14 at 15:49
  • Dan, thanks for taking the time to look into this. The system folder contains all the libraries that are part of an os. I don't know if you are familiar with linux but its essentially the same thing. This folder contains all the other folders that are required for all functionalities of an OS to run such as "bin", "etc","usr", "xbin" folders that one would find in a linux distribution within the root folder. On a second thought, I am wondering if I flash this as a zip file, if it would automatically extract them in partition that it needs to be in. Thanks
    – Totti
    Feb 12 '14 at 16:52
  1. Download the latest recovery image for your device:
  2. Connect your phone to computer via USB cable. Boot your phone into bootloader and issue: fastboot flash recovery path/to/your/recovery.img
  3. Boot your phone into recovery. Mount SD Card to USB in TWRP Recovery or use adb push to copy your custom ROM .zip file to phone.
  4. Install your custom ROM from .zip file in TWRP.
  5. Extract boot.img from root of your ROM .zip file to your computer.
  6. Connect your phone to computer via USB cable. Boot your phone into bootloader and issue: fastboot flash boot path/to/your/boot.img
  7. Restart your phone to see if it can boot okay now.

I did not kinda get what did you mean by "folders". But I will still tell you a general method to push folders into phone without actually flashing non-stock recovery. Base procedure-> You download a recovery. Yes, twrp or cwm, not stock. No we wont actually flash them. We boot into recovery right from pc, without flashing recovery. We use adb, mount folders and then push file using adb.

Now for detailed produre. Download cwm or twrp (I recommend twrp, a bunch of extra features than cwm in my opinion). Go into fastboot mode. Then, Use this command->

fastboot boot recovery.img

This will boot into the recovery lying on your computer instead of one on your phone, hence twrp/cwm. Now go to Mounts option in recovery, check mark system and whatever partitions you will be pushing data too.

Then use adb commands to push the files. I will go with your question, since you want to push to /system folder, lets go with that.

1) We mount system folder through adb.

adb shell mount -o rw,remount -t yaffs2 /system

2) We push the folder from pc to phone using adb.

adb push "pathToFolderOnPC" /system/

And this will push contents into system.

Remember to fix permissions.

Another way is to do this-> Boot into recovery. Then instead of mounting system (in case you are unable to mount system for whatever reason), push that folder into sdcard (since sdcard doesnt need special commands to be mounted).

adb push "pathToYourFolderOnPC" /sdcard/

then in twrp recovery, go to advanced/Terminal Command and use the command:

cp /sdcard/system/ /system/

This will push system files from your sdcard to /system partition. Again, fix permissions. And make sure you have check marked "system" in mounts.


  • Remember to wipe the old system partition data first, using fastboot or from recovery, whatever method you like.

  • There is no direct way to push folder through ADB.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.