Internal memory partition remap - Motorola Photon Q 4G LTE

What way are partitions made in this phone? Are they described into in fstab-like files or hardcoded in recoveries/kernels?
It will be nice to make revision of mapping for reasons:
1. Too much space for /system. I have more than 900mb free with CM11.
2. Possibility to unite /data and /sdcard binded partitions, like it's made on many newer devices. Oops, seems like already done in at least CM.
3. Adding unused space to /data and /cache(ex. for ART).
Is it possible, if yes - why it is not used?

It is not possible to resize the partitions (I tried that on my own, without success).
We are able to use/modify fstab to switch partitions (e.g. userdata and cache) but it is recommended to do this in the kernel because then the recovery will use the new layout also.
The last method is new for me, I don't know how to do this.
fstab.qcom is in root (in cm11).

Tried? Please post links/method ^_^

Sorry, I was not at home, so providing links was too hard to try.
Here is my post -> http://forum.xda-developers.com/pho...0-photon-q-t2838299/post58401143#post58401143
Read also the post after that one.

Related

[Q] ext2/ext3/ex4 and lynux-swap with incubus RLS14/15

Hi, I have been testing several NAND set-ups
-system to NAND and data to resized data,img
-system to resized system.img and data to resized data.img
-system to NAND and data to ext2
...
I am currently using NAND and data to ext2 partition, so all apps are installed there. After lots of reading I can not understand posts that are obsolete and posts that are not so I would appreciate if someone can explain me the basics and optimal setup for incubus superfroyo RLS14/15 roms:
I have now 4 partitions:
1) fat32,
2) 1,5G ext2 (app, app-private etc),
3) 1,5G ext2 (lost+found folder) and
4) 96M lynux-swap.
- How can I turn ext2 to ext3? do I need to do so? I have also read about ext4. Upgrading to ext3/ext4 applies to my 2) partition, to my 3) partition or to both? will I loose data stored? "there is no ext3/ext4 fs because there isn't the support on the compiled kernel. Ext3/ex4 are journal file system so are bad for limited writing device like nand or sd and thre is no good rease to use it" answered by l1qd1.
- How can I check if my lynux-swap is enabled and used by the rom?
- Do partitions 2) and 3) really need to be <1,5 G? why so?
- Can I take apk from apps folder in partition 2) in case I want to keep them for future fresh installs?
- What is lynux-swap optimal size? a 1,5G partition would be worse than 96 M? Why?
- Which tools are you using with incubus roms to manage installaion location and similar functionalities?
Another big mark I have is about deoxeding installed aps (not belonging to the ROM). Should I do it? why? how?
Pretty basic stuff I guess for experienced users & programmers, but I am new to lynux and android. Have read lots of things but it is difficult to learn by myself what would work with our Polaris and incubus ROMS and dzo/kk kernels,
Stick to ext2 man, you won't turn your old engine to 240mph on a Ford Model T.
You're not getting some major boost if the hardware dosn't use it, so I'd stick with ext2.
And you also want Super FroYo on your ext2 partition, yes? I'm here to help.
- How can I check if my lynux-swap is enabled and used by the rom?
adb shell
Code:
free
if on swap you have 0 it isn't enabled.
Code:
swapon /dev/device
to enable it or i suggest you tu use compcache.
- Do partitions 2) and 3) really need to be <1,5 G? No
- Can I take apk from apps folder in partition 2) in case I want to keep them for future fresh installs? Yes but not all apk support this
- What is lynux-swap optimal size? a 1,5G partition would be worse than 96 M? Why? Too Big = more sparse but it's a problem only for real disk so you can create a swap big as you want but it's unuseful (100 M is enaught)
i suggest you to switch to my kernels because are more updated and kk move to another device.
Yah l1q1d I love ur kernels. Eager for more !
l1q1d, I am testing your kernel as you advised me. I could apply the wifi patch without problems using your androiupdate18-09-10, as you told me some time ago they are both 2.6.25.
However I do not manage to turn linux-swap on: that's what I do: I install ubuntu, I use G-Parted to create partitions on the sd card. When I do so, the third partition is always shown as linux-swap in G-Parted but when I test adb shell -> parted -> print, it always shows as ext2. I can not dismount and can not swap on it.
The other way round, if I deleted all partitions with G-Parted and create the partitions with mkpartsfs or if I use mkfs to change the third partition from ext2 to linux-swap, then sometimes I can swap on it (directly on adb shell or with G-Parted) but when I unplug the device will tell me the card is empty and will not be able to mount it, access it from ubuntu or from the device. If I reboot then, the system will hang until I install both data and sysetm to nand. This happens no matter if I activate or not from the polaris or even if I switch on or off usb mode. The card at that point is useless. I guess the partition table or some other basic file is messed.
Could you please explain a little more how can I come with a 13.5G fat32 partition, a 2,4 ext2 partiions and a 0,1 lynux swap swapped on partition??
I really need to test this set up, since with the standard set-up (system to nand, fat32 for files and ext2 for installed apps I can not install all apps I use since performance drops significantly).
regards
well, ... dumb me, maybe with compcache you are referring to launch a script?
where do I get this compcache.sh? how do I launch it? from adb? from the terminal? from the sd card?...

