[REQUEST] Backup of gpt table of unlocked US997 - LG G6 Questions and Answers

Hi guys. I need help. Who has US997 with TWRP? Please make a gpt table backup. Will be grateful for your help!
This will make a backup of your current gpt table:
1. Boot into TWRP
2. Open a command line/terminal on your PC (wherever you have access to ADB)
3. Connect your phone to your PC
4. Everything in the command line/terminal
Code:
adb shell
sgdisk /dev/block/sda --b=/external_sd/GPT_orig.bin // if you want save file to microSD card
or
sgdisk /dev/block/sda --b=/sdcard/GPT_orig.bin // if you want to save file to internal storage
Update:
I create partition table from kdz file

Related

Need help to recover the partion tables of LS 980

I tried to flash a TWRP into my LG g2 LS980 and stuck up with black screen and tried
dd if=/home/med/Desktop/aboot.img of=/dev/sdb5
dd if=/home/med/Desktop/rpm.img of=/dev/sdb6
dd if=/home/med/Desktop/tz.img of=/dev/sdb8
dd if=/home/med/Desktop/openrecovery-twrp-2.6.3.2-g2d802 of=/dev/sdb15
the last step i did a blender instead of TWRP recovery I used stock recovery and stuck up in a black screen
now while i issue the command "gdisk -l /dev/sdb"
[[email protected] boobam]# gdisk -l /dev/sdb
GPT fdisk (gdisk) version 0.8.10
Caution: invalid main GPT header, but valid backup; regenerating main header
from backup!
Caution! After loading partitions, the CRC doesn't check out!
Warning! Main partition table CRC mismatch! Loaded backup partition table
instead of main partition table!
Warning! One or more CRCs don't match. You should repair the disk!
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: damaged
Found invalid MBR and corrupt GPT. What do you want to do? (Using the
GPT MAY permit recovery of GPT data.)
1 - Use current GPT
2 - Create blank GPT
Please some one help me.

[Q] How to mount encrypted image on PC - Note 4 Android L

Hello,
I used default encryption on Note 4 Android 5.0.1
I made a raw image backup device through TWRP (Terminal Command )to SDCARD:
dd if=/dev/block/mmcblk0p24 of=/external_sd/system.img
dd if=/dev/block/mmcblk0p27 of=/external_sd/encdata.img
dd if=/dev/block/mmcblk0p25 of=/external_sd/enccache.img
system.img not encrypted. Seamlessly image mounted on PC through:
mount -t ext4 system.img Test
But encdata.img is encrypted...
How can mount the encrypted Android image on PC?
Is it even possible?

Flashing and repartitioning Xiaomi MI2S running MIUI6

