Still Stuck on TWRP, but now able to see device via Linux! - Kindle Fire Q&A, Help & Troubleshooting

Hey all,
So I was able to run KFU and it got me stuck on the boot screen. Got help with that and was able to run KFU again but it got stuck on removing boot check and now I'm stuck with the TWRP homescreen.
My device was recognized in device manager but in the KFU it says ADB Status: Offline and Boot Status Unknown. ADB Device List is empty.
I am unable to mount the device from TWRP it keeps failing. I am also unable to mount the sdcard partition what-so-ever.
Pooch sent me info on how to boot up via usb drive into Linux (Mint) and I can find the device in the adb device list but I am not familiar enough with Linux to know how to push the ROM to the device as well as a better/newer version of TWRP. Any help in this would be greatly appreciated. Thanks.

I sent you full instructions on how to proceed in a pm the reason I chose that system is because its nice and small it will get you going.. you only have 150 mb to work with follow instructions and you should be fine

Issues persist
Hello! So, I was able to detect my device via adb in Linux with the help of ThePooch. (thanks a bunch!!!) However we have a small problem.
I am unable to mount my SD Card partition in TWRP at all. I wasn't sure why so we tried a bunch of stuff: We tried pushing a ROM, We tried mounting it via adb in terminal on Linux... We tried "fastboot oem format"... We tried adb shell echo /dev/block/mmcblk0p12 >> /sys/devices/platform/usb_mass_storage/lun0/file
We tried updating the recovery to TWRP 2.2.2.0.
We tried a lot of things however we were very unsuccessful in this and I am still unable to click "Mount SD Card" in TWRP or format it or wipe it.
What's confusing is that I was able to push files (zips) to the sd card temporarily and see them when we click "install" on TWRP however they fail to install and anything pushed to the sd card is, or course, erased on rebooting.
Really don't know what to do at this point as I am at a loss and would appreciate any assistance in this. Thanks so much!

Boot into recovery and enter:
Code:
adb shell
parted /dev/block/mmcblk0
print
...and post the results here.

soupmagnet said:
Boot into recovery and enter:
Code:
adb shell
parted /dev/block/mmcblk0
print
...and post the results here.
Click to expand...
Click to collapse
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 ext4 system
10 849MB 2041MB 1192MB ext4 userdata
11 2041MB 2309MB 268MB ext4 cache
12 2309MB 7690MB 5380MB media

hmm wish I knew what I was looking at it looks to me like some things still exist even after a full wipe if I`m reading it correct glad soup knows what to look for

sphinxdog said:
Really don't know what to do at this point as I am at a loss and would appreciate any assistance in this. Thanks so much!
Click to expand...
Click to collapse
I've ran into this a couple of times and what I usually do is to delete the "media" partition, create it again with parted, name it "media", and then finally let the stock Kindle Fire recovery repair it. You may be able to skip the delete/create part and just boot into the stock recovery to see if it can repair it.

probably would work if in fact he had a working system but there isnt a bootable one at least..

Code:
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 ext4 system
10 849MB 2041MB 1192MB ext4 userdata
11 2041MB 2309MB 268MB ext4 cache
12 2309MB 7690MB 5380MB media
Thepooch said:
hmm wish I knew what I was looking at it looks to me like some things still exist even after a full wipe if I`m reading it correct glad soup knows what to look for
Click to expand...
Click to collapse
The 'parted' program manipulates the partition table, which basically tells the device how the storage partitions are laid out. The 'print' command used to obtain the output above just displays the information stored in the partition table. I set the output in CODE so it's easier to read. The bottom portion of the data is the more interesting part and you can see the column names there...
Number - This is the partition number. You may have seen "/dev/block/mmcblk0p5" in the past referring to the recovery partition. That number after the letter 'p' refers to the partition number.
Start - This is the offset value for where the partition begins.
End - This is the offset value for where the partition ends.
Size - This is the size of the partition calculated by the difference of the two offset values above. Imagine a ruler where your "Start" offset is the 1 inch tick mark and your "End" offset is the 6 inch tick mark. The "Size" between the tick marks... 6 - 1 is 5.
File system - This is how the partition has been formatted... ext4 is a commonly used filesystem for linux. It's blank if parted doesn't recognize the filesystem type or none has been specified.
Name - The name given to the partition. You'll recognize some as ones you've used to refer to these partitions in fastboot. FYI, userdata typically gets mounted to /data and media gets mounted to /sdcard.
Flags - Used to indicate special characteristics of the filesystem.
The significant part of the output above is the missing filesystem for the media partition. It should have a fat32 filesystem. I'll leave it to soupmagnet to explain how to fix it.

kinfauns said:
The significant part of the output above is the missing filesystem for the media partition. It should have a fat32 filesystem.
Click to expand...
Click to collapse
As always, kinfains is correct. I've dealt with an issue similar to this on my own device pretty recently, so I knew immediately what we'd be dealing with. So you're going to remove, recreate and repartition your sdcard and then you'll be all set. Needless to say, any data on your sdcard will be lost, if it isn't already. Not to worry though, considering everything you have gone through up until this point, this part should be pretty painless.
Code:
adb shell
parted /dev/block/mmcblk0
rm 12
mkpartfs primary fat32 2309 7690
name 12 media
quit
mount /sdcard
exit
adb reboot
You may not need to reboot, but in my case, I did. You'll then be able to mount your sdcard over USB, or use "adb push" to transfer a ROM to flash in recovery. Just remember to wipe System and "Factory Reset" in recovery first, or you may very well find yourself in the exact same situation as before.
Have fun.

SUCCESS!!!! That took care of it! And I was able to load up the ROM with no problem. Thanks for all the help ThePooch & SoupMagnet!!!
Sent from my Kindle Fire using xda app-developers app

Related

[Q]: repartitioning hiccup [solved]

