Mladen Nochev
Mladen Nochev

Reputation: 31

Android adb backup storage issue

I have problem with adb bakup on my android phone - it is Lenovo Vibe Shot Z90a40, Android version 5.1. I'm trying to backup Viber, but the problem happens for other packages and full backup too. The size of produced .ab file is always about 40 bytes.

I've created .bat script where executing logcat to see what happens in device:

@echo off
echo Connecting.
"%~dp0adb" version
"%~dp0adb" kill-server
"%~dp0adb" wait-for-device

"%~dp0adb" shell am force-stop com.viber.voip

echo Enter Backup My Data on Android phone screen.
"%~dp0adb" backup -f "%~dp0viber.ab" com.viber.voip

ping -n 10 127.0.0.1>nul 
"%~dp0adb" shell logcat -d > "%~dp0log.txt"
"%~dp0adb" kill-server

echo "press any key to exit." 
pause

I see in the log error message which tells that there is not enough free space:

I/BackupManagerService( 1136): --- Performing full-dataset adb backup ---

I/BackupManagerService( 1136): Initiating bind of OBB service on com.android.server.backup.BackupManagerService$FullBackupObbConnection@3bc92971

W/ContextImpl( 1136): Calling a method in the system process without a qualified user: android.app.ContextImpl.bindService:1809 com.android.server.backup.BackupManagerService$FullBackupObbConnection.establish:2998 com.android.server.backup.BackupManagerService$PerformAdbBackupTask.run:3620 java.lang.Thread.run:818 <bottom of call stack> 

E/Cryptfs (  304): not running with encryption, aborting

I/BackupManagerService( 1136): OBB service connection com.android.internal.backup.IObbBackupService$Stub$Proxy@22da70c4 connected on com.android.server.backup.BackupManagerService$FullBackupObbConnection@3bc92971

D/BackupManagerService( 1136): Binding to full backup agent : com.viber.voip

W/BackupManagerService( 1136): ensureAvailableSpace 

D/BackupStrogeUtils( 1136):  freeCacheStorage bytes=230686720

D/BackupStrogeUtils( 1136):  freeCacheStorage Start bytes:230686720

D/BackupStrogeUtils( 1136):  listFilesRecursive start uid=1000

D/BackupStrogeUtils( 1136):  listFilesRecursive file = /cache/recovery/last_log_r file.stat.st_uid=0

D/BackupStrogeUtils( 1136):  listFilesRecursive file = /cache/recovery/last_install file.stat.st_uid=0

D/BackupStrogeUtils( 1136):  listFilesRecursive file = /cache/recovery/last_locale file.stat.st_uid=0

D/BackupStrogeUtils( 1136):  freeCacheStorage Found 0 on cache

D/BackupStrogeUtils( 1136):  freeCacheStorage End 

D/BackupStrogeUtils( 1136): Not enough free space; 230686720 requested, 220848128 available

D/BackupManagerService( 1136): backupOnePackage ensureAvailableSpace failed : com.viber.voip

D/BackupManagerService( 1136): Full backup processing complete.

D/bu      (26755): Finished.

But I have a lot of free space on device. I executed df command:

@echo off
"%~dp0adb" kill-server
"%~dp0adb" shell df > df.txt
"%~dp0adb" kill-server
echo Done!
pause

And here is result:

* daemon not running. starting it now on port 5037 *
* daemon started successfully *
Filesystem               Size     Used     Free   Blksize

/dev                     1.4G    76.0K     1.4G   4096

/sys/fs/cgroup           1.4G    12.0K     1.4G   4096

/mnt/asec                1.4G     0.0K     1.4G   4096

/mnt/obb                 1.4G     0.0K     1.4G   4096

/system                  1.9G     1.7G   255.5M   4096

/data                   25.4G    12.3G    13.1G   4096

/preload               387.4M   127.5M   259.9M   4096

/cache                 248.0M   220.0K   247.7M   4096

/persist                27.5M   184.0K    27.3M   4096

/firmware               64.0M    51.1M    12.9M   16384

/mnt/shell/emulated     25.3G    12.3G    13.1G   4096

/storage/emulated/legacy    25.3G    12.3G    13.1G   4096

/storage/sdcard0        25.3G    12.3G    13.1G   4096

I have almost 13GB free on /data partition. The strange situation is that backup restore function works, I successfully transferred viber package from my old phone to this phone.

I found similar thread and made tests with both versions 1.0.31 and 1.0.32 of adb, but the result is the same. Does anyone has an idea what is wrong ? Any help is appreciated.

Thanks in advance

Upvotes: 3

Views: 1375

Answers (1)

Spikolynn
Spikolynn

Reputation: 4173

Backup started working for me after quoting the parameters for ADB as described in this SO thread.

e.g.:

adb backup "-apk -shared -all -f backup.ab"

I did use 1.0.31, but it might not have been the factor.

Upvotes: 2

Related Questions