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

Help downloaded OTA file location?

hstroph

Android Expert
My 16GB Nexus 5 has downloaded OTA updates, but my choice is to manually flash the Android factory images.

Where are the downloaded OTA updates kept in the filesystem please? I need to delete them in order to free up some space. I could search for them if I knew their naming conventions.

Thanks.
 
Hey @hstroph,

The update.zip file should be found in your /cache folder, although without a rooted browser, you'll not be able to view or remove it.

Well, it's not there:
root@hammerhead:/ # ls -lR /cache
/cache:
drwx------ system system 2016-04-18 10:12 backup
drwxrwx--- root root 2016-04-18 10:11 lost+found
drwxrwxrwx system cache 2016-09-15 12:47 recovery
/cache/backup:
drwx------ system system 2016-04-18 10:12 1
/cache/backup/1:
drwx------ system system 2016-04-18 10:12 _delta
drwx------ system system 2016-04-18 10:12 _full
/cache/backup/1/_delta:
/cache/backup/1/_full:
/cache/lost+found:
/cache/recovery:
-rw-r----- root root 50260 2016-09-15 11:46 last_log

As a matter of fact it's not anywhere:
root@hammerhead:/ # find / -type f -name update.zip 2>/dev/null
1|root@hammerhead:/ #

So I look for the 10 largest files on the device:
root@hammerhead:/ # ls -lR 2>/dev/null | sort -rn -k4 | uniq | head
-rw-rw-r-- media_rw media_rw 105514924 2016-06-16 12:22 VID_20160616_122215.mp4
-rw-rw---- root sdcard_rw 105514924 2016-06-16 12:22 VID_20160616_122215.mp4
-rw-rw---- root everybody 105514924 2016-06-16 12:22 VID_20160616_122215.mp4
-rw-r----- root everybody 105514924 2016-06-16 12:22 VID_20160616_122215.mp4
-rw------- root root 100663296 1970-07-16 17:00 su.img
-rw-r--r-- system u0_a29999 95109552 2016-09-21 15:00 base.odex
-rw-r--r-- system u0_a29999 85860784 2016-09-21 15:05 base.odex
-rw-r--r-- system u0_a29999 76992944 2016-09-17 12:24 base.odex
-rw-r--r-- system u0_a29999 64143792 2016-09-17 12:26 base.odex
-rw-r--r-- system system 62607646 2016-09-22 17:12 base.apk

... and it appears that several VID are same, but at different places on the filesystem with different group. Oh well, thanks, and I'll keep searching. There's not enough room left to update the apps.
 
Hmm, not sure...I have an active, pending OTA on my N5 and the OTA file ("update.zip") is in the /cache folder:

ScaryAlien@LV-426 ~
$ adb shell
shell@hammerhead:/ $ su
root@hammerhead:/ # cd /cache
root@hammerhead:/cache # ls -al
-rwx------ system system 5576 2016-09-26 21:59 @pm@.data
drwx------ system system 1970-01-04 01:33 backup
drwxrwx--- root root 1969-12-31 19:00 lost+found
drwxrwx--- system cache 2016-09-10 17:24 recovery
-rw------- u0_a10 u0_a10 14333179 2016-05-29 10:47 update.zip
root@hammerhead:/cache #​

upload_2016-9-26_22-1-26.png


Pay no mind to the fact that the download is from May--this is a test device and I haven't done any OTA installs (I'm also rooted as you can see and I'm not using FlashFire, etc...).

Do you have active OTA notifications or what makes you think you have a pending OTA?
 
Also, with regard to the multiples of those .mp4 files you're seeing, they're likely really just in one place and the symlinks are showing you different paths to the "SD card" and how to "see" that same file.

Here's an example to demonstrate this:

root@hammerhead:/cache # cd /sdcard
root@hammerhead:/sdcard # touch this-file-is-on-sdcard.txt
root@hammerhead:/sdcard # cd /
root@hammerhead:/ # ls -lR 2> /dev/null | grep this-file-is-on-sdcard.txt
-rw-rw-r-- media_rw media_rw 0 2016-09-26 22:16 this-file-is-on-sdcard.txt
-rw-rw---- root sdcard_rw 0 2016-09-26 22:16 this-file-is-on-sdcard.txt
-rw-r----- root everybody 0 2016-09-26 22:16 this-file-is-on-sdcard.txt
-rw-rw---- root everybody 0 2016-09-26 22:16 this-file-is-on-sdcard.txt
-rw-rw---- root sdcard_rw 0 2016-09-26 22:16 this-file-is-on-sdcard.txt
root@hammerhead:/ # ls -lR 2> /dev/null > /sdcard/lsoutput.txt
root@hammerhead:/ #