[Q] Resize internal partitions

Hi,
This has been asked many times before with no real solution that applies to different devices.
I'm running out of space on my /system partition and can't install any more apps even though I don't have that many installed.
I want a way to re-size the Android partitions manually to whatever size I want. Or just delete all current partitions and create new ones.
How do I do that? Is there any GUI partitioning tools similar to the ones available for Windows?
I don't want to move files from /system to another partition. I want to change the partition size.
My current /system partition:
For what reason are you moving apps to /system? You can't install them there, you have to push/move them there, installs go to /data. So keep them in /data, where they're installed by default. You have tons of space available there.
Partition table (start addresses and sizes) is hard-coded in bootloader, and can be redefined in kernel boot parameters (in this case recovery needs to be recompiled with the same parameters too, otherwise it won't write to the same partitions the kernel will read from). You're welcome to hack any of those. As you could probably understand from this paragraph, I wouldn't expect having GUI tools for that.
Thanks for the reply.
I'm not trying to move apps to /system. I thought apps are installed there by default because every time I try to install a new app it gives me an error message saying that there is not enough space on /system.
Now I know that apps are not installed in /system.
I just need more space in /system so I can install new apps without any errors.
What can I do to get more space on /system partition? Can I replace the bootloader?
I don't have any Android programming experience. I probably need something that is available out there to do the job.
In stock form, you shouldn't even have write permissions to /system. Nothing should be ever written there, and it can be 99.99999% utilized - there shouldn't be any free space left for anything, it shouldn't normally be used.
If you're getting that error when trying to install an app - you need to check what's reporting the error. It's not a "real" error, it means there's something wrong with your phone.
Try wiping cache partition from recovery...does this make any difference?
Jack is correct.
Swyped from my DesireS
refer to this
if this may help you http://forum.xda-developers.com/showthread.php?t=1959691
:highfive:
mayank88288 said:
refer to this
if this may help you http://forum.xda-developers.com/showthread.php?t=1959691
:highfive:
Click to expand...
Click to collapse
Way to bump a year old thread :thumbup:
“I'm bad and I'm going to hell, and I don't care. I'd rather be in hell than anywhere where you are. ”*―*William Faulkner

[Q] Q. Regarding Data Storage on BootMenu's 2nd System

I posted this in a thread in the Dev. section but that's probably not the appropriate place for it - I've been installing ROMS (SCV7, Swifty Trix) with BootMenu on the second system with Leak #1 on the primary system. On the primary system I have ~ 4 gigs allotted to app storage and on the second I only have ~ 200 mbs. I can't even begin to install a basic set of application... are there any suggestions on how to remedy this situation? I've been Google-ing the subject but haven't found much information so far.
EDIT - So, I guess "RTFM" should always be in mind:
Q: I have a "low storage space" on 2nd system?
Webtop partition size is only 1.3GB.
To make thing simple, the included boot_second.sh script bind mount /system & /data inside this webtop partition.
You have at least 4 option, if you want to have bigger /data
1.Reassign /data to /sdcard (IO speed depend on sdcard speed rating)
2.Reassign /data to /dev/block/userdata (this will replace all your data for stock system)
3.Reassign /data to /dev/block/cache (bind /cache to somewhere else e.g : /webtop/cache)
4.Use a lightweight ROM (/system size = small)
You need to modify these files to suit your needs.
/preinstall/bootmenu/script/boot_stock.sh
/preinstall/bootmenu/config/stock.recovery.fstab
/preinstall/bootmenu/script/boot_second.sh
/preinstall/bootmenu/config/second.recovery.fstab
Sorry, for now you all have to configure this files manually.
--------
So, this is a little beyond what I've done with Android thus far... for now I haven't been able to figure out how to work it out. Any suggestions would be much appreciated. Thanks!
goto
1) mounts/format
2) format webtop
3) toggle second system recovery (main menu)
4) install/restore whichever ROM u desire
i think erasing webtop will pretty much free system space in "second system"
and remember second system is usually considered as trial purpose
as far as my exp. changing something in first system will somtime affect the second system
Happy flashing
aguacateojos said:
I posted this in a thread in the Dev. section but that's probably not the appropriate place for it - I've been installing ROMS (SCV7, Swifty Trix) with BootMenu on the second system with Leak #1 on the primary system. On the primary system I have ~ 4 gigs allotted to app storage and on the second I only have ~ 200 mbs. I can't even begin to install a basic set of application... are there any suggestions on how to remedy this situation? I've been Google-ing the subject but haven't found much information so far.
EDIT - So, I guess "RTFM" should always be in mind:
Q: I have a "low storage space" on 2nd system?
Webtop partition size is only 1.3GB.
To make thing simple, the included boot_second.sh script bind mount /system & /data inside this webtop partition.
You have at least 4 option, if you want to have bigger /data
1.Reassign /data to /sdcard (IO speed depend on sdcard speed rating)
2.Reassign /data to /dev/block/userdata (this will replace all your data for stock system)
3.Reassign /data to /dev/block/cache (bind /cache to somewhere else e.g : /webtop/cache)
4.Use a lightweight ROM (/system size = small)
You need to modify these files to suit your needs.
/preinstall/bootmenu/script/boot_stock.sh
/preinstall/bootmenu/config/stock.recovery.fstab
/preinstall/bootmenu/script/boot_second.sh
/preinstall/bootmenu/config/second.recovery.fstab
Sorry, for now you all have to configure this files manually.
--------
So, this is a little beyond what I've done with Android thus far... for now I haven't been able to figure out how to work it out. Any suggestions would be much appreciated. Thanks!
Click to expand...
Click to collapse
All of that is not needed, and you will mess up your install on first system too.
I get trying new things out and trail blazing, but next time do a little research first. There are people who don't think and search for a problem and find your solution try it and learn they now have to fxz, but don't know how or can't.
This appears to be way beyond you. Next time try something a little smaller and less likely to screw something up for those that don't know or not very capable.
shardul.phatak said:
goto
1) mounts/format
2) format webtop
3) toggle second system recovery (main menu)
4) install/restore whichever ROM u desire
i think erasing webtop will pretty much free system space in "second system"
and remember second system is usually considered as trial purpose
as far as my exp. changing something in first system will somtime affect the second system
Happy flashing
Click to expand...
Click to collapse
What he said ^^

