Need help creating nandroid backup without screen. - OnePlus 3 Questions & Answers

Hi there,
Last friday I broke my lcd screen, it simply does not turn on anymore. Tomorrow an UPS employe will pick up my device and ship it to OP for repair.
My device: Oneplus 3 running TWRP recovery and rooted LineageOS. Adb is enabled in dev settings.
So now I am trying to create a nandroid backup to easily restore my system and data when I get my phone back since OP will reset it ...
I had this genious idea to boot into recovery and create a backup using adb but I ran into a problem.
I have to unlock my device in order to create the backup :/
adb console:
> D:\Desktop\Fastboot+ADB\Win32>adb backup -f backupbeforerepair --twrp system data boot
> Now unlock your device and confirm the backup operation.
So now I am hoping any of you will come up with another genious idea or a workaround so I can create this damn backup
Thanks alot in advance!

If anyone else would ever find himself in the same situation as me I was able to create the backup by doing the following:
You can use open recovery script in TWRP. See http://wiki.rootzwiki.com/OpenRecoveryScript
If you have the file
/cache/recovery/openrecoveryscript
then TWRP will process it when it starts.
If the file contains
backup BSDO myBackup
then the boot (kernel), system, and data partitions will be backed up in compressed format and named myBackup.
So, on your PC, create the openrecoveryscript file, boot into recovery, use ADB to push the file to /cache/recovery/openrecoveryscript then reboot back into recovery. That should trigger the backup process.
Note, the backup will be written to the default location TWRP for backups.
Click to expand...
Click to collapse

Related

Nandroid for Hero

Anyone got Nanadroid working with Hero yet?
Need to take a back up on my device before I start playing around with it!
recovery.img with nandroid here: http://forum.xda-developers.com/showthread.php?t=543571
Beat me to it - I did a successful Nandroid backup today before I rooted my Hero. So I guess if I need to I can restore that unrooted image. I used the recovery image in the rooting thread above xx
Hi Dayzee,
I'm pretty new to all this, su just to be on the safe side: does your method (linked above) allow me to make a full backup of everything I have in my phone now, and to restore that backup if / when I brick it trying to root it or install a different build?
Thanks in advance.
frandavid100 said:
Hi Dayzee,
I'm pretty new to all this, su just to be on the safe side: does your method (linked above) allow me to make a full backup of everything I have in my phone now, and to restore that backup if / when I brick it trying to root it or install a different build?
Thanks in advance.
Click to expand...
Click to collapse
yes it will restore whatever you had when you made the backup inlcuding setting and just anything you can imagine.
i think that is what Nandroid does, but I've never had to restore from a backup so can't be sure - any thread or wiki on Nandroid will tell you.
The recovery image that you boot during the rooting process has Nandroid built in - when you get to the recovery console screen, scroll down to Nandroid back up and press the scroll wheel - away it goes, and then says back up completed - the file is then on your SD card in a folder called Nandroid and from the looks of the console, to restore, you'd just scroll to that option and press the scroll button.
If you're in doubt - do nowt - that's my moto. But good luck if you want to have a go
Dayzee
Thanks minogue, that's relieving. I'd like to start learning to make the most of my hero, but I'm quite afraid of breaking it, what with being so expensive and me having a monthly data fee for it and all.
Hi,
What is the image 'cm-hero-recovery.img' exactly?
Is it a particular Hero release? I presume this is the image of the rooted hero....but how does it compare to the unlocked HTC supplied Hero? Are there missing applications, widgets etc...?
Thanks
Phil
n00b question no. 1
I'm new to Android so I suspect you'll need to be patient with me, very patient. I'm trying to backup my device but I've been unsuccessful so far. This is what I'm doing:
1. Power down handset
2. Power handset back up(holding down back key) This brings up the Fastboot, I think, screen.
3. Plug in USB cable
4. Fire up CMD.exe
5. Enter "fastboot boot cm-hero-recovery.img" - this brings up Android system recovery screen.
6. but now when I select "[Alt+B]Nandroid v2.2 backup" it says performing backup for a second or so but results in: Error running nandroid backup. Backup not performed.
I tried removing the USB cable but that doesn't help. Any advice/ideas/anything, I'm desperate(not really, maybe a little: ). Thanks
roeblerrieland said:
I'm new to Android so I suspect you'll need to be patient with me, very patient. I'm trying to backup my device but I've been unsuccessful so far. This is what I'm doing:
1. Power down handset
2. Power handset back up(holding down back key) This brings up the Fastboot, I think, screen.
3. Plug in USB cable
4. Fire up CMD.exe
5. Enter "fastboot boot cm-hero-recovery.img" - this brings up Android system recovery screen.
6. but now when I select "[Alt+B]Nandroid v2.2 backup" it says performing backup for a second or so but results in: Error running nandroid backup. Backup not performed.
I tried removing the USB cable but that doesn't help. Any advice/ideas/anything, I'm desperate(not really, maybe a little: ). Thanks
Click to expand...
Click to collapse
hmmm, you need to have at least 152 MB + the size of your data partition free on your sdcard.If you have the space and still doesn't work, you can try to do a backup using command line from the recovery:
Code:
adb shell
nandroid-mobile.sh -b
ps. nandroid options:
Code:
nandroid-mobile v2.1
Usage: /sbin/nandroid-mobile.sh {-b|--backup|-r|--restore|-d|--delete|-u|--getupdate|--webget|--compress|--bzip2} [options]
At least one operation must be defined, try /sbin/nandroid-mobile.sh --help for more information
Not choices: Space! Thanks.
OK just did a backup works great Thank you all

