[Q] How to resize/recreate /system and /data partitions? - LG Optimus 3D

With all the lighter custom ROMs we have today, the default huge /system partition we have in the O3D is a waste of space. Same with the /data partition. For those who don´t know, both /system and /data (and other smaller ones) are actual internal SD Card space!
That´s why we have LG specs saying we have 8GB of internal flash storage, when in fact we have just 5.5GB available.
So my question is: is there a (safe) way to wipe all internal SD partitions and then recreate them with more appropriate sizes, earning back all the wasted space?
Thanks a lot!

Marcovecchio said:
With all the lighter custom ROMs we have today, the default huge /system partition we have in the O3D is a waste of space. Same with the /data partition. For those who don´t know, both /system and /data (and other smaller ones) are actual internal SD Card space!
That´s why we have LG specs saying we have 8GB of internal flash storage, when in fact we have just 5.5GB available.
So my question is: is there a (safe) way to wipe all internal SD partitions and then recreate them with more appropriate sizes, earning back all the wasted space?
Thanks a lot!
Click to expand...
Click to collapse
Have you read about data2ext? I think it would be a very good solution to us.
Sent from my LG-P920 using XDA App

Thanks for the reply, ThiaiZ!
However, I think I´m looking for something different: as far as I know, data2ext changes the /data partition pointer to external memory (SD Card), so the original /data partition will never be used by the OS, and it´s space will be wasted, right?
I would like to find a way to get this wasted space back! If we could repartition /system, /data, /cache, to smaller sizes, we would have more storage space for stuff on the internal SD. Does it make sense? Thanks!

Well, since I had no solutions here, I would like to post some examples of this for other phone models:
MyTouch 3G Slide - http://forum.xda-developers.com/showthread.php?t=893706
LG GT540 - http://forum.xda-developers.com/showthread.php?t=1171531
The MyTouch 3G Slide thread is particularly good because it explains in detail how to check the partition sizes, and shows how much space is wasted on the /system partition.

Marcovecchio said:
Well, since I had no solutions here, I would like to post some examples of this for other phone models:
MyTouch 3G Slide - http://forum.xda-developers.com/showthread.php?t=893706
LG GT540 - http://forum.xda-developers.com/showthread.php?t=1171531
The MyTouch 3G Slide thread is particularly good because it explains in detail how to check the partition sizes, and shows how much space is wasted on the /system partition.
Click to expand...
Click to collapse
Don't we have to be s-off to be able to resize the partitions ?
I did it a lot on my HTC Desire.
BTW do you have any idea in which block data and sd-ext are mounted on our device ?

I believe the S-OFF flag exists only in HTC devices. I read that somewhere here, at XDA. The guy seemed to know what he was talking about, and he said LG never implemented any kind of protection like S-ON / S-OFF.
About the block names, I believe you can list the blocks and the partition names they´re mounted as, with the "df" command. I know almost nothing about Linux, and even less about how Android manage it´s partitions, but that would be nice to be able to tweak their sizes...

LG GT540's partitions can easily be resized by flashing an MBN file. Don't know if this phone can get that done too
http://forum.xda-developers.com/showthread.php?t=1171531

Don't try resizing partitions.
You'll brick your phone.

Related

[Q] Custom MTD Partitions

I was reading in the desire forums and saw this thread.
[DEV][S-OFF] Custom MTD Partitions (resize data, system, and cache)
I've always been disappointed with the small amount of space the Aria has for internal storage. Would it be possible to change the partition size of the aria to allow for more internal storage?
KillerBeaver said:
I was reading in the desire forums and saw this thread.
[DEV][S-OFF] Custom MTD Partitions (resize data, system, and cache)
I've always been disappointed with the small amount of space the Aria has for internal storage. Would it be possible to change the partition size of the aria to allow for more internal storage?
Click to expand...
Click to collapse
just use s2e or darktremors apps2sd and have all the internal storage you want lol
I had heard that battery life and r/w speed could be better on the internal. Is that incorrect? I thought it could be done relatively simply with a hex editor, but i'm not very knowledgeable in that specific department. So, that's why i wanted to ask.

[Q] What are the benefits of formating the sd to ext/swap etc?