[Q] Replace Internal Data Partition for External SD

Let me start with: I know that there have been many posts on this, but before you get mad, I was unable to find an answer to what I specifically want to do.
For reference: I am a software developer and sysadmin with a decent amount of Linux experience, but not a lot of android specific experience.
Now that the introduction is out of the way:
What I would like to do is completely remove the "USERDATA" partition (the "Internal SD card"), grow the "SYSTEM" partition to fill that space, and then mount my SD Card (external) as the SD Card that the system sees.
I'm currently on Cyanogenmod 10.1 but want to upgrade to 11 soon.
The reason I want to do this is because:
I have all if my apps that I can set to install to SD Card
Both "internal" partitions are full (only about 200MB is available for pictures/etc. and I can no longer update apps)
Camera (and pretty much everything else as well) stores to the Internal SD card by default
If the system partition was 1.1+1.4=2.5GB and all of my apps were "installed" to a real SD card, it would be a lot more comfortable.
So, here's what I am thinking *might* work (maybe not in the right order, though?):
Point the fstab entry for the internal SD card to the external SD card
I have the PIT file. I will delete the "USERDATA " and grow "SYSTEM" to fill the space
When I write it out in steps, it seems pretty simple...
My concerns:
Will a ROM update (to CM11) re-partition back to the old way (and, in the process, break a bunch of stuff)?
I don't ever plan to go back to stock android or change to another ROM (other than upgrades).
Thanks for reading this long post and for any insight you may be able to provide.
--mobrien118
It's a wonderful idea if it works.
Sent from my SAMSUNG-SGH-T769 using xda app-developers app
Modifying partitions is a bit dangerous.
But I have to ask you why do you need another GB of /system storage?
There was a line you can put in the build.prop that flips your ext. SD with the internal one on cm10 I believe.
This'd interest me if I could get rid of usbdisk and sdcard0 merged.
It would need the phone to be repartitioned though, causing issues with the backups and ROMs.
You may even have to compile cm from source.
Its a lot of trouble
Sent from my SAMSUNG-SGH-T769 using Tapatalk
I just did so on S4 Mini with cm-11 Android 4.4.
First I was thinking of using symlinks and/or bind mounts to redirect to the the external sdcard, but that's a bit of a hassle because
1) Since 4.2: both emulated and external storage is mounted with a fuse layer on top not supporting symlinks
2) Since 4.4: no more global write access on external storage
So moving data was the simplest solution. Besides providing (much) more space my sdcard is also around 20% faster in sequential writes: 8.5 MB/s internal vs 10.5 MB/s external. Is it really 2014?
I haven't yet decided what to do with the original data partition, so for the moment I left it unused. Hence I haven't touched the internal partition table.
Quick summary
partition sdcard (gdisk)
I recommend using GPT, this lets you work with partition names rather than numbers. For the sake of still having an "official" external sdcard I made two partitions. Keep in mind that it's usually the first partition which gets automatically mounted as external sdcard. So I made the 2nd partition the new home for data. This partition however has to be manually specified in the ramdisks fstab which involves flashing the boot partition.
format the new partitions (mkfs.ext4)
copy the original /data directory tree to the new data partition
extract initrd from boot.img (abootimg)
extract files from initrd (gunzip & cpio)
replace the /data entry in fstab pointing at your new data partition
re-pack initrd and boot.img (gzip, cpio & abootimg)
flash boot.img onto the boot partition (dd)
If you use recovery, you also have to edit it's fstab (analog to boot.img mentioned above)
done
Alternatively has anyone tried an init.d script? I see those scripts get executed before the mounting of data & sdcard
Meanwhile the original userdata partition got replaced by 3 new partitions: system2, cache2 & userdata2 which are now used for a dual boot ROM.
I've only changed GPT, not PIT. ROMs and Recovery don't use PIT, so as long as Heimdall/Odin isn't involved it should not cause any issues.
Hey guys,
So after read all that, I am also vry interested in what the OP has suggested. I get that the pit doesn't need to be affected, but as the OP asked, when flashing a new rom or updating an existing, would the partition be reformatted back to the way android handles it, ie; back to the system and data seperate and the sdcard not being used as the internal partition?
I am no developer and only have minimal knowledge in linux and android programing, but I am a quick study and any guide to help me sort this would be greatly appreciated.
Also I am about to get a second S4 mini specifcally for doing things like this so if I brick I don't care?
My next question is could it be possible to code the PIT file to do this for you so that you can just flash that through odin, but again would flashing roms affect this.
Cheers,
Sora.
aguaz said:
I just did so on S4 Mini with cm-11 Android 4.4.
First I was thinking of using symlinks and/or bind mounts to redirect to the the external sdcard, but that's a bit of a hassle because
1) Since 4.2: both emulated and external storage is mounted with a fuse layer on top not supporting symlinks
2) Since 4.4: no more global write access on external storage
So moving data was the simplest solution. Besides providing (much) more space my sdcard is also around 20% faster in sequential writes: 8.5 MB/s internal vs 10.5 MB/s external. Is it really 2014?
I haven't yet decided what to do with the original data partition, so for the moment I left it unused. Hence I haven't touched the internal partition table.
Quick summary
partition sdcard (gdisk)
I recommend using GPT, this lets you work with partition names rather than numbers. For the sake of still having an "official" external sdcard I made two partitions. Keep in mind that it's usually the first partition which gets automatically mounted as external sdcard. So I made the 2nd partition the new home for data. This partition however has to be manually specified in the ramdisks fstab which involves flashing the boot partition.
format the new partitions (mkfs.ext4)
copy the original /data directory tree to the new data partition
extract initrd from boot.img (abootimg)
extract files from initrd (gunzip & cpio)
replace the /data entry in fstab pointing at your new data partition
re-pack initrd and boot.img (gzip, cpio & abootimg)
flash boot.img onto the boot partition (dd)
If you use recovery, you also have to edit it's fstab (analog to boot.img mentioned above)
done
Alternatively has anyone tried an init.d script? I see those scripts get executed before the mounting of data & sdcard
Click to expand...
Click to collapse
I just managed to replace my internal sd with the external sd following your ruff guide. thank you very much! At first I struggled a bit getting it to work, because I had encrypted my data partition before -.- this seems to change something in the fstab / mounting / boot-up process, I couldn't get my S4 mini to boot with just changing the fstab.qcom in boot.img. With my recovery (TWRP) it worked from the start editing recovery.img's fstab.twrp /data mount point.
After decrypting(formatting) /data and re-editing fstab.qcom in boot.img it finally works I'm so happy! Enjoying a lot of space on my sdcard now!
usefull threads / information I learnt from:
Partition structure of S4 Mini
Encryption of ExtSD & some fstab information
Editing initrd
abootimg ReadMe
(Links last tried 28.05.2015)

