1. Download our Official Android App: Forums for Android!

Intro to Android HFS and Backup

Discussion in 'Android Lounge' started by gpup, Feb 4, 2014.

  1. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    Hi,

    I wonder if anyone knows of a resource that has a good intro to Android's Hierarchical File System. I have a background in computer science and technology, but Android's OS has a hierarchical file system like I have never seen, and it baffles me. I am simply trying to back up all the files on my phone so that if I lose my phone I can just reload the whole directory onto a new phone and don't have to reload files manually. This should be simple.

    My phone is rooted. I learned that I cannot use ADB pull (USB connection) to download the files directly to my computer because root access is blocked over ADB without sideloading a different OS. So instead, I am using a root file explorer and trying to copy my phone's directory onto a microSD card. The problem is that there seem to be a lot of aliases (directory shortcuts) on the Android HFS. But rather than copying the shortcuts as shortcuts (as one would expect), for every shortcut, it tries to copy all the files over again, which puts the copy function into somewhat of a loop and fills up the SD card rather quickly. (e.g if there are 10 shortcuts to a file, it will copy the file 10 times, and worse, sometimes directory shortcuts are nested and circular so it attempts to copy the same directory an infinite number of times. If anyone can recommend a resource that explains how the Android HFS works, I would be grateful, so I can understand how to make a legit copy of all the files without sending the copy function into an infinite loop. Simple task!

    I can't believe how much time it's taking just to figure out how to make a backup copy of my phone.

    Thanks much,
    Ben
     

    Advertisement

  2. palmtree5

    palmtree5 Sunny Vacation Supporter!
    Moderator
    Rank:
     #38
    Points:
    633
    Posts:
    4,538
    Joined:
    May 2, 2012

    May 2, 2012
    4,538
    3,345
    633
    Male
    Student
    USA
    You could install a terminal emulator (like this one) and do a system dump of all of your partitions using dd (you may also wish to have busybox installed)
     
  3. funkylogik

    funkylogik share the love peeps ;)
    Rank:
    None
    Points:
    1,443
    Posts:
    21,404
    Joined:
    Sep 15, 2011

    Sep 15, 2011
    21,404
    7,246
    1,443
    Male
    monkey
    Paisley, Scotland, Western Europe
    Since youre rooted, you could save yourself the headache and install a custom recovery and make a complete backup image
     
  4. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    Hi Palm Tree. Thanks so much for your help. I actually already have Terminal Emulator installed. Apologies for my ignorance on the topic, but can you please help me understand your suggestion? Normally in terminal (on a PC) I would just use sudo ditto / [destination] to flash the whole drive. However, the terminal app on my phone doesn't seem to recognize the sudo command, and the prompt is a $ so it looks like it's not logged in as root. Further, I am confused as to what to put as the destination. Would it just be "/storage/extSdCard"?

    Also not familiar at all with dd or busybox (and couldn't even find dd on the play store), or how they work. Are those apps that would just flash my entire phone onto an SD card? Again, please pardon my ignorance and much appreciate the help!
     
  5. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    Thanks much for the suggestion. When you say "custom recovery," you're referring to a custom OS for the phone, right? Installing a whole new OS sounds like it would be a lot more work than just flashing a copy of the drive as is, or am I missing something here (entirely possible!)? Thanks again for the assistance.
     
  6. funkylogik

    funkylogik share the love peeps ;)
    Rank:
    None
    Points:
    1,443
    Posts:
    21,404
    Joined:
    Sep 15, 2011

    Sep 15, 2011
    21,404
    7,246
    1,443
    Male
    monkey
    Paisley, Scotland, Western Europe
    Hey mate :beer:
    By "custom recovery" i mean like ClockworkMod or TWRP. these arent custom roms, they just replace the stock recovery mode of the phone giving a lot more options including the ability to make a backup of the entire phone, everything (firmware, apps, system apps, an image of how the phone was when you made the backup) :thumbup:
     
  7. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    Okay, I tried to install TWRP and now my phone is stuck in "download mode" and I can't figure out how to get out of it. I am using "Recovery Tools Flasher to install TWRP. I emailed the developer and am still waiting to hear back. My phone jus says "Downloading Do not turn of Target!" and won't do anything else or give me a status. It's been about an hour and I really need to use my phone. Any thoughts. All this just to backup my phone! you'd think it would be a little easier!
     
  8. SulkyAndroid17

    SulkyAndroid17 Android Enthusiast
    Rank:
    None
    Points:
    68
    Posts:
    333
    Joined:
    Dec 17, 2012

    Dec 17, 2012
    333
    145
    68
    Male
    College Student
    Uhmerica
    I think this is your problem. You need to find instructions for your phone. External helper tools like that seem to often cause more problems.

    Are you rooted?
     
  9. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    I am rooted. Yes, the tool indicated that it is compatible with my phone. When I looked up the intructions it seemed I needed to use a tool like that. In any case, my phone has been showing "Downloading Do not turn off target!!" for about 4 hours. Anyone know how to get out of this so I can finally back up my phone? Not to mention USE it again!
     
  10. SulkyAndroid17

    SulkyAndroid17 Android Enthusiast
    Rank:
    None
    Points:
    68
    Posts:
    333
    Joined:
    Dec 17, 2012

    Dec 17, 2012
    333
    145
    68
    Male
    College Student
    Uhmerica
    What phone do you have?

    A pull of the battery should set you straight. If you can't remove your battery, holding the power button for 10 seconds or so should work.
     
  11. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    Galaxy S4. Tried both of those and no luck.

    Should I use odin? I downloaded it from here:

    odin and ops file

    but can't figure out how to use the dam thing.
     
  12. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    I see a lot of reference to using Odin to install TWRP but can't find instructions anywhere as to HOW to use it, or where to download the appropriate files. Sulky, I would guess there would be instructions all over the place for the GS4, but when I Googled it they all just said to use one of the tools, so I found one that said it was compatible with my phone and now my phone doesn't work. Ugh, and this was supposed to be the "easy" way to do a complete backup, according to funkylogik.

    I am thinking if I can find these instructions you refer to somewhere, that maybe I can try that and somehow I can install TWRP using my USB cable and my computer. Any idea where the instructions for the GS4 might be? When I open Odin, it looks like there are 6 possible types of files I can upload to the phone: Ops, Boot, Phone, Pda, CSC, and EFS. Which category does the TWRP custom recovery fit into? And where can I download the TWRP recovery without using one of the tools (which apparently I was not supposed to use....ooops....).
     
  13. SulkyAndroid17

    SulkyAndroid17 Android Enthusiast
    Rank:
    None
    Points:
    68
    Posts:
    333
    Joined:
    Dec 17, 2012

    Dec 17, 2012
    333
    145
    68
    Male
    College Student
    Uhmerica
    I haven't used Odin in a long time. But if you do get TWRP installed, it will make a complete back up of your phone. In Funky's defense, it'll be easy when you figure out what's going on. You'll see. :)

    You might be able to find the instructions through this site. Here's the Galaxy S4 forum. Scroll down and choose your carrier. Then go to the the All Things Root Guide. There will be list of guides. Asking your questions there would probably get you better help at this point.

    If you don't want to back up the entire phone, Titanium Backup or Helium provides an alternative.
     
  14. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    Thanks, and glad to hear TWRP will do a complete backup!

    Ok, good news: I was able to get out of download mode (FINALLY, and much to my relief!). It took me hours to do, but I got it. I'm still not entirely sure how I did it. It seems like MAYBE it was plugging the phone into USB and then holding down ONLY the volume down button, but I can't be certain. Phone rebooted into normal mode and seems to be working. Thank goodness, but what a waste of an evening!

    Okay, now to try again, but first to confirm that the steps are right so I don't soft brick my phone (again) or hard brick it. I posted in the other forum, but in short, it looks like Goo Manager is the way to go, based on this:

    TeamWin Projects - TWRP 2.7 - Samsung Galaxy S4 (AT&T) | TeamWin

    Does that sound right? The only thing I can't figure out is that when I start to follow the steps on that page, the file Goo Manager says it's going to install is openrecover-twrp-2.6.3.1-jflteatt.img

    Why wouldn't it install the latest version, 2.7.0.1? And does it matter? Think it's safe to click ok to proceed this time?

    Thanks again for your help!
     
  15. SulkyAndroid17

    SulkyAndroid17 Android Enthusiast
    Rank:
    None
    Points:
    68
    Posts:
    333
    Joined:
    Dec 17, 2012

    Dec 17, 2012
    333
    145
    68
    Male
    College Student
    Uhmerica
  16. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    PS It was this site that gave me all the different things to try to get out of download mode. Even though those are all ways to get INTO download mode, one of them got me out of it (as I say I think it was: phone powered off, hold down volume minus, then connect to computer and when it starts up it asks if I want to install custom OS. Just say No and then it booted normally, but not certain if that was what did it).

    http://forum.xda-developers.com/showthread.php?t=1953930
     
  17. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    I found that too, but that doesn't show HOW to install it, does it? Even the link I quoted shows that 2.7.0.1 is the latest version. The only thing inconsistent is that the Goo Manager tool wants to install 2.6.3.1. Maybe that's the best version for my phone??
     
  18. SulkyAndroid17

    SulkyAndroid17 Android Enthusiast
    Rank:
    None
    Points:
    68
    Posts:
    333
    Joined:
    Dec 17, 2012

    Dec 17, 2012
    333
    145
    68
    Male
    College Student
    Uhmerica
    It does I think. I found that on the first post.
     
    gpup likes this.
  19. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    Ah, yes, it's right there! Well, no luck. When I tried that, it started downloading the 2.6.3.1 file. So I just went ahead and did it. It said "Recovery Flashed Successfully," but then when I tried to reboot into recovery mode I got that same "Downloading Do not turn of Target!" screen again. Fortunately, I knew how to get out of it this time! Strange, right?
     
  20. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    I just gave Goo Manager a try and same result. It showed recovery successfully installed, but when I restarted into recovery I was back on the Download Screen. I can now confirm how to get out of the download screen:

    1) Hold down power for a few seconds, or remove battery to power off the phone.
    1)a) Replace battery if you removed it
    2) Hold down the volume down button
    3) While holding down the volume down button, hold down the power button
    4) Once the phone vibrates to indicate it's starting up, release the power button, but keep holding down the volume down button.

    Now you're presented with the following message:
    "Warning!!

    A custom OS can cause critical problems in your phone and installed applications. Installing a custom OS on your device may cause it to shut down as a result. Please see manual for details.

    If you want to download a custom OS, press the volume up key. Otherwise, press the volume down key to cancel.

    Volume up: Continue
    Volume down: Cancel (restart phone)"

    Here's where I've been pressing volume down to restart. Is it worth trying to press volume up? I'm not trying to install a custom OS, just the TWRP custom recovery.
     
  21. SulkyAndroid17

    SulkyAndroid17 Android Enthusiast
    Rank:
    None
    Points:
    68
    Posts:
    333
    Joined:
    Dec 17, 2012

    Dec 17, 2012
    333
    145
    68
    Male
    College Student
    Uhmerica
    How are you booting into recovery?

    Pressing Volume Down + Power + Home is usually how it's done.
     
  22. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    I was just the option in Goo Manager/TWRP Manager that says "Reboot in Recovery." Interestingly, using the [volume down + home + power] method brings me straight to that warning screen about installing a custom OS. Should I "Continue" or "cancel?"

    FYI, I also tried using the TWRP Manager to create a backup from within the app and when I started the backup, the phone restarted (presumably to go into recovery mode to create the backup), but went straight to the download screen.
     
  23. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    Well, I figured out part of it: looks like recovery mode on the GS4 is actually volume UP + home + power. When I do that, it brings me back to the "Downloading...do not turn off target" screen. I think the volume down combo sends me to "download mode" which gives me that warning screen about the custom OS. Still doesn't answer the question about how to get into the TWRP recovery screen though. I wonder what happens if I Continue. But it also sounds risky!
     
  24. SulkyAndroid17

    SulkyAndroid17 Android Enthusiast
    Rank:
    None
    Points:
    68
    Posts:
    333
    Joined:
    Dec 17, 2012

    Dec 17, 2012
    333
    145
    68
    Male
    College Student
    Uhmerica
    Lol, well I guess I'd see where continue took me. You'd be flashing ROMs from within TWRP. Or Odin?
     
  25. gpup

    gpup Member
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    39
    Joined:
    Jul 8, 2013

    Jul 8, 2013
    39
    0
    15
    Not using Odin. Don't know what ROM it would be flashing. It doesn't say! Anyway to find out??
     

Share This Page

Loading...