Ok, I posted this question in 2 other threads that had info on the process (will delete the posts when this one goes live), but no responses after a couple of days. One of them is old though.
I have TWRP 2.1.1 installed. ADB seems to be working normally. Superuser is working fine after booting to android. I'm running a custom ICS ROM (Energy); read that stock ROM can cause issues repartitioning.
I started with this How-to as it looked very straight forward.
I start throwing the commands at ADB and here's what I got for my efforts:
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
~ # su
su
/sbin/sh: su: not found
~ # cd /data
cd /data
/data # ls
ls
/data #
decided to go ahead and check the mount command:
Code:
~ # mount
mount
rootfs on / type rootfs (rw)
tmpfs on /dev type tmpfs (rw,relatime,mode=755)
devpts on /dev/pts type devpts (rw,relatime,mode=600)
proc on /proc type proc (rw,relatime)
sysfs on /sys type sysfs (rw,relatime)
~ #
and parted just for giggles:
Code:
~ # parted /dev/block/mmcblk0
parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(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 ext4 system
10 849MB 2041MB 1192MB ext4 userdata
11 2041MB 2309MB 268MB ext4 cache
12 2309MB 7690MB 5380MB fat32 media
(parted)
Ok, so that much worked. Now I tried to shrink 12 so I could double the size of 9. I want to get Switchme set up for his/her profiles and 500MB just isn't going to cut it.
That's when I hit a brick wall:
Code:
(parted) resize 12 2846 7690
resize 12 2846 7690
resize 12 2846 7690
Error: Unable to satisfy all constraints on the partition.
(parted)
One thing that jumps out at me right away is this:
Code:
adb shell
~ # su
su/sbin/sh: su: not found
It seems you are not actually rooted.
To check, enter:
Code:
adb shell
ls /system/xbin
If you don't see "su" in the list, then you don't have root permissions, which would probably prevent you from doing what you need to accomplish.
That's what I was wondering, but apps are able to ask for and receive root permission from within the ROM. SU does exist, just not where the shell is looking when in recovery.
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
~ # ls /system/xbin
ls /system/xbin
ls: /system/xbin: No such file or directory
~ #
I did an ls /system/xbin from adb shell and from Terminal Emulator within Android and both returned a long list containing SU.
TWRP provides an unsecured (unsecure? insecure?) boot. Whatever the terminology, it gives you immediate access to root privileges. Apparently CWMR (which was used in the OP of the thread you used) does not and so that author had to use su. For TWRP, it's not necessary and not even available. You already have root privileges as indicated by the hash prompt.
I tried resizing my /sdcard partition and it worked fine with the command you tried. I'm not sure what's going on with your storage device that it wouldn't resize it for you. At first I thought it might be mounted, but your mount command shows otherwise and parted gave me a different error when I had it mounted.
I don't know if this is going to help you, but you might try giving it the "MB" suffix in your numbers....
Code:
resize 12 2846MB 7690MB
Maybe even try changing units to bytes and giving the resize command byte sized boundaries.
Code:
unit B
print
will show you the numbers in bytes and you'd have to use the "B" suffix as in the "MB" example above.
If none of that works, you can always remove and remake the partition. For example...
Code:
rm 12
mkpartfs primary fat32 <start> <end>
name 12 media
You'd obviously need to insert acceptable boundaries for the start and end into that command. It might even be easier to just remove all 9, 10, 11, and 12 and remake/rename them, but remember 9, 10, and 11 are ext4 filesystems so the above mkpartfs command needs to be tweaked accordingly.
One thing I noticed while I was experimenting with the partition table this morning... all of the existing partitions have been allocated in 128MB chunks. I have no idea if this affects performance. I'd imagine you'd only need to stick to the 512B sector sizes, but you might want to stay with those conventions if it's not too inconvenient for you.
If you mess up the partition table, you can always go back to fastboot mode in FFF and use the...
Code:
fastboot oem format
feature to bring your partition table back to stock.
Good luck.
Wow, excellent response. Just the kind of detail I was hoping to get and it confirmed a few suspicions I had while searching the kindle threads. I'll report back on my degree of success when I get some free time to tinker.
I have a nandroid backup (also saved to PC) just in case and saved the partition table as-found. If everything gets hosed and I do an oem format I can just restore that and go or try from square one again, yes?
Sent from my TBolt with the XDA App using 1 opposable thumb
ProfEngr said:
Wow, excellent response. Just the kind of detail I was hoping to get and it confirmed a few suspicions I had while searching the kindle threads. I'll report back on my degree of success when I get some free time to tinker.
I have a nandroid backup (also saved to PC) just in case and saved the partition table as-found. If everything gets hosed and I do an oem format I can just restore that and go or try from square one again, yes?
Sent from my TBolt with the XDA App using 1 opposable thumb
Click to expand...
Click to collapse
I'd say that's a safe bet. Just be very careful about handling partitions 1 and 2 because those two are critical to getting anything to boot on your device. As long as you don't touch the xloader in partition 1 and have FFF installed in partition 2, you can rebuild the rest of it.... in theory. I only say "in theory" because I've never actually had to do it, but I don't see why it wouldn't work.
A couple of additional things I figured out after you put me to work with parted....
It looks like parted doesn't know how to make an ext4 filesystem, so mkpartfs balks if you tell it to make one. You'll have to use mkpart which just makes the partition, but not the filesystem. Then exit out of parted and use mke2fs, which despite its name knows how to make an ext4 filesystem. Like this for the cache partition...
Code:
mke2fs -T ext4 /dev/block/mmcblk0p11
The other thing is that parted sets a "msftres" flag on the fat32 filesystem it makes. The flag apparently is to tell the OS that it's reserved for Windows, or something like that. I didn't have a problem mounting in Linux and MacOS X, but the stuff I've read seems to indicate that older OS's have a problem with it. Unfortunately, the version of busybox on TWRP doesn't have a module to make a fat32 filesystem. I'm looking around to see how to get around that.
In any case, this should get you most of the way there. I'll followup if I find something out.
Ok. I used to run n*x, but use only M$ right now. Haven't touched a 'mac' since Jr High (IIgs)
Sent from my TBolt with the XDA App using 1 opposable thumb
ProfEngr said:
Ok. I used to run n*x, but use only M$ right now. Haven't touched a 'mac' since Jr High (IIgs)
Sent from my TBolt with the XDA App using 1 opposable thumb
Click to expand...
Click to collapse
I have a IIgs sitting in the basement... but it's not a mac, it's an Apple ][.
Found the last piece...
Code:
/system/bin/newfs_msdos /dev/block/mmcblk0p12
will make a fat32 filesystem correctly. I think that's all you'll need.
EDIT: OK, I must have been half asleep when I posted the above. That binary is on the stock system software I had mounted. There's nothing on TWRP to create a fat32 filesystem correctly.
Yeah, ][e was my first computer that didn't crash at the drop of a keystroke. Had an Adam tape drive model, but it froze up constantly.
Sent from my TBolt with the XDA App using 1 opposable thumb
So, I met with success following the repartition thread and tweaking it with your suggestions. I didn't quite move and many MB around as I thought, but it was enough to move me a little farther down the road with SwitchMe. At least it doesn't tell me I don't have enough memory for a 2nd profile now.
I still think it has issues with ICS or EnergyROM itself. When I created a new profile and rebooted to it I was stuck on Nova launcher instead of GO like the main profile. Strange.
I'll consider this thread to have fulfilled its usefulness. Thanks again for the help.
no device found
ProfEngr said:
So, I met with success following the repartition thread and tweaking it with your suggestions. I didn't quite move and many MB around as I thought, but it was enough to move me a little farther down the road with SwitchMe. At least it doesn't tell me I don't have enough memory for a 2nd profile now.
I still think it has issues with ICS or EnergyROM itself. When I created a new profile and rebooted to it I was stuck on Nova launcher instead of GO like the main profile. Strange.
I'll consider this thread to have fulfilled its usefulness. Thanks again for the help.
Click to expand...
Click to collapse
I get
(parted)
Error: No device found
Retry/Cancel

Unable to mount data & cache

Hi all, got my kindle fire brick. I think my partition is messed up. I bought a factory cable which able me to install twrp and i succefully(i guess) flashed energy ICS. But it prompt me "e:unable to mount '/data" e:unable to mount '/cache". I were to boot to normal boot it will just boot endlessly but i still can access to fff and twrp.i did some research on repartitioning for kindle fire but i need some guidance. Help is much appreciated
Sent from my GT-I9100 using xda app-developers app
Usually this is a fairly bad indication but do this go to the mount section in twrp and make sure there are no checks in the boxes of data and system if so uncheck them, I know you said data and cache but this should have a check in the box then try a reboot also were you previously using cwmr? If so you may have been bitten by the bug a very unsightly one that generally means the death of your kindle unless you know how to repartition around a broken emmc. What did you do prior to this that caused this to happen?
Also energy is not the best for good mounting just saying...
I was using fireparted to backup my partition when my pc suddenly shut down. Thats when everything screws up. Also my data and cache are not able to check or uncheck. I hope theres a kind soul to guide me through this process
Sent from my GT-I9100 using xda app-developers app
If you ask me I would say its toast but maybe someone knows a way to restore factory partitions I know many are looking for a solution for thier parts only kindle....
From what I understand...
Code:
fastboot oem format
...will rewrite your partition table to stock. And as long as you haven't messed with the partition sizes, your data will stay intact.
Enter:
Code:
shell cat /proc/partitions
To get a list of your current partitions and sizes to check to see if they even exist to begin with. And if so, it's likely just a case of broken or missing mountpoints.
Now, whether or not "fastboot oem format" will restore broken or missing mountpoints, I couldn't tell you for sure; I've never had to try it. But in your situation, it probably couldn't hurt to try.
You can also recreate mountpoints manually if needed.
[Edit:] It has just been explained to me that "fastboot oem format" won't do anything about mountpoints.
Assuming you can get into TWRP and run adb shell, execute the following command...
Code:
adb shell parted /dev/block/mmcblk0 unit b print
Note: version 2.2.0 is missing the parted binary, so you'll need to use 2.1.1
This will give you a detailed layout of your storage device and the filesystems for each partition. I'm running from memory here, but the right column should show the filesystem types it sees for that particular partition. For userdata (which is mounted as data) and cache, those should be ext4. If you don't see that, you need to remake those partitions.
Code:
adb shell mke2fs -T ext4 /dev/block/mmcblk0p10
adb shell mke2fs -T ext4 /dev/block/mmcblk0p11
Then you can repeat the parted command above and see if the commands worked. If the commands were successful, you can use the mount command or it's probably easier to just reboot into TWRP and it should do it automatically.
kinfauns said:
Assuming you can get into TWRP and run adb shell, execute the following command...
Code:
adb shell parted /dev/block/mmcblk0 unit b print
Note: version 2.2.0 is missing the parted binary, so you'll need to use 2.1.1
This will give you a detailed layout of your storage device and the filesystems for each partition. I'm running from memory here, but the right column should show the filesystem types it sees for that particular partition. For userdata (which is mounted as data) and cache, those should be ext4. If you don't see that, you need to remake those partitions.
Code:
adb shell mke2fs -T ext4 /dev/block/mmcblk0p10
adb shell mke2fs -T ext4 /dev/block/mmcblk0p11
Then you can repeat the parted command above and see if the commands worked. If the commands were successful, you can use the mount command or it's probably easier to just reboot into TWRP and it should do it automatically.
Click to expand...
Click to collapse
Pardon me for my Noob-ness, are the code to be execute on pc or on TWRP?
dean11 said:
Pardon me for my Noob-ness, are the code to be execute on pc or on TWRP?
Click to expand...
Click to collapse
Step back a bit and figure out how all of these things work together by reading the first 3 posts here...
http://forum.xda-developers.com/showthread.php?t=1552547
It will be a lot easier for you to understand what you are doing and why you are doing them. It will also explain how and where to run the commands.
kinfauns said:
Step back a bit and figure out how all of these things work together by reading the first 3 posts here...
http://forum.xda-developers.com/showthread.php?t=1552547
It will be a lot easier for you to understand what you are doing and why you are doing them. It will also explain how and where to run the commands.
Click to expand...
Click to collapse
OH MY GOOOOD!!!! MY KINDLE IS ALIVE!!!! THANK YOU SO MUCH @kinfauns!
kinfauns said:
Assuming you can get into TWRP and run adb shell, execute the following command...
Code:
adb shell parted /dev/block/mmcblk0 unit b print
Note: version 2.2.0 is missing the parted binary, so you'll need to use 2.1.1
This will give you a detailed layout of your storage device and the filesystems for each partition. I'm running from memory here, but the right column should show the filesystem types it sees for that particular partition. For userdata (which is mounted as data) and cache, those should be ext4. If you don't see that, you need to remake those partitions.
Code:
adb shell mke2fs -T ext4 /dev/block/mmcblk0p10
adb shell mke2fs -T ext4 /dev/block/mmcblk0p11
Then you can repeat the parted command above and see if the commands worked. If the commands were successful, you can use the mount command or it's probably easier to just reboot into TWRP and it should do it automatically.
Click to expand...
Click to collapse
I have the similar situation.
And when I use "parted" to check my kidle partition, there is no cache, and the userdata is ext2.
Number Start End Size File system Name Flags
1 131072B 262143B 131072B xloader
2 262144B 524287B 262144B bootloader
3 524288B 11010047B 10485760B dkernel
4 11010048B 212336639B 201326592B ext4 dfs
5 212336640B 229113855B 16777216B recovery
6 229113856B 296222719B 67108864B ext4 backup
7 296222720B 306708479B 10485760B boot
8 306708480B 311951359B 5242880B ext4 splash
9 311951360B 848822271B 536870912B ext4 system
10 848822272B 849000447B 178176B ext2 userdata
12 2448000000B 7748000255B 5300000256B fat32 media msftres
When I use the mke2fs to change the file system type, it returns this error
Not enough space to build proposed filesystem while setting up superblock.
Please help!
Thank you in advance!
june12 said:
I have the similar situation.
And when I use "parted" to check my kidle partition, there is no cache, and the userdata is ext2.
Number Start End Size File system Name Flags
1 131072B 262143B 131072B xloader
2 262144B 524287B 262144B bootloader
3 524288B 11010047B 10485760B dkernel
4 11010048B 212336639B 201326592B ext4 dfs
5 212336640B 229113855B 16777216B recovery
6 229113856B 296222719B 67108864B ext4 backup
7 296222720B 306708479B 10485760B boot
8 306708480B 311951359B 5242880B ext4 splash
9 311951360B 848822271B 536870912B ext4 system
10 848822272B 849000447B 178176B ext2 userdata
12 2448000000B 7748000255B 5300000256B fat32 media msftres
When I use the mke2fs to change the file system type, it returns this error
Not enough space to build proposed filesystem while setting up superblock.
Please help!
Thank you in advance!
Click to expand...
Click to collapse
I don't know who or what did that to your partition table, but partitions 10-12 are not right. It looks like mke2fs is complaining because your userdata partition is only ~178KB. I'm also a bit concerned that you've extended the media partition as far as you have. You might have some additional problems there.
The easiest way for you to get started on a fix is to get into fastboot mode with FFF and run...
Code:
fastboot oem format
That will bring your partition table back to stock, so you can run those mke2fs commands to remake those filesystems on the two partitions. You'll also have to remake the media partition in parted. You can find some instructions on how to do that here...
http://forum.xda-developers.com/showthread.php?t=1658885
Hey,
My current ROM is fine, but I can't mount data & cache in TWRP.
Nothing happens when I click mount data or mount cache in TWRP 2.6.3.1
I reflashed twrp two times and checked the md5sum.
When I try to backup my rom:
When I try a factory reset:
This is what I tried in fastboot:
Code:
fastboot oem format
...
OKAY [ 0.064s]
finished. total time: 0.065s
fastboot oem idme bootmode 4000
...
OKAY [ 0.081s]
finished. total time: 0.081s
fastboot reboot
rebooting...
finished. total time: -0.000s
adb shell cat /proc/partitions
major minor #blocks name
7 0 8348 loop0
179 0 7553024 mmcblk0
179 1 128 mmcblk0p1
179 2 256 mmcblk0p2
179 3 10240 mmcblk0p3
179 4 196608 mmcblk0p4
179 5 16384 mmcblk0p5
179 6 65536 mmcblk0p6
179 7 10240 mmcblk0p7
179 8 5120 mmcblk0p8
179 9 524288 mmcblk0p9
179 10 1164288 mmcblk0p10
179 11 262144 mmcblk0p11
179 12 5254144 mmcblk0p12
179 64 512 mmcblk0boot1
179 32 512 mmcblk0boot0
254 0 8347 dm-0
The parted command isn't working for me.
I have never repartitioned them as far as I know.
Wha't wrong with my partitions?

[Q] Pulling my hair out over Dual Booting!

Ok, I'm 90% of the way to getting my Kindle exactly how I want it, but I'm getting stuck at the last hill. Let me take you through a step by step of what I've done, and then what I want to do, and lets see if I can get some help and finally get this thing working!
I bought my 1st Gen Kindle a year after it came out, and immediately rooted it. Within a month, I put some old version of TWRP on and flashed to a custom ROM. Since then I've purchased Amazon Prime and wish to be able to use my Kindle with it. this involves having a perfectly Stock, non-rooted ROM installed. Thus began my nightmare of trying to get it back into such a state.
After 3 hours of running down dead end paths, I finally ran the latest Kindle Fire Utility (0.9.9) and had to finally use COTR recovery to flash the 6.2.3 stock rom because I was getting all sorts of errors using TWRP.
Now I have a perfectly back to Stock Kindle, but I still want Gapps and Netflix, but without rooting my device to break video streaming. Solution? Dual boot!
Ran the TWRP installer, and then the FFF installer. Then ran the Dual Boot installer, choosing the option to prepare FFF for dual booting. Now my kindle has the FFF bootloader, can boot into Stock as the primary and can boot into TWRP Recovery. However, when I tried to flash an alt rom (SBloods' ROM found https://code.google.com/p/kindle-alt-roms-cm10-cm9-dev/downloads/list ) it says it completes successfully, however when I attempt to boot into the alterante boot, it just stays at the Fastboot Booting screen.
What do I need to do and/or use in order to get my alt ROM (or any alt ROM) booting properly?
asrrin29 said:
Ok, I'm 90% of the way to getting my Kindle exactly how I want it, but I'm getting stuck at the last hill. Let me take you through a step by step of what I've done, and then what I want to do, and lets see if I can get some help and finally get this thing working!
I bought my 1st Gen Kindle a year after it came out, and immediately rooted it. Within a month, I put some old version of TWRP on and flashed to a custom ROM. Since then I've purchased Amazon Prime and wish to be able to use my Kindle with it. this involves having a perfectly Stock, non-rooted ROM installed. Thus began my nightmare of trying to get it back into such a state.
After 3 hours of running down dead end paths, I finally ran the latest Kindle Fire Utility (0.9.9) and had to finally use COTR recovery to flash the 6.2.3 stock rom because I was getting all sorts of errors using TWRP.
Now I have a perfectly back to Stock Kindle, but I still want Gapps and Netflix, but without rooting my device to break video streaming. Solution? Dual boot!
Ran the TWRP installer, and then the FFF installer. Then ran the Dual Boot installer, choosing the option to prepare FFF for dual booting. Now my kindle has the FFF bootloader, can boot into Stock as the primary and can boot into TWRP Recovery. However, when I tried to flash an alt rom (SBloods' ROM found https://code.google.com/p/kindle-alt-roms-cm10-cm9-dev/downloads/list ) it says it completes successfully, however when I attempt to boot into the alterante boot, it just stays at the Fastboot Booting screen.
What do I need to do and/or use in order to get my alt ROM (or any alt ROM) booting properly?
Click to expand...
Click to collapse
Boot into recovery and enter the following commands:
Code:
adb shell parted /dev/block/mmcblk0
print
If the shell complains that 'parted' isn't installed, you can install it temporarily (until reboot).
1)Download 'parted' here: http://d-h.st/h81
2) place the 'parted' binary in the same directory from which you are entering your commands and enter the following:
Code:
adb push parted /sbin/parted
adb shell chown 0.0 /sbin/parted
adb shell chmod 755 /sbin/parted
Once you have 'parted' running and have entered the 'print' command to print the partition table, copy it and post it here.
Here's the output:
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
~ # ←[6nparted /dev/block/mmcblk0
parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(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 ext4 system
10 849MB 2041MB 1192MB ext4 userdata
11 2041MB 2309MB 268MB ext4 cache
12 2309MB 7690MB 5380MB fat32 media
(parted)
asrrin29 said:
Here's the output:
Code:
C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell
~ # ←[6nparted /dev/block/mmcblk0
parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(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 ext4 system
10 849MB 2041MB 1192MB ext4 userdata
11 2041MB 2309MB 268MB ext4 cache
12 2309MB 7690MB 5380MB fat32 media
(parted)
Click to expand...
Click to collapse
Well there's your problem. In order to have a dual boot, you have to have separate sets of partitions for both boots. You should go back to the instructions for dual booting and see what you missed.
Hint: you should have a total of 16 partitions.
Ok, so I redid the the dual-boot and set up the partitions, but now I am unable to copy files to the sdcard. I keep getting an Error: 80070057 the parameter is incorrect.
I tried installing SBlood's ROM and this time it restarts the recovery everytime it goes to initialize scripts. I then tried to get a different ROM (The MIUI one) onto the kindle by using ADB push, and I get an unknown error when trying to install it.
asrrin29 said:
Ok, so I redid the the dual-boot and set up the partitions, but now I am unable to copy files to the sdcard. I keep getting an Error: 80070057 the parameter is incorrect.
I tried installing SBlood's ROM and this time it restarts the recovery everytime it goes to initialize scripts. I then tried to get a different ROM (The MIUI one) onto the kindle by using ADB push, and I get an unknown error when trying to install it.
Click to expand...
Click to collapse
What did you use to set up your partitions? Did you create them manually or did you use the format-all.zip?
soupmagnet said:
What did you use to set up your partitions? Did you create them manually or did you use the format-all.zip?
Click to expand...
Click to collapse
I used the altrom-format-all.zip that came with KFU 0.9.9.
asrrin29 said:
I used the altrom-format-all.zip that came with KFU 0.9.9.
Click to expand...
Click to collapse
The error you are receiving may be a problem with Windows, and not necessarily the device or the dual boot.
Try the following and see if it makes a difference:
http://support.microsoft.com/kb/982736
soupmagnet said:
The error you are receiving may be a problem with Windows, and not necessarily the device or the dual boot.
Try the following and see if it makes a difference:
http://support.microsoft.com/kb/982736
Click to expand...
Click to collapse
The error only happens on the dual booted Kindle. I can plug any other android device, or my kindle when it's in single boot mode, and it doesn't happen.
asrrin29 said:
The error only happens on the dual booted Kindle. I can plug any other android device, or my kindle when it's in single boot mode, and it doesn't happen.
Click to expand...
Click to collapse
When you print your partition table, does the media partition have "msftres" beside it?

[NooB Guide] Increase Internal Storage of XS/XSL

Attention!​ I know there are already some posts about it. If you find it annoying PLEASE ignore this post. Do Not bother to comment. Just Ignore it.​
Disclaimer: I'm Not Responsible for Anything. If you wish do it as your own risk.​
These things are goning to happen
For the reason of Formating data will be lost - So backup everything to PC
You'll lose google sign in, contacts, messages, social networking etc. - backup before proceed
Things You will Need
Drivers - For Detecting your device properly (Sony Users can use "Flashtool")
ADB - Use mini version. You don't have to install Android SDK for this
USB Cable
CMD - Use "ConEmu" or "Console2" more flexible than cmd. Provides easy copy of text from console
TWRP Recovery - Download it from twrp site
I'm Going to put this assuming you as Novice. So I'll Explain as much as possible
Step 1 -
* Installing flashtool
Download flashtool from the link given above
Install flashtool as usual.
Then from "C:\Flashtool\drivers" install drivers for your phone.
Open Flashtool (Keep it open for this step)
* Phone Detection
After installing drivers - enable "USB debugging" in phone. Connect your phone to pc see if it is detected or not.
If not try doing uninstall & installing flashtool again. If it is not detected yet I shall say "STOP" forget partitioning. Look in the forum for a solution. Fix it and then continue.
If your device detects properly in normal mode then proceed
Turn off phone. Connect USB cable to PC and while pressing volume up button and connect cable to Phone.
A blue light will flash & Driver will install if necessary. In Flashtool window it will show fastboot mode after detecting phone. If not "STOP" try again. Fix it and then continue.
Step 2 - Install mini adb
If you have downloaded mini ADB.exe version install it to root directory of PC for example C:\ADB. Double click to open the .exe when ask for location of install show to C:\ADB
If you have downloaded Mini ADB as .zip/.rar file. Right click on the file> Extract to > C:\ADB
Step 3 - TWRP
Download from the link given above.
Move Downloaded TWRP image such as twrp-3.0.0-0-nozomi.img to ADB folder (C:\ADB)
Rename the file to twrp.img.
(Optional) - also move rom.zip for later use. If you want to install a fresh rom.
Step 4 - Kernel flash
* Flashing Kernel by flashtool
Turn off phone, conncet it to pc while pressing volume + button
open flashtool> flash device (thunder icon)> fastboot> Flash kernel> select twrp-3.0.0-0-nozomi.img
See the flashtool log if it says "OK" then Reboot/start the phone. Otherwise redo this step.
When starting press volume + - button several time it will bring up recovery screen.
* Flashing kernel into Fota Kernel.
You have to Upload the recovery.img into your phone & Flash to do this: Open Command Window by default in windows it is called cmd.
Opening Command window
* By CMD:
Go to ADB folder> Press Shift + Right Mouse button> Open Command window here> it will open a command window
* Using Other console software:
ConEmu or Console2 can't be open this way. You have to use "cd" command to go to adb folder.
In conEmu or console2 write: cd your adb location for example: cd c:\ADB
Now write these in command window-
adb push twrp.img /sdcard/ <<<<---- this will copy twrp.img to your phone sdcard. Remember to change recovery name to twrp.img
dd if=/sdcard/twrp.img of=/dev/block/mmcblk0p11 <<<<---- this will write twrp to FOTA block of your phone.
** Rebooting phone will bring up recovery screen. In the recovery screen it will ask you whether system should be put into "Read only mode". Don't do that.
** In twrp Go to Mount> deselect System, data, cache, Sdcard and read only system > select again > again Deselect
Before You Procced Any Further Make Sure:
PC can detect your device Normally
PC Can detect device in Fastboot mode
If you really want to do this or not?
Step 5 - Partitioning
[*] Connect USB Cable while in TWRP recovery. (It dosen't matter which screen you are in just Stay in twrp recovery)
[*] Open ADB Folder> Open CMD or ConEmu from there (See Step 4 - opening command window section for this)
Write these command
adb shell <<<<----- it will start ADB
then write
fdisk /dev/block/mmcblk0 <<<<----- It will enable partitioning commands to work
This will bring some info & It will Look Like this:
The number of cylinders for this disk is set to 973824.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)
Command (m for help):
**NOTE** " Command (m for help): " will show automatically if you successfuly entered in partitioning mode if not redo steps again.​
Now we need to see each block of default partition and detect SDCARD & Internal Storage: Write this-
p <<<<<<----- This will print or show each partition. Command (m for help): already be there just write p for example Command (m for help): p
It will show this:
Code:
[HIDE]Disk /dev/block/mmcblk0: 31.9 GB, 31910264832 bytes
4 heads, 16 sectors/track, 973824 cylinders
Units = cylinders of 64 * 512 = 32768 bytes
Device Boot Start End Blocks Id System
/dev/block/mmcblk0p1 1 65 2048 f0 Linux/PA-RISC boot
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2 * 65 81 512 4d Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3 129 768 20480 48 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4 769 954240 30511104 5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5 785 800 512 46 Unknown
/dev/block/mmcblk0p6 833 928 3072 4a Unknown
/dev/block/mmcblk0p7 961 1056 3072 4b Unknown
/dev/block/mmcblk0p8 1089 1184 3072 58 Unknown
/dev/block/mmcblk0p9 1217 1376 5120 70 Unknown
/dev/block/mmcblk0p10 1409 1664 8192 83 Linux
/dev/block/mmcblk0p11 1665 2176 16384 f0 Linux/PA-RISC boot
/dev/block/mmcblk0p12 2177 34944 1048576 83 Linux
/dev/block/mmcblk0p13 34945 42944 256000 83 Linux
/dev/block/mmcblk0p14 42945 108480 2097152 83 Linux
/dev/block/mmcblk0p15 108481 954240 27064320 c Win95 FAT32 (LBA)
Command (m for help):[/HIDE]
STOP​COPY THESE PARTITIOIN INFO TO A TEXT FILE AND SAVE IT. EVERY PHONE HAS SEPERATE PARTITION SETTING. IF ANYTHING GOES WRONG IT WILL BE NECESSARY TO SEE AND GIVE EXACTLY SAME VALUE TO RECOVER ORIGINAL PARTITION.​
Identifying SDCARD & Internal Storage - From the print output we see lots of blocks and lots of data. But We need to know which partition belongs to which.
/dev/block/mmcblk0p14 <<<---- this is the Internal Storage. See the blocks column its like 2 GB (2097152)
/dev/block/mmcblk0p15 <<<---- this is the SDCARD. Blocks look like it's around 27GB and there is also win95 FAT32 type partition.
As we need to increase Internal Storage Size. From where these extra storage will come from? Well, it's from SDCARD. That's why SDCARD & Internal Storage has to be deleted and repartition again. As for delete do this
d <<<<<---- for deleting partition Command (m for help): d
Partition number (1-15): <<<<---- it will ask which partition you want to delete?
15 <<<<<---- First delete mmcblk0p15
then again give
d <<<<<---- for deleting partition Command (m for help): d
Partition number (1-15): 14 <<<<----- Deletes Internal storage partition which is mmcblk0p14
You can give P command to see whether those partition deleted or not
Command (m for help): p
Now creating new partition for Internal storage. Write
n <<<<<----- this is for creating new partition Command (m for help): n
this will show this:
Code:
First cylinder (769-954240, default 769):
To Understand properly look at this table you generated earlier using p command:
Code:
start end
/dev/block/mmcblk0p13 34945 42944
/dev/block/mmcblk0p14 42945 108480
/dev/block/mmcblk0p15 108481 954240
Here mmcblk0p13 started ended at 42944. mmcblk0p14 started at 42945. And mmcblk0p14 ended 108480 just after that mmcblk0p15 started at 108481. Ending is beginning. Quiet easy actually.
So when asked to put first cylinder: you take mmcblk0p13 end value plus 1 write that in first cylinder. for example if End value of mmcblk0p13 is 2 then first cylinder will be 3. if mmcblk0p13 end value is 1000 then first cylinder value will be 1001. if mmcblk0p13 End value is 42900 then first cylinder Value will be 42901. I think that's enough for understanding.
First cylinder (769-954240, default 769): 42945 [<<<<----- in my case mmcblk0p13 end value is 42944 so first cylinder value is 42945 this will not be same for you. press Enter]
Then it will ask for Last Cylinder value: There is three way to put this in kilobyte, in megabyte or in default size but we have to put + sign before size. For example: +100000k or +4000M or +2000000. Easiest one will be using Megabyte. 4000 megabyte is 4 gb, 8000 is 8GB. By default when partitioning system keep some space for recording partition info that's why we never get full size in Memory card, Hard disk, Flash drive etc. This will also be applied here. If you give +4000M command you will get 3.6GB or 3.7GB Something like that. So calculate give some more to keep it even if you want.
Code:
Last cylinder or +size or +sizeM or +sizeK (42945-954240, default 954240):
I want my internal storage is around 4GB So I Gave
+4192 <<<<----- Last cylinder or +size or +sizeM or +sizeK (42945-954240, default 954240): +4192
Now The SDCARD Partition. To create This partition we have to give First cylinder value. As we don't know mmcblk0p14 has which Ending cylinder value. We have to generate the partition table and see. So give the P command.
Command (m for help): p <<<<--- shows partition table. Note the END Value of mmcblk0p14. suppose End value is 170875
Give n command
Command (m for help): n <<<<--- new partition for SDCARD or mmcblk0p15. It will ask for first cylinder
First cylinder (769-954240, default 769): <<<<---- put noted Ending value of mmcblk0p14 + 1 here. (170875+1 = 170876) press enter
Now Last cylinder: Just press enter it will take default
Last cylinder or +size or +sizeM or +sizeK (42945-954240, default 954240):
Change partition type for SDCARD by giving these command.
Command (m for help): t <<<--- t for change partition type.
Partition number (1-15): 15 <<<--- It asks which partition to be changed give 15 for SDCARD/mmcblk0p15
Hex code (type L to list codes): c <<<--- FAT32 from win95 for most compatibility give c to choose this. Do not change to any other system type it might not recognized by PC or even your device. Press enter.
Writing all these changing permanently
Command (m for help): w <<<--- give w for write permission. if successful you'll see these message.
Code:
The partition table has been altered.
Calling ioctl() to re-read partition table
**NOTE** if you see something like below line. Partition is not altered or changed. Redo all steps carefully and properly.
Code:
fdisk: WARNING: rereading partition table failed, kernel still uses old table: Device or resource busy
Step 6 - Formatting Partition.
Your Partition table redefined or resized only. No Formatting has done yet. Your phone do not read memory unless its properly formatted.
If you wish to use stock or stock based rom DO NOT CHANGE PARTITION FORMAT. It will cause problem even brick. Search around forum for more info about this.
Changing Partition format is good for the Upgraded OS version like lolipop 5.0.0 or 5.1.1 or Marshmallow 6.0.0 to work some features. But not always necessary.
Disconnect Phone from pc> Boot into recovery
Code:
TWRP> Wipe> Advance> Format data, cache, system and SDCARD.
If you want to change Format>
Code:
From TWRP>Wipe>Advance>select system or data or cache> change file format> select desiered one> change.
Nice tutorial...but how to push ROM back to phone
payjo73 said:
Nice tutorial...but how to push ROM back to phone
Click to expand...
Click to collapse
If you Mean Stock ROM Use flash tool.
If you mean a zip file of custom rom use adb command:
adb push something.zip /sdcard/
Hey, I have done the exact same procedure and flashed oneofakind ROM. Now my internal SD card seems to be messed up.
Camera app throws error "insert an SD card before using" error & Gallery app throws error "no SD card detected error"
Kindly HELP !!
ps : I already had TWRP installed, had root access & unlocked bootloader. So started from Step 5 with partitioning steps ! I can see the internal storage of 19GB in settings though.
pps : I searched google extensively but most related solutions had external SD card being used so I couldn't reconcile it with my device (Xperia S)
C0D3FR34K said:
Hey, I have done the exact same procedure and flashed oneofakind ROM. Now my internal SD card seems to be messed up.
Camera app throws error "insert an SD card before using" error & Gallery app throws error "no SD card detected error"
Kindly HELP !!
ps : I already had TWRP installed, had root access & unlocked bootloader. So started from Step 5 with partitioning steps ! I can see the internal storage of 19GB in settings though.
pps : I searched google extensively but most related solutions had external SD card being used so I couldn't reconcile it with my device (Xperia S)
Click to expand...
Click to collapse
You need to allow permissions for letting the app access storage in settings of phone.
Mirhawk said:
You need to allow permissions for letting the app access storage in settings of phone.
Click to expand...
Click to collapse
Thanks.
How do i do that ? I never had to do it earlier. I have installed the ROM multiple times in past year.
C0D3FR34K said:
Thanks.
How do i do that ? I never had to do it earlier. I have installed the ROM multiple times in past year.
Click to expand...
Click to collapse
It's in Settings, Apps>Settings icon at top right> App permissions. This error occurs with Marshmellow ROM's as they some new pemission features. You can check out the link in My signature for more related info
Bro i was following this tutorial but i don't know how mobile got disconnected ?.. Now mobile got damaged it can't able to switch on.. Even pc not detecting.. What should I do now.. Please help???

How To Guide Resize internal storage on Xiaomi Pad 5 (nabu) and install PostmarketOS Preview

!!!!!DISCLAIMER!!!!!! --- below info is provided as is without any warranty, do it on your own risk
!!!BACKUP!!! !!!BACKUP!!! !!!BACKUP!!!
This procedure alter your userdata partition and you will lose anything if you do not do a backup.
_______________________________
Donate a coffee to support development:
Donate via PayPal to serdeliuk
Please carefully read all steps twice and be sure you understand them, the last part explains why you may want to have some free/unused space in the end.
0. Your device should be unlocked with Xiaomi
1. Developer options should be enabled
2. Check your MIUI version and download a stock image to have at hand all the original images in case you may need them.
For example is easy to forget to switch the slot a/b and write the wrong slot and break your device boot to android.
3. Reboot to OrangeFOX
- Download OrangeFOX image, please read this thread [UNOFFICIAL] Xiaomi Pad 5 nabu OrangeFox/TWRP recovery
- adb reboot bootloader
- fastboot boot xiaomi-nabu-orangefox.img
- adb shell
- review your partitions: ls -la /dev/block/bootdevice/by-name/
- we are interested in userdata partition location, in the below output we can see that is on /dev/block/sda device and it is the 31th partition on that device.
Code:
sh-5.0# ls -l /dev/block/bootdevice/by-name/ | grep userdata
lrwxrwxrwx 1 root root 16 1970-04-30 14:11 userdata -> /dev/block/sda31
4. Use parted against the /dev/block/sda device and print some info about partitions
Code:
sh-5.0# parted /dev/block/sda
GNU Parted 3.3
Using /dev/block/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
At the parted prompt, type print to see partitions on /dev/block/sda
Code:
(parted) print
print
Model: SAMSUNG KLUDG4UHDC-B0E1 (scsi)
Disk /dev/block/sda: 126GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 24.6kB 32.8kB 8192B switch
2 32.8kB 65.5kB 32.8kB ssd
3 65.5kB 98.3kB 32.8kB dbg
4 98.3kB 131kB 32.8kB bk01
5 131kB 262kB 131kB bk02
6 262kB 524kB 262kB bk03
7 524kB 1049kB 524kB bk04
8 1049kB 1573kB 524kB keystore
9 1573kB 2097kB 524kB frp
10 2097kB 4194kB 2097kB countrycode
11 4194kB 8389kB 4194kB misc
12 8389kB 12.6MB 4194kB vm-data
13 12.6MB 16.8MB 4194kB bk06
14 16.8MB 25.2MB 8389kB logfs
15 25.2MB 33.6MB 8389kB ffu
16 33.6MB 50.3MB 16.8MB oops
17 50.3MB 67.1MB 16.8MB devinfo
18 67.1MB 83.9MB 16.8MB oem_misc1
19 83.9MB 101MB 16.8MB ext4 metadata
20 101MB 134MB 32.9MB bk08
21 134MB 168MB 34.2MB splash
22 168MB 201MB 33.6MB bk09
23 201MB 9328MB 9127MB super
24 9328MB 9328MB 131kB vbmeta_system_a
25 9328MB 9328MB 131kB vbmeta_system_b
26 9328MB 9396MB 67.1MB logdump
27 9396MB 9530MB 134MB minidump
28 9530MB 9664MB 134MB rawdump
29 9664MB 10.7GB 1074MB ext4 cust
30 10.7GB 10.9GB 134MB ext4 rescue
31 10.9GB 126GB 115GB userdata
5. Remove userdata partition, double check the partition's number THIS COMMAND DO NOT ASK FOR CONFIRMATION, BE SURE YOU DID A BACKUP OF YOUR DATA
Code:
(parted) rm 31
rm 31
And check the result
Code:
(parted) print
print
Model: SAMSUNG KLUDG4UHDC-B0E1 (scsi)
Disk /dev/block/sda: 126GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 24.6kB 32.8kB 8192B switch
2 32.8kB 65.5kB 32.8kB ssd
3 65.5kB 98.3kB 32.8kB dbg
4 98.3kB 131kB 32.8kB bk01
5 131kB 262kB 131kB bk02
6 262kB 524kB 262kB bk03
7 524kB 1049kB 524kB bk04
8 1049kB 1573kB 524kB keystore
9 1573kB 2097kB 524kB frp
10 2097kB 4194kB 2097kB countrycode
11 4194kB 8389kB 4194kB misc
12 8389kB 12.6MB 4194kB vm-data
13 12.6MB 16.8MB 4194kB bk06
14 16.8MB 25.2MB 8389kB logfs
15 25.2MB 33.6MB 8389kB ffu
16 33.6MB 50.3MB 16.8MB oops
17 50.3MB 67.1MB 16.8MB devinfo
18 67.1MB 83.9MB 16.8MB oem_misc1
19 83.9MB 101MB 16.8MB ext4 metadata
20 101MB 134MB 32.9MB bk08
21 134MB 168MB 34.2MB splash
22 168MB 201MB 33.6MB bk09
23 201MB 9328MB 9127MB super
24 9328MB 9328MB 131kB vbmeta_system_a
25 9328MB 9328MB 131kB vbmeta_system_b
26 9328MB 9396MB 67.1MB logdump
27 9396MB 9530MB 134MB minidump
28 9530MB 9664MB 134MB rawdump
29 9664MB 10.7GB 1074MB ext4 cust
30 10.7GB 10.9GB 134MB ext4 rescue
6. Note the end of the last partition in the above list, 10.9GB, this number will be used as the start of the new userdata partition, followed by the end of the partition.
Let say that we want to make an approx 40GB userdata partititon using the following command:
NOTE, between userdata and 10.9GB are 3 spaces, one of them replace the partition type flag, it is important to use 3 spaces at this step.
Code:
(parted) mkpart userdata 10.9GB 50GB
7. Use print described at step 5 and see the result
Code:
(parted) print
Then exit/quit parted
Code:
(parted) quit
8. Reboot to Android and let the OS do the job fixing and formatting the userdata on the new size, will take a while to boot first time after resize, so grab a coffee, a beer, or else, note, it is important to keep the original partition name "userdata"
Code:
sh-5.0# reboot
9. Reboot to OrangeFOX again as described at step 3 and now create the PostmarketOS partition, I will name the partition as pmos:
print the actual partitions
Code:
(parted) print
Number Start End Size File system Name Flags
.....
31 10.9GB 50.0GB 39.1GB userdata
Use the last end as the start of the new partition and for end the desired extra size for your partition, let pretend we want a 20GB pmos partition as ext4 (minimum partition size is 4GB)
Code:
(parted) mkpart pmos ext4 50.0GB 70GB
The remaining free space, if any, can be used for future OSes, let say you want to have Windows and/or Ubuntu along your Android and PostmarketOS in the near future, think twice and partition wise your device and keep some free space if you think you will need it.
After each command you can check the free/available space with following command
Code:
(parted) print free
10. At this point your Android should be running well with the new userdata partition and you are ready to install the PostmarketOS nabu preview.
- Download preview images, please read this thread [INFO] PostmarketOS Linux boot on Xiaomi Pad 5 (nabu)
(NOTE THE IMAGES ARE NOT YET AVAILABLE I WILL UPDATE THE ABOVE POST IN THE NEXT FEW DAYS WHEN I AM DONE WITH THEM)
- Reboot to fastboot and check from which slot is your android booted
Code:
:~$ fastboot getvar current-slot
current-slot: a
finished. total time: 0.005s
Keep in mind that your current version of Android use slot A in above case, slot B is temporarily unused and we can take advantage to install our boot loader. Please note, if you update your Android version the new version will use the unused slot to install updates and our images will be lost, i am talking about 3 partitions involved to properly boot PostmarketOS, boot, vbmeta and dtbo partitions.
In order to flash and boot PostmarketOS you should change the active slot, because above the Android slot was A i am changing the slot to B
Code:
:~$ fastboot set_active b
Setting current slot to 'b'...
OKAY [ 0.046s]
finished. total time: 0.046s
11. Write PostmarketOS preview images.
Flash the new vbmeta with disabled verified boot, more info in PostmarketOS Wiki at Android_Verified_Boot_(AVB)
Code:
:~$ fastboot flash vbmeta_b vbmeta_disabled.img
Erase Android DTBO partition, we do not need it, but if present will be loaded and will prevent our boot
Code:
:~$ fastboot erase dtbo_b
Flash PostmarketOS boot.img
Code:
:~$ fastboot flash boot_b boot.img
Flash PostmarketOS image, please use the partition name you created for PostmarketOS at step 9, this process will takew a while, grab another beer
Code:
:~$ fastboot flash pmos xiaomi-nabu.img
Now you are ready to boot your PostmarketOS preview
Code:
:~$ fastboot reboot
You can switch from PostmarketOS to Android via changing active slots with fastboot, out there are some android/linux apps that can change the active slot while rebooting, you may need to search for them and test if they work.
The last step is to use the free space somehow, by creating one or more new partitions, in order to be able to do that you need to alter the GPT size limit, by default the limit is 32 and if you try to add a new partition you will get a similar error as the following one
Code:
(parted) mkpart WIN ntfs 50.5GB 126GB
mkpart WIN ntfs 50.5GB 126GB
Error: Too many primary partitions.
If you are on slot B to use PostmarketOS you need to switch to slot A to boot my OrangeFOX again:
Code:
:~$ fastboot set_active a
:~$ fastboot boot xiaomi-nabu-orangefox.img
To overcome the limit you will need to use the sgdisk tool, the following command should do the job:
Code:
sh-5.0# sgdisk -S 54 /dev/block/sda
Adjusting GPT size from 54 to 64 to fill the sector
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
The operation has completed successfully.
sh-5.0#
Now you can use parted to create new partitions, up to 64.
Enjoy
Thanks @Vagelis1608 for reminding me to add the last part about increasing the GPT limit.
P.S.
This thread is about how to repartition your device and install PostmarketOS preview images, if you want to discuss about my PostmarketOS please use this thread [INFO] PostmarketOS Linux boot on Xiaomi Pad 5 (nabu)
I would recommend to mount the "extra space" that's left until you need it for something else.
Either for something non vital ( cache/dalvik-cache ? ) or, better yet, simple storage.
I will look into mounting it as a "virtual SD card".
But yeah, this is exciting and I can't wait for you to release the images.
Vagelis1608 said:
I would recommend to mount the "extra space" that's left until you need it for something else.
Either for something non vital ( cache/dalvik-cache ? ) or, better yet, simple storage.
I will look into mounting it as a "virtual SD card".
But yeah, this is exciting and I can't wait for you to release the images.
Click to expand...
Click to collapse
Indeed, this is a way to use it, but there cannot be added a new partition without some extra work to alter the GPT itself and increase the limit of 32 partitions.... an operation that require a few extra steps.
serdeliuk said:
Indeed, this is a way to use it, but there cannot be added a new partition without some extra work to alter the GPT itself and increase the limit of 32 partitions.... an operation that require a few extra steps.
Click to expand...
Click to collapse
Oh, yeah, I forgot about that.
But still, that will have to be done for a 3rd OS, as you mentioned
Though the user won't have to wipe their data again, which is good
Vagelis1608 said:
Oh, yeah, I forgot about that.
But still, that will have to be done for a 3rd OS, as you mentioned
Though the user won't have to wipe their data again, which is good
Click to expand...
Click to collapse
If the space is left unused/free as suggested there is actually an easy step to alter the GPT later and add one or more partitions without losing anything. I just omitted the step as i thought is not related to the scope of this HowTo.
My OrangeFOX image contains a proper version of sgdisk that is able to alter the GPT size.
Actually i think i can add the extra steps at the end of the post #1 indeed, thanks for suggestion.
serdeliuk said:
If the space is left unused/free as suggested there is actually an easy step to alter the GPT later and add one or more partitions without losing anything. I just omitted the step as i thought is not related to the scope of this HowTo.
My OrangeFOX image contains a proper version of sgdisk that is able to alter the GPT size.
Actually i think i can add the extra steps at the end of the post #1 indeed, thanks for suggestion.
Click to expand...
Click to collapse
I find that it's better to do all the work at once.
Helps to not forget something important.
Good thing your sgdisk is ready and it doesn't need any extra tools.
Optional steps, for sure, but still good to have.
Just don't go over 8192 partitions. Things seem to be bugged after that, from what I read.
Vagelis1608 said:
I find that it's better to do all the work at once.
Helps to not forget something important.
Good thing your sgdisk is ready and it doesn't need any extra tools.
Optional steps, for sure, but still good to have.
Just don't go over 8192 partitions. Things seem to be bugged after that, from what I read.
Click to expand...
Click to collapse
I have added the last missing steps, thanks.
When i started to write the HowTo i didn't realized that will be that huge, is too long to read )))
serdeliuk said:
When i started to write the HowTo i didn't realized that will be that huge, is too long to read )))
Click to expand...
Click to collapse
It's fine, don't worry about it.
It's not like ordinary users will follow it. It's for advanced users
Did anyone do it? Do you have Some screenshots or video review?
denis3509 said:
Did anyone do it? Do you have Some screenshots or video review?
Click to expand...
Click to collapse
I did it on my nabu, i do not have any screenshots or videos, but i have doubts that will help more than what is in the first post, if you have any doubts do not do it, read more, study more, ask questions before do anything, this way you will avoid a soft brick.
I've tried to follow your steps for partitioning, and the pmos guide of porting a new device. I used the map220v kernel, and using pmbootstrap i build and solved some configs error. After i've extracted boot.img and xiaomi-nabu.img, flashed vbmeta_disabled, and then the other images. But when i try boot the slot b, it will redirect to fastboot. How can i solve it?
DTBO? You need to erase dtbo on the slot you are using pmos with.
sparky98 said:
I've tried to follow your steps for partitioning, and the pmos guide of porting a new device. I used the map220v kernel, and using pmbootstrap i build and solved some configs error. After i've extracted boot.img and xiaomi-nabu.img, flashed vbmeta_disabled, and then the other images. But when i try boot the slot b, it will redirect to fastboot. How can i solve it?
Click to expand...
Click to collapse
Also you need to disable AVB in vbmeta too and be sure you have the Postmarketos on the right slot.
Yes i did what you all said before flashing on boot_b and pmos, but maybe i'm doing that wrong.
I erased dtbo_b like this guide, and i've generated the disabled vbmeta with
Bash:
avbtool make_vbmeta_image --flags 2 --padding_size 4096 --output vbmeta_disabled.img
and flashed this image on vbmeta_b
sparky98 said:
Yes i did what you all said before flashing on boot_b and pmos, but maybe i'm doing that wrong.
I erased dtbo_b like this guide, and i've generated the disabled vbmeta with
Bash:
avbtool make_vbmeta_image --flags 2 --padding_size 4096 --output vbmeta_disabled.img
and flashed this image on vbmeta_b
Click to expand...
Click to collapse
Then this HowTo guide reached his scope, you had successfully resized your internal storage, why your OS does not boot is out of scope of this thread, you may need to seek assistance from the developer of your packages. At first glance i can say that your kernel is not properly configured and your DTB is not complete, but please ask the developer of your sources to debug his work and maybe to help you with your issues. Or watch my other threads about PostmarketOS on nabu as soon I will make my sources available as well as some prebuild images.
The preview images of my PostmarketOS port for nabe are available now, check post this thread [INFO] PostmarketOS Linux boot on Xiaomi Pad 5 (nabu)

Categories

Resources