[Q] Shattered screen & backup (solved)

Hi everyone, for Christmas my screen was crushed by a car .
The screen is completely destroyed (both touch screen & display screen).
However the phone is booting, so I can put it in recovery mod (I rooted the phone and I have clockworkmod).
After many trials, I succeeded in having adb connecting to my phone in blind mode.
I did this:
Code:
adb mount /data
adb pull /data /a_backup_folder
adb mount /system
adb pull /system /another_backup_folder
... and copied back my SD to my computer. I plan to buy another Desire and to revert the instruction by issuing a push for the data & system. This is:
Code:
adb mount /data
adb push /a_backup_folder /data
adb mount /system
adb push /another_backup_folder /system
Will it work ? Or is the system in sync with the flashed firmware ?
Can I selectively push some of the folders (namely applications, and the whole data). I hope to get back my settings, contacts etc...
I'm afraid I cannot do a whole lot more, since I do everything in blind mode.
Any advice on this ?
Thank you !
Just make a nandroid, should be able to restore as long as you don't have a different screen version (AMOLED to SLCD) but not 100% sure.
TheGhost1233 said:
Just make a nandroid, should be able to restore as long as you don't have a different screen version (AMOLED to SLCD) but not 100% sure.
Click to expand...
Click to collapse
Thank you for your suggestion.
Can I do it even if I do not have a screen ? I've tried to launch it but I fear it needs busybox (it says that it cannot find nc) and I think I do not have it (and don't know how to put it without the screen).
What are the supplementary steps that nandroid does ?
This is for CWM 2.5.0.7.
Sorry mist the part that you have to do everything blind, when in recovery press 5 times down on the volume rocker and then 2 times on the OJ let it sit for 10 min, should be done sooner but i don't know how to check if it's finished. After 10 min press once again on the OJ, your phone should reboot and in the Clockwork folder on the SD card should be a backup folder with a folder with the current date and time of the back up.
Unfortunately it did not work.
It did the steps as provided, and indeed the phone rebooted, but there is no clockworkmod folder on the sd card.
Is there any way to do a similar operation with adb ? This would be easier since when I'm in adb shell, I can type from the PC .
Try installing amon ra recovery. You should be able to do it. This is what the amon ra thread says:
Scripts available via adb :
* Nandroid v2.2.1 : enter "nandroid-mobile.sh" to start.
Explenation: http://forum.xda-developers.com/showpost.php?p=3046976&postcount=1
I think that this is what you are looking for
Use the command below to find out what partitions each mtd is for (I don't remember)
cat /process/mtd
Then backup with
cat /dev/mtd/mtdx > /sdcard/mtd.img
(Replacing x with whatever number)
Get all the partitions you need, boot, cache, data and system. Then flash to your new phone from fastboot.
fastboot flash boot mtdx.img
You might want to get hold of a tool called unyaffs and take a look inside the images you make to check its all ok before you bin your old phone or send it back.
mercianary said:
Use the command below to find out what partitions each mtd is for (I don't remember)
cat /process/mtd
Then backup with
cat /dev/mtd/mtdx > /sdcard/mtd.img
(Replacing x with whatever number)
Get all the partitions you need, boot, cache, data and system. Then flash to your new phone from fastboot.
fastboot flash boot mtdx.img
You might want to get hold of a tool called unyaffs and take a look inside the images you make to check its all ok before you bin your old phone or send it back.
Click to expand...
Click to collapse
Ok the first step worked, but unyaffs does not want to open my imgs.
The size are as follow:
Code:
3*145*728 boot.img
3*145*728 boot_ro.img
41*943*040 cache.img
41*943*040 cache_ro.img
655*360 misc.img
655*360 misc_ro.img
4*718*592 recovery.img
4*718*592 recovery_ro.img
262*144*000 system.img
262*144*000 system_ro.img
154*796*032 userdata.img
154*796*032 userdata_ro.img
which seems good (I also made images from the mtdXro). However I should be able to extract userdata and system from my understanding. I tried with unyaffs both on linux and on windows, on both I get a segmentation fault.
Do I have a way to verify that theses images are good ? I do not want to trash the new phone I will buy with a faulty image...
Flash the same rom from recovery on your new phone, then flash the data image from fastboot, if it works the first boot should take a while as it builds the cache. If it doesn't work just clear data and it wont have done any damage to your new phone.
You will have to zip the data image before you fastboot flash it because it's too big for fastboot to receive.
If you have s-off on your old phone I would flash amon-ra recovery from fastboot then use the nandroid script over adb.
As long as you don't try to flash the recovery you backed up I don't think there's any chance of damaging your new phone doing this.
Ok the final solution was to use the new phone (rooted and with clockworkmod) as a reference.
I did the same backup sequence on the two phones, and have been able to restore the backup on the new phone.
Thank you everyone for your help !
Glad you got it sorted...don't drop your phone under a car again.
Sent from my HTC Desire using XDA App

Cannot restoring backup through ClockWorkMod Recovery 3.0.2.6

Hi
I took and backup of my rom to try a new one but wanted to go back to the old one. When I try to restore the backup through ClockWorkMod Recovery, it restores the system but when restoring data and PDU, ClockWorkMod Recovery restarts.
When I get to my desktop, all my icons are there but the apps themselves are missing along with a lot of other stuff.
Any idea why this might be happening and what I can do to restore my backup??
Thanks
I could give you a solution, but whatever happens, its not my fault!! , because maybe CWM recovery did that for a reason.
But anyway...
Take the data.img file from your sdcard(in clockworkMod folder) and extract it (many programs out there that extract .img files, i use 'ext2explore')
Then make a flashable .zip file and flash it (make sure its signed, and has the right folder structure and updater-script code).
I've never dont this, but theoretically it should work.
Or, You could flash it via fastboot.
Place the same data.img in your SDK/tools folder, boot into fastboot & fire up your cmd window
Code:
fastboot flash data data.img
Again the same disclaimer applies, use at your own risk.
I'm having the same problem and I tried to flash data.img,
"fastboot flash userdata data.img" ,
But it said my back was too large.
I'm gonna try the ext2explorer and see if that works.
Sent from my Desire HD using XDA App
@Andyharney post: yea, you could do it that way!, i forgot all about that method
Thanks for your help.
You must be right. There must be something wrong with the backup and that's why it isn't restoring and dont wanna risk breaking anything more.
Again, thanks for helping.
ext2explorer says somthing about the masterblock not being found. Im not sure what to do, just gnna use the titanium backups frm a couple days back

Flashing Nandroid backups

Hi
Would it be possible for me to do the above without having to connect my phone to my laptop every time?
I know I have would have to load the boot.img first from a cmd window whenever i wanted to try a new rom, but was just wondering if I'd have to do that with it already on the internal sd card.
Any help would be appreciated.
Wiggo
Unless the backup you're restoring uses the same boot.img as the one you're using you will need to flash the one from your backup (using fastboot) when you restore it.
Recovery doesn't have permission to write to the boot partition; this means whether you're flashing a ROM or a backup from recovery the boot.img won't be written and you'll have to do it manually.
hopscotchjunkie said:
Unless the backup you're restoring uses the same boot.img as the one you're using you will need to flash the one from your backup (using fastboot) when you restore it.
Recovery doesn't have permission to write to the boot partition; this means whether you're flashing a ROM or a backup from recovery the boot.img won't be written and you'll have to do it manually.
Click to expand...
Click to collapse
That makes sense. Thanks very much for your help

No ROM installed, stuck in recovery.

I was getting random reboots and I tried to delete everything. I thought "clean to install new ROM" would just do a thorough cleaning.
When I try to boot it stays on the white HTC screen.
I can boot into the recovery and Squabbi's HTC One M8 toolkit reads it.
However, I have no idea what files to flash or even HOW to flash them so I can get an OS back on my phone. Can somebody please help?
I have no ADB experience.
Copy a rom zip on external sd and flash it through recovery or use a nandroid backup if you have one, but as you want a clean install maybe you want to use the first method
lukes91 said:
Copy a rom zip on external sd and flash it through recovery or use a nandroid backup if you have one, but as you want a clean install maybe you want to use the first method
Click to expand...
Click to collapse
Thank you for your reply. I am currently in ADB i tried to do "adb sideload" but got an error "failed to write data 'protocol fault (no status)'
I am going to try "adb push" right now and see if that works.
In the meantime, is it possible for me to recover using RUU in my current state of being stuck in recovery mode? Thanks again. I'll make sure to hit that donation button.
decko5 said:
Thank you for your reply. I am currently in ADB i tried to do "adb sideload" but got an error "failed to write data 'protocol fault (no status)'
I am going to try "adb push" right now and see if that works.
In the meantime, is it possible for me to recover using RUU in my current state of being stuck in recovery mode? Thanks again. I'll make sure to hit that donation button.
Click to expand...
Click to collapse
Well, the error might be a recovery issue, a cable issue (use stock htc one) or a driver issue... Unfortunately no RUU is available, so search for a nandroid backup in mr hofs' thread, copy it on the external sd card and recover it... Use the same recovery the backup was taken with (should be noted near the backup)... Let me know if you need further help dude
lukes91 said:
Well, the error might be a recovery issue, a cable issue (use stock htc one) or a driver issue... Unfortunately no RUU is available, so search for a nandroid backup in mr hofs' thread, copy it on the external sd card and recover it... Use the same recovery the backup was taken with (should be noted near the backup)... Let me know if you need further help dude
Click to expand...
Click to collapse
Ok so i found my nandroid backup and i am currently i am in adb. how do i push the backup to the TWRP backup directory?
decko5 said:
Ok so i found my nandroid backup and i am currently i am in adb. how do i push the backup to the TWRP backup directory?
Click to expand...
Click to collapse
It's easier to mount the storage in twrp, so you can browse it with the computer and copy paste the file inside... Then unplug the phone and restore the nandroid...
Edit: in this thread
http://forum.xda-developers.com/showthread.php?t=2318497
there are very useful infos for you, and there is the adb push command you are looking for (path should be the same)... Let me know if you recover everything or if you need more help
lukes91 said:
It's easier to mount the storage in twrp, so you can browse it with the computer and copy paste the file inside... Then unplug the phone and restore the nandroid...
Edit: in this thread
http://forum.xda-developers.com/showthread.php?t=2318497
there are very useful infos for you, and there is the adb push command you are looking for (path should be the same)... Let me know if you recover everything or if you need more help
Click to expand...
Click to collapse
I flashed TWRP via fastboot. then i pushed a nandroid backup hosted on this site to the /sdcard/TWRP/backsups/<a directory i made here> finally got everything working. Thanks again for everything. I just hope the random rebooting doesn't come back.
I think it was rebooting because I disabled some bloatware apps via an app called App Master, which requires root. And when i restarted the phone, all those apps tried to run again but there was a conflict with App Master.
decko5 said:
I flashed TWRP via fastboot. then i pushed a nandroid backup hosted on this site to the /sdcard/TWRP/backsups/<a directory i made here> finally got everything working. Thanks again for everything. I just hope the random rebooting doesn't come back.
I think it was rebooting because I disabled some bloatware apps via an app called App Master, which requires root. And when i restarted the phone, all those apps tried to run again but there was a conflict with App Master.
Click to expand...
Click to collapse
Well, you can try to reinstall the rom without removing the bloatware... If it's stable you found the culprit

Categories

Resources