I'm a Linux user so I know what swap, ext2, ext3 etc technically means. What I don't understand is what are the *actual* benefits of formating my SD Card to these formats. I've run into a lot of guides and how-tos but no one cares to explain why to do it.
So to sum up:
Does the Android System actually cares if I create these formats?
If it does, will I notice actual increase in performance?
What about apps2SD?
What kind of format do you recomend?
I have an HTC Desire and I'm using CyanogenMod, Oxygen and MIUI in rotation (means I replace one with another every couple months).
Thanks in advance!
aventinus said:
I'm a Linux user so I know what swap, ext2, ext3 etc technically means. What I don't understand is what are the *actual* benefits of formating my SD Card to these formats. I've run into a lot of guides and how-tos but no one cares to explain why to do it.
So to sum up:
Does the Android System actually cares if I create these formats?
If it does, will I notice actual increase in performance?
What about apps2SD?
What kind of format do you recomend?
I have an HTC Desire and I'm using CyanogenMod, Oxygen and MIUI in rotation (means I replace one with another every couple months).
Thanks in advance!
Click to expand...
Click to collapse
Faster SD Card speeds for app2sd, thats mainly it. If you don't use A2SD there isnt much point to it, but if you do it can be very useful. What some people do though are format their System and Data partitions to EXT2 or EXT4 so then the whole system is faster all around and is a large improvement over stock rfs.
fowenati said:
Faster SD Card speeds for app2sd, thats mainly it. If you don't use A2SD there isnt much point to it, but if you do it can be very useful. What some people do though are format their System and Data partitions to EXT2 or EXT4 so then the whole system is faster all around and is a large improvement over stock rfs.
Click to expand...
Click to collapse
Ok so if make an ext partition, the apps that are stored in this partition will run faster. That sounds fair. Should I have both ext and FAT partions? And if I do, how does Android know where to put the apps? Also how about swap?
aventinus said:
Ok so if make an ext partition, the apps that are stored in this partition will run faster. That sounds fair. Should I have both ext and FAT partions? And if I do, how does Android know where to put the apps? Also how about swap?
Click to expand...
Click to collapse
No need for swap, and yes EXT is automatically recognized by android for a2sd, but make sure your ROM supports it. You would have an EXT partition between 256mb-2gb max, and then the rest would be FAT.
fowenati said:
No need for swap, and yes EXT is automatically recognized by android for a2sd, but make sure your ROM supports it. You would have an EXT partition between 256mb-2gb max, and then the rest would be FAT.
Click to expand...
Click to collapse
Ok! That was really eye-opening! Thank you so much!
no problem!

Regarding disk space

Has anyone tried to repartition our /system and /data folders to create an /emmc partition for our phones? Seems like OE partitioning scheme is a huge waste of space and we could better utilize the extra space if it was in user mountable partition.
This should be easy to do via recovery yes?
Sent from my MB865 using xda premium
unsivil_audio said:
Has anyone tried to repartition our /system and /data folders to create an /emmc partition for our phones? Seems like OE partitioning scheme is a huge waste of space and we could better utilize the extra space if it was in user mountable partition.
This should be easy to do via recovery yes?
Sent from my MB865 using xda premium
Click to expand...
Click to collapse
Yes both lfaber06 and I sort of do something similar, with the way we have safestrap setup, but we use the SDcard instead. The one issue I see with this is what the future brings for this phone, like what moto might do for us with ICS, and such, what may be needed in these partitions to make it work. Other that that I don't see an issue, but you will have to change a ton of start scripts if the partition numbers change.
Jim
Sent from my MB865 using xda premium
I don't think you understand, I want the space to be user accessible, like I have on my nook. I flashed a custom repartition from cwm to resize data and media partitions. The /emmc partition is a fat32 partition I believe (on my nook anyways). I've never even come close to filling my 2gb data partition, and now I have 4gb of space for music or videos storage.
unsivil_audio said:
I don't think you understand, I want the space to be user accessible, like I have on my nook. I flashed a custom repartition from cwm to resize data and media partitions. The /emmc partition is a fat32 partition I believe (on my nook anyways). I've never even come close to filling my 2gb data partition, and now I have 4gb of space for music or videos storage.
Click to expand...
Click to collapse
No, I don't think you understand what that really does under the covers. Both lfaber06 and I have been working on this device for a while, we are the ONLY two devs currently working on this device. What I am telling you is that if you change the size of ANY of the internal partitions, It might effect the ability to update to another version of Android. Your Nook, is not a Mototrola device, and Moto has completly messed with/up android, and therefore it is not safe to do what you are saying. No matter what you can not get access to the internal partitions, yes on AOSP devices / devices that can be AOSP (the nook is one), you can do those things. The Atrix2 still has a locked bootloader, so we are stuck with their kernel, and version of android. To do what you are saying you will need to have an AOSP kernel, and have MANY init scripts updated to understand the new partition table. It is not as easy as you make it out to be.
Okay, I was under the impression with rw abilities on /system and /data partitions we also have the ability to mount, unmount; also giving us the ability to edit the partition blocks via bootstrap.
Ok how about this, there is a guy in the Nook Tablet forum (locked bootloader, like us) who had the idea of basically running a fat32 "img" that in the /data (ext4) partition to that would mount via a script and be user accessible? That would be possible I would think.
unsivil_audio said:
Okay, I was under the impression with rw abilities on /system and /data partitions we also have the ability to mount, unmount; also giving us the ability to edit the partition blocks via bootstrap.
Ok how about this, there is a guy in the Nook Tablet forum (locked bootloader, like us) who had the idea of basically running a fat32 "img" that in the /data (ext4) partition to that would mount via a script and be user accessible? That would be possible I would think.
Click to expand...
Click to collapse
Yes you do have access to all of those things with root, but Moto has done so much customization to this thing, that would not be safe.
Yes, that is also something that lfaber06 and I have thrown around as well, the logistics of it need to be worked out for our phone, and the proper init scripts need to be put together.
Are you up for the task? I only ask because he and I are currently working on porting cm7 and cm9 to our phone, which is a huge task. I can help you out, but I just can't take on anymore projects for this phone at the moment, since I have 5 different things I am working on for us right now.
I am definitely down to help, still going to be a bit of a learning curve for myself. Still pretty new to linux/android.
unsivil_audio said:
I am definitely down to help, still going to be a bit of a learning curve for myself. Still pretty new to linux/android.
Click to expand...
Click to collapse
PM me, with as much info as you have about this, preferably any links that you have read, and I will help you develop a game plan, and what you will need to make this hack happen. You will have to do some research on your own, and I can help with the Linux/Android part, and help you figure out what you will need to do. I am also not sure on the what kind of speed to expect from something like this, so that will also be something to look into, since this will be a virtual disk file.

