• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

A Backup Routine for us all

I can't believe this thread doesn't get more action...

Anyway, I'm back again and I've upgraded my phone. I currently have a Verizon Samsung Galaxy S4 (SCH-i545) that's fully rooted, ROMed (GPE 4.4.4), custom kernel, custom recovery, but the bootloader is still locked.

Some questions:
  1. Because I'm rooted, a simple adb pull command can grab pretty much all the files on my phone (including stuff like system, data, internal sdcard and external sdcard) correct?
  2. Should I be putting my phone in recovery or download mode / bootloader mode? It seems that if the phone is on, the files that are being copied could be in use (especially the apps.)
  3. Do I need to mount anything to do a full pull?
  4. Do I need to enter some sort of "root mode" in adb before I do a pull?
  5. Will the tool in this thread grab what I need? I'm a bit concerned that it's out of date, or won't grab everything.
 
Upvote 0
This is not a nandroid backup.

It only grabs the internal user storage partition (example, storage/emulated or /sdcard) and the actual sd card content if one exists.

It does use adb pull.

When you turn on usb debugging, what you're really doing is having the system run adbd - the adb daemon - on your phone.

Without adbd running, adb has nothing to talk to.

Therefore, chances of this working from the bootloader or recovery are really slim.

Nandroid backups are great. You can even use them to back up the storage we do - better be to an OTG USB drive or something, not sure that you want to try backing storage up to itself.

Or use this script while your phone is running and you won't have the nandroid downtime while backing up huge stores of your media (for example).
 
Upvote 0
Btw - doing an adb pull of /system or /data is likely to be a bad idea.

If you want to create a pc-based nandroid backup, you really want to use tar through an adb shell pipe.

That will at least preserve ownership and permissions - but may not be stable enough for a restore. I don't have much advice to give further on that.

Or just use recovery, nandroid backup from there - your nandroid backups will come along in our backup.
 
Upvote 0
Well, I had actually started a manual pull of the microSD card using "adb pull /storage/extSdCard C:\pathonmycomputer" and it was running along just fine, but I decided to stop it and try out this utility in hopes of capturing the contents of the internal storage as well. I ran into an issue - I've followed the instructions and this is what I'm getting (below). Any ideas?

EDIT: I should note that I simply copied and pasted the unzipped contents of the Windows version to C:\adb and then ran the "backup-sd" batch file. I also checked out and made sure that folder and java were included in the system variable path string.

Untitled.jpg
 
  • Like
Reactions: scary alien
Upvote 0
Ok, it's attached. I should also note that I've been trying to pull the internal storage from different locations (/mnt/shell/emulated/0/ and /data/media/0/ and /storage/emulated/0/) without any success. It just keeps telling me "remote object 'folder_path' does not exist."

Anyway, the mounted.txt file is attached.
 

Attachments

  • mounted.txt
    2.6 KB · Views: 257
Upvote 0
Awesome, thanks! Also, one final side-note, I just booted into my custom recovery (PhilZ) which has a mount menu. I mounted "data" and then ran "adb pull /data/media/0/ C:\locationonmycomputer" and it actually is running.

I assume the problem before was that I didn't mount "/data" although I'm not actually sure how (or if) I could have done that while booted up. I'm also kinda confused why I was able to just pull the microSD without any mounting, but I had to mount "/data" to get at the internal storage.

EDIT: Ok... not sure what just happened, but it stopped prematurely. It ran for a bit and then gave me "cannot create 'C:\location-on-my-computer date-and-time : No such file or directory"
I'm very confused because it's just a picture file from Instagram that it stopped on, and there were a lot of other pictures from that folder that it pulled successfully. I also have plenty of room left in the folder on my computer....
 
Upvote 0
Ok, here's how it shakes out @scary alien -

scan for vfat in /mnt ->

icard = /mnt/media_rw/extSdCard

scan for fuse ->

ecard = /mnt/shell/emulated /storage/extSdCard

Therefore CARDS evaluates to:

/mnt/media_rw/extSdCard
/mnt/shell/emulated /storage/extSdCard

If I define CARDS to process ecard the same as icard, I get this on the CARDS eval -

/mnt/media_rw/extSdCard
/mnt/shell/emulated
/storage/extSdCard

Which left to run long enough, will drop through and find /storage/extSdCard that @kwest12 reported working in post #29.