After upgrading from MIUIv4 to v6, I've discovered that the new version comes with a bootloader that
reflashes the recovery partition each time it's run with the stock recovery, which makes it impossible to use a custom recovery in order to install unsigned .zip patches,
doesn't support download mode, which makes it impossible to connect the phone to a computer as a block device and repartition it.
Since resolving this wasn't completely trivial (to me) and required a bit of research, I took some notes for future reference. I later decided to publish these notes, since someone might find them useful. Keep in mind that, while I do have technical background, I'm not intimately acquainted with the inner workings of Android and there was some trial and error involved. As a result, certain steps may be too heavy-handed or even unnecessary and I encourage comments on that.
Prerequisites
The guide presumes one has the adb, fastboot and parted binaries installed on an OS that enables access to connected block devices via the filesystem. For most users, that means a linux box.
Download mode
Booting into download mode appears to be disabled in MIUI6 v5.8.6. You will therefore need to boot into a custom recovery (see Booting into a custom recovery mode) and flash an alternative ROM (it would likely suffice to flash only certain partitions?):
Code:
$ adb push cm-11-20150802-NIGHTLY-aries.zip /storage/sdcard0
To boot into the download mode with an alternative ROM, consult [3] or run adb reboot dload against the phone in the system or in the recovery mode.
Repartitioning the internal flash memory
In my experience, the default size of the /system partition is insufficient to accommodate all the system applications along with the ever-growing Google Apps. The original inspiration came from [4]. To adjust the partition sizes, I used the parted command-line tool, since it comes with full support for GPT partitions and labels. Gparted used, but (as of v0.19.0-2) appeared to be much slower compared to parted and didn't seem to fully support GPT partition labels. Keep in mind that, unlike gparted, parted applies the changes to the block device immediately. Proceed with caution.
Before starting, it's best to backup the current partition table for a reference:
Code:
# gparted /dev/sdc
GNU Parted 3.2
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit MiB
(parted) print
Number Start End Size File system Name Flags
1 0,02MiB 85,0MiB 85,0MiB fat16 modem msftdata
2 85,0MiB 170MiB 85,0MiB fat16 modem1 msftdata
3 170MiB 171MiB 0,50MiB sbl1
4 171MiB 171MiB 0,50MiB sbl2
5 171MiB 172MiB 1,00MiB sbl3
6 172MiB 173MiB 1,00MiB rpm
7 173MiB 174MiB 1,00MiB tz
8 174MiB 175MiB 0,50MiB DDR
9 175MiB 179MiB 4,00MiB aboot
10 179MiB 180MiB 1,00MiB misc
11 180MiB 182MiB 2,85MiB logo
12 182MiB 183MiB 0,76MiB m9kefs1
13 183MiB 184MiB 0,76MiB m9kefs2
14 184MiB 184MiB 0,00MiB m9kefsc
15 184MiB 192MiB 8,11MiB bk1
16 192MiB 193MiB 0,76MiB m9kefs3
17 193MiB 256MiB 63,2MiB bk2
18 256MiB 271MiB 15,0MiB boot
19 271MiB 286MiB 15,0MiB boot1
20 286MiB 301MiB 15,0MiB recovery
21 301MiB 312MiB 11,0MiB bk3
22 312MiB 320MiB 8,00MiB ext4 persist
23 320MiB 832MiB 512MiB ext4 system
24 832MiB 1344MiB 512MiB ext2 system1
25 1344MiB 1728MiB 384MiB ext4 cache
26 1728MiB 5312MiB 3584MiB ext4 userdata
27 5312MiB 29820MiB 24509MiB ext4 storage
Mind that /dev/sdc refers to the block device of my phone and will differ on your system depending on the amount of other block devices connected and the type of your system. It's also best to backup either the entire block device (/dev/sdc) or at last the specific partitions you are going to be messing with (/dev/sdcXY) – this is doubly important for partitions <= 22, the correct content of which may be difficult to retrieve when damaged. Labels (most likely) aren't important, the partition numbers are, so make sure you keep the order of the partitions when fiddling with them.
After finishing, reconnect the phone to make the kernel recognize the new partition structure and create the filesystem (mkfs.ext4) for any partitions you have created. The following example makes the system and system1 partitions 1GiB each and the userdata partition 4GiB at the expense of the storage partition:
Code:
# parted /dev/sdc
GNU Parted 3.2
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) rm 23
(parted) rm 24
(parted) rm 25
(parted) rm 26
(parted) rm 27
(parted) mkpart physical ext4 320MiB 1344MiB
(parted) mkpart physical ext4 1344MiB 2368MiB
(parted) mkpart physical ext4 2368MiB 2752MiB
(parted) mkpart physical ext4 2752MiB 6848MiB
(parted) mkpart physical ext4 6848MiB 29819MiB
(parted) name 23 system
(parted) name 24 system1
(parted) name 25 cache
(parted) name 26 userdata
(parted) name 27 storage
(parted) quit
# sync
And then, after reattaching the phone to the computer:
Code:
# for i in /dev/sdc2[34567]; do mkfs.ext4 $i; done
# sync
Recovery mode
For booting into recovery, consult [3].
Booting into a custom recovery
Use the process described at [2], with steps 7-8 interchanged with 9-10. I used the emms_appsboot.mbm and recovery-clockwork-6.0.5.0-aries-20140718.img files (see List of files) from the fastboot mode as follows:
Code:
$ fastboot flash recovery recovery-clockwork-6.0.5.0-aries-20140718.img
$ fastboot flash aboot emmc_appsboot.mbn
$ fastboot boot recovery-clockwork-6.0.5.0-aries-20140718.img
If the phone gets stuck at booting during the last step, restart the phone and try again.
You should now be in the custom recovery. For me, this only lasted until a reboot. Then, the recovery was replaced with the stock one and it became impossible to boot into the system, effectively softbricking the phone. To fix this, flash the stock emmc_appsboot.mbm bootloader image extracted from the .zip of the MIUI ROM you are using and flash it from the fastboot mode:
Code:
$ fastboot flash aboot ./the/original/emmc_appsboot.mbn
$ fastboot continue
Fastboot mode
To boot into the fastboot mode, either:
Reboot the phone while holding the volume down button.
Run adb reboot bootloader against the phone in the system or in the recovery mode.
List of files
You don't need these files, it's only what I used, which should enable the reproducibility of my results.
xiaomi.eu_multi_aries_5.8.6_v6-5.0.zip – The MIUI6 v5.8.6 Czech ROM. Downloaded from [5].
emms_appsboot.mbm – A fixed bootloader for MIUI6 v5.8.6, which allows for the installation of recoveries other than the
built-in one (see Reinstalling the recovery). Downloaded from [2].
recovery-clockwork-6.0.5.0-aries-20140718.img – A recovery image of a custom version of the clockworkmod. Extracted from the archive downloaded from [1].
cm-11-20150802-NIGHTLY-aries.zip – An alternative ROM (Cyanogenmod 11). downloaded from [6].
Links
[2014-07-08] ClockworkMod Recovery 6.0.5.0
[Tools, Tips & Tutorials] [Device Team] How to get Custom Recoveries working again on Mi 2/2S with MIUI 6
[Tips & Tutorials] [Mods' Insight] Understanding Recovery mode & Download Mode
[SCRIPT] Fix partition table for Android 4.4
MIUIV6 OFFICIAL RELEASE
Browse Files for Samsung Galaxy S - aries
Hi, I updated partitioning tutorial to install Android 10: https://forum.xda-developers.com/t/guide-tutorial-howto-xiaomi-mi-2-2s-stock-to-android-10.4391775/

Pixel (2016) Partition Names, Numbers and Sizes

I thought it might be helpful to others to document some test results after rooting my Google Pixel (2016) phone with Magisk (v20.4) and Magisk Manager (v8.0.4), and using various commands with a terminal emulator (Termux) on my phone, and with terminal and adb on my Linux (Ubuntu) computer with phone connected.
Command outputs appear to refer to the number (#) of blocks. By presupposing that each of these blocks has 1,024 bytes, I calculated partition sizes in MB and GB, and compared the values to the sizes of the files copied using adb pull /dev/block/bootdevice/by-name. The values matched exactly, and the total size of all of the partitions came to 32 GB, which is the size of my phone’s internal storage.
I found 62 different partitions on my phone, and combining several command outputs enabled me to produce the following table.
Partition NamePartition NumberNumber of BlocksPartition Size MBPartition Size GBaboot_asda174,0964.2aboot_bsda184,0964.2apdp_asda292560.3apdp_bsda302560.3board_infosdf1160.0boot_asda1932,76833.6boot_bsda2032,76833.6bootlocker_asda15120.5bootlocker_bsda25120.5cdtsdd1240.0cmnlib32_asda132560.3cmnlib32_bsda142560.3cmnlib64_asda152560.3cmnlib64_bsda162560.3ddrsdd111,0241.0devcfg_asda231280.1devcfg_bsda241280.1devinfosdf440.0devinfobaksdd540.0dipsdd71,0241.0dposdd640.0frpsde15120.5fscsdd840.0fsgsdf32,0482.1hosd_asda2132,76833.6hosd_bsda2232,76833.6hyp_asda115120.5hyp_bsda125120.5keymaster_asda35120.5keymaster_bsda45120.5metadatasde516,38416.8mfgsdf22360.3miscsdd11,0241.0modem_asda2571,68073.4modem_bsda2671,76073.4modemst1sdd92,0482.1modemst2sdd102,0482.1msadp_asda272560.3msadp_bsda282560.3persistsdd332,76833.6pg1fssde34,0964.2pg2fssde42,0482.1pmic_asda95120.5pmic_bsda105120.5ramdumpsde26,1446.3reserve0sda364,8204.9reserve3sdd139,0209.2reserve4sde67,6367.8reserve5sdf55,8246.0rpm_asda75120.5rpm_bsda85120.5secsdd41280.1ssdsdd280.0system_asda332,097,1522,147.52.1 GBsystem_bsda342,097,1522,147.52.1 GBtz_asda52,0482.1tz_bsda62,0482.1userdatasda3526,038,27226,663.226.7 GBvendor_asda31307,200314.60.3 GBvendor_bsda32307,200314.60.3 GBxbl_asdb14,0524.1xbl_bsdc14,0524.1TOTALS-31,248,12031,998.132 GB
Partition NamePartition NumberNumber of BlocksPartition Size MBPartition Size GBsda-31,145,98431,893.531.9 GBsdb-4,0964.2sdc-4,0964.2sdd-49,15250.3sde-36,86437.7sdf-8,1928.4TOTALS-31,248,38431,998.332 GB
The sda partition is the main part of the phone's internal storage, but could sdb, sdc, sdd, sde and sdf partitions be held on separate disks or boards?
Commands used via Phone and Terminal Emulator:
uname (with -a appended)
sudo cat /proc/partitions
tsu
sudo cat /proc/partitions
su
cd /dev/block/bootdevice/by-name
ls -all
Commands used via Computer Terminal and ADB: (I found it easier to temporarily boot TWRP using fastboot boot twrp-3.4.0-0-sailfish.img).
adb ls /dev/block/bootdevice/by-name
adb shell ls /dev/block/bootdevice/by-name
adb shell ls -all /dev/block/bootdevice/by-name
adb pull /dev/block/bootdevice/by-name (see below)
adb shell uname (with -a appended)
adb shell
cat /proc/partitions
The adb pull command copied 34.5 GB files (took 18 mins) into a ‘by-name’ file in my adb folder. The files in 'by-name' included boot (33.6 MB), system (2.1 GB) and vendor (314.6 MB) files (approx 2.5 GB) that were not included in the command outputs, which instead had similarly sized boot_a, boot_b, system_a, system_b, vendor_a and vendor_b files.

[GUIDE][HOW TO FIX] 28 (ErrorCode::kDownloadOperationExecutionError) | 5 (ErrorCode::kPostInstallRunnerError)

In this short guide, I will explain to you how to easily fix the recovery error, the name of which can be found in the title. This guide is only a collection of information found on the Internet and a simple explanation of the problem. It was created so that you can easily find it on the Internet and fix the problem quickly.
1. Error mentioned in the title of the guide.
The reason for the error is the problem of installing the ZIP package by Sideload. It is caused by a lack of space on the partition and only occurs when installing Android 11 and above.
2. How can I fix this problem?
In these few steps, described below, I will explain how to fix the error contained in the title of the guide.
Method one (Many thanks to the Pixel Experience team for preparing flash-ready files):
Flash one of the files included in the guide using recovery. Please select 32GB or 128GB respectively depending on the capacity of this device.
Method two:
1. Boot the phone in fastboot mode and use ADB & Fastboot to send the below command to the phone, using the path to the image of the latest TWRP version in place of recovery.img.
Code:
fastboot boot recovery.img
2. After running TWRP, use the commands below with ADB & Fastboot, noting that each line of the code below is one step to complete. Note that there are two code versions below. For the phone version with 32GB of built-in memory and 128GB.
a) For the version with 32GB of built-in memory:
Code:
sgdisk --delete=33 /dev/block/sda
sgdisk --delete=34 /dev/block/sda
sgdisk --delete=35 /dev/block/sda
sgdisk --new=33:227142:1275716 --change-name=33:system_a --typecode=33:EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 /dev/block/sda
sgdisk --new=34:1275717:2324291 --change-name=34:system_b --typecode=34:77036CD4-03D5-42BB-8ED1-37E5A88BAA34 /dev/block/sda
sgdisk --new=35:2324292:7785285 --change-name=35:userdata --typecode=35:EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 /dev/block/sda
b) For the version with 128GB of built-in memory:
Code:
sgdisk --delete=33 /dev/block/sda
sgdisk --delete=34 /dev/block/sda
sgdisk --delete=35 /dev/block/sda
sgdisk --new=33:227142:1537862 --change-name=33:system_a --typecode=33:77036CD4-03D5-42BB-8ED1-37E5A88BAA34 /dev/block/sda
sgdisk --new=34:1537863:2848582 --change-name=34:system_b --typecode=34:EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 /dev/block/sda
sgdisk --new=35:2848583:31215429 --change-name=35:userdata --typecode=35:EBD0A0A2-B9E5-4433-87C0-68B6B72699C7 /dev/block/sda
Ready! You can now try to install new software via Sideload or directly in recovery. Everything should work fine.
reserved
i have google pixel 3 with the same problem it has 64gb storage which code should i use
Does anyone know to fix this error for newer pixels? I am getting (ErrorCode: :kPostinstallRunnerError) trying to update my unlocked Pixel 4a (5G) from 11.0.0 (RQ1A.210105.003, Jan 2021) to any newer version. I was previously rooted, but have since uninstalled Magisk, still receiving the same error.

Categories

Resources