Can I Gain Extra Space In System Partition Using Links? - General Questions and Answers

I have a Galaxy Nexus with not much space left in the /system partition, which means that after I have flashed the Blackberry apps (~250M) I can't even flash Pico GApps.
Is it possible to symlink or mount a sub-directory (e.g. /system/priv-app) to a different partition to free space?

Related

/system partition size

On a 32GB Verizon version GS3, when I go to settings > storage, under miscellaneous files, it show "system memory" to be 5.74GB, I looked at an unrooted 16GB version, and system memory was only 3.49GB, of my total 5.8GB miscellaneous files, about 60mb is other files and applications, and the remainder says "5.74GB system memory".
Why is it so much higher on a 32GB vs. 16GB? I mean the system files should not be proportional to internal storage space, right? I don't have a lot of apps, and I have in fact removed a bunch of original system apps, it tells me I have only about 300 mb of /system space available, how is this possible?
I have flashed rooted images from Odin a couple of times, restored NAND about 20 times or more, and rooted via adb once or twice from stock unrooted. Is all this fragmenting the /system partition? Should I format /system next time I'm in recovery? If so, my pc doesn't seem to recognize the phone in recovery when connected. Do I need different drivers to connect while in recovery, so I can mount and format /system? I can format /data and /cache easily in recovery, and when I had my old HTC Evo 4G, I could connect the phone while in cwm and format /system, but I can't on an SGS3. Is there another easy way to format /system before restoring a NAND backup to truly start from scratch on a clean system partition?
Thank you

Huawei Ascend G330 U8825-1 resize internal partitions to gain space for apps

the g330 comes with a reasonable storage. But there is not enough space for apps on /data. The internal sd-card got a lot of space. resizing /data (part. 18) may be critical and requires another recovery image. So my idea is to log in the phone, start fdisk /dev/block/mmcblk0, delete internal sd-card partition (19), then create a e.g. 1 GB partition with ext4, which I will mount on /data/app, and give the rest to a new partition 20 for internal sd-card.
I think this approach is more fail-save and can be done quite fast. I have to change just init.rc to add one mount and vold.fstab. Has somebody tried this?
yes, i know, the dalvik-cache and /data/data will still load the /data partition, and app2sd would save the same space from /data. But app2sd needs one mount for each app (at least in GB), so booting takes very long time and I have to wait until I can launch an app.
I read sometimes, the kernel get the offsets of the partitions of flash as parameters when booted - so some offsets would be wrong when I change the partion table. This would cause to fail mount /data/app - what about this?
rregn said:
the g330 comes with a reasonable storage. But there is not enough space for apps on /data. The internal sd-card got a lot of space. resizing /data (part. 18) may be critical and requires another recovery image. So my idea is to log in the phone, start fdisk /dev/block/mmcblk0, delete internal sd-card partition (19), then create a e.g. 1 GB partition with ext4, which I will mount on /data/app, and give the rest to a new partition 20 for internal sd-card.
I think this approach is more fail-save and can be done quite fast. I have to change just init.rc to add one mount and vold.fstab. Has somebody tried this?
yes, i know, the dalvik-cache and /data/data will still load the /data partition, and app2sd would save the same space from /data. But app2sd needs one mount for each app (at least in GB), so booting takes very long time and I have to wait until I can launch an app.
I read sometimes, the kernel get the offsets of the partitions of flash as parameters when booted - so some offsets would be wrong when I change the partion table. This would cause to fail mount /data/app - what about this?
Click to expand...
Click to collapse
I tried this and it works
its for g300 but it works on g330
http://www.htcmania.com/showthread.php?t=428466
sorry, its in spanish haha use the google tranlator
xals1997 said:
I tried this and it works
its for g300 but it works on g330
http://www.htcmania.com/showthread.php?t=428466
sorry, its in spanish haha use the google tranlator
Click to expand...
Click to collapse
Did i get the idea? You use link2SD (from Bülent Akpinar) , but instead of using a 2nd partition of the external SD-card with ext2, you use the internal SD-card for link2SD?
But i heard that link2SD need a ext2/3 partition? Also, in my version of link2SD there is:
mount -t ext2 -o rw /dev/block/vold/179:2 ...
btw. how is /system/etc/install-recovery.sh triggered

Internal storage optimization