Except - that's 3 sd cards - and that's going to hit the error trap that the system isn't evaluating properly.

I was at a loss that /mnt/media_rw/extSdCard exists as a vfat volume on /dev/block/vold/179:33 and doesn't respond to an adb pull - that's irrational.

I was at another loss as to what /mnt/shell/emulated is supposed to be accomplishing as a fuse system at all. I have that on my M8 now as well, so I drilled in and that's another umbrella for 0 and at the end of the day that's a softlink to /mnt/sdcard (internal).

And then I remembered that this is the Verizon Samsung Galaxy S4 (SCH-i545) - the famous 16 GB phone with 9 GB free for the user - unless it's the exact same system as found in Europe with only 7 GB free.

I exposed those shenanigans at launch.

http://androidforums.com/threads/ca...2-or-64-gig-phone.712741/page-11#post-5830162

Between this 32/64 thread, the Verizon misleading people on 16 GB thread and this new one on the 16 GB discussion - juicy or not - that's really about a thread extra for the subject in general.

I left a 3-day redirect on the title to survive the weekend as a compromise on the move/merge.

That's one heck of a story though!

But - in light of the terminal/df outputs shown earlier in this thread, it's no surprise.

Which - I continue to warn on this - the Euro model does not have 9.6 GB, it has 7.6 GB.

The Euro model's filesystems add to 16 GB. The US model's add to 18 GB.

There's something wrong there.

I'm not sure why no one wants to approach that here - but there's something wrong there.

And I think this is a big part of the problem here.

Bottom line - Samsung overloaded the mount points so that any normal probe would report 9.6 GB free - and if you look further, those probes say that a 16 GB phone is 18 GB - and that's not true.

I'll have to sleep on this one.

I'm sure that the eval can be sorted out - I'm just loathe to hard-code a single model exception.
 
Last edited:
Upvote 0
I'm going to test it more tomorrow, but I also think that adb pull crashed when it encountered a file with some spaces in the name. I did a suuuper quick Google search and found this:https://code.google.com/p/android/issues/detail?id=8185

I have a sneaking suspicion that issue has something to do with what's going on. I'll test this again tomorrow and see if I can replicate the crash.
 
Upvote 0
That's not what's going on with the backup's inability to resolve the targets though.

Surprised that's a problem with file names.

Yeah, I was referring to the separate issue of it erroring out and stopping the pull operation. I just re-confirmed that it stops upon encountering that file in the Instagram folder. I'm going to rename a few of the other files to see if I can isolate exactly what's causing the error.

EDIT: So, I went and found the trouble-file using ES File Explorer (I have granted it root permissions, obviously) and I attempted to copy it from the internal memory to my microSD. The file explorer refused to move it until I renamed it from “Aug 2, 2014 04:45:19 PM” to “Aug 2, 2014 04 45 19 PM.” Apparently the colons throw things off, and I’m betting that it’s also what’s throwing off the adb pull. I will try it and confirm.

EDIT 2: Verified. Removing the colons but leaving the spaces allows the file to be pulled correctly, so obviously it's the colons that are causing the problem; based on the toast-message I get from the file explorer when I try to re-save a filename with a colon, the following symbols will all result in the same error */\":?|<>
 
Last edited:
Upvote 0
The link in this page to "Windows version of the script" is broken, can you provide an updated location? It points here: http://androidforums.com/attachments/faqs/65051d1386124285-backup-routine-us-all-win-backup-sd.zip which says the requested page cannot be found.
Thanks.
Apologies, got broken when we changed forum software.

A second, correct, link is at the top of the second post, referred to as scary alien's attachment -

http://androidforums.com/threads/a-backup-routine-for-us-all.697582/#post-5619799

That link does work, please try it until we can fix the thread.

Recent changes on some devices has broken the script for some users. Apologies again, we are working on it.
 
  • Like
Reactions: scary alien
Upvote 0
@EarlyMon,

I've fixed the links / references to the win-backup-sd.zip file in the first two posts.

Not totally sure I know what you mean about removing the two card block--you mean the two card processing limit (i.e., go-ahead and (try to) process all cards that we identify?)?