[Q&A] 2 GB External Data -- Hefe Hook Kernel and others

The Hefe Hook kernel allows you to mount a partition of your microSD as /data, getting 2 GB (or more) for your apps and their data.
Please ask your questions here about installation, use, or general approach.
This is great @jeffsf and can u show me how to re-partition the "real internal" storage? I mean expanding the /system since u put the /data out of it. Thanks man
Sent from my GT-N7000 using Tapatalk 2
daothanhduy1996 said:
This is great @jeffsf can u show me how to re-partition the "real internal" storage? I mean expanding the /system since u put the /data out of it.
Click to expand...
Click to collapse
Yes, you've hit on another of the reasons I've been exploring using the microSD for "live" storage. It's one thing to use potentially slow storage for photos that you basically write once or "app to SD" where you read the APK at boot time, make sure your ODEX in the Davlik cache is good, then generally read from the internal-flash cache. It is another when that memory is being read and written "constantly" when your phone is running.
The good thing is that once /data is not part of the internal flash filesystem, you don't have to worry about one ROM (kernel) thinking it begins at one place and another saying it starts at another. Previously, if one ROM had one /system size and another and a different one, the next partition, /data, would look to be corrupt when you swapped ROMs.
As a warning, not all users have fast microSD cards. Some that say "Class 10" on them really are dogs, especially for small reads/writes. The "Class" ratings are for sustained writes, as you would have with a camera recording video. If your ROM is "external /data" only, or even defaults to that, be prepared for a slew of "Your ROMs sucks. It is so slow." complaints.
You'll also need a way to automate formatting the card. It can be done on the phone, as long as you aren't trying to preserve any data.
As I recall, the layout of the MTD partitions is done in drivers/mtd/onenand/samsung_galaxys4g.h I would be careful not to move the partition boundary for efs, as you'd have to move the data it contains in your updater script. Repeating the warning about not moving the boot and recovery partitions is probably a good idea as well!
Your build tree may need some of these values, or at least think it needs some of these values. For example, device/samsung/aries-common from the CyanogenMod/cm-11.0 (KitKat) branch calls out NAND page sizes, partition sizes, and flash block sizes. I haven't looked in detail at your build tree so I can't comment on how it might handle things differently than the CyanogenMod one.
itzik2sh said:
Hi
I hope I don't ask anything silly, but please let me know if any of my assumptions is wrong :
1. I take FBi's251's AOKP milestone 6 (ICS 4.0.4)
2. 8GB SDCard was formatted to FAT32 (4GB) and EXT3 (4GB) using TWRP kernel
(Beastmode's proton kernel to be exact).
3. I would flash this kernel and it would move apps and their data to the sd-ext
without any special additions.
Thanks. I read the thread, but unfortunately 8GB SD is what i have and I think it should be enough.
Thanks again.
P.S - it's for 2 guys I already sold them my SGS4Gs. I want them to be happy...
Click to expand...
Click to collapse
AOKP should be fine. I haven't tried it recently, but it was the tree in which I did the early Hefe Kernel development.
As I understand it, you have a microSD with
partition 1: 4 GB FAT32
partition 2: 4 GB ext3
So that can work, but will need some tweaking of the init-on-fs.sh script. I intentionally didn't use the second partition as so many scripts gobble that up as sd-ext and do who knows what to it.
My first preference would be to reformat the cards, perhaps:
6 GB FAT32
1 MB ext2/3/4 (Yes, 1 MB, a sliver, choice of ext2, ext3, ext4 up to you)
2 GB ext4
since then the script will work without modification and if they install a third-party script that uses the second partition, it won't corrupt their data.
If you were to keep the formatting the way that it is now, you'd need to edit the mount commands in the script to look something like:
Code:
/system/xbin/busybox umount /data
/system/xbin/busybox mount -t ext3 -o noatime /dev/block/mmcblk0p2 /data
(removing the sd-ext mount)
I'm not sure what your expectations are, but all that the kernel and that script will do is mount a different disk partition on /data -- you need to manually move the data over (or restore from something like Titanium Backup). There may be some trickery in renaming that could be used with TWRP backups to restore from data.yaffs2.win to the new /data partition, but I haven't tried that at all.
Hi Jeff
Thanks for your quick reply, and sorry again for not seeing the Q&A thread.
I think making it :
partition 1: 4 GB FAT32 (sdcard)
partition 2: 2 GB ext3 (sd-ext)
partition 3: 2 GB ext3 (data)
partition 4: 1 MB (spare)
would be better and handle data as well. don't you think ?
Would it be worth doing with a "Team" micro-SD card (class 6 I believe) ?
Thanks.
I haven't tried a Class 6 card, but my gut feeling is that it will be dicey. I didn't "commit" to using /data on microSD until I had tried it for several days using Titanium Backup's ability to move both apps and app data to the external card. I would try that first, especially as the phones in question aren't going to be in your hands (I consider you an expert user, able to manage things outside the UI with ease).
I've attached some testing I did a while ago with Transcend and SanDisk cards. When you look at them, realize that the speed scale changes between them. I have a feeling that the real "performance" on a device is going to be related to relatively small reads and writes, not the ability to stream video to the card. I also don't know much about the Team brand, but I found that even some well-known brands didn't have the performance of the Transcend or SanDisk in the same category.
However you configure your cards, I would definitely recommend a journaling filesystem of some sort. I've had my microSD come loose inside the phone. The journal will at least help to reduce any filesystem corruption should that happen.
You don't need the fourth partition -- I have it there to be able to keep rsync backups for fast ROM swapping.
.
Regarding the apps data, have you tried exploring the Mount2SD script ?
sent from me
I've tried a couple of the scripts out there in the past. Since backing up my data is very important to me, I trust the scripts in Titanium Backup to work well with its backup/restore strategies.
Mounts2SD looks like it has gotten a lot more sophisticated than it was when I tried it in the past. It sounds like something worth trying in its current state. At a quick glance (and not looking at the code), I'd personally make some different choices about features; enabling journaling, and being concerned about why lost+found was filling up (things should only appear there if the file system is found to be corrupt).

storage issue

Hello, I have this phone (8gb) since August and never noticed how much storage I have until now because it started notifying me storage was full. Well, it says total space is 4,53gb and without /system 3,60. So my question is, where is the 4gb of storage that I don't see? I was hoping it was occupied by /system but it is not. We're talking about a half of the storage and it's unbelievable that I cannot use at least 5 of the 8 I've payed for.
Any help would be very appreciated!
4.53 gb is your /data partition(user apps and data are stored here), other space is used in /system partition where all system files are located.
Is there a way to resize the partitions?
isavoro said:
Is there a way to resize the partitions?
Click to expand...
Click to collapse
it was possible to resize partitions in many phones and there are also apps available on playstore for it. but you should reset it to default before flashing any rom. :/
And do you think reducing /system may be a problem?
isavoro said:
And do you think reducing /system may be a problem?
Click to expand...
Click to collapse
when I was using stock, my system partition was filled by 1.5gb from 2.19gb. there is still some space there but you shouldn't reduce it because it will get filled over time with app updates. and there will be problem with ota updates if you resize it.

Categories

Resources