Question How to get full backup of sdcard? - Google Pixel 5a

Previously I could just plug my phone into my computer and run "adb pull -a /sdcard ." (Android 8) But that command doesn't work anymore now that I have a Pixel 5a with Android 11, it's filled with errors, such as:
Code:
adb: error: failed to copy '/sdcard/Android/data/com.alltrails.alltrails/files/tiles/tile_cache.db-wal' to './sdcard/Android/data/com.alltrails.alltrails/files/tiles/tile_cache.db-wal': remote open failed: Permission denied
This is some random app file, and I'm sure there are others too with weird permissions which cause adb to quit as soon as it has the error.
I've read that I could use a command like this:
Code:
adb exec-out "tar -ch sdcard | gzip" > sdcard_backup.tar.gz
but this just produces a corrupted archive because "tar" can't read all of the files either and so the error messages get inserted into the archive.
Any other ideas to simply get a full backup of /sdcard? Thanks

scarlion said:
Previously I could just plug my phone into my computer and run "adb pull -a /sdcard ." (Android 8) But that command doesn't work anymore now that I have a Pixel 5a with Android 11, it's filled with errors, such as:
Code:
adb: error: failed to copy '/sdcard/Android/data/com.alltrails.alltrails/files/tiles/tile_cache.db-wal' to './sdcard/Android/data/com.alltrails.alltrails/files/tiles/tile_cache.db-wal': remote open failed: Permission denied
This is some random app file, and I'm sure there are others too with weird permissions which cause adb to quit as soon as it has the error.
I've read that I could use a command like this:
Code:
adb exec-out "tar -ch sdcard | gzip" > sdcard_backup.tar.gz
but this just produces a corrupted archive because "tar" can't read all of the files either and so the error messages get inserted into the archive.
Any other ideas to simply get a full backup of /sdcard? Thanks
Click to expand...
Click to collapse
I'm guessing that you're not rooted. That means that you probably won't be able to access most (if not all) of Android/data due to scoped storage restrictions.
If you change the tar command to
tar -chzf sdcard_backup.tar.gz sdcard
you should at least split out the errors from the data. The z option tells tar to compress the output using gzip. No need to explicitly pipe it through an external gzip program. f tells it that the next string is the output file name.
For the full tar manual see
GNU tar 1.34
GNU tar 1.34
www.gnu.org
A good file explorer should be able to get access to the restricted directories so you could use that to copy the data from there. I'm not sure about restoring in this case though since permissions may not be properly preserved.
If you are rooted then you can use tar to grab everything. There are options to preserve permissions but I would use the /data/media/0 path for that (path may not be correct. I'm going by memory since I'm not currently rooted and can't see the necessary directory structures).
I'll follow up here eventually once I do root, hopefully in a few days.

Related

[Q] Extract contents of sdcard via ADB

I'm sure this has been asked before however, no amount of searching has led me to a solution.
I was messing around earlier with the android.policy.odex & android.policy.jar files on my phone. I made a backup of these files to my phones sdcard however I failed to back them up to my PC as I was "sure" my changes would work.
1. Need to pull the contents of the backup folder from my sdcard. A few hours later I can't remember the name of the folder...yes..apparently I am this dumb.
I had thought that I would be able to do something like this...however that results in a opendir failed, permission denied
Code:
adb shell
mount /sdcard
ls /sdcard
2. Push the original files to system/framework. Assuming i can grab the original fiels i'm good from this point on...
gah...silly me.
you don't need to mount adb shell in order to pull files. Just use adb pull.

[How To] Remove WebTopMod without root! [How To]

Since I was looking to be able to update my phone, I had to remove the WebtopMod. Since the previous instructions required me to root my phone to remove it, which was counterproductive because it would mean loosing the ability to update anyway. I looked through the WebtopMod installation scripts and came up with this guide to remove it:
View attachment WebtopModRemoveGuideNoRoot.txt
Note: I've attached the guide in a separate file, because the forum is stupid and thinks that exe, bak, odex, apk, and dex are valid TLD's and says I can't post external links. If I ever get "approximately eight" posts I'll put it in this post.
If you don't have the original backup files, look in page 3 of the howto post for removing it with root. (Thanks, MotoAtrixFan for posting it and twoeleven99 for alerting me to this)
Happy Updating!
eliplan312 said:
Since I was looking to be able to update my phone, I had to remove the WebtopMod. Since the previous instructions required me to root my phone to remove it, which was counterproductive because it would mean loosing the ability to update anyway. I looked through the WebtopMod installation scripts and came up with this guide to remove it:
View attachment 556542
Note: I've attached the guide in a separate file, because the forum is stupid and thinks that exe, bak, odex, apk, and dex are valid TLD's and says I can't post external links. If I ever get "approximately eight" posts I'll put it in this post.
If you don't have the original backup files, look in page 3 of the howto post for removing it with root. (Thanks, MotoAtrixFan for posting it and twoeleven99 for alerting me to this)
Happy Updating!
Click to expand...
Click to collapse
you can update even if you are rooted you cant update only when you modify the /system or some apps
went step by step through your guide and I still cannot update - the apply_patch_check still fails at DockProvider.apk - aside from reflashing the stock SBF, what do you recommend?
Try this
Try setting the phone to usb mass storage mode and replacing the files in the WebtopModBackup folder on the sd/media area with these: View attachment WebtopModBackup.zip
The files in the archive worked for me, not sure why it wouldn't work. If those don't work for you, please post the console log.
eliplan312 said:
Try setting the phone to usb mass storage mode and replacing the files in the WebtopModBackup folder on the sd/media area with these: View attachment 556596
The files in the archive worked for me, not sure why it wouldn't work. If those don't work for you, please post the console log.
Click to expand...
Click to collapse
Thanks, but something appears to be totally screwed up on my DockProvider and DockService applications on Titanium Backup - they are listed at the bottom with grey slashes through them. The crazy part is.... it works with the webtop hack, but the update doesn't see the correct files, so something is obviously messed up.
Now, by putting the files from the WebtopModBackup on the phone, shouldn't that fix the issue? Then perform the steps in your text doc? I can't believe I'll have to SBF stock in order to fix the stupid DockProvider and DockService!!
What I meant was, replace the files in the WebtopModBackup folder with the stuff in the archive, then re-do the instruction in the text file.
I'm sorry but your instructions aren't working for me. I've followed your instructions very carefully but when I get to the command
cd /mnt/sdcard/WebtopModBackup
I get a directory not found error.
I can change to /mnt/sdcard but when I type 'ls' nothing appears. The directory is empty.
What am I doing wrong?
One thing I've noticed is that when I enter the 'adb.exe shell ./data/local/tmp/psneuter' command, the phone appears to dismount and remount and then when I go into the shell the '/mnt/sdcard' directory is empty.
Yeah I'm also having that problem....I'm trying to push the backup files into the correct folder. However, when I get a read-only error, so from what I read I'm supposed to reboot into recovery mode. When I try to do this the recovery console says e: can't open/cache/recovery/command and I can't connect to my phone. Any help?
To start I want to say Thank you to the OP for posting this. But there are a few errors, so I hope I can help.
To anyone having issues with this, there are a few things that you must have to make this work.
Note this only works for AT&T Atrix as I do not have a Bell Atrix
#1; THE 1st PART DOES NOT WORK if you performed the update. You should be rooted. You can check to see if you updated by pressing menu --> settings --> about phone and your Build version says something like OLYFR_U4_1.5.7 it will not work, you need to skip down to my next post of my coding since you should already be rooted. The 1st part of this uses the method that made rooting possible, since that was removed with the update, it no longer applies. So if you are updated, you should already be rooted and can skip a few steps
#2; You must have a folder called WebTopModBackup with the .bak files in it on the internal memory (not your memory card but the fake internal one). Open the app called Files, select Internal phone storage, select the WebTopModBackup folder and make sure you see the following files, if not you need to get them
Code:
DockProvider.apk.bak
DockProvider.odex.bak
DockService.apk.bak
DockService.odex.bak
PortalApp.apk.bak
PortalApp.odex.bak
#3; Do not mount your sdcard. When you plug in your USB cable to the compter, pull down the drop menu, select the USB connection and make sure None is selected; then press ok. If one of the other options are selected, select None press ok and wait for 30 seconds for the internal and external cards to mount. @Phazoni more than likely this is your issue
#4; USB debugging must be turned on. Press menu --> settings --> applications --> development --> and check USB debugging if not checked
#5; Make sure you have at least 50% battery, just in case
#6; During the steps you mount (make it editable) the /system folder where the files are, if you get a read-only error you did not do step
mount -o rw,remount /dev/block/mmcblk0p12 /system
correctly or your phone is somehow not rooted.
Click to expand...
Click to collapse
Ok now let's look at the code in the OP
Code:
adb.exe push psneuter /data/local/tmp
adb.exe shell chmod 755 /data/local/tmp/psneuter
adb.exe shell ./data/local/tmp/psneuter
adb.exe shell
adb.exe push is the command to copy a file to your phone; so we are making a copy of psneuter and putting it on the phone.
adb.exe shell chmod 755 this gives premission to the phone to use the psneuter file
adb.exe shell ./ this makes the psneuter file run and creates a fake root
adb.exe shell this should really be typed as adb shell but whatever. This takes you into the phone's system to edit the files. While in adb, the line should start with a # if it is a $ then psneuter did not work. Just to try, type su and see if the $ changes to a # if it does continue
Code:
cd /mnt/sdcard/WebtopModBackup
This command takes you to the location of your backup, remeber step 2 & 3, if this folder is empty and you cannot get to it, you have an issue there
Code:
mv DockProvider.apk.bak DockProvider.apk
mv DockProvider.odex.bak DockProvider.odex
mv DockService.apk.bak DockService.apk
mv DockService.odex.bak DockService.odex
mv PortalApp.apk.bak PortalApp.apk
mv PortalApp.odex.bak PortalApp.odex
Personally this is not the best way to do this (rename the files by making copies and then making more copies), but not my code. The mv command moves a file. In this case you are only using it to rename the files removing the .bak from the end. See my code at the bottom
Code:
mount -o rw,remount /dev/block/mmcblk0p12 /system
This mounts the /system folder so you can edit the system files
Code:
cp DockProvider.apk /system/app/
cp DockProvider.odex /system/app/
cp DockService.apk /system/app/
cp DockService.odex /system/app/
cp PortalApp.apk /system/app/
cp PortalApp.odex /system/app/
This code copies the files into the original locations as the correct name. This assumes you are still in the folder where the backups are. If this fails, the /system folder is not mounted, the files are missing or you are in a different folder. This is also missing the chmod /system/app/* coding. I will cover that below
Code:
rm /data/dalvik-cache/[email protected]*.dex
rm /data/dalvik-cache/[email protected]*.dex
rm /data/dalvik-cache/[email protected]*.odex
rm /data/dalvik-cache/[email protected]*.odex
rm is the command to remove/delete a file, running these 4 commands will remove the system cache and will most likely cause your phone to reboot before the next step; that is ok.
Code:
reboot now
This reboots the phone and removes the temp root.
Click to expand...
Click to collapse
See my next post for my coding
AGAIN
Note this only works for AT&T Atrix as I do not have a Bell Atrix
#1; THE 1st PART DOES NOT WORK if you performed the update. You should be rooted. You can check to see if you updated by pressing menu --> settings --> about phone and your Build version says something like OLYFR_U4_1.5.7 it will not work, you need to skip down to my next post of my coding since you should already be rooted. The 1st part of this uses the method that made rooting possible, since that was removed with the update, it no longer applies. So if you are updated, you should already be rooted and can skip a few steps
#2; You must have a folder called WebTopModBackup with the .bak files in it on the internal memory (not your memory card but the fake internal one). Open the app called Files, select Internal phone storage, select the WebTopModBackup folder and make sure you see the following files, if not you need to get them
Code:
DockProvider.apk.bak
DockProvider.odex.bak
DockService.apk.bak
DockService.odex.bak
PortalApp.apk.bak
PortalApp.odex.bak
#3; Do not mount your sdcard. When you plug in your USB cable to the compter, pull down the drop menu, select the USB connection and make sure None is selected; then press ok. If one of the other options are selected, select None press ok and wait for 30 seconds for the internal and external cards to mount. @Phazoni more than likely this is your issue
#4; USB debugging must be turned on. Press menu --> settings --> applications --> development --> and check USB debugging if not checked
#5; Make sure you have at least 50% battery, just in case
#6; During the steps you mount (make it editable) the /system folder where the files are, if you get a read-only error you did not do step
mount -o rw,remount /dev/block/mmcblk0p12 /system
correctly or your phone is somehow not rooted.
Click to expand...
Click to collapse
NOW for my recommended coding
After you follow my 6 steps above do the following
#1. on your compter press start --> run --> Type cmd this will open the command prompt for windows. Then navigate to the folder where the original WebTopMod files are located.
#2a. If are rooted jump down to step 4
#2. If you are not rooted and have not updated your phone type the following letter for letter
Code:
adb push psneuter /data/local/tmp
adb shell
You will now be in the ADB shell.
#3. You should see a $ so type the following
Code:
chmod 755 /data/local/tmp/psneuter
./data/local/tmp/psneuter
#4 This will kick you out of ADB, wait for it and when it does count to 30 for adb to reset. Now type the following:
Code:
adb shell
#5. You should see the # sign, if you see $ type su to change it since you should be rooted either by rooting the phone or using steps 1-3 above for pre-update.
Code:
mount -o rw,remount /dev/block/mmcblk0p12 /system
cp /mnt/sdcard/WebtopModBackupDockProvider.apk.bak /system/app/DockProvider.apk
cp /mnt/sdcard/WebtopModBackupDockProvider.odex.bak /system/app/DockProvider.odex
cp /mnt/sdcard/WebtopModBackupDockService.apk.bak /system/app/DockService.apk
cp /mnt/sdcard/WebtopModBackupDockService.odex.bak /system/app/DockService.odex
cp /mnt/sdcard/WebtopModBackupPortalApp.apk.bak /system/app/PortalApp.apk
cp /mnt/sdcard/WebtopModBackupPortalApp.odex.bak /system/app/PortalApp.odex
chmod 644 /system/app/*
rm /data/dalvik-cache/[email protected]*.dex
rm /data/dalvik-cache/[email protected]*.dex
rm /data/dalvik-cache/[email protected]*.odex
rm /data/dalvik-cache/[email protected]*.odex
reboot now
This
1. mounts the /system folder so you can replace the files then
2. renames nd copies the back-up files to the original locations in one step
3. Then the chmod 644 command sets the correct premissions for the files so they work,
4. clears the cache and
5. reboots the phone.
Click to expand...
Click to collapse
I hope this helps anyone stuck

ADB Shell not working, but my N1 isn't bricked

I wanted to use USB Tunnel to share my PC's internet connection with the phone, but I got the error:
Code:
- exec '/system/bin/sh' failed: No such file or directory (2) -
I tried to install other APK's through ADB and they also failed, so I googled this error and I saw that the main issue is a failing ADB Shell. I tried to open Shell and I got the same error. The difference between me and the other users is that my phone is booting as usual, USB Mass Storage works, the phone is detected by fastboot- and adb devices commands and everything is working as intended, except for installing APKs through ADB/opening Shell.
Here is my phone's current config:
MeDroidMod 1.4.4 w/ HWA
Latest Tiamat kernel
TexasICE HBOOT w/ 210/8/218 partition layout
4GB microSD card...I don't know the filesystem but it's definitely NOT ext4, so there's not A2SD for me (I think it's FAT or FAT32)
ClockWorkMod Recovery
gnexus47 said:
I wanted to use USB Tunnel to share my PC's internet connection with the phone, but I got the error:
Code:
- exec '/system/bin/sh' failed: No such file or directory (2) -
I tried to install other APK's through ADB and they also failed, so I googled this error and I saw that the main issue is a failing ADB Shell. I tried to open Shell and I got the same error. The difference between me and the other users is that my phone is booting as usual, USB Mass Storage works, the phone is detected by fastboot- and adb devices commands and everything is working as intended, except for installing APKs through ADB/opening Shell.
Here is my phone's current config:
MeDroidMod 1.4.4 w/ HWA
Latest Tiamat kernel
TexasICE HBOOT w/ 210/8/218 partition layout
4GB microSD card...I don't know the filesystem but it's definitely NOT ext4, so there's not A2SD for me (I think it's FAT or FAT32)
ClockWorkMod Recovery
Click to expand...
Click to collapse
Which adb commands did you use? Can you list the commands here that you had used? It could be that you didn't issue su command to get superuser rights?
you don't need to be in Shell to push apk
put the apk on your C: drive
open command window and navigate to the folder you have adb/fastboot in--normally tools of your sdk
then:
type adb devices--then
1. adb remount
2. adb push C:/CalendarGoogle.apk /system/app/CalendarGoogle.apk
3. adb push C:/CalendarProvider.apk /system/app/CalendarProvider.apk
4. adb shell
7. chmod 777 system/app/CalendarGoogle.apk
11. chmod 777 system/app/CalendarProvider.apk
12. exit
13. Reboot
use the apk name of whatever you are flashing in place of mine and your chmod may not be exactly like mine--
ADB Shell
rugmankc said:
you don't need to be in Shell to push apk
put the apk on your C: drive
open command window and navigate to the folder you have adb/fastboot in--normally tools of your sdk
then:
type adb devices--then
1. adb remount
2. adb push C:/CalendarGoogle.apk /system/app/CalendarGoogle.apk
3. adb push C:/CalendarProvider.apk /system/app/CalendarProvider.apk
4. adb shell
7. chmod 777 system/app/CalendarGoogle.apk
11. chmod 777 system/app/CalendarProvider.apk
12. exit
13. Reboot
use the apk name of whatever you are flashing in place of mine and your chmod may not be exactly like mine--
Click to expand...
Click to collapse
I don't use ADB Shell to push APK's. That's just another thing which doesn't work.
@taodan: I only use: adb install xxxxx.apk.
A work around is to mount the sdcard and drag and drop the apks to the sdcard. Then install using your favorite file manager.
evilkorn said:
A work around is to mount the sdcard and drag and drop the apks to the sdcard. Then install using your favorite file manager.
Click to expand...
Click to collapse
that will work too, i've used root explorer to copy paste from sdcard to correct file location. prefer adb. set your permissions after
did you try adb remount first, not sure if that would help
what i was saying is you don't need to type adb shell. assuming you are doing this from a pc command terminal window.
you can use the commands I gave above to push apk. i think when you push it copies apk to phone leaving apk on pc also. install actually moves it to phone--as i understand it
here is some links and info that might help.*
http://www.talkandroid.com/guides/beginner/install-apk-files-on-android/#.T2-cdaJST3U
http://www.brighthub.com/mobile/google-android/articles/37151.aspx
also, have you ever had luck installing/pushing apk's. you may not have the correct environmental path on pc or are typing incorrect path in your command line
you can google environmental path editing for android and get examples of how to do it--i am not even sure mine is set right since I still have to type the full path in command window to use adb
sorry if this is old news just trying to find your problem

Pushing certificate to root so no lock is requested.

I need to push a certificate my university requires to connect to it's wi-fi in a way that it would be considered a system one so I won't need to set a security lock (something android requires for login storage).
I've done it before on my LG O2X but it was running ICS and in JB the method I used doesn't work (at one point I managed to wipe ALL certificates ). It used to be as simple as installing it, copying a folder, wiping storage login data and then pasting that folder back and rebooting. Now I've found at least 4 possible locations in which the certificate file can be stored .
So, anyone have an idea how to do it? And also which exact files should I copy (so I can create a zip to automate the process).
xswistaqx said:
I need to push a certificate my university requires to connect to it's wi-fi in a way that it would be considered a system one so I won't need to set a security lock (something android requires for login storage).
I've done it before on my LG O2X but it was running ICS and in JB the method I used doesn't work (at one point I managed to wipe ALL certificates ). It used to be as simple as installing it, copying a folder, wiping storage login data and then pasting that folder back and rebooting. Now I've found at least 4 possible locations in which the certificate file can be stored .
So, anyone have an idea how to do it? And also which exact files should I copy (so I can create a zip to automate the process).
Click to expand...
Click to collapse
I just figured this out yesterday with my 4.3 JB android phone. I have my own root CA that I use to secure my personal server that I wish to access from my phone, and some of the apps I use require a trusted (shows up green in your browser) SSL cert. Being a cheap b*@$ard, I decided to make my own instead of buying one - also, I can be fairly sure the FBI / NSA haven't messed with my own.
Anyway, here's what I did:
You need first to create the file in the format that android wants. In my case, the certificate file is simply named "ca.crt," so I'll use that in my examples. You'll need openssl installed on whatever computer you're using for this.
First, we need to create the file that's formatted right for the phone:
Code:
$ cp ca.crt ca_phone.crt
$ openssl x509 -in ca.crt -text -fingerprint -noout >> ca_phone.crt
This gives you a file that looks kind of like this:
Code:
-----BEGIN CERTIFICATE-----
(bunch of gobbledegook)
-----END CERTIFICATE-----
(bunch of info about your certificate)
SHA1 Fingerprint=(SHA1 fingerprint of your cert)
Now, the hard part. If you take a look at your phone, under /system/etc/security/cacerts, you will see there are a bunch of files in there that have weird-looking names like 216caf34.0 and such - basically an 8 byte hex name with a .0 extension. Each one of those is a factory-installed trusted certificate! In order for them to be recognized by your phone, they have to be:
1. located in /system/etc/security/cacerts
2. have the proper permissions
3. have the proper file name
I'll show you how to do all that, assuming you have a rooted phone and adb working.
First, the name has to be a "hash" of the certificate contents itself. I found this out from reading this page: http://blog.kylemanna.com/android/2013/06/02/android-ca-certificates/
The article is slightly wrong, though, because at least in the openssl install I have, there is no option called -subject_hash_old:
Code:
$ openssl x509 -in ca.crt -subject_hash -noout
(8 hexidecimal characters, i/e: deadbeef)
The (8 hexidecimal characters) that command spits out is to be your file name. Yours should be unique. For my example, I'll use deadbeef.
Code:
$ mv ca_phone.crt deadbeef.0
Now, lets look in your phone to make sure there isn't already a deadbeef.0 in /system/etc/security/cacerts. There shouldn't be, but if there is, we can do something about it.
Code:
## First, make sure you're running adb as root:
$ adb root
## Next, remount /system as read-write:
$ adb remount
## Now, go in:
$ adb shell
## You're now in your phone's file system. Check to see
## if there's already a cert there with your filename:
~> ls -la /system/etc/security/cacerts/dead*
If there is, you'll have to rename your file to deadbeef.1 .. the extension is there for the unlikely event that 2 different certs have the same subject_hash. Increment the extension until you have a file that doesn't exist in the phone's folder.
Now, get out of adb shell:
Code:
~> exit
Now that you're back in your certificate folder, you can push your cert to the phone:
Code:
$ adb push deadbeef.0 /system/etc/security/cacerts/deadbeef.0
## Now, lastly, we need to go back into the phone and make
## sure the permissions are right on that file:
## First, go into your phone:
$ adb shell
Now fix the perms:
~> chmod 644 /system/etc/security/cacerts/deadbeef.0
## Note that the file should also be owned by root and root. If it's not, do this:
~> chown root:root /system/etc/security/cacerts/deadbeef.0
And now you should be done. All that's left is to disconnect the USB cable and reboot your phone. Now your cert should be installed and recognized without having to lock your screen.
Hopefully I've given you enough information that you can create a flashable ZIP file with your cert in the right place so you can just flash that after flashing a new ROM and have everything work great.
Good luck!

Help flashing stock rom to Pixel 4 XL with Pixelbook?

Hello folks!
Its been a while since i posted here - i havent been flashing roms for an age (kids etc got in the way!)
Anyway, i've picked up a Pixel 4 XL, and it was running a custom ROM, i'm trying to move back to stock and have been able to follow all the guides i've found up to using the 'fastboot flashall' in shell.
The command works and delivers the
Bootloader Version...:
Baseband Version.....:
Serial Number........:
values, but then errors out with the following error "fastboot: error: ANDROID_PRODUCT_OUT not set"
I'm stumped what that means and how to fix. I'm doing all of this on my Pixelbook, and have updated fastboot and adb as per the initial steps for flashing.
Can anyone shed any light on what i still need to do to get flashall to work as expected?
Thanks in advance if you are able to help out!
ptm
Welcome Back
Could you post the exact command you are using for fastboot flash please? It sounds like fastboot is not finding the files to flash. Usually, depending on the configuration of the fastboot install, it's easier to place the firmware in the same directory as the fastboot binary.
Thanks! It turns out i've missed this place!
So the firmware files are all on the chromebook and I've used 'shell' to navigate to where I've unzipped. Here's the command line with the command i'm using: "[email protected] ~/Downloads/ota_file $ fastboot flashall"
Before trying a full flash, i was trying to sideload the OTA as per instructions here https://developers.google.com/android/ota#instructions but moving the file from my pixelbook to the 4XL fails at 47% every time.
So i reverted to a full flash as per these instructions - https://developers.google.com/android/images and that is where i'm coming a cropper with the 'not set' error.
Thanks for your help!
ktmom said:
Welcome Back
Could you post the exact command you are using for fastboot flash please? It sounds like fastboot is not finding the files to flash. Usually, depending on the configuration of the fastboot install, it's easier to place the firmware in the same directory as the fastboot binary.
Click to expand...
Click to collapse
I thinnk you may be merging several approaches.
You are using the full factory image downloaded from the https://developers.google.com/android/images page, right? Then, once downloaded, you are unzipping the file and cd into the new directory (from the unzip). The command then should be
Code:
./flash-all.sh
As far as the OTA install is concerned, you are using the command
Code:
adb sideload "ota_file.zip"
, and at 47%, what happens that it appears to fail? My memory on my P3XL is at that point it takes awhile.
If you are using a C to C switch to an A to C cable and try it. You'll want to remove the wipe from the flash-all before you flash the full image and it's the flash all you should be using to flash.
Yeah i think you're right - so now just concentrating on the Full Flash method shown on the Google Developers page, and yes doing it exactly as you'd described.
Ok - using
Code:
./flash-all.sh
now returns the error
Code:
bash: ./flash-all.sh: Permission denied
I have tried to prefix './flash-all.sh' with 'Fastboot' but no dice here either. Is that required at all?
ktmom said:
I thinnk you may be merging several approaches.
You are using the full factory image downloaded from the https://developers.google.com/android/images page, right? Then, once downloaded, you are unzipping the file and cd into the new directory (from the unzip). The command then should be
Code:
./flash-all.sh
As far as the OTA install is concerned, you are using the command
Code:
adb sideload "ota_file.zip"
, and at 47%, what happens that it appears to fail? My memory on my P3XL is at that point it takes awhile.
Click to expand...
Click to collapse
ptm said:
Yeah i think you're right - so now just concentrating on the Full Flash method shown on the Google Developers page, and yes doing it exactly as you'd described.
Ok - using
Code:
./flash-all.sh
now returns the error
Code:
bash: ./flash-all.sh: Permission denied
I have tried to prefix './flash-all.sh' with 'Fastboot' but no dice here either. Is that required at all?
Click to expand...
Click to collapse
You need to give the "flash-all.sh" script execution rights (that is why the permission denied error). Use this code:
Code:
chmod +x ./flash-all.sh
You may need super user/root rights:
Code:
sudo chmod +x ./flash-all.sh
The "flash-all.sh" script is a stand-alone script that sequentially flashes the entire factory package. As was mentioned in another repsonse in this thread, in cases where you want to update, but not lose your installed user apps and data, you would edit the script and remove the "-w" augment. In this case, you are returning to stock and you should perform the wipe (-w).
The dot slash (./) that preceeds the flash-all.sh tells the bash interpreter (what runs commands you give) that the file is right here, in this directory.
The flash-all.sh is a standalone script (series of written instructions) and calls fastboot from within it.
Thanks for sticking with me on this ktmom!
OK, i've used both
Code:
chmod +x ./flash-all.sh
and
Code:
sudo chmod +x ./flash-all.sh
but still getting the permission denied error when i launch ./flash-all.sh
I'll do a screencast vid walking through the entire process i'm following, so that you can see what i'm up too and in case it gives any further clues for a solution.
Thanks again!
ktmom said:
You need to give the "flash-all.sh" script execution rights (that is why the permission denied error). Use this code:
Code:
chmod +x ./flash-all.sh
You may need super user/root rights:
Code:
sudo chmod +x ./flash-all.sh
The "flash-all.sh" script is a stand-alone script that sequentially flashes the entire factory package. As was mentioned in another repsonse in this thread, in cases where you want to update, but not lose your installed user apps and data, you would edit the script and remove the "-w" augment. In this case, you are returning to stock and you should perform the wipe (-w).
The dot slash (./) that preceeds the flash-all.sh tells the bash interpreter (what runs commands you give) that the file is right here, in this directory.
The flash-all.sh is a standalone script (series of written instructions) and calls fastboot from within it.
Click to expand...
Click to collapse
@ptm, No worries, I'll do my best to help. I'm typing this on a chromebook that I also use to fastboot to a P3XL.
Edit 1:
Just to make sure:
1) The bootloader is unlocked?
2) "fastboot devices" returns the serial number of your device?
3) you are running ./flash-all.sh command as root or as the default user? In other words, the same way that fastboot devices returns the serial number. Either sudo fastboot devices or just fastboot devices.
4) if you enter the linux command: ls -al flash-all.sh do you get something like:
-rwxr-xr-x. 1 chronos chronos 957 Jul 18 2019 flash-all.sh
In this example -rwxr-xr-x is depicting the file permissions where there are three groupings; owner group everyone else. The first rwx means read, write and execute permissions for the file owner. Others in the same group and everyone else has read and execute permissions. Execute (x) is required in order for a script to run. If your file does not have three x so that all three groups have permission to execute it, then we need to revisit that.
Edit 2:
Another thought that could be affecting you is ADB and Fastboot are old. in your crosh shell, type:
Code:
[email protected] ~ $ adb --version
Android Debug Bridge version 1.0.41
Version 29.0.5-5949299
[email protected] ~ $ fastboot --version
fastboot version 29.0.5-5949299
Installed as /usr/local/bin/fastboot
If either returns a version older than the output above, then the easy way to update these is to use the script on Nathan Chance's Githuib. This might look a little overwhelming but it's pretty easy. I suggest you read the page, but the operative information is in section 4. Run the setup script:
To install, run
Code:
curl -s https://raw.githubusercontent.com/nathanchance/chromeos-adb-fastboot/master/install.sh | bash
in your shell prompt.
This script very nicely updates your ADB/Fastboot to the newest version which will be required for your P4XL
Are you guys sure you aren't making it too hard? You don't have to give any commands to install the full image. Download the full image and put it into an empty folder, go ahead and extract it in that folder. Create another new folder, Copy everything into it so you still have the full image in the first folder. Now download the tools and put those into a folder and extract them in that folder. Take the entire contents of that folder and add it to the folder you copied the extracted image into. What you should have now is one folder that still has the full extracted image, one that has the full extracted tools, and one that has both. If you have not already done so the phone should have debugging enabled and oem should be on. Go ahead and put it into bootloader mode and plug it in, type cmd in the path bar of the folder with both tools and image and check devices which will tell you if the tools can see the phone. If you get your serial the tools can see the phone. If you're going to wipe you can go ahead and click the flash-all and it will start the process, you do not give any commands. If you don't want to wipe the edit the flash-all to remove the-w, save it, and click on it. Again, no command is given, you just click and the flash-all does the rest.
Edit... And dont forget, A to C, not the provided C to C.
krabman said:
Are you guys sure you aren't making it too hard? You don't have to give any commands to install the full image. Download the full image and put it into an empty folder, go ahead and extract it in that folder. Create another new folder, Copy everything into it so you still have the full image in the first folder. Now download the tools and put those into a folder and extract them in that folder. Take the entire contents of that folder and add it to the folder you copied the extracted image into. What you should have now is one folder that still has the full extracted image, one that has the full extracted tools, and one that has both. If you have not already done so the phone should have debugging enabled and oem should be on. Go ahead and put it into bootloader mode and plug it in, type cmd in the path bar of the folder with both tools and image and check devices which will tell you if the tools can see the phone. If you get your serial the tools can see the phone. If you're going to wipe you can go ahead and click the flash-all and it will start the process, you do not give any commands. If you don't want to wipe the edit the flash-all to remove the-w, save it, and click on it. Again, no command is given, you just click and the flash-all does the rest.
Edit... And dont forget, A to C, not the provided C to C.
Click to expand...
Click to collapse
What Tools do you need to do this?
Same page as the images, scroll up from them and in the description of the process they have a link to the platform tools.
@krabman, Since this is using a chromebook, not a PC, things are flakier than normal. I just replicated the problems experienced by @ptm and some of it is due to old ADB/Fastboot as described in my previous post. Some is because ChromeOS made a change in an update that mounts nearly all of the partitions noexec, which means scripts can not execute and give the reported, "no permissions" error. There is a workaround since /usr/local is mounted executable. It's also possible to remount a partition with exec permissions.
@ptm, as the easiest route, I suggest making sure the ABD is current using the script I linked yesterday, and then going back to the OTA sideload method. I tanked my phone for a few hours yesterday trying to make fastboot get through the entire system image. I finally resorted to my full ubuntu install on my chromebook.
airmaxx23 said:
What Tools do you need to do this?
Click to expand...
Click to collapse
A general Fastboot/ADB tutorial is available here. If you are not using a chromebook, this thread's discussion will just add confusion.
If you are using a chromebook, then you need to enter a crosh shell, make sure adb and fastboot are updated as described in an earlier post and read the rest of the information I posted about the associated problems.
My understanding is the sh should flash on chrome with the latest tools as I described and you use the bat for PC. If the device is down he would have nothing to lose trying, if not I'd be leery of trying it since a partial flash will definitely result in a softie. Of course the possibility that I don't fully understand it may explain my puzzlement.
ktmom said:
A general Fastboot/ADB tutorial is available here. If you are not using a chromebook, this thread's discussion will just add confusion.
If you are using a chromebook, then you need to enter a crosh shell, make sure adb and fastboot are updated as described in an earlier post and read the rest of the information I posted about the associated problems.
Click to expand...
Click to collapse
Thanks, I know how to use ADB on the PC but I have a ChromeBook that I'd like to use as well. I already have it in Developer Mode.
I got it working, I just to run the script to update ADB and Fastboot.
airmaxx23 said:
Thanks, I know how to use ADB on the PC but I have a ChromeBook that I'd like to use as well. I already have it in Developer Mode.
When I open a Crosh Window, type shell, then adb devices my Pixel 4 XL shows up but I get: no permissions; see [http://developer.android.com/tools/device.html]
Click to expand...
Click to collapse
My bet is your ADB/fastboot are to old. Go back to post 9 and read the lower portion under edit2. You should also read forward from that point as there are additional issues that ChromeOS introduced with the noexec mounting of partitions. It will mean that without a workaround, you can not execute the flash-all.sh.
ktmom said:
My bet is your ADB/fastboot are to old. Go back to post 9 and read the lower portion under edit2. You should also read forward from that point as there are additional issues that ChromeOS introduced with the noexec mounting of partitions. It will mean that without a workaround, you can not execute the flash-all.sh.
Click to expand...
Click to collapse
Hey there,
SO i decided to try the OTA sideload method on a friends PC - i got the following response through CMD prompt
Code:
C:\Users\LYALL\Downloads>adb sideload ota-file.zip
Total xfer: 1.00x 1
However the phone is reporting a failure verifying the file signature and giving
Code:
E: Error code: 21
What do you think is causing that? I saw that Google has a new browser based flash tool to allow for AOSP builds to flash - would using that work better for me do you think?
ptm
ptm said:
Hey there,
SO i decided to try the OTA sideload method on a friends PC - i got the following response through CMD prompt
Code:
C:\Users\LYALL\Downloads>adb sideload ota-file.zip
Total xfer: 1.00x 1
However the phone is reporting a failure verifying the file signature and giving
Code:
E: Error code: 21
What do you think is causing that? I saw that Google has a new browser based flash tool to allow for AOSP builds to flash - would using that work better for me do you think?
ptm
Click to expand...
Click to collapse
Make sure you have downloaded the correct OTA and for crosshatch coral. Use the sha256 checksum provided in the download page and ensure the file is not corrupted. I check the integrity of the file before using it especially if I've moved it since the last verification.
You are rebooting to recovery (not rescue mode) and using the OTA sideload action from *within* recovery, before using the adb command, right?
The Google update and repair tool is an option.
ktmom said:
Make sure you have downloaded the correct OTA and for crosshatch. Use the sha256 checksum provided in the download page and ensure the file is not corrupted. I check the integrity of the file before using it especially if I've moved it since the last verification.
You are rebooting to recovery (not rescue mode) and using the OTA sideload action from *within* recovery, before using the adb command, right?
The Google update and repair tool is an option.
Click to expand...
Click to collapse
I think Pixel 4 XL is Coral, not Crosshatch.
I have downloaded the OTA file thats third from the bottom on this page (https://developers.google.com/android/ota) which is the rom number - 10.0.0 (QQ1B.200105.004, Jan 2020).
Yes, followed the instructions and booted to recovery, selected 'update from adb' from within recovery and then checked
Code:
adb devices
to ensure it showed 'sideload'. I then ran the command
Code:
adb sideload ota_file.zip
The transfer seemed to work fine, but then i got the error above showing on the device.
I cant seem to use the Google update and repair tool, as I'm in the UK and it says its not supported.
I can get it working with a VPN but the carrier i'm on doesnt show, although i do have the option of selecting 'other' as the carrier - I'm happy to give that a go, but wanted to get your thoughts on it first. Will selecting carrier as 'other' work ok for a UK based phone?
ptm

Categories

Resources