(I don't think I've looked at your shell script version since we first developed these guys, so I'm a little behind the curve :p)

Thanks!
 
Upvote 0
So this isn't working for me at the moment (my phone is a Galaxy S3)

Code:
#
# ----------------------------------------------------------------------
# AndroidForums.com backup-sd.bat (version 03-December-2013)
#
#  Instructions:
#
#  1. make sure you have the proper adb USB drivers installed
#  2. make sure you have USB debugging enabled
#  3. make sure you device is connected to your computer via a USB cable
#  4. if applicable, ensure your SD card is mounted as 'Charge only'
#     instead of 'USB Mass Storage'
#
# ----------------------------------------------------------------------
#
# Please reboot your device, then press the [Enter] key to
# start the backup or [control-c] to quit:
#
Press any key to continue . . .
The process cannot access the file because it is being used by another process.
      2 [main] afutil 4620 find_fast_cwd: WARNING: Couldn't compute FAST_CWD poi
nter.  Please report this problem to
the public mailing list cygwin@cygwin.com
      2 [main] afutil 4544 find_fast_cwd: WARNING: Couldn't compute FAST_CWD poi
nter.  Please report this problem to
the public mailing list cygwin@cygwin.com
      2 [main] afutil 6076 find_fast_cwd: WARNING: Couldn't compute FAST_CWD poi
nter.  Please report this problem to
the public mailing list cygwin@cygwin.com
      2 [main] afutil 1348 find_fast_cwd: WARNING: Couldn't compute FAST_CWD poi
nter.  Please report this problem to
the public mailing list cygwin@cygwin.com
      2 [main] afutil 2556 find_fast_cwd: WARNING: Couldn't compute FAST_CWD poi
nter.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] afutil 2312 find_fast_cwd: WARNING: Couldn't compute FAST_CWD poi
nter.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] afutil 2136 find_fast_cwd: WARNING: Couldn't compute FAST_CWD poi
nter.  Please report this problem to
the public mailing list cygwin@cygwin.com
      1 [main] afutil 5640 find_fast_cwd: WARNING: Couldn't compute FAST_CWD poi
nter.  Please report this problem to
the public mailing list cygwin@cygwin.com
# here we go...
remote object '/mnt/media_rw/extSdCard' does not exist
The filename, directory name, or volume label syntax is incorrect.
# no secondary SD card found needing to be backed-up
#
# backup started:   Fri 03/06/2015  12:41
# backup completed: Fri 03/06/2015  12:41
#
# all done! [press [Enter] to exit the script]
 
Upvote 0
Oh wow, people are still posting on this thread. I was worried it was long dead.

Also, where are the instructions said to be at the end of this thread? I didn't see any on any of the posts, yet people keep referring to having followed the instructions...

My phone ran out of space and I plan to use Link2SD, which needs a second partition that I don't have. When I partitioned my SD card for my tablet, I screwed it up, so I want to get it right this time.

I used Titanium Backup to backup my Internal, but then realized it didn't backup my SD card. Found my way here and downloaded everything (e.g., UniversalADBDrivers, SDK-Tools.zip, Win-Backup-SD.zip). I put the extracted SDK-Tools folder onto my C:/ annnnnnnd now I have no clue what to do with any of this.

I'm usually quite computer literate, but this is entirely foreign to me. I'm such a n00b... Sorry. Can someone be a good Samaritan please?

Update: Opened command prompt, redirected to the folder where adb.exe was and I have a list of commands now. Thinking adb pull? Not sure how to use it...

Also, I think it's relevant that my phone doesn't connect with a drive letter, so I'm not sure what path to put into the script...
 
Last edited:
Upvote 0
Stupid question... Is this equivalent to copying and pasting the contents of my SD card to my computer? Because I can do that, so I think I answered my own question and the answer is no.

What should I take a screenshot of? The fact that my device has no "path"?
I was hoping to see the command window.

Most of the time (before a relatively recent Android change), this is the equivalent of copying and pasting both the internal and actual physical sd card - except the intent here is to help do both at once, with the backup folders named with a timestamp so you can a) automate this from other scripts, b) have a backup location discipline provided without having to constantly remember or rethink things.
 
  • Like
Reactions: hamstrman
Upvote 0
I was hoping to see the command window.

Most of the time (before a relatively recent Android change), this is the equivalent of copying and pasting both the internal and actual physical sd card - except the intent here is to help do both at once, with the backup folders named with a timestamp so you can a) automate this from other scripts, b) have a backup location discipline provided without having to constantly remember or rethink things.
Command Window.png
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones