TWRP 2.2.1.1 Backup help - Kindle Fire Q&A, Help & Troubleshooting

I move old backups to computer then do a new backup.
Sent from my MB855 using xda premium

I'm only guessing but it may be possible that TWRP will only allow so much data to be stored in the TWRP folder. How much do you have stored there? Have you tried getting rid of some old backups?

Boot into TWRP, run the following commands...
adb shell parted /dev/block/mmcblk0 print
adb shell du -s /sdcard
The first will output the partition table details.
The second will tell you how much storage space you are using in the /sdcard partition.

I looked into this a bit in the past but never found clear info. First, as you are aware FFF Extended does some moving around of the partitions to load/unload your primary or alternate ROMs depending on what you are booting into. Root Explorer would give you partition information from within the partitions after FFF Extended has loaded the partition tables as needed for whichever ROM you are loading. TWRP isn't running from "within" one of your two ROMs and therefore it is likely that it does not see your partition tables the same as one or both of your ROMs would. Not much help I know, but I have read through most of the info on the FFF Extended wiki and the documentation isn't real clear on how it manipulates the /sdcard and partition tables as needed to dual boot.

danscxda said:
I looked into this a bit in the past but never found clear info. First, as you are aware FFF Extended does some moving around of the partitions to load/unload your primary or alternate ROMs depending on what you are booting into. Root Explorer would give you partition information from within the partitions after FFF Extended has loaded the partition tables as needed for whichever ROM you are loading. TWRP isn't running from "within" one of your two ROMs and therefore it is likely that it does not see your partition tables the same as one or both of your ROMs would. Not much help I know, but I have read through most of the info on the FFF Extended wiki and the documentation isn't real clear on how it manipulates the /sdcard and partition tables as needed to dual boot.
Click to expand...
Click to collapse
I think you might be a little confused about how FFFe works. The partition table is not a dynamic structure manipulated on the fly by whatever operating system loads at the time. The partition table is stored at a specific location on the storage space, so the device can determine how the storage space has been divided (partitioned). There's only one partition table and it can only be seen one way.
For Android ROMs, you typically need 4 different partition spaces for them to run... boot, system, userdata and cache. FFFe shrinks the media partition (typically called the /sdcard) by approximately 2 GB, then creates another set of these partitions... boot2, system2, userdata2, and cache2, in that space. An alt-ROM has to be specially modified to get the recovery to flash it into this alternate space and to get the booting system to mount the alternate partitions (system2, userdata2, and cache2) instead of the "normal" partitions (system, userdata, and cache). Once all of these have been set up correctly, you just need to have the bootloader select the desired boot partition (boot or boot2) and off it goes.
Hope that clears things up.

Related

[Q] Arc's /cache partition