A Simple Way to (kind of) Dual Boot an Android

This is just an idea. I tried it on my Nokia 6.1 (2018) (PL2) running Android 10, and it worked; so I thought it might work on other devices too. My device:
Android 10 Q
System-as-root
A/B slots
Released with Project Treble support (and hence has the fstab in the vendor partition)
DM-verity, force-encryption and disk quota disabled with this mod by Zackptg5.
It basically uses a single partition to store the contents of what I call two different userdata "profiles". Normally, you have one userdata partition on a device, and that stores one profile. Here, however, I used a subdirectory on the root of the userdata partition to store the contents of the second profile, and modified the fstab to correctly bind-mount it on /data. Bind-mounting made things simple in my opinion--I didn't have to go about actually repartitioning my storage. The reason this works is that any changes you make to your phone on the lines of installing and updating apps, downloading files, changing settings, etc. are all reflected only on the userdata partition. No other partition on an android phone is ever touched unless the system is updated. Hence, the userdata partition is the only partition you need to mess around with in order to have two profiles.
===================================​DISCLAIMER:
I am NOT sharing a solution. I am only sharing an idea for you to try and/or improvise on. It may work, it may not. I will not hold your hand; you will have to use your own knowledge and common sense. I am not responsible for anything that goes wrong on your device.
If you do not understand what is going on in this post, please do not try this.
There is a reason I'm not explaining all the terms I'm using here. I assume that if you, the reader, want to try this out, you a) have some knowledge and experience, and b) have the fire in your belly to research to learn more about what you don't understand.
===================================​
Now for the fun:
The first thing I did was to create a new mountpoint the userdata partition. This I made on what is the root filesystem of the device; on a system-as-root device, it would be on the root of the system partition, and on a non-system-as-root device, it would be on the root of the boot ramdisk. I named it userdata/. Accordingly, I edited my fstab.qcom (at etc/fstab.qcom on the vendor partition for my device) to mount the userdata partition on /userdata/ instead of /data/:
Code:
#<device> <mountpoint> <type> <options>
/dev/block/bootdevice/by-name/userdata /userdata <whatever whatever whatever> <you'd probably have to disable options like fileencryption, quota, check (verification), etc.>
and to mount the second profile's directory. Note that it is bind-mounted:
Code:
/userdata/userdata/ /data none bind
Now to switch between the two profiles, you'd switch between the original fstab and the one you just modified.
That is (most of) it. Some things I noticed:
The device would refuse to boot initially. What worked was to backup and wipe my data, boot, create the second profile's directory and copy the contents of the just-created userdata profile into the second profile's directory. In other words, I couldn't run a "first boot" on the second data profile--I had to copy an existing profile into the second profile. I really don't know why this happens.
I suspect that disk quota, filesystem encryption and verification will mess with this (or rather, the other way around). I can't be sure, because I have all three disabled.
Having a shared Internal Storage (/data/media/0/) is convenient. For this, I just bind-mounted that too:
Code:
/userdata/media/0/ /data/media/0/ none bind
This can also be used to easily achieve dual booting on an A/B device, as long as you don't use seamless updates. One ROM per slot can be installed, and the fstab.qcom on one of the vendor partitions can be configured to use the second profile. This way, there would be no need for an external SD card or additional partitions.
I'm pretty sure there will be other hurdles with other devices and other android versions. As I said, I'm just here to share an IDEA, and NOT a foolproof, one-size-fits-all solution. I hope this helps other people make their lives simpler. Please do share your notes on this thread if you manage to get it working on your device!
Its easy to have two roms on one device and its simple,just take a nandroid aof your current rum,now flash another rom an set it up,when u need the other rom just restore your nandroid and so on,i have 4 roms,all fine,lol.
But that's kinda inefficient, don't you think? If you just swap a single file instead of the whole data partition, it's much faster--it takes as long as rebooting + a few milliseconds.
But well, whatever suits you
Hey bro can u pls explain the second code line u mentioned???
varunrocks17 said:
Hey bro can u pls explain the second code line u mentioned???
Click to expand...
Click to collapse
/userdata/userdata/ /data none bind: (this is the line right?)
This bind-mounts the directory /userdata/userdata on /data. /userdata/userdata (directory /userdata under the userdata partition that we previously mounted) is the directory under which the contents of the alternative userdata partition are stored.
Bind-mounting is a means by which a folder can be treated as a device to mount (as opposed to a normal block device or partition). As the mount(8) documentation states, it is a way to "Remount part of the file hierarchy somewhere else."
By this mechanism, the /userdata/userdata folder is made to look like the entire userdata partition. In other words, when you access anything under /data/, you're in fact accessing /userdata/userdata/.
I did something similar to a Jellybean. That is, quite long time ago. Stock fw didn't support encryption. So I made a hack that used cryptsetup and vold.decrypt triggers. That way only framework had to restart. It probably is not that simple anymore...
Anyways, what I learned that it wasn't worth it, so I didn't release it back then. Back then there was a real space shortage and it wasn't wasted like nowadays....
Thanks for that userdata idea that's what I was messing around and. Creating multiple partitions for each rom ...
Btw one question :
Kernel intially mounts vendor then from vendor/etc/fstab.qcom all others are mounted ..?
Or kernel have the predefined vendor system and userdata partition locations ..??
I am really confused here ..
That's why my multi boot was bit messy..
aryankaran said:
Thanks for that userdata idea that's what I was messing around and. Creating multiple partitions for each rom ...
Click to expand...
Click to collapse
Glad I could help
aryankaran said:
Kernel intially mounts vendor then from vendor/etc/fstab.qcom all others are mounted ..?
Or kernel have the predefined vendor system and userdata partition locations ..??
Click to expand...
Click to collapse
On my system-as-root device treble-enabled device, the vendor partition is mounted by the kernel. There is a node in the kernel's device tree blob (dtb) that specifies the vendor mount. When the kernel is fully initialized, it has its own /dev filesystem, using which it mounts the vendor partition. I hope that part is clear.... not sure if I explained it nicely...
Once the vendor is mounted, /vendor/etc/fstab.qcom is read and all the other partitions are mounted from there.
Ok it means it's just the same scenario as it was till Android 7.1.2 that boot image mounts all partitions..
Just difference that kernel now mounts vendor and further processed by fstab ..

Categories

Resources