[HOW-TO] Use Safestrap (backup and flash) (WIP)

Discussion in 'Droid 3 Hacks' started by guidot, Nov 10, 2011.

  1. guidot
    Offline

    guidot Developer Relations Staff Member Premium Member

    Joined:
    Feb 10, 2010
    Messages:
    7,350
    Likes Received:
    270
    Trophy Points:
    0
    Location:
    Massachusetts
    Ok, guide #4 coming at you here.

    So, Hashcode's been busy making all kinds of cool stuff to make our D3 great. Safestrap is his newest project.

    The rundown: Essentially, this 'strap separates your userdata (/data and /system) in non-safe mode (stock if you will), from the ROM you will flash in safe mode.

    Steps to make a backup in non-safe mode and safe mode are the same, but they CAN NOT be restored interchangeably.

    1. Reboot the phone (manually or via an app; ATM reboot to recovery is NOT supported.)
    2. At splash screen press menu key. You are now in CWR.
    3. Select backup and restore.
    4. Select backup.
    5. Should take about 1-3 minutes here. This backup is contained on your SDcard-ext (the physical card, unless you don't have one; I need verification that it works without an SD.
    6. Done.

    You'll notice in a file explorer, that the backups are separated in /sdcard-ext/safestrap/backup/non-safe-xxx-xxx and (once you make one) /sdcard-ext/safestrap/backup/safe-xxx-xxx as they cannot be flashed interchangeably.

    To flash a ROM:
    1. Make sure the ROM .zip file is on your SDcard
    2. Reboot and access recovery as above.
    3. Select Safe System
    4. Turn on Safe System (this should take a few minutes as it is copying the userdata to an unused partition)
    5. Power off and reboot into recovery (have not verified this is acutally necessary)
    6. wipe data (in main menu)
    7. wipe cache (in main menu)
    8. Select mounts and storage
    9. Format /system
    10. Back to main menu
    11. Select Advanced
    12. Wipe Dalvik Cache
    13. Main Menu
    14. Install zip (your ROM) from SDcard
    15. Reboot (should take a good while to boot, up to 5 minutes)

    To restore your stock system:
    1. Reboot into recovery.
    2. select Safe System
    3. Turn off Safe System
    4. Reboot

    At this time, the splash screen should show "Safe system: Disabled"

    Thanks to:
    hashcode
    koush
    fishacura
    ndoren
    13th angel
    clumsyninja21
    Last edited: Feb 19, 2012
  2. guidot
    Offline

    guidot Developer Relations Staff Member Premium Member

    Joined:
    Feb 10, 2010
    Messages:
    7,350
    Likes Received:
    270
    Trophy Points:
    0
    Location:
    Massachusetts
    I am testing a ROM right now.

    My guide works. ;)

    The initial boot after the new rom flashes is literally twice, if not 3 times as long as the OG droid was.

    Sent from my Safestrapped, Rooted, ROM'd XT862
  3. ndoren
    Offline

    ndoren New Member

    Joined:
    Nov 7, 2009
    Messages:
    85
    Likes Received:
    3
    Trophy Points:
    0
    Guidot, thanks for your effort on the guide! Brilliant minds think alike, because to some extent, Hashcode posted a How-To on his blog site for
    Safestrap. See: Hash of Codes: HOW-TO Safestrap

    However, like his blogs, his How-To is a little confusing there. Maybe this is stating the obvious, but I can't be sure. Does "Non-safe" refer to "1st-system" and "Safe" refer to "2nd-system"? He uses all the terms but doesn't really link them clearly.

    For those who aren't into burning ROMs but just want the security of nandroid backups for their stock ROM, does Safestrap have any advantages at all over the simple Koush bootstrap and recovery?
  4. guidot
    Offline

    guidot Developer Relations Staff Member Premium Member

    Joined:
    Feb 10, 2010
    Messages:
    7,350
    Likes Received:
    270
    Trophy Points:
    0
    Location:
    Massachusetts
    Yes non-safe could be considered 1st init and Safe is 2nd init, but its more different than even that.

    Let me explain a bit (hoping that folks have some idea about computer/filesystems):

    When you create a backup in non-safe mode, it is a standard FULL backup in CWR.

    When you change from non-safe to safe mode, safestrap actually moves the userdata (/data and /system) to /emmc which is an unused partition in the filesystem. So the new safe mode is technically no different than the non-safe mode regarding the existing filesystem. It doesn't write the ROM to a different location than normal, the safestrap just moves the userdata from the 'stock rom' to a secondary location.

    Essentially, its as close to being unbrickable as it can be. You can always get into the strap even using power+m if the splash screen doesn't show.

    Sent from my Safestrapped, Rooted, ROM'd XT862
    Last edited: Nov 11, 2011
  5. svickstc
    Offline

    svickstc New Member

    Joined:
    Oct 10, 2011
    Messages:
    235
    Likes Received:
    2
    Trophy Points:
    0
    When creating a backup would you want to be in safe mode or non safe mode,

    I would assume safe mode from your description?

    Not sure if i fully understand but, but having safe mode disabled would essentially be one rom, and enabling safe mode would allow you to install a second rom, and can just toggle back and forth between safe and non safe mode?
    Last edited: Nov 15, 2011
  6. guidot
    Offline

    guidot Developer Relations Staff Member Premium Member

    Joined:
    Feb 10, 2010
    Messages:
    7,350
    Likes Received:
    270
    Trophy Points:
    0
    Location:
    Massachusetts
    Safe mode is for flashing ROMs.
    Non-safe is where your 'stock+root' ROM and data is.

    Always flash in safe. Safe meaning 'safe to flash.'

    Sent from my Safestrapped, Rooted, ROM'd XT862
  7. guidot
    Offline

    guidot Developer Relations Staff Member Premium Member

    Joined:
    Feb 10, 2010
    Messages:
    7,350
    Likes Received:
    270
    Trophy Points:
    0
    Location:
    Massachusetts
    Its not meant to go back and forth. Its solely for disaster recovery.

    Sent from my Safestrapped, Rooted, ROM'd XT862
  8. svickstc
    Offline

    svickstc New Member

    Joined:
    Oct 10, 2011
    Messages:
    235
    Likes Received:
    2
    Trophy Points:
    0
    so when i toggle to safe and flash a rom, i wouldnt toggle it off unless i was going to do a restore?

    thanks for your quick reply and help understanding this!!!
    Last edited: Nov 15, 2011
  9. guidot
    Offline

    guidot Developer Relations Staff Member Premium Member

    Joined:
    Feb 10, 2010
    Messages:
    7,350
    Likes Received:
    270
    Trophy Points:
    0
    Location:
    Massachusetts
    If you are interested in flashing ROMs a lot, I would make a backup of your stock setup in non-safe mode, then switch to safe and start flashing! I'll probably stay in safe mode unless I have to unroot for warranty!

    Sent from my Safestrapped, Rooted, ROM'd XT862
  10. svickstc
    Offline

    svickstc New Member

    Joined:
    Oct 10, 2011
    Messages:
    235
    Likes Received:
    2
    Trophy Points:
    0
    Ok, I created a backup in non safe mode, and is still in non safe mode until i decided to make the jump from SD3 to one of these new roms requiring safestrap

    should i be in safe mod when flashing themes too?
    Last edited: Nov 15, 2011
  11. matthskim
    Offline

    matthskim New Member

    Joined:
    Feb 22, 2011
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    0
    Thanks for all your dedication on Safestrap.

    Would/should you install all apps you need/want in non-safe mode first and then just flash the safe rom and let the app/data flow through automatically to the new safe rom? Or just keep the stock rom withoutyour apps + root and install the safe rom and install apps in the safe rom?

    Secondly, when the OTA comes through in the non-safe mode, will the new updates such as kernell, radio, what have you be reflected in the safe rom?

    Thirdly, if anything goes bad with the safe rom, would you be able to restore to the non-safe really easily? Then, how would you do that?

    Thanks a lot for your help.

    Thanks.
  12. guidot
    Offline

    guidot Developer Relations Staff Member Premium Member

    Joined:
    Feb 10, 2010
    Messages:
    7,350
    Likes Received:
    270
    Trophy Points:
    0
    Location:
    Massachusetts
    You need to be in safe mode to flash any ROM or theme associated with that ROM.

    Sent from my Safestrapped, Rooted, ROM'd XT862
  13. guidot
    Offline

    guidot Developer Relations Staff Member Premium Member

    Joined:
    Feb 10, 2010
    Messages:
    7,350
    Likes Received:
    270
    Trophy Points:
    0
    Location:
    Massachusetts
    Ok, lots of data you are downloading here.

    Let me try to address everything.

    I would make a backup in non-safe mode of your phone as it is right now in stock form (+root obviously). That way if anything goes south in either safe or non-safe you are covered.

    If you are in safe mode, you don't "see", or rather, the upgrade servers don't see the non-safe mode. You most likely will not see OTAs if you are on a ROM, as the /system folder won't be correct. If you go back to non-safe mode and accept an OTA (which I DO NOT recommend), you will most likely have to re root and re install safestrap (if your phone can even be re rooted at that point).

    If something goes wrong, ie a bootloop or bad flash, you can reboot, hit menu and change back to non-safe and restore your backup. Should be just a few minutes.

    That is the beauty of Safestrap.


    Sent from my Safestrapped, Rooted, ROM'd XT862
  14. guidot
    Offline

    guidot Developer Relations Staff Member Premium Member

    Joined:
    Feb 10, 2010
    Messages:
    7,350
    Likes Received:
    270
    Trophy Points:
    0
    Location:
    Massachusetts
    In regards to the apps, its personal preference.

    I used to test for a developer, so I'm used to reinstalling everything all the time.

    Obviously without all the apps and their data, the backup would be faster and smaller file size.

    Sent from my Safestrapped, Rooted, ROM'd XT862
  15. matthskim
    Offline

    matthskim New Member

    Joined:
    Feb 22, 2011
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    0

    Thanks.

    Could you please give me an answer to my first question regarding where I should install apps, non-safe or safe.

    Edit: woops, you already answer. Thanks.
    Last edited: Nov 15, 2011
  16. guidot
    Offline

    guidot Developer Relations Staff Member Premium Member

    Joined:
    Feb 10, 2010
    Messages:
    7,350
    Likes Received:
    270
    Trophy Points:
    0
    Location:
    Massachusetts
    Just to reiterate; safe and non-safe are 2 different things. No data 'flows' between them in any fashion.

    Sent from my Safestrapped, Rooted, ROM'd XT862
  17. matthskim
    Offline

    matthskim New Member

    Joined:
    Feb 22, 2011
    Messages:
    61
    Likes Received:
    0
    Trophy Points:
    0
    Oh, I see.

    I thought that the apps/data would flow through between the two systems based on following remarks on Hashcodes' blog:

    1. Many enhancements to Safestrap Recovery including:
      • Caching of userdata between the safe and non-safe systems -- This does take some time. I know it's not instant like it was before. But many users were experiencing hung starts, etc. And now you don't need to constantly backup/restore between swaps.
  18. guidot
    Offline

    guidot Developer Relations Staff Member Premium Member

    Joined:
    Feb 10, 2010
    Messages:
    7,350
    Likes Received:
    270
    Trophy Points:
    0
    Location:
    Massachusetts
    That is only when moving from non-safe (ie moving userdata to /emmc) and back to non-safe (ie replacing from /emmc to /system and /data).

    Sent from my Safestrapped, Rooted, ROM'd XT862
  19. svickstc
    Offline

    svickstc New Member

    Joined:
    Oct 10, 2011
    Messages:
    235
    Likes Received:
    2
    Trophy Points:
    0
    I created a backup in non safe mode of my SD3 and when i toggle to safe mode to flash a new, i go to reboot and it just hangs at a black screen after the safestrap menu goes away

    i have to pull the battery and toggle back to non safe mode for it to boot back up?
  20. jamauney
    Offline

    jamauney New Member

    Joined:
    Nov 16, 2011
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    I'm having trouble flashing a ROM. I've tried multiple placing multiple .zip files on the internal storage, but none of them show up in the "install zip from sdcard" menu on Safestrap. I assume I'm doing something wrong, but can't figure out what it is. Any help would be appreciated.
Search tags for this page
how to enter safestrap recovery mode on the razr m
,
how to flash using safestrap
,
how to use how-to safestrap
,

how to use safestrap

,
how to use safestrap 3
,
how to use safestrap recovery
,
how to wipe data safestrap
,
safestrap
,
safestrap backup
,
safestrap galaxy nexus
,
samsung galaxy s 4 active bad backup threw safestrap
,
using safestrap
,
using safestrap to flash roms
,
where does safestrap save backups
,
where does safestrap store backups