Help! Need system.img! - Kindle Fire General

Hi guys,
I got my friends Kindle Fire, a bricked one (he bought it cheap...). I got a motorola factory cable. This device got a TWRP OpenRecovery, FFF boot. And... empty /system partition!
I would be very very gratefull for a system.img to flash it from fastboot using my factory cable.
Thanks in advance!

Are you saying you have fff &twrp installed?
Sent from my Galaxy Nexus using xda premium

Yes, but i cannot flash an update.zip from twrp.
E:failed to mount /sdcard (invalid argument)
E:Can't mount /sdcard/update.zip
E:failed to mount /sdcard (invalid argument)
Error flashing zip '/sdcard/update.zip'

Go into mount and check that only sdcard is ticked
Sent from my Galaxy Nexus using xda premium

I cannot tick it. Only 'cache' can be ticked

does adb work?

Yes. I pushed update.zip to sdcard, so yes - it's working

type this and show me the output
$ adb shell
~ # dmesg | grep mmc0

~ # dmesg | grep mmc0
dmesg | grep mmc0
<6>[ 2.450927] mmc0: new high speed DDR MMC card at address 0001
<6>[ 2.451354] mmcblk0: mmc0:0001 MMC08G 7.28 GiB

ok you are safe from the only kindle killing bug known
---------- Post added at 12:03 AM ---------- Previous post was at 12:00 AM ----------
adb shell
idme?
show me the results

Good to hear Now I need only a system.img to get this baby working :]
~ # idme?
idme?
/sbin/sh: idme?: not found
~ #
// this 5 minutes wait between posts is killing me! //

it looks like your partitions are messed up.
if you try the above command it should show your partitions. you may have to do a fastboot oem format.
sorry wrong command above.
adb shell
parted /dev/block/mmcblk0

