Nexus 5 Forum

Support downloaded OTA file location?

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.
 

Related:

#1 hstroph, Sep 23, 2016
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.
 
#2 scary alien, Sep 26, 2016
Well, it's not there:
[email protected]:/ # 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:
[email protected]:/ # find / -type f -name update.zip 2>/dev/null
1|[email protected]:/ #

So I look for the 10 largest files on the device:
[email protected]:/ # 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.
 
#3 hstroph, Sep 26, 2016
Hmm, not sure...I have an active, pending OTA on my N5 and the OTA file ("update.zip") is in the /cache folder:

[email protected] ~
$ adb shell
[email protected]:/ $ su
[email protected]:/ # cd /cache
[email protected]:/cache # ls -al
-rwx------ system system 5576 2016-09-26 21:59 @[email protected]
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
[email protected]:/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?
 
#4 scary alien, Sep 26, 2016
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:

[email protected]:/cache # cd /sdcard
[email protected]:/sdcard # touch this-file-is-on-sdcard.txt
[email protected]:/sdcard # cd /
[email protected]:/ # 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
[email protected]:/ # ls -lR 2> /dev/null > /sdcard/lsoutput.txt
[email protected]:/ #

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:

[email protected] ~
$ 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​
 
#5 scary alien, Sep 26, 2016 Last edited: Sep 26, 2016
Yes, those were my thoughts initially, but a symlink in Unix/Linux is denoted by an "l" in the first permissions field, highlighted below:

[email protected]:/ # touch /cache/test
[email protected]:/ # ln -s /cache/test /cache/test.symlink
[email protected]:/ # 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:

[email protected]:/ # find / -type l 2>/dev/null
/sdcard
/storage/self/primary
/mnt/sdcard
/mnt/runtime/default/self/primary
/mnt/user/0/primary
...
 
#6 hstroph, Sep 28, 2016 Last edited: Sep 28, 2016
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.
 
#7 scary alien, Sep 28, 2016
Yup, once again a notification of an OTA update, yet:
[email protected]:/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
[email protected]:/ # find / -name update.zip 2>/dev/null
1|[email protected]:/ #
 
#8 hstroph, Jan 18, 2017
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?
 
#9 scary alien, Jan 18, 2017
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.
 
#10 hstroph, Jan 19, 2017