@mrvek: a follow-up to http://review.cyanogenmod.org/61837
dalvik.vm.dexopt-data-only is being completely removed from CM currently, btw.
I've been playing with a little hack.
To get the unused/wasted space of system partition back to the read/write domain, we can swap the cache and system partition names (they are usually mounted by name, so the partitions can be effectively swapped by this).
Code:
diff --git a/fs/partitions/efi.c b/fs/partitions/efi.c
index 6296b40..4bc9234 100644
--- a/fs/partitions/efi.c
+++ b/fs/partitions/efi.c
@@ -666,6 +666,12 @@ int efi_partition(struct parsed_partitions *state)
info->volname[label_count] = c;
label_count++;
}
+ if (!strcmp(info->volname, "cache")) {
+ strcpy(info->volname, "system");
+ } else if (!strcmp(info->volname, "system")) {
+ strcpy(info->volname, "cache");
+ }
state->parts[i + 1].has_info = true;
}
kfree(ptes);
userdata are not affected by this change (no wipe/factory reset by user required), system has still almost 250MB free available when the current CM11+gapps are installed to the formerly cache, now system partition.
The r/w mounted cache has around 1.4 GB now.
The following script can be put as e.g. 10dex2cache to /system/etc/init.d
Code:
#!/system/bin/sh
rm -rf /data/dalvik-cache/*
/system/xbin/mount --bind /cache/dalvik-cache /data/dalvik-cache
So the dalvik-cache is stored in cache partition, freeing some space from userdata
In my case, it means over 400MB more free space in userdata when dalvik is used.
ART files are much bigger (the test of ART actually made me do this, as I haven't had enough free space in data for the switch to ART anymore).
plus:
- more free space in data
- much less wasted space in r/o mounted system
minus:
- free space in cache is not monitored, if it runs out, things will fail miserably without proper user notification of the cause (that's the main reason why dex in cache support is being removed from CM; when switched to ART, I have currently less than 400MB free in cache...)
- users would need to use a recovery with the same hack in its kernel => using some random available recovery build would result in partition mismatch
- fastboot erase cache issued by user would erase system...
- it's a hack
I'd welcome some opinions about this hack, @stargo , thanks .
Is a kernel-hack the only way to change the mounts? (I assumed I would find something like fstab or similar).
I wished we could partition our phone >.<
Btw. I am not able to switch to ART. (Over 2.9 GB free space on the phone.)
After a reboot it's back to dalvik again. (build 03.08.2014; dd.mm.yyyy) It must be one of the installed apps, maybe XPrivacy.
Loader009 said:
Is a kernel-hack the only way to change the mounts? (I assumed I would find something like fstab or similar).
I wished we could partition our phone >.<
Btw. I am not able to switch to ART. (Over 2.9 GB free space on the phone.)
After a reboot it's back to dalvik again. (build 03.08.2014; dd.mm.yyyy) It must be one of the installed apps, maybe XPrivacy.
Click to expand...
Click to collapse
Kernel hack is certainly not the only way, but it's the simplest way - you do it at a single low level place and that's it, both android system and recoveries are then covered.
xposed is not compatible with ART - it's the xposed framework what keeps switching the VM back to dalvik for you.
If I apply the kernel fix, I don't need the mount script, right?
Fr4gg0r said:
If I apply the kernel fix, I don't need the mount script, right?
Click to expand...
Click to collapse
The kernel hack effectively swaps system and cache partitions (stock system partition is 1.4 GB, cache 755.9MB; the kernel hack will swap them to 1.4GB r/w mounted cache and 755.9MB r/o mounted system)
The bind mount script is just one of the possible ways of use of the gained space in the now larger (by the kernel hack), read/write mounted cache - it moves the dalvik-cache from /data partition to /cache partition...
why cant we just change our partition sizes like the touchpad?
http://forum.xda-developers.com/showthread.php?t=2756314
No idea Simply throwing parted at it doesn't work, it seems that the partition table is saved somewhere else (Result: data was moved, but original partition table restored -> broken data)
I also tried unsuccessfully parted.
When I was done with parted, I rebooted. All partitions were reverted back to stock.
I believe it is as mifritscher said...

How you can fix error 70 upon installing gapps over a custom rom

OK I'm sure some of you have at least run into this problem when installing gapps over a custom ROM and I can tell you how to fix it!
after flashing your custom ROM be in twrp and from the main screen select: mount>select system>press home button>wipe>advanced wipe>select system>click repair or change file system>resize file system>swipe to resize. After that you are almost done, go back to main screen and flash the gapps zip and congratulations you got gapps successfully installed, if any errors when booting or bootloops make sure you try this again EXACTLY how i said. If this helped you please hit the thanks button ?
error 70 = no enough storage
Storage is storage and full is full... In most cases /system is almost full. This partition contains your OS. The GApps installer.zip is not an image file! It installs single files and files need storage. If there is not enough free storage then you should delete some other apps.
Resizing doesn't make sense because for the additional new storage on /system you lost storage on another partition. In most cases userdata.
WoKoschekk said:
error 70 = no enough storage
Storage is storage and full is full... In most cases /system is almost full. This partition contains your OS. The GApps installer.zip is not an image file! It installs single files and files need storage. If there is not enough free storage then you should delete some other apps.
Resizing doesn't make sense because for the additional new storage on /system you lost storage on another partition. In most cases userdata.
Click to expand...
Click to collapse
When you install gapps it installs it to the os partition and as such makes sense as of why it's a system app. Besides this worked for me Everytime
Well, I tried it with my Nexus 5 and lineage 14.1, Gapps 7.1 Nano. Didn't work! Got the same old Error 70.
And the answer is .... use a gapps.config.txt file. You can include/exclude the packages you want in gapps. This reduces the size needed in the recovery partition so it will fit. If you want to know how much space you have to work with, open a terminal and as su, enter df -h and see what the system partition is using and how much free space you have.
Worked for me!

Installing apps into system partition

Is there any way to prepare a Gapps like package with additional apps of choice (any app i want to be installed) and install them after ROM into system partition?
If i install a debloated Gapps i end up with 3/4 of unused system partition which will not be used in the future-it is a space wasted. resizing partitons is dangerous if i have to use backups. If it would be possible to install apps of choice into the system partition then i could use up system partition space and use userdata space for other stuff. Of course app updates of apps installed into system partition should be installed/stored in system partition too.
Thank you
Personally never would abuse /system partition to store user-apps there.
xXx yYy said:
Personally never would abuse /system partition to store user-apps there.
Click to expand...
Click to collapse
Why if 3/4 of space is unused? Could you let me know if you are familiar with dangers of it? thanks
Never encountered or heard of that 3/4 of storage space under /system is unused. My experince is that only some 100KB are free for further use ( updates ).
xXx yYy said:
Never encountered or heard of that 3/4 of storage space under /system is unused. My experince is that only some 100KB are free for further use ( updates ).
Click to expand...
Click to collapse
Isnt this system space on the screenshot system partition? Let me know if i am wrong. thank you
If phone's Android is rooted and its /system partition is mounted as RW then apply the du command in Android's terminal to get the disk space memory utilized by files in /system partition.
To get the unused disk space memory in /system apply the df command.

Categories

Resources