adb shell
parted /dev/block/mmcblk0
(parted) print
print
print
Model: MMC MMC08G (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 131kB 262kB 131kB xloader
2 262kB 524kB 262kB bootloader
3 524kB 11.0MB 10.5MB dkernel
4 11.0MB 212MB 201MB ext4 dfs
5 212MB 229MB 16.8MB recovery
6 229MB 296MB 67.1MB ext4 backup
7 296MB 307MB 10.5MB boot
8 307MB 312MB 5243kB ext4 splash
9 312MB 849MB 537MB system
10 849MB 2041MB 1192MB userdata
11 2041MB 2309MB 268MB ext4 cache
12 2309MB 7690MB 5380MB media
(parted)

ok all good there.
make sure your usb is connected
turn off kindle (hold button for at least 20 seconds)
cd to where you have fastboot and type, fastboot oem format and press enter
it should say "waiting for device"
then press power button on kindle
this should format the partitions back to factory settings.
post the outcome and i will advise

C:\kfu\tools>fastboot oem format
... OKAY [ 0.063s]
finished. total time: 0.063s
C:\kfu\tools>

ok your using kfu.
is there an option to install fff & twrp again?

KFU is trying to install twrp, but when it's reloading i'm getting back to twrp, not fastboot mode.
I can install twrp via factory cable.
(I think this device was erased in some way. In TWRP / Advanced / File Manager folder /system is empty. I pushed sh to /system/bin with adb, before asking for this img in this thread)

you now need to push a rom onto the sdcard use this as its the base of ics at the minute.
http://bit.ly/NaD2vW its hashcodes and it includes his 3.0 kernel
---------- Post added at 12:35 AM ---------- Previous post was at 12:32 AM ----------
yes now you mention it 0.063 seconds does sound fast to format all partitions back to factory set

http://bit.ly/NaD2vW its hashcodes and it includes his 3.0 kernel
404 Not Found
Hmm... i got stock kindle fire bin file and MoDaCo Custom ROM for the Kindle Fire.
I can try one of them

down load twrp 2.1 from here and flash it with fastboot.
(fastboot is only on for a small time on each boot, so turn off kindle again, issue fastboot flash recovery /place/path/to/twrp2.1/here.img enter
should say "waiting for device"
then power on this should install twrp again (incase your twrp is duff)
---------- Post added at 12:43 AM ---------- Previous post was at 12:42 AM ----------
sorry link http://forum.xda-developers.com/showthread.php?t=1592681

Related

Corrupt Cache Partition - help needed

Hello,
my setup:
- CM 11 unofficial Build3 by vertigo running with ART and the whatsapp fix ( http://forum.xda-developers.com/showthread.php?t=2498084 )
- latest banks gapps
- latest TWRP (2.6.3.2)
What I wanted to do
I simply wanted to install the new official CM11 nightly, booted into TWRP, installed the rom and the gapps without wiping, which shouldnt be a problem - i didn't revert to dalvik for this, if that makes any difference.
I suspect there was an error while downloading the new nightly rom, it gave me an error msg while updating. (ill use MD5 from now on...)
So i just reflashed the build3 from vertigo with the gapps - but now i have the problem that the phone doesnt boot.
It shows the LG Logo unusually long and then shows the CM Boot Logo forever.
Whats the situation now:
i can mount every partition, except cache - wiping also fails obviously
i can enter TWRP and flash stuff
i have made a backup before my update attempt
i also have every file needed for a clean flash on my sdcard
What I tried already:
Wiping everything but the internal sdcard - clean install - still wont boot
restoring the backup works aswell, but still doesnt boot
help gladly appreciated, i think i only need to fix my cache partition and then restore everything and it should work again...
nfin1te said:
Hello,
my setup:
- CM 11 unofficial Build3 by vertigo running with ART and the whatsapp fix ( http://forum.xda-developers.com/showthread.php?t=2498084 )
- latest banks gapps
- latest TWRP (2.6.3.2)
What I wanted to do
I simply wanted to install the new official CM11 nightly, booted into TWRP, installed the rom and the gapps without wiping, which shouldnt be a problem - i didn't revert to dalvik for this, if that makes any difference.
I suspect there was an error while downloading the new nightly rom, it gave me an error msg while updating. (ill use MD5 from now on...)
So i just reflashed the build3 from vertigo with the gapps - but now i have the problem that the phone doesnt boot.
It shows the LG Logo unusually long and then shows the CM Boot Logo forever.
Whats the situation now:
i can mount every partition, except cache - wiping also fails obviously
i can enter TWRP and flash stuff
i have made a backup before my update attempt
i also have every file needed for a clean flash on my sdcard
What I tried already:
Wiping everything but the internal sdcard - clean install - still wont boot
restoring the backup works aswell, but still doesnt boot
help gladly appreciated, i think i only need to fix my cache partition and then restore everything and it should work again...
Click to expand...
Click to collapse
Can you clear it the slow way? Untick -rm rf option in settings, then clear cache. The partition itself shouldn't have been changed by installing a ROM, it must be some kind of problematic content.
Incep said:
Can you clear it the slow way? Untick -rm rf option in settings, then clear cache. The partition itself shouldn't have been changed by installing a ROM, it must be some kind of problematic content.
Click to expand...
Click to collapse
Nope, as I can't mount it, none of those 2 ways is possible.
Just says
At the beginning:
updating partition details
then:
E:unable to mount /cache
several times,
and somwhere inbetween
Running boot script...
and
Finished running boot script
nfin1te said:
Nope, as I can't mount it, none of those 2 ways is possible.
Just says
At the beginning:
updating partition details
then:
E:unable to mount /cache
several times,
and somwhere inbetween
Running boot script...
and
Finished running boot script
Click to expand...
Click to collapse
I didn't think it needed to be mounted in order to be cleared the normal way.
It sounds like it must be repartitioned, or fixed with some kind of disk scan before it can be normally mounted. Maybe there is a way to ssh into the phone and run fsck on the disk?
(ssh is a remote shell for unix, fsck is the linux "scan disk" tool for recovering errors, you can connect to your phone if it has an ssh server running by downloading Putty for windows or through the terminal on mac)
I'm not an expert on android partitions, so maybe someone else want to chime in on this.
Incep said:
It sounds like it must be repartitioned, or fixed with some kind of disk scan before it can be normally mounted. Maybe there is a way to ssh into the phone and run fsck on the disk?
(ssh is a remote shell for unix, fsck is the linux "scan disk" tool for recovering errors, you can connect to your phone if it has an ssh server running by downloading Putty for windows or through the terminal on mac)
Click to expand...
Click to collapse
I'm more than willing to try, but i'd need some sort of instructions, i have no experience with this.
thanks!
What i want to avoid, if somehow possible, is to reflash a stock rom, reroot and reinstall TWRP and go thru the whole procedure again.
nfin1te said:
I'm more than willing to try, but i'd need some sort of instructions, i have no experience with this.
thanks!
What i want to avoid, if somehow possible, is to reflash a stock rom, reroot and reinstall TWRP and go thru the whole procedure again.
Click to expand...
Click to collapse
I'm not sure if my method works, but atleast you have a running adb server on your phone when in TWRP, which is the android debugging protocol. It has a lot of tools, some which might be useful. You should google a bit around on the subject.
Incep said:
I'm not sure if my method works, but atleast you have a running adb server on your phone when in TWRP, which is the android debugging protocol. It has a lot of tools, some which might be useful. You should google a bit around on the subject.
Click to expand...
Click to collapse
Yeah, thats what im doing atm... but i didn't have success finding someone with a similar problem so far.
All i ever have done in ADB is enable/disable fastboot on my old nexus and sideload some images.
nfin1te said:
Yeah, thats what im doing atm... but i didn't have success finding someone with a similar problem so far.
All i ever have done in ADB is enable/disable fastboot on my old nexus and sideload some images.
Click to expand...
Click to collapse
Me too, I'm not really an android developer, just worked a lot with Linux earlier, and it's conceptually the same thing! Hopefully I pointed you in the right direction.
ok i entered adb shell alrdy, but when i try to use the parted command, it says
~ # parted /dev/block/mmcblk0
/sbin/sh: parted: not found
~ #
Edit:
Apparently, i need to push parted first.
Im currently trying this: http://www.droidforums.net/forum/htc-droid-eris/78650-internal-storage-partitions-screwed-up.html
nfin1te said:
ok i entered adb shell alrdy, but when i try to use the parted command, it says
~ # parted /dev/block/mmcblk0
/sbin/sh: parted: not found
~ #
Click to expand...
Click to collapse
Maybe you don't have parted installed on your phone. Each command is actually it's own program, which lies in a folder which is either /bin for normal apps, and /sbin for system-changing apps. So probably check /sbin if there is a binary file called 'parted' there. But be careful of this program… It can be very destructive.
Incep said:
Maybe you don't have parted installed on your phone. Each command is actually it's own program, which lies in a folder which is either /bin for normal apps, and /sbin for system-changing apps. So probably check /sbin if there is a binary file called 'parted' there. But be careful of this program… It can be very destructive.
Click to expand...
Click to collapse
Yeah thx, i just managed to push the necessary files.
Ok, now im looking at this partition table:
(parted) print
print
Model: MMC 032G96 (sd/mmc)
Disk /dev/block/mmcblk0: 31.3GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 16.8MB 83.9MB 67.1MB fat16 modem
2 83.9MB 84.9MB 1049kB sbl1
3 84.9MB 85.5MB 524kB dbi
4 101MB 101MB 524kB DDR
5 117MB 118MB 1049kB aboot
6 118MB 120MB 1049kB rpm
7 134MB 151MB 16.8MB boot
8 151MB 152MB 1049kB tz
9 152MB 152MB 1024B pad
10 168MB 171MB 3146kB modemst1
11 171MB 174MB 3146kB modemst2
12 174MB 174MB 1024B pad1
13 185MB 201MB 16.8MB misc
14 201MB 235MB 33.6MB ext4 persist
15 235MB 252MB 16.8MB recovery
16 252MB 255MB 3146kB fsg
17 268MB 269MB 524kB fsc
18 269MB 269MB 524kB ssd
19 269MB 269MB 1024B pad2
20 269MB 270MB 524kB encrypt
21 285MB 294MB 8389kB ext4 drm
22 294MB 302MB 8389kB ext4 sns
23 302MB 336MB 33.6MB laf
24 336MB 369MB 33.6MB fota
25 369MB 403MB 33.6MB ext4 mpt
26 403MB 403MB 524kB dbibak
27 403MB 404MB 1049kB rpmbak
28 404MB 405MB 1049kB tzbak
29 405MB 405MB 8192B rct
30 419MB 3322MB 2902MB ext4 system
31 3322MB 3959MB 638MB cache
32 3959MB 4043MB 83.9MB tombstones
33 4043MB 4060MB 16.8MB spare
34 4060MB 4110MB 50.3MB ext4 cust
35 4110MB 31.2GB 27.1GB ext4 userdata
36 31.2GB 31.3GB 62.9MB grow
(parted)
I assume, the problem is, that cache seems screwed as it doesn't show any filesystem right?
So if i make this partition ext4, it should work again?
If i check pt31/cache, it says:
(parted) check 31
check 31
Error: Could not detect file system.
(parted)
So, im assuming, im right.
lol, man this is frustrating
(parted) mkfs ext4
mkfs ext4
Warning: The existing file system will be destroyed and all data on the
partition will be lost. Do you want to continue?
parted: invalid token: ext4
Yes/No? yes
yes
Partition number? 31
31
File system type? [ext2]? ext4
ext4
No Implementation: Support for creating ext4 file systems is not implemented
yet.
(parted)
It's alive again!
ext2 worked aswell, as i/we thought - the problem was the cache partition got f'ed up. Making a new FS using parted solved the problem.
THANKS bro for pointing me in the right direction.
Edit: restored backup and everythings fine again
I have the same issue , i am running on ubuntu i but i dont quite get the instrations ?
emrexcem said:
I have the same issue , i am running on ubuntu i but i dont quite get the instrations ?
Click to expand...
Click to collapse
Hi mate i had the same problem and after a long struggling i got this working again.
-Use a Windows computer and install the SDK tools
-Check OP's link to find the "parted" file
-Connect phone in recovery
-Open cmd in windows and type adb shell, you'll get a new console with a #
-Push your parted file to /sbin using adb push command:
In my case i had the parted file in E: drive so i used adb push E:\parted /sbin/parted
-If you try to execute parted you'll get a "permission denied" error, so after pushing the file you need to fix the permissions so type "chmod 777 /sbin/parted"
-Execute parted and just follow OP's steps and you'll be fine.
Hope it helps
Don't use parted to create a filesystem
nfin1te said:
It's alive again!
ext2 worked aswell, as i/we thought - the problem was the cache partition got f'ed up. Making a new FS using parted solved the problem.
THANKS bro for pointing me in the right direction.
Edit: restored backup and everythings fine again
Click to expand...
Click to collapse
You saved my but but as far as I know it is not recomended to use parted to create a filesystem.
Use
mke2fs -T ext4 [partition]
instead
nfin1te said:
It's alive again!
ext2 worked aswell, as i/we thought - the problem was the cache partition got f'ed up. Making a new FS using parted solved the problem.
THANKS bro for pointing me in the right direction.
Edit: restored backup and everythings fine again
Click to expand...
Click to collapse
Can you please provide more detailed instruction please, i have apparently the same problem, i not familiar with adb, i have now pushed all necessary parts to phone what should i do now.
I am stuck please please help.
pingwinpower said:
You saved my but but as far as I know it is not recomended to use parted to create a filesystem.
Use
mke2fs -T ext4 [partition]
instead
Click to expand...
Click to collapse
Can you please provide more detailed instruction please, i have apparently the same problem, i not familiar with adb, i have now pushed all necessary parts to phone what should i do now.
I am stuck please please help.
redkib said:
Can you please provide more detailed instruction please, i have apparently the same problem, i not familiar with adb, i have now pushed all necessary parts to phone what should i do now.
I am stuck please please help.
Click to expand...
Click to collapse
I cant really provide any more information than this, please be more specific with your problem.
Since apparently you have pushed all the files via adb already, you just need to use the "mkfs" command to create a news filesystem, just be sure to select the right partition number (the corrupted one). You can find the correct command via google or take a look at my post
(parted) mkfs ext2
Warning: The existing file system will be destroyed and all data on the
partition will be lost. Do you want to continue?
Yes/No? yes
yes
Partition number? 31
31
File system type? [ext2]?
ext2
(parted)
Click to expand...
Click to collapse

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/

Nexus 10 Gapps fix with Pie

I have made a workaround/guide for the Nexus 10 Pie/Gapps problem (modified Nexus 4; Tnx to bmg1001).
Modified and corrected , for installation of Pie (Android 9.0) with Gapps.
Source: https://forum.xda-developers.com/nexus-4/general/guide-increase-nexus-4s-partition-space-t3800264
Big thanks to bmg1001 on XDA-Dev!
REQUIREMENTS:
parted (in the ZIP-file on mega.nz or link above)
adb and fastboot, and preferably knowledge on how they work
Step 1: Install TWRP onto your Nexus 10 and reboot into it.
Step 2: Open up command prompt / terminal (Right mouse click) in the folder were the "parted-script" is located and check to see if your Nexus 10 is connected properly with the command "adb devices".
Step 3: Once you've confirmed that adb is fully working and your Nexus 10 is properly connected to your PC, download parted and use adb to push it to your Nexus 10 using the command: "adb push parted /"
(Without the " )!!!
Step 4: Now enter the following command: adb shell
and then the command: chmod +x parted (This will enter adb shell and make the "parted" binary you pushed to your device earlier executable.)
Step 5: Now run the command: ./parted /dev/block/mmcblk0 p ( You should see a long list with a bunch of numbers and names in your terminal. These are the partitions on your device. parted will give you the partition number, the "start" and "end" of the partition, the size, and the name.
This is the partition layout on my device. It will probably be the same on your device, though the size of userdata may vary depending on whether you have the 32gb or 16gb Nexus 10). It should look a bit like the table below:
Number Start End Size File system Name Flags
1 4194kB 25.2MB 21.0MB ext4 efs
2 25.2MB 33.6MB 8389kB param
3 33.6MB 50.3MB 16.8MB boot
4 50.3MB 83.8MB 33.5MB recovery
5 83.8MB 83.9MB 65.5kB metadata
6 83.9MB 88.1MB 4194kB misc
7 88.1MB 612MB 523MB ext4 cache
8 612MB 1481MB 869MB ext2 system
9 1481MB 15.8GB 14.3GB ext4 userdata
Step 6: Now run the following three commands: umount /data umount /sdcard umount /cache
Step 7: So, on my Nexus 10, the system partition is number 8, and cache is 7. We're kinda lucky in the fact that system and cache are right next to each other, meaning we don't have to touch any other partition.
You'll want to run these two next commands. These commands will essentially "remove" the two partitions: ./parted /dev/block/mmcblk0 rm 7 ./parted /dev/block/mmcblk0 rm 8
Step 8: Now it is time to recreate these two partitions, however, when recreating them, we will make system bigger and the cache smaller. From the partitions list we got in Step 5, we can see that cache starts at 88.1 and ends at 612, while system starts at 612 and ends at 1481. The following two commands will rebuild /system starting at 88.1, but ending at 400, while rebuilding cache at 400, and ending at 1481. We are essentially stealing a large chunk from cache, since we don't really need that anymore on newer ROMs. I choose the "system-/cache-size" randomly, so you may size it, the way you like!
Command: ./parted /dev/block/mmcblk0 mkpart primary 88.1 400 and ./parted /dev/block/mmcblk0 mkpart primary 400 1481
Step 9: Now run this command: ./parted /dev/block/mmcblk0 p
(This will bring up the partitions list, or table, again. This time, however, we'll see the new partitions where system and cache were, however, they have no names! The following two commands will name the two partitions again): ./parted /dev/block/mmcblk0 name 8 system and ./parted /dev/block/mmcblk0 name 7 cache
Step 10: Great! Now the partitions should be named again! Now, we still have to format the partitions as ext4 so that we can actually use them. The following two commands will do that for you.
mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p7
mke2fs -b 4096 -T ext2 /dev/block/mmcblk0p8
If you run ./parted /dev/block/mmcblk0 p It will show you the list, as shown below:
Number Start End Size File system Name Flags
1 4194kB 25.2MB 21.0MB ext4 efs
2 25.2MB 33.6MB 8389kB param
3 33.6MB 50.3MB 16.8MB boot
4 50.3MB 83.8MB 33.5MB recovery
5 83.8MB 83.9MB 65.5kB metadata
6 83.9MB 88.1MB 4194kB misc
7 88.1MB 400MB 312MB ext4 cache
8 400MB 1481MB 1081MB ext2 system
9 1481MB 15.8GB 14.3GB ext4 userdata
Step 11: Now run the command: mount -a (This command didn't work for me. Gave me errors. I rebooted from TWRP in to Recovery mode again) and then type exit.
Now you can follow your guide to flash your custom rom with GAPPS. Enjoy!!!!
Biomus
https://mega.nz/#!Rk0VCKrY!E84TJmMa9_MD5a8Wn9V7KMGgF-_SCCmXKbLahPneqKg
Thank you man, it works perfectly!
biomus said:
I have made a workaround/guide for the Nexus 10 Pie/Gapps problem (modified Nexus 4; Tnx to bmg1001).
Modified and corrected , for installation of Pie (Android 9.0) with Gapps.
Source: https://forum.xda-developers.com/nexus-4/general/guide-increase-nexus-4s-partition-space-t3800264
Big thanks to bmg1001 on XDA-Dev!
REQUIREMENTS:
parted (in the ZIP-file on mega.nz or link above)
adb and fastboot, and preferably knowledge on how they work
Step 1: Install TWRP onto your Nexus 10 and reboot into it.
Step 2: Open up command prompt / terminal (Right mouse click) in the folder were the "parted-script" is located and check to see if your Nexus 10 is connected properly with the command "adb devices".
Step 3: Once you've confirmed that adb is fully working and your Nexus 10 is properly connected to your PC, download parted and use adb to push it to your Nexus 10 using the command: "adb push parted /"
(Without the " )!!!
Step 4: Now enter the following command: adb shell
and then the command: chmod +x parted (This will enter adb shell and make the "parted" binary you pushed to your device earlier executable.)
Step 5: Now run the command: ./parted /dev/block/mmcblk0 p ( You should see a long list with a bunch of numbers and names in your terminal. These are the partitions on your device. parted will give you the partition number, the "start" and "end" of the partition, the size, and the name.
This is the partition layout on my device. It will probably be the same on your device, though the size of userdata may vary depending on whether you have the 32gb or 16gb Nexus 10). It should look a bit like the table below:
Number Start End Size File system Name Flags
1 4194kB 25.2MB 21.0MB ext4 efs
2 25.2MB 33.6MB 8389kB param
3 33.6MB 50.3MB 16.8MB boot
4 50.3MB 83.8MB 33.5MB recovery
5 83.8MB 83.9MB 65.5kB metadata
6 83.9MB 88.1MB 4194kB misc
7 88.1MB 612MB 523MB ext4 cache
8 612MB 1481MB 869MB ext2 system
9 1481MB 15.8GB 14.3GB ext4 userdata
Step 6: Now run the following three commands: umount /data umount /sdcard umount /cache
Step 7: So, on my Nexus 10, the system partition is number 8, and cache is 7. We're kinda lucky in the fact that system and cache are right next to each other, meaning we don't have to touch any other partition.
You'll want to run these two next commands. These commands will essentially "remove" the two partitions: ./parted /dev/block/mmcblk0 rm 7 ./parted /dev/block/mmcblk0 rm 8
Step 8: Now it is time to recreate these two partitions, however, when recreating them, we will make system bigger and the cache smaller. From the partitions list we got in Step 5, we can see that cache starts at 88.1 and ends at 612, while system starts at 612 and ends at 1481. The following two commands will rebuild /system starting at 88.1, but ending at 400, while rebuilding cache at 400, and ending at 1481. We are essentially stealing a large chunk from cache, since we don't really need that anymore on newer ROMs. I choose the "system-/cache-size" randomly, so you may size it, the way you like!
Command: ./parted /dev/block/mmcblk0 mkpart primary 88.1 400 and ./parted /dev/block/mmcblk0 mkpart primary 400 1481
Step 9: Now run this command: ./parted /dev/block/mmcblk0 p
(This will bring up the partitions list, or table, again. This time, however, we'll see the new partitions where system and cache were, however, they have no names! The following two commands will name the two partitions again): ./parted /dev/block/mmcblk0 name 8 system and ./parted /dev/block/mmcblk0 name 7 cache
Step 10: Great! Now the partitions should be named again! Now, we still have to format the partitions as ext4 so that we can actually use them. The following two commands will do that for you.
mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p7
mke2fs -b 4096 -T ext2 /dev/block/mmcblk0p8
If you run ./parted /dev/block/mmcblk0 p It will show you the list, as shown below:
Number Start End Size File system Name Flags
1 4194kB 25.2MB 21.0MB ext4 efs
2 25.2MB 33.6MB 8389kB param
3 33.6MB 50.3MB 16.8MB boot
4 50.3MB 83.8MB 33.5MB recovery
5 83.8MB 83.9MB 65.5kB metadata
6 83.9MB 88.1MB 4194kB misc
7 88.1MB 400MB 312MB ext4 cache
8 400MB 1481MB 1081MB ext2 system
9 1481MB 15.8GB 14.3GB ext4 userdata
Step 11: Now run the command: mount -a (This command didn't work for me. Gave me errors. I rebooted from TWRP in to Recovery mode again) and then type exit.
Now you can follow your guide to flash your custom rom with GAPPS. Enjoy!!!!
Biomus
Hi,
Click to expand...
Click to collapse
Thanks for this article,
I am having problems.
I have opened a terminal in the folder where the parted script is ( I am using linux )
The command adb push parted, returns the error ''usage requires an argument''
I regularly push files to my nexus 10 , but use the argument adb push xxxx /sdcard.
This pushes it to the sd card.
Consequently, I cannot go beyond the first part of this tutorial :-(
If I can push parted to sdcard, I am not sure how to chmod it from the sdcard.
many Thanks
Pootler
biomus said:
https://mega.nz/#!Rk0VCKrY!E84TJmMa9_MD5a8Wn9V7KMGgF-_SCCmXKbLahPneqKg
Click to expand...
Click to collapse
pootler said:
Thanks for this article,
I am having problems.
I have opened a terminal in the folder where the parted script is ( I am using linux )
The command adb push parted, returns the error ''usage requires an argument''
I regularly push files to my nexus 10 , but use the argument adb push xxxx /sdcard.
This pushes it to the sd card.
Consequently, I cannot go beyond the first part of this tutorial :-(
If I can push parted to sdcard, I am not sure how to chmod it from the sdcard.
many Thanks
Pootler
Click to expand...
Click to collapse
I just followed the instructions (I am using a Windows 10 PC and Nexus 10).
Step 1 - just follow the instructions
Step 2 - in TWRP open terminal (Advanced->Terminal) and then on your PC open a command prompt where you have adb installed and enter "adb devices" (without the quotes) and expect to get a line printed with your device number and "recovery" in the text. From what you said I guess you are familiar with this bit.
Step 3 - from the downloaded ZIP file (from mega.nz or the link provided) extract the "parted" file to somewhere on your PC, e.g. c:\users\me\desktop\parted and then in the PC command prompt enter "adb push c:\users\me\desktop\parted /" (without the quotes)
Step 4 - I originally did this in the PC command window "adb shell" and "chmod +x parted"
Steps 5-11 - these are done in the TWRP terminal. I too got an error when doing "mount -a" (couldn't mount 3 things) but I then entered "mount -a" again and then it only failed to mount the USB-OTG which was to be expected.
IMPORTANT
I used these instructions to resize the /system to install the following 3 files
lineage-16.0-20210620-UNOFFICIAL-manta.zip
Magisk-v23.0.apk
open_gapps-arm-9.0-pico-20210717.zip
from https://forum.xda-developers.com/t/rom-unofficial-9-lineage-16-0-manta-nexus-10.4175477/ but found the 400 value still left too small a /system so changed it to 330 (the GApps log file, at bottom, said I needed an additional 56712 bytes [approx 55.4KB] so I increased the system size by 70KB by changing 400 to 330). Remember you need to use the 330 in both of the 2 "mkpart" commands. After doing that all 3 files were installed OK, I then chose the "Wipe Cache/Dalvik" button (on the Install Zip page) and then "Reboot System" button to start the initial ROM setup.
I hope that helps.

[TUTORIAL] How to resize system partition on Galaxy S3 for larger GAPPS

On newer Android versions, the system occupies more of the system partition and with GAPPS upgrades, larger GAPPS packages (such as stock and mini) cannot fit on the system partition of the 2012 Galaxy S3. You can just use pico or nano, but sometimes you want the full GAPPS, the real deal. This is also necessary for upcoming ROMs that come with GAPPS preinstalled, such as Pixel Experience. To do this, you must resize the system partition. You can do this by taking some of the space from the cache partition and giving it to the system partition.
PLEASE NOTE: This process is not risk-free! If you do not know what you are doing, I strongly advise against this procedure. I am not responsible for any bricked devices or issues you may face. You have been warned.
Requirements:
A Samsung Galaxy S3. I have the i9300 model, where I have tested it.
parted, downloadable from here. If it downloads as a txt file, delete the extension by renaming it without the txt.
TWRP installed on your device (available for i9300 from here.)
A computer with ADB installed and relevant drivers.
First of all, you must boot TWRP. Once booted, wipe all partitions in TWRP, including system. Reboot back into recovery. Then go into mount and deselect all devices, and uncheck the box saying "Mount system partition as read-only"
Secondly, connect your S3 and send parted to the device with the following command:
Code:
adb push <path_to_parted> /
Thirdly, enter the ADB shell with the following command:
Code:
adb shell
Now, give executable permission to the parted file with the following command:
Code:
chmod +x parted
Now run:
Code:
./parted /dev/block/mmcblk0
Run the print command and you will get a list of partitions. It should look something like:
Code:
Model: MMC VTU00M (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 4194kB 8389kB 4194kB BOTA0
2 8389kB 12.6MB 4194kB BOTA1
3 12.6MB 33.6MB 21.0MB ext4 EFS
4 33.6MB 41.9MB 8389kB PARAM
5 41.9MB 50.3MB 8389kB BOOT
6 50.3MB 58.7MB 8389kB RECOVERY
7 58.7MB 92.3MB 33.6MB RADIO
8 92.3MB 1166MB 1074MB ext4 CACHE
9 1166MB 2777MB 1611MB ext4 SYSTEM
10 2777MB 3364MB 587MB ext4 HIDDEN
11 3364MB 3372MB 8389kB OTA
12 3372MB 15.8GB 12.4GB ext4 USERDATA
Make a note of the Start and End points for partitions 8 and 9 (CACHE and SYSTEM). In my case, the start and end points for partition 8 are 92.3 and 1166 and the start and end points for partition 9 are 1166 and 2777.
What we're going to do is delete these two partitions, then recreate them, but make the new partition 8 (Cache) smaller and allocate the space left to partition 9 (System).
Remove them with the following commands in parted:
Code:
./parted /dev/block/mmcblk0 rm 8
./parted /dev/block/mmcblk0 rm 9
Now recreate them with the following commands:
Code:
./parted /dev/block/mmcblk0 mkpart primary <cache_start> <cache_start+200>
./parted /dev/block/mmcblk0 mkpart primary <cache_end> <system_end>
Replace <cache_start> with the start of the former cache petition. In my case, it would be:
Code:
./parted /dev/block/mmcblk0 mkpart primary 92.3 292
./parted /dev/block/mmcblk0 mkpart primary 292 2777
Now name the partitions.
Code:
./parted /dev/block/mmcblk0 name 8 CACHE
./parted /dev/block/mmcblk0 name 9 SYSTEM
Then format them as ext4:
Code:
mke2fs -T ext4 /dev/block/mmcblk0p8
mke2fs -T ext4 /dev/block/mmcblk0p9
Run ./parted, followed by print, to check if the changes have been applied. If so, well done! You have successfully enlarged the system partition. Exit parted with the quit command.
Now configure and exit:
Code:
mount -a
exit
Reboot back into recovery and install any ROM of your choice. Once you've installed the ROM, reboot into recovery once again, and navigate to wipe --> advanced wipe, select system, tap repair or change filesystem, then resize.
You can now install any GAPPS of your choice. I've gotten LineageOS 16.0 working with mini gapps (Google Play Store + some Google apps) and it is working fine. You could make the system partition bigger by borrowing some more MB from the cache partition, or experimenting further by taking some from the HIDDEN partition. Remember, I am NOT responsible for any damage done when doing this. You assume full responsibility for any problems with the device. I hope this tutorial did help you, feel free to post here if it did or ask for help if you need it.
Did you experiment this process for a long time ? With so small a cache what could be the consequences ?
A finally do you know what is the use of HIDDEN partition ?
Great tutorial anyway.
barbe31 said:
Did you experiment this process for a long time ? With so small a cache what could be the consequences ?
Click to expand...
Click to collapse
Newer Android versions don't use up as much in the cache partition. If you're on say stock ICS or JB you may encounter some issues but if you're using LOS 15 or 16 it should work fine. I've used LOS 16 with GAPPS using this method for a while on my S3 and it's been fine.
ChasTechProjects said:
parted, downloadable from here.
Click to expand...
Click to collapse
Link says file doesn't exist.
petera703 said:
Link says file doesn't exist.
Click to expand...
Click to collapse
parted
drive.google.com
Cheers for that. I've been trying for some time to do the same thing on a Galaxy S4 Mini, working from a few variations of this process that I've found here and there, but never with any success. All appears to go well, with no errors, but it doesn't stick--the device just reverts to the previous partition sizes on reboot..
I've been using parted 3.2. I wondered if it would work with the parted you were using, but the one from your new link is 1.8 and doesn't even get as far for me (tried that one previously and it gets errors on my device).
If anyone know how to overcome the issue of resized partitions not surviving a reboot on Android, please help! I've been unable to solve it.
If it was plain Linux, it would be something to do with fstab, but fstab is never mentioned in the posts where people succeed in resizing Android partitions, so I think it must be something else, and perhaps something that varies from one device to another. Looking forward to any suggestions--thanks!
Can this idea/technique be applied to other *droid based devices
like Nook HD ?
[ Having same 'not enough space for the gaps' issue]

[SM-J500FN] Cannot resize partitions with parted - changes not saved

I booted to TWRP recovery and tried to shrink /system and extend /data in the following way:
Code:
parted /dev/block/mmcblk0
(parted) unit s
(parted) print free
The output (original partition table):
Code:
Model: MMC H8G4u! (sd/mmc)
Disk /dev/block/mmcblk0: 15269888s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
34s 8191s 8158s Free Space
1 8192s 38911s 30720s apnhlos msftdata
2 38912s 156543s 117632s modem msftdata
3 156544s 157567s 1024s sbl1
4 157568s 157631s 64s ddr
5 157632s 161727s 4096s aboot
6 161728s 162751s 1024s rpm
7 162752s 163775s 1024s qsee
8 163776s 164799s 1024s qhee
9 164800s 170943s 6144s fsg
10 170944s 170975s 32s sec
11 170976s 192511s 21536s pad msftdata
12 192512s 212991s 20480s param
13 212992s 241663s 28672s ext4 efs
14 241664s 247807s 6144s modemst1
15 247808s 253951s 6144s modemst2
16 253952s 280575s 26624s boot
17 280576s 311295s 30720s recovery
18 311296s 336897s 25602s fota
19 336898s 351215s 14318s backup legacy_boot
20 351216s 357359s 6144s fsc
21 357360s 357375s 16s ssd
22 357376s 373759s 16384s ext4 persist
23 373760s 374783s 1024s persistent
24 374784s 393215s 18432s ext4 persdata
25 393216s 4653055s 4259840s ext4 system
26 4653056s 5062655s 409600s ext4 cache
27 5062656s 5206015s 143360s ext4 hidden
28 5206016s 15269847s 10063832s ext4 userdata
15269848s 15269854s 7s Free Space
Then I removed last 3 partitions and resized /system:
Code:
(parted) rm 28
(parted) rm 27
(parted) rm 26
(parted) resizepart 25 3186687
(parted) mkpart physical ext4 3186688 3596287
(parted) name 26 cache
(parted) mkpart physical ext4 3596288 3602431
(parted) name 27 hidden
(parted) mkpart physical ext4 3602432 15269847
(parted) name 28 userdata
(parted) quit
Then you need to sync changes to be able to mount /system again:
Code:
sync
blockdev --flushbufs /dev/block/mmcblk0
partprobe
However, nothing is changed. All sizes remained old.
Code:
parted /dev/block/mmcblk0 print free
After mounting partitions in TWRP or after reboot to system the partition sizes remain old.
What am I doing wrong? Has Samsung Galaxy J5 (SM-J500FN) any hardware lock? Do I need to perform resizing in download mode?
One more think to mention. Util parted downloaded from there. All changes were visible after "print free" before "quit". But I also tried parted from another thread and changes were not appliedd after "print free".
Anyone tried to shrink /system partition with this util?
GitHub - Lanchon/REPIT: A Device-Only Data-Sparing Repartitioning Tool For Android
A Device-Only Data-Sparing Repartitioning Tool For Android - GitHub - Lanchon/REPIT: A Device-Only Data-Sparing Repartitioning Tool For Android
github.com
Script looks good but there are some questions:
resize2fs - does it defrag file system before shrinking it? Otherwise system would be lost.
is this chunk-by-chunk data moving in function processParMove() necessary in 2021? No Linux tools that perform partitioning with data move on eMMC drives?
If resize2fs defrags files before shrinking file system, then it should be safe to use REPIT.
Note: For anybody who want to repartition its device manually (in devices where you may do it via adb but in Samsung Galaxy you can't) - do not shrink partitions without resize2fs first.
resize2fs(8) - Linux man page
The resize2fs program will resize ext2, ext3, or ext4 file systems. It can be used to enlarge or shrink an unmounted file system located on device. If the ...
linux.die.net
Edit: and will it even work? AFAIK you need PIT file to repartition Samsung Galaxy in Odin.
Edit 2: Is this forum dead? I'm postponing REPIT on my J5 because GPT seems signed and this may lead to hard brick. Until any other J5 users confirm REPIT is safe, i will stick to soft linking apps from /system to /data and cron job to keep links.
Port Request for HUAWEI Honor 4X Che1-CL20 · Issue #28 · Lanchon/REPIT
Hi Lanchon, Can I have a REPIT configuration file for my HUAWEI Honor 4X Che1-CL20? Thanks. your exact device and device codename. http://www.phonemore.com/phone/huawei-honor-4x-che1-cl20/2184 HUAW...
github.com
Edit 3: Not tried REPIT yet but if you want to try it, you need busybox installed. It will NOT work with toybox that is installed by default in stock ROMs.

Categories

Resources