Hey,
I've got Arconium ICS rom installed on my Xperia Arc. I'm running low on internal memory, and while trying to find more space on the device I've found this:
Code:
Filesystem Size Used Available Use% Mounted on
/dev/block/mtdblock2 225.0M 1.1M 223.9M 1% /cache
So my question is - what is the cache partition used for on ICS? How big should it be? I found this in the description of some Nexus HD ICS rom:
Cache partition (/dev/block/mtdblock4) is only used by CWM.
Cache partition size is not important because the data partition (/dev/block/mtdblock5) is used as the cache space when running Android.
Click to expand...
Click to collapse
Of course partitions path varies, but the info seems to be relevant.
And a final question - fdisk doesn't seem to work (getting "fdisk: can't read from" error) - how do I go about changing partition table?
To my knowledge (based mostly on HTC phones), in normal use the cache partition is used for downloading apps prior to installing, and for downloading OTA updates (which is why it's so big).
If youre running custom ROMs then this partition doesnt need to be anything like this size, because youre not going to be installing OTA updates. HTC desire owners resize this down to as little as 5meg (though this seems low to me, IMO it should be at least as big as the biggest app youre ever likely to install, so i'd say 25-50 meg is a safer bet.
Now, i have no idea how CWM works, so if this is using the partition to perform installs or nandroid backups or something then your probably wouldnt want to make it much smaller.
There is also a lot of space which could be freed up on the system partition, particularly if youre using a stripped down ROM.
All of the above is all well and good, if there is a way of changing the Arc's partition table. I have no idea how this is done, or if it is even possible. So would love someone who knows about this stuff to respond. BUT: i very much doubt FDISK (you mean windows fdisk?!?!?) is the answer - at the very least i'd expect that you'd need a specially modified kernel in order to boot with a modified partition table. The fact that it fdisk with an error instead of giving it a try is probably the only reason your phone still boots.

Using SDCARD as /data

I have a problem with my phone.
I believe that the internal partitions are messed up.
I have tried a couple of guides to fix this but no luck. I get "error formatting /data!" on recovery. I also tried using the formatting tools from adb shell (e2fsck, gparted).
The main problem is that when i restart my phone the /data partition gets wiped, and the phone reboots in blank, no apps no setting (some of them remain).
I wonder if i can solve this by setting my sd-card to be the new /data. I doesn't matter if i have to leave the sd-card on all the time. i mainly use this phone for developing apps.
Thanks.:good:
Felivel said:
I have a problem with my phone.
I believe that the internal partitions are messed up.
I have tried a couple of guides to fix this but no luck. I get "error formatting /data!" on recovery. I also tried using the formatting tools from adb shell (e2fsck, gparted).
The main problem is that when i restart my phone the /data partition gets wiped, and the phone reboots in blank, no apps no setting (some of them remain).
I wonder if i can solve this by setting my sd-card to be the new /data. I doesn't matter if i have to leave the sd-card on all the time. i mainly use this phone for developing apps.
Thanks.:good:
Click to expand...
Click to collapse
It could probably be done if you could get the sdcard to mount at boot, not sure if thats possible. You would need to create a flashable much like the ext4 mod, that edits the init.inc.rc file to mount the sdcard and /data to it. You would want to partition your sdcard with an ext3 or ext4 partition and use that for data.
Yes it can be done. That's how boot manager works, by modifying the ramdisk to load images from sdcard or emmc instead of the partition. I think I have an idea on how to make your request work.
Edit: If you feel like trying a project, what needs to be done is create a file data.img and mount it as loopback using busybox (ROM needs a working busybox).
Then the boot.img needs to be updated replacing the mount /data entry in init.inc.rc with the location of the loopback device and a loopback setup prior to this. The data.img created needs to be formatted ext3 or ext4. I know it's not too detailed but rather just a summary.

Brainstorming about repartitioning

Just thinking out loud....
I don't know if the ICS leak flashes change the partition table, but the way my phone is set up, there's 11 partitions:
p1: /efs
p2: /system
p3: /cache
p4: The "Internal SD"
p5: A mere 2MB. Mostly blank (long stretches of 00 or FF), except for <1KB of... something. Nothing jumps out at me in the hexdump. Could just be leftover garbage from Gingerbread.
p6: /data
p7: 16MB. Definitely something important here. Strings present suggest it's related to, if not part of, the bootloader, or perhaps download mode.
p8: 5MB: Looks like an Android bootimg. Recovery?
p9: 8MB: Pretty sure this is where the Linux kernel and rootfs for the actual system resides.
p10: 8MB: Completely blank.
p11: 500MB. An ext4 filesystem containing only the Asphalt 6 video and screenshots that you'd find on the "Internal SD" of a freshly Odin'd Glide.
I wonder if p5 actually serves a purpose; if not, we could theoretically merge it, p4, and p6 into one gigantic /data partition. That may be a bit more useful for those running with large microSD cards.
Things we need to look at:
One, bootloader. Does it look for things at static offsets? Does it read the partition table?
Two, recovery. I'm guessing CWMR will read the partition table, but is it expecting certain partitions to contain certain things?
In both cases, it shouldn't be anything we can't work around by filling out partition numbers or stretches of NAND with blank partitions. But we'll need to know what the offsets need to be.
Just putting the thought out there.
PIT & GPT, custom PIT
Actually the last PIT partition contains GPT data, and what we've seen inside the booted system comes out of GPT. But there is unallocated ~11Mb (according to GPT) before the first partition, and the PIT contains info about that!
cross-ref my thread: [Q] mmcblk0 Partiton table type (sgh-i927)
For now I'm looking a way of crafting my custom PIT-file, did you see any info about that?

[Q] Inc as a data media device

I know I'm late to the party and this was probably already discussed, but I couldn't find it with search. Has anyone considered converting the inc to a data media device (http://www.xda-developers.com/android/what-is-a-data-media-device/)? I've seen this done with other devices (e.g. hp touchpad). I'd be nice to be able to use the EMMC partition for storage and data. I know there is ext4all but I still seem to run out of space quickly since dalvik-cache is half of /data.
Not sure if hboot will let you combine partitions to do what you want; however, lvm can probably accomplish what you're hoping to achieve but it takes quite a bit of effort to setup.
Sent from my One using Tapatalk
I wasn't necessarily thinking we need to combine any partitions. Just don't mount the existing /data and /data/data partitions, and mount the EMMC partition as /data with an emulated sdcard at /data/media. I think this is how the Samsung phones work; you have both "internal" and "external" sdcards. Seems like it should just be some config changes and maybe a recovery that is datamedia aware so you don't erase the emulated sdcard when wiping data.
Smells like a project. I'll see if I will get around to this but this sounds doable.
No promises but my Inc could get bricked and I wouldn't cry over it so I can take a few risks.
Sent from my One using Tapatalk
I've only done a little research so far, but it seems like you'd only need to change a few configuration files. I don't think you could truly brick your Inc, could you? I'm tempted to try and get it working myself but I can't risk bricking my dd.
Sent from my ADR6300 using Tapatalk
ive got 2 incs so I dont mind messing with it, I have a touchpad tho and from what I know (I am decent friends with invisiblek and he does work on the touchpad) the only real difference, is re-partitioning your internal and setting the device tree to mount data as data/media instead of for say /data or /data/data
I have a TouchPad too. Finally made the leap to kk and datamedia there which is what got me thinking about the Inc. The repartioning done for the TouchPad was too make the data partition larger since it now holds both apps and sdcard data. We shouldn't have to do that for the Inc since we already have a partition with 6.6 gig available. Nothing is mounted at /data/media, it's just another directory on the main /data partition. That's why you need a special recovery that "wipes" data instead of formatting...
I've been looking at the changes milaq made. I assume invisiblek did something similar if not the same.
Sent from my ADR6300 using Tapatalk
natediggity said:
I have a TouchPad too. Finally made the leap to kk and datamedia there which is what got me thinking about the Inc. The repartioning done for the TouchPad was too make the data partition larger since it now holds both apps and sdcard data. We shouldn't have to do that for the Inc since we already have a partition with 6.6 gig available. Nothing is mounted at /data/media, it's just another directory on the main /data partition. That's why you need a special recovery that "wipes" data instead of formatting...
I've been looking at the changes milaq made. I assume invisiblek did something similar if not the same.
Sent from my ADR6300 using Tapatalk
Click to expand...
Click to collapse
A fancy flashable script to convert your boot.img to use /data/media should be possible. So far I told it to switch to mmcblk03 from 01 for /data so it's 6.6GB. The other part is relocating fuse to use /data/media for the internal storage instead of /emmc. That should be somewhat easy to change but a bit harder to script.
/data/media was designed for devices that don't have an sdcard slot which the Inc does have so this is more of a proof of concept idea for me than actual utility.
Ok, the last part is recovery and the current recovery images appear to be large enough to make the recovery build part fail. I'm not sure the actual recovery partition size on the inc but the images come to be about 4.5 MB and fail.
zachf714 said:
ive got 2 incs so I dont mind messing with it, I have a touchpad tho and from what I know (I am decent friends with invisiblek and he does work on the touchpad) the only real difference, is re-partitioning your internal and setting the device tree to mount data as data/media instead of for say /data or /data/data
Click to expand...
Click to collapse
/data/media uses fuse on an existing ext4 partition so the recovery as nate said has to be told to wipe /data instead of format (in other words, using an rm command and excluding /data/media).
This makes filesystem corruption harder to fix since the partition can't be wiped from recovery normally unless it's a format which TWRP does have an option to format /data.
tiny4579 said:
A fancy flashable script to convert your boot.img to use /data/media should be possible. So far I told it to switch to mmcblk03 from 01 for /data so it's 6.6GB. The other part is relocating fuse to use /data/media for the internal storage instead of /emmc. That should be somewhat easy to change but a bit harder to script.
/data/media was designed for devices that don't have an sdcard slot which the Inc does have so this is more of a proof of concept idea for me than actual utility.
Ok, the last part is recovery and the current recovery images appear to be large enough to make the recovery build part fail. I'm not sure the actual recovery partition size on the inc but the images come to be about 4.5 MB and fail.
Click to expand...
Click to collapse
Check my device tree, I have a commit on omni that compresses recovery a bit more and I use it to build
Sent from my SCH-I535 using Tapatalk
tiny4579 said:
A fancy flashable script to convert your boot.img to use /data/media should be possible. So far I told it to switch to mmcblk03 from 01 for /data so it's 6.6GB. The other part is relocating fuse to use /data/media for the internal storage instead of /emmc. That should be somewhat easy to change but a bit harder to script.
Click to expand...
Click to collapse
I don't need a flashable script unless it's required. Personally, I'm fine just building a new system image and flashing that.
tiny4579 said:
/data/media was designed for devices that don't have an sdcard slot which the Inc does have so this is more of a proof of concept idea for me than actual utility.
Click to expand...
Click to collapse
datamedia can be used in conjunction with sdcards. This is what the new samsung phones do. I thought the HTC One did as well, but I just remembered it doesn't have a sdcard slot. If you haven't already, check out this page: https://source.android.com/devices/tech/storage/config-example.html. Our config would be similar to the Xoom's.

[Question] Resizing partitions with TWRP

I have a brand new G3 (D852) with Koodo that I just got 2 days ago. I've rooted, installed TWRP and flashed a few AOSP roms. Not a fan of any manufacturer UI, even though LG's is very minimal, so AOSP it is. I noticed that my system partition has more than 1GB of free space after everything is flashed and good to go. I also noticed that the latest TWRP (2.8.7.0) has a resize partition option inside the Wipe section. What I want to know is, how can I use this to resize the system and data partitions so that 1GB+ isn't being wasted and unused. I'd really like to get that 1GB+ added to my data partition for apps.
I've tried using it. The only time it didn't spit out an error was after I wiped the system partition. It succeeded in "resizing" it after that, but it didn't change anything. The system partition remained the same size.
ToYeD said:
I have a brand new G3 (D852) with Koodo that I just got 2 days ago. I've rooted, installed TWRP and flashed a few AOSP roms. Not a fan of any manufacturer UI, even though LG's is very minimal, so AOSP it is. I noticed that my system partition has more than 1GB of free space after everything is flashed and good to go. I also noticed that the latest TWRP (2.8.7.0) has a resize partition option inside the Wipe section. What I want to know is, how can I use this to resize the system and data partitions so that 1GB+ isn't being wasted and unused. I'd really like to get that 1GB+ added to my data partition for apps.
I've tried using it. The only time it didn't spit out an error was after I wiped the system partition. It succeeded in "resizing" it after that, but it didn't change anything. The system partition remained the same size.
Click to expand...
Click to collapse
This it why the option is there:
resize2fs feature: On some devices like the Nexus 6, the factory images include a userdata image that is the proper size only for the 32GB units. If you flash the factory image to a 64GB Nexus 6, the data partition will appear as if it only has the free space of a 32GB device. Using the resize2fs option, TWRP can resize your data partition to take up the full space available. The resize2fs may also be useful to resize system partitions on devices where custom ROM system images don’t take up the full partition space. Lastly, resize2fs may be useful in some cases to reserve the proper space at the end of a data partition for a full disk encryption key, should your partition be formatted incorrectly for some reason.
jeffrey268 said:
This it why the option is there:
resize2fs feature: On some devices like the Nexus 6, the factory images include a userdata image that is the proper size only for the 32GB units. If you flash the factory image to a 64GB Nexus 6, the data partition will appear as if it only has the free space of a 32GB device. Using the resize2fs option, TWRP can resize your data partition to take up the full space available. The resize2fs may also be useful to resize system partitions on devices where custom ROM system images don’t take up the full partition space. Lastly, resize2fs may be useful in some cases to reserve the proper space at the end of a data partition for a full disk encryption key, should your partition be formatted incorrectly for some reason.
Click to expand...
Click to collapse
Thank you for the reply
If I understand you correctly, the feature's original intent is to resize /data partitions in the event the rom/system image treats a larger storage capacity device as a lower capacity one, ie. 64GB device is treated like 32GB so /data will only reflect 32GB minus (system image install size), wasting 32GB and leaving it inaccessible to the user.
However, it also seemed like you were saying I also could use it to resize my /system partition to a smaller size so CM12.1 (with it's ~900MB install size after Full TK-Gapps) will only leave ~50MB to ~100MB on /system instead of ~1.5GB. However, the question remains. How do I do this and can I reallocate the ~1.5GB to the /data partition for apps and internal storage? If this can't be done then I see no point in resizing /system to begin with as it will still be inaccessible to me as the user.
ToYeD said:
Thank you for the reply
If I understand you correctly, the feature's original intent is to resize /data partitions in the event the rom/system image treats a larger storage capacity device as a lower capacity one, ie. 64GB device is treated like 32GB so /data will only reflect 32GB minus (system image install size), wasting 32GB and leaving it inaccessible to the user.
However, it also seemed like you were saying I also could use it to resize my /system partition to a smaller size so CM12.1 (with it's ~900MB install size after Full TK-Gapps) will only leave ~50MB to ~100MB on /system instead of ~1.5GB. However, the question remains. How do I do this and can I reallocate the ~1.5GB to the /data partition for apps and internal storage? If this can't be done then I see no point in resizing /system to begin with as it will still be inaccessible to me as the user.
Click to expand...
Click to collapse
I read a few things online and it seems you need aan unlocked bootlader, the G3 bootloader is not unlockable, so you are probily out of luck maby you can ask in the Q&A thread of the rom you are using.

Categories

Resources