When I pulled-down the lsoutput.txt to my Linux shell, I could see/identify the folders each file was in:

./data/media/0:
-rw-rw-r-- media_rw media_rw 0 2016-09-26 22:16 this-file-is-on-sdcard.txt

./mnt/runtime/default/emulated/0:
-rw-rw---- root sdcard_rw 0 2016-09-26 22:16 this-file-is-on-sdcard.txt

./mnt/runtime/read/emulated/0:
-rw-r----- root everybody 0 2016-09-26 22:16 this-file-is-on-sdcard.txt

./mnt/runtime/write/emulated/0:
-rw-rw---- root everybody 0 2016-09-26 22:16 this-file-is-on-sdcard.txt

./storage/emulated/0:
-rw-rw---- root sdcard_rw 0 2016-09-26 22:16 this-file-is-on-sdcard.txt​

Same file, different paths to that same file.

Hope that helps!

:)

edit: and one more, using the "/sdcard" link:

ScaryAlien@LV-426 ~
$ adb shell ls -al /sdcard/this-file-is-on-sdcard.txt
-rw-rw---- root sdcard_rw 0 2016-09-26 22:16 this-file-is-on-sdcard.txt​
 
Last edited:
Also, with regard to the multiples of those .mp4 files you're seeing, they're likely really just in one place and the symlinks are showing you different paths to the "SD card" and how to "see" that same file.

Yes, those were my thoughts initially, but a symlink in Unix/Linux is denoted by an "l" in the first permissions field, highlighted below:

root@hammerhead:/ # touch /cache/test
root@hammerhead:/ # ln -s /cache/test /cache/test.symlink
root@hammerhead:/ # ls -l /cache/test*
-rw------- root root 0 2016-09-28 09:25 test
lrwxrwxrwx root root 2016-09-28 09:26 test.symlink -> /cache/test

But the parent directories seem to be the clue:

root@hammerhead:/ # find / -type l 2>/dev/null
/sdcard
/storage/self/primary
/mnt/sdcard
/mnt/runtime/default/self/primary
/mnt/user/0/primary
...
 
Last edited:
Yeah, I was using "symlinks" a bit loosely here...I don't know all of the mechanics (init.rc magic) of how Android is doing this, but it's clearly related to supporting multiple user spaces on the "SD card" the "fuse" emulation of the "SD card".

I'm not at my dev machine to hook-up my N5 to dig deeper, but since Google add the multi-user support (4.x?) we've seen this "mirrored" folders that present the same files and folders from different perspectives--most of which you can't see unless you have a root access to the file structure.

I'm sure if you do a similar test like I did above, you'll see what I did...or, if you change an attribute (chmod for example) of one of your .mp4 files in question above, you'll see that attribute changed across the different views.
 
Hmm, not sure...I have an active, pending OTA on my N5 and the OTA file ("update.zip") is in the /cache folder:

ScaryAlien@LV-426 ~
$ adb shell
shell@hammerhead:/ $ su
root@hammerhead:/ # cd /cache
root@hammerhead:/cache # ls -al
-rwx------ system system 5576 2016-09-26 21:59 @pm@.data
drwx------ system system 1970-01-04 01:33 backup
drwxrwx--- root root 1969-12-31 19:00 lost+found
drwxrwx--- system cache 2016-09-10 17:24 recovery
-rw------- u0_a10 u0_a10 14333179 2016-05-29 10:47 update.zip
...​

Pay no mind to the fact that the download is from May--this is a test device and I haven't done any OTA installs (I'm also rooted as you can see and I'm not using FlashFire, etc...).

Do you have active OTA notifications or what makes you think you have a pending OTA?

Yup, once again a notification of an OTA update, yet:
root@hammerhead:/cache # ls -al
drwx------ system system 2016-04-18 10:12 backup
drwxrwx--- root root 2016-04-18 10:11 lost+found
drwxrwx--- system cache 2016-10-11 14:28 recovery
root@hammerhead:/ # find / -name update.zip 2>/dev/null
1|root@hammerhead:/ #
 
Does it say you have a download available? I.e., perhaps it's not yet downloaded it...?

Can you post a screenshot of the notification and/or the update screen?
 
Does it say you have a download available? I.e., perhaps it's not yet downloaded it...?

Can you post a screenshot of the notification and/or the update screen?

Ah, perhaps that the reason, thank you. The notification, if I recall correctly, led me to believe that it was simply waiting to install, not download. At any rate, having once installed an OTA a couple of years ago that wiped the phone and made life difficult for some time, I now manually flash a factory image whenever such an OTA notification appears, after modifying the "flash-all.sh" script to remove the "-w" (wipe) option to fastboot. It's terrible that the wipe option is the default.
 
Back
Top Bottom