[MOD] Storage Expansion for S4 Mini (microSD for /data) - Galaxy S 4 Mini Original Android Development

------
TLDR
---
As most people know, 8GB is not enough for modern smartphones. With this mod, I provide a modified 'fstab' file and instructions on how to expand '/data' to install apps without root and in a universal way. All apps will install as if in internal storage.
Furthermore, given the old age of these phones, internal eMMC will progressively degrade until the phone dies completely. I have experienced going from 10MB/s writes, to 5, to 2 and then a completely dead phone. This extends the life of eMMC by only writing Android updates to eMMC and will improve responsiveness in phones with very worn eMMC flash.
This is work in progress (some slowdowns occur depending on the card), but I have been daily driving this mode for two months now. I have made adjustments so that the microSD stalls less than stock 'fstab' and EXT4 filesystem.
Example of 64GB card, w/ backup partition (p2) created, still 26GiB free for apps:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
---
THIS MAY DELETE YOUR DATA OR SOFT-BRICK YOUR PHONE. Be careful beforehand and backup your data to another microSD card.
IF YOUR PC HAS eMMC DRIVE, /dev/mmcblk1 MAY BE YOUR OS. Check before doing anything and after each reboot, as sometimes Linux reassigns them on machines with eMMC + card reader.
---
TODO/BUGS
---
- Used space will be messed up if you use more than one partition (can't be mounted as removable storage) but free space will be correct.
- Sometimes I have experienced reboots, with no data loss that I can find. I don't think it is related to this ROM mod.
- F2FS is still experimental and has no way to recover from a corrupted drive/card. If something goes wrong, your only option is to dump the files with PhotoRec software and try to recover what you can.
The data will be there but F2FS can't seem to recover from a damaged superblock.
I have used on one phone without issues for 3+ years but when there is SB corruption it can't recover.
- Push this to a 16.0 ROM, which is lighter on the RAM and has ambient display. (just personal preference) This requires a custom ROM.
---
HARDWARE
---
First you need a capable microSDXC card, I have only tested SanDisk Ultra A1 which are not perfect. SanDisk Extreme 64GB A2 class are probably good but please report performance if you try it. I only recommend this class of cards.
The problem with Sandisk Ultra is that sometimes they stall doing GC and the phone also stalls. This is quite random and will be worse if you use the phone for extended periods without time for background GC to run.
The advantages is they do some kind of wear-levelling and I am yet to see one of these cards die to wear out, despite being used on RPi machines 24/7.
SanDisk Ultra cards (A1 class) and most SanDisk USB drives have issues where they perform great when new but don't do proper garbage collection and will get very slow after a couple of days. So benchmarks look fine but real world it becomes really bad. I had a USB drive that only recovered to 5MB/s writes, that was the baseline, after three or four sequential wipes to most of the drive. These types of cards will also be very slow if you try them as adoptable storage.
Any microSD will work but choose a fast one and please help test different brands.
You also need a PC, preferably with Linux, and a card reader of any kind. This can be done in Windows through TWRP and ADB access but I don't recommend it.
---
BASICS
---
We will format the microSD card with one or two partitions. If you split it, you can do manual backups for the second partition but you can't mount it. Remember that by using /data on the SD card, you cannot use TWRP to backup to it. The modded '/data' partition will mount as a removable SD card in stock TWRP.
Download files:
Arco68's LineageOS 17.1 ROM
The new 'fstab' file from Pastebin: fstab.qcom.
Process flow:
Install 'adb' and enter TWRP mode to access shell,
Use fdisk to create a DOS partition table
Add a new partition with half or full size, starting at block 32768. Leave 1 or 2GiB space free and don't touch it with data. Some types of cards will be able to use these for better performance.
(OPTIONAL) Create 2nd partition right after the first one.
Change the partition(s) type to 'Linux' and spare space as 'Hidden HPFS/NTFS'.
Format partition(s) as F2FS (can also do ext4 but should be unusable),
After this, we will install arco68's 17.1 ROM and push a new 'fstab.qcom' file that will mount the microSD partiton as '/data' and the phone can use it to install apps and user data.
Encryption has not been tested and is not expected to work.
---
PREPARE microSDXC CARD
---
You should also format the card on a Linux PC if you can, as recovery has outdated f2fs-progs or not at all. The ROM has modules and will boot F2FS when instructed to do so.
Check that /dev/mmcblk1 is your microSD card reader BEFORE PROCEEDING! Otherwise, you may nuke your OS!
Do the procedure as listed before, first thing is to 'p' to check you are on the right microSD drive.
Then create the new DOS table and the partitions. This is for expert users only, at this time I will not post detailed fdisk commands.
The output from 'p' print command looks something like this:
Disk /dev/mmcblk1: 31.00 GiB, xxx bytes, 16252928 sectors
Disk model: Sandisk Ultra
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0xZZZYYYXXX
Device Boot Start End Sectors Size Id Type
/dev/mmcblk1p1 * 32768 62947327 62914560 30G 83 Linux
/dev/mmcblk1p2 62947328 yyyyyyyy xxxxxx 900M 17 Hidden HPFS/NTFS
Click to expand...
Click to collapse
You have to manually type '62947328' for the start of the hidden partition. This is only required if you had put data on the card, upon which you should TRIM the unused blocks:
blkdiscard -v /dev/mmcblk1p2
Click to expand...
Click to collapse
If you have a partition to do backups, this moves to p3. Next we format p1 to use as '/data':
mkfs.f2fs -s 2 -z 1 -g android /dev/mmcblk1p1
Click to expand...
Click to collapse
Now we move the card into the phone.
---
ADB COMMANDS
---
This tutorial assumes you have arco68's LineageOS 17.1 from this ROM already installed.
You need to boot the phone in recovery mode by rebooting with VOLUME UP + HOME pressed, until you see 'recovery booting' on the top of the screen.
Next, mount the /system partition and push the new 'fstab' file from your PC:
adb push fstab.qcom /system/vendor/etc/fstab.qcom
Click to expand...
Click to collapse
After this is completed wait a few seconds, unmount system and reboot the phone. It should take a while for the first boot but you should see the setup screen and everything should be running.
If it is not booting, go to recovery or remove the microSD card and check if files are being created on the drive. If yes, everything seems ok. S4 Mini has a very long first boot, for some reason.
Enjoy your new S4 Mini storage of 32/64/128 GB!

RESERVED FOR microSDXC user reports.

I already have LOS 17.1 on my gt-i9192, is there any video tutorial to help out in the SDCARD mod process?

Not really. Are you familiar with Linux and formatting hard drives? If you are, it's mostly install the software and run the commands. You need to know how to find the sdcard device node in /dev (if it's sdX or mmcblk0/1, depending on the PC).
I can help you out or post a preformatted MBR file so you can just write it to the SDCard.

As my 18.1 phone has eaten it's eMMC, I think I'll do this on my next one. Have you used this with Magisk?

ivorget said:
As my 18.1 phone has eaten it's eMMC, I think I'll do this on my next one. Have you used this with Magisk?
Click to expand...
Click to collapse
I definitely recommend doing this then, as I had my eMMC also down to something like 2MiB/s sequential writes before it died - after a few months - and killed the phone completely.
I have never used Magisk nor really understand it's purpose. What would you want to accomplish?

so it's possible format microSD as EXT4?

Yes, it is but you would need to change the above FSTAB file entry for 'mmcblk1p1' from F2FS to:
/dev/block/platform/msm_sdcc.3/mmcblk1p1 /data noatime,nosuid,nodev,auto_da_alloc
I would advise you to not use EXT4 as that is usually more suited to flash with advanced FTL and even TRIM support.

tM&M said:
I definitely recommend doing this then, as I had my eMMC also down to something like 2MiB/s sequential writes before it died - after a few months - and killed the phone completely.
I have never used Magisk nor really understand it's purpose. What would you want to accomplish?
Click to expand...
Click to collapse
Sorry, just saw this now. Yeah I went and ahead and did on 18.1 and it's working great so thanks for making this guide. I guess it's not really necessary as it hasn't caused you issues but I also fixed the relevant userdata partition line in /vendor/etc/selinux/vendor_file_contexts.
A GPT partition table also works fine now, maybe was just lucky as I saw afterwards that was a recent fix lifted into our kernel. Using gparted and mkfs.f2fs from a recent linux system doesn't seem to have caused any issues either.
I'm using a V10 speed card which I think is about the speed of the original eMMC so should probably be the suggested minimum.
Magisk I use for root, mainly for a Tasker setup to tweak charging to extend battery life. I'll tidy it up enough to share at some stage.
Anyway I took a chance and Magisk does work on this setup too.

ivorget said:
Sorry, just saw this now. Yeah I went and ahead and did on 18.1 and it's working great so thanks for making this guide. I guess it's not really necessary as it hasn't caused you issues but I also fixed the relevant userdata partition line in /vendor/etc/selinux/vendor_file_contexts.
A GPT partition table also works fine now, maybe was just lucky as I saw afterwards that was a recent fix lifted into our kernel. Using gparted and mkfs.f2fs from a recent linux system doesn't seem to have caused any issues either.
I'm using a V10 speed card which I think is about the speed of the original eMMC so should probably be the suggested minimum.
Magisk I use for root, mainly for a Tasker setup to tweak charging to extend battery life. I'll tidy it up enough to share at some stage.
Anyway I took a chance and Magisk does work on this setup too.
Click to expand...
Click to collapse
If you can share the context file that would be great. I was having some issues with contexts but this was not MOD related - happened wit the stock ROM - and had to manually fix contexts on TWRP. So maybe that was the issue.
Do please post what card you are using and if you experience performance degradation after a couple of weeks. SanDisk cards are notorious for only running well the first couple of days as they don't have background GC and maybe are not suited to F2FS/EXT4 at all.

tM&M said:
If you can share the context file that would be great. I was having some issues with contexts but this was not MOD related - happened wit the stock ROM - and had to manually fix contexts on TWRP. So maybe that was the issue.
Do please post what card you are using and if you experience performance degradation after a couple of weeks. SanDisk cards are notorious for only running well the first couple of days as they don't have background GC and maybe are not suited to F2FS/EXT4 at all.
Click to expand...
Click to collapse
OK I've attached the file - remove the .txt extension. Search for mmcblk1p1 to see the changes - one line referencing mmcblk1p1 commented out and another line where the data partition is changed to that.
(Full disclosure: I'm using partition 4 so I didn't need to comment out the mmcblk1p1 partition line in my setup.)
Reminder that the file is for 18.1 (unless you find that it's the same for 17.1). And to be clear for anyone else reading the full path it goes under is:
/system/vendor/etc/selinux/
My SD card is a Kingston Canvas Select Plus. The package indicates Class 10 U1 so maybe better to say that as the V10 only appears on the card label.
I am a little concerned that the default android 3-day trim seems to be taking longer but I'll keep an eye on it:
$ logcat | grep -E 'trim |Trimmed'
02-04 06:50:34.969 191 9173 D vold : Starting trim of /data
02-04 06:51:09.778 191 9173 I vold : Trimmed 397697024 bytes on /data in 34799ms

Related

[DEV] CM7 Developers Thread

Please limit this thread to development comments and questions!
The users thread is for all other posts.
When in doubt, post in the users thread.
After many long nights of banging our heads against keyboard, the CM7 port is finally shaping up.
In addition to nightly releases, we may from time to time be releasing test builds here for your feedback and enjoyment. If you find issues please feel free to post here in this thread. Leave all other feedback for the user thread.
Where to get progress news:
I will tweet progress from time to time.
Twitter: @dalingrin
We are usually in #nookie on freenode.
You can always check the Cyanogen [email protected] http://github.com/cyanogenmod​
Current Issues
DO NOT FORMAT YOUR SD CARD IN CM7. DUE TO A VOLD ISSUE THIS WILL FORMAT YOUR /BOOT INSTEAD OF THE SD CARD!
****Should be fixed in nightly 13****
-Standy battery life is not as good as stock
Because of a kernel bug CM7 does not fully sleep. The result
is ~1% battery drain per hour while the screen is off. With normal use I usually go
1 - 2 days between charging.
***fixed in 2.6.32 builds***
-A few apps do not scale to full screen
In order to get Market and Maps to work fully the lcddensity has to be
set to something other than 160 causing a few apps not to scale properly.
-Wifi slow to reconnect at times
****fixed****
-Video playback is slow
****fixed****
-Default rotary lockscreen does not fit screen
****fixed****
-Market partially works
****fixed****
-Bluetooth does not work
****Update**** Bluetooth now works in CM7.
Bluetooth is working seemingly perfect except for the range. Unfortunately, the range is terrible.
Depending on the device you are paried with, the range is between 1-5ft. Any ideas on how to
fix the range issue would be much appreciated.
-Do not use SetCPU profiles
If you enable SetCPU profiles it will become a runaway process eating 100% cpu.
Setting your cpu clock can be done in Cyanogenmod Settings. Under Performance->CPU Settings
-Internal storage partition is not mounted on boot and is not shareable via USB
****fixed****​
Download and Install
MUST USE 3.0.1.0+ RECOVERY:
This is installable ONLY with an ext4 aware Clockwork Mod Recovery.
*** Also it is critical to be aware that installing CM7 will write to the internal emmc of your device. You are advised NOT to try it. But if you choose to do so, understand you do so entirely at your own risk. Read sections 15-17 of the GPL for the gist of this disclaimer. There is no warranty or claim of usefulness or fitness for any particular purpose. No one but you shall accepts responsibility for what may happen if you download or try to use this development software. ***
Download for CM7:
Nightlies:
http://mirror.teamdouche.net/?device=encore
Install instructions:
http://forum.xda-developers.com/showpost.php?p=11452450&postcount=19​
Post Reserved.
Developer Tips
(Standard do-at-your-own-risk-and-responsibility disclaimers apply.)
* For those developers building from source:
In $OUT, you'll find a few files:
recovery.img --> rename to uRecRam
kernel --> rename to uRecImg
Now you've got the ext4 clockworkmod for mmc built from source.
* Also, there's also a script in $OUT called:
sd_ramdisk_packer.sh
Assuming this works, it should repack your $OUT/root (mmc ramdisk) into a uRamdisk that can be used with a bootable SDcard. The stuff in /system would go in the /system partition of the SD card (p2).
The result: a bootable CM7 on SD. It may not be wise to distribute as Cyanogenmod for encore is a fast-moving target-- unless you plan to create a new one every day or something.
* If you don't like the buttons at the top for some reason, there's the SoftKeys app as well as Button Savior.
* There is a slightly-themed u-boot.bin in device/bn/encore/prebuilt/boot/. It is simply a recompiled u-boot from BN's source.​
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Info about emmc geometry
If your emmc is hosed and you want to start COMPLETELY from scratch, understand that the underlying geometry (before any partitions are created) of your emmc must be set up correctly on OMAP machines such as the nook before any partitions are created.
You can read more about that stuff here. If you are booted into an "emergency" SD card and have a totally hosed emmc, you can use fdisk to format /dev/block/mmcblk0 to the correct geometry, and then create the partitions one at a time, with a vfat partition as your /boot partition (p1). Then put mlo, u-boot.bin, uImage, uRamdisk, uRecImg, and uRecRam in /boot (p1) and you should have a bootable system.
Read the link above about SD/MMC formatting for OMAP3. Your nook is an OMAP3621, so you gotta get that geometry right, otherwise it won't boot. Luckily, the instructions on using fdisk are pretty good.
More info:
your emmc: /dev/block/mmcblk0
your sd: /dev/block/mmcblk1
Partition Info
the partitions you should have created are at:
/dev/block/mmcblk0p1 == /boot
/dev/block/mmcblk0p5 == /system
etc
/boot, /rom, and /media are of type "vfat"
/system, /data, and /cache are of type "ext4"
/factory (p3) isn't used by cm7
partition 4 is just there to allow you to create partitions 5-8
Sample instructions for copying files from cm7 update.zip on local computer to emmc /boot
You should be able to copy those four files simply by getting the lastest cm7, unzipping it on your computer, then once you boot into your bootable SD card, do:
Code:
COMPUTER> adb shell
# mkdir /data/bootmountpoint
# mkdir /data/systemmountpoint
# mount /dev/block/mmcblk0p1 /data/bootmountpoint
# mount /dev/block/mmcblk0p5 /data/systemmountpoint
# exit
COMPUTER> adb push mlo /data/bootmountpoint/
COMPUTER> adb push u-boot.bin /data/bootmountpoint/
COMPUTER> adb push uImage /data/bootmountpoint/
COMPUTER> adb push uRamdisk /data/bootmountoint/
COMPUTER> adb push my/path/to/sdcard/system /data/systemmountpoint/
Man, everyone makes better (prettier) release threads than I do.
oups, to delete
I can mount SD card find from my PC on Ubuntu.
Some apps don't show up on search, only one worth noting right now is Dolphin browser. I can find all kinds of add-ons, but not the app itself.
The lockscreen defaulted to the slider, but when I rebooted it went back to rotary. I went to settings and changed it back to slider.
Edit: Also to note is when I first launch the market, I get a force close on search function unless I use menu->search first. Will try fix permissions. Edit: fix permissions doesn't work, I must use menu->search the first time.
Edit 2: Beautiful Widgets shows up in market but says it isn't there when I try to install.
I had no trouble mounting SD to my PC (windows 7 64). I don't remember which now, but many apps showed in market, allowed me to install, but when I tried to 'open' from their market page I was told they weren't there - just opening my app drawer showed them and they worked fine. Something in market for that one.
screen on/off notification
is the screen on/off setting working?
I've also been able to mount to sd via Ubuntu and OS X.
Is there any way to get/use the recovery without using a burn to SD method?
going to try it out now... thanks dalingrin
i notice the file name is the same as the first test release. hopefully i have the right file.
-edit-
so yes i did have the correct file. lockscreen fix works and am still able to change it to rotary although it 'appears' to be set on rotary already.
market works... so far i have not found anything missing.
i have not been able to connect to usb. first connect got me a failed driver install and i don't see any usb mounting option in settings. -edit- just tried again and now it works? probably a windows thing.
dalingrin said:
Fixes that need testing
-USB storage mounting
We need folks to test mounting your sd card from within CM7 onto your computers.
-Market Access
This build contains a partial fix for Android market filters. I don't expect all apps to be available yet but I'm not sure what is and not available in the current build.
-Default lockscreen
I have submitted a patch upstream to change the default lockscreen from rotary to the traditional slider. This is because the rotary lockscreen does not scale for the nook. This patch required changing some mechanics in CM and needs testing. In particular, it needs to be verified that the initial lockscreen is the traditional slider but can still be changed in Cyanogenmod Settings.
Click to expand...
Click to collapse
zpure awesomeness! I can't wait for the bugs to get ironed out
here is a problem I have noticed. When I try to buy and app I get a force close and I cannot purchase an app.
UPDATE: I installed the newest market 2.3.2 and it does the same thing. I did the wipe cache, force stop on market and framework services, rebooted and still cannot purchase apps. Gotta be something in the build that is causing it to stop. I can download free apps just fine and the apps I already purchased.
jkurl said:
here is a problem I have noticed. When I try to buy and app I get a force close and I cannot purchase an app.
Click to expand...
Click to collapse
just checked this and i get force closes as well.
It's a beautiful thing. Thanks for the great work, guys!
I flashed the update from the original version that thecubed released and can report the following market bugs:
Astrid, Facebook, and Flixster do not show up in the market.
In the market, clicking on All Games / Top Free leads to a loading circle that never completes (no results ever get shown).
So there seem to be 2 different RC1s (both called the same thing) plus a single nightly. Which one should we be testing?
No maps, Facebook, or pulse in market running release from this thread
FletchF said:
So there seem to be 2 different RC1s (both called the same thing) plus a single nightly. Which one should we be testing?
Click to expand...
Click to collapse
OK, I gather it went like this:
old RC1->first nightly->this newer RC1
so, test the RC1 from this thread until newer nightlys start to appear.
These are the only apps I use I can't see in the market:
imdb
minimalistic text
google maps and street view
simi clock
wolframalpha
speedtest.net
I tried adb pushing all of them but wolfram from my htc desire. Imdb, minimalistic text and simi clock work, speedtest and google maps force close.
I also pushed Cyanbread.apk to /system/app and selected it from theme manager, it also seems to work great.
In the market, clicking on All Games / Top Free leads to a loading circle that never completes (no results ever get shown).
Click to expand...
Click to collapse
That only happens sometimes for me. Most of the times it works without problems.
(edit) Oh, and mounting the sd card also works ok.

[GUIDE] Increase RAM using Swap File and Swap Partition

Copied from CarlDeanCatabay post
Increase RAM using Swap File and Swap PartitionNOTE:
I spent hours updating my guides and I don't ask you to press that THANKS button, be kind enough not to copy my guides to other forums. I know some noobs want to make a name on other forum boards... but hey, that's not an excuse! ​WARNING: This mod may degrade SD card life.
​What you need:
MiniTool Partition Wizard for SD Card Partitioning
A MicroSD HC 4GB or higher class 6 or class 10
MicroSD HC Card Adapter
A card reader (if your pc doesn't have card reader built in | USB Mount is not adviseable)
Swapper2 from Google Play Store [DOWNLOAD]
ADB Shell or terminal Emulator (to check if swap is activated)
Make sure you have BusyBox installed
Before we start, lets do some reading . . .
RAM
What is RAMRandom Access Memory (RAM) is temporary data storage that the CPU uses during calculations. The more RAM a device has, the more calculated results the CPU can store - which means less time the CPU has to do the same thing over and over again. In other words, the CPU can check RAM to see if it has already made a particular calculation in the recent past. If it has, it can use the pre-computed results instead of wasting processing time recomputing the same calculation. In short, more RAM means a more efficient (and faster) device. ​SWAP
What is SWAPSwap is, in short, virtual RAM. With swap, a small portion of the hard drive is set aside and used like RAM. The computer will attempt to keep as much information as possible in RAM until the RAM is full. At that point, the computer will begin moving inactive blocks of memory (called pages) to the hard disk, freeing up RAM for active processes. If one of the pages on the hard disk needs to be accessed again, it will be moved back into RAM, and a different inactive page in RAM will be moved onto the hard disk ('swapped'). The trade off is disks and SD cards are considerably slower than physical RAM, so when something needs to be swapped, there is a noticeable performance hit.
Unlike traditional swap, Android's Memory Manager kills inactive processes to free up memory. Android signals to the process, then the process will usually write out a small bit of specific information about its state (for example, Google Maps may write out the map view coordinates; Browser might write the URL of the page being viewed) and then the process exits. When you next access that application, it is restarted: the application is loaded from storage, and retrieves the state information that it saved when it last closed. In some applications, this makes it seem as if the application never closed at all. This is not much different from traditional swap, except that Android apps are specially programed to write out very specific information, making Android's Memory Manager more efficient that swap. ​Step by Step GuideHow to create Swap PartitionUsing MiniTool Partition Wizard
Plug in you MicroSD HC Card to your computer using the card adapter. (Do not use USB Mount)
Open MiniTool Partition Wizard and look for the card
Right Click on it and select Delete Partition
Click on Apply to Delete the Partition
Right Click on it again and select Create Partition
Set the partitions as follows:1st partition:
Label: Android-SD
Create as: Primary
File System: Fat32
Partition size: as much as you want! ​2nd partition:
Label: Android-EXT3 (2nd partition is for EXT which you can use for A2SD or Link2SD)
Create as: Primary
File System: EXT3 (be it a custom kernel or ROM with EXT4 support, use EXT3 still -play safe! )
Partition size: MIN: 256 MB MAX: 1024MB (1GB)​3rd partition:
Label: (do not put anything)
Create as: Primary
File System: Linux Swap
Partition size: MIN: 32MB MAX: 1024MB(1GB) RECOMMENDED: 256MB​
After creating partitions, click Apply to apply changes.
Using ClockWorkMod
Reboot to Recovery
Go to Advanced and Debugging
Select partition SD card and select the partition size that delights you
How to use Swap
For us to be able to use swap file or swap partition, we need to use Swapper2 which you can get from Google Play.
Download and Install Swapper2 (of course)
After installing, open Swapper2 and navigate to Menu > Settings
Swapper preferences: (for kernels that doesn't have swap partition support)
Run swapper at startup (put a check)
Swap place: /sd card/swapfile.swp (you can place it in a folder if you don't like a messy sd card structure )
Swap size: MIN: 10 MB MAX: 256MB RECOMMENDED: 32MB (choose any)
Swapiness: RECOMMENDED: 10MB SYSTEM DEFAULT: 60MB MAX: 100MB (choose any)
Safe unmount (put a check)
Safe remount (put a check)
Advanced preferences: (for Kernels that supports swap partition only)
Use swap partition (put a check)
Swap partition: /dev/block/mmcblk0p2​
After setting preferences, press back and tap on "ON" to turn on swap. Reboot afterwards
How can I tell if swap is running?Go to the terminal emulator - or open adb shell - and run 'free'.
If it looks like this (with zeros in the swap line), you do not have swap:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
If it looks like this (with anything other than zeros in the swap line), you do have swap:
​NOTE:
You need to turn off swap before you mount SD via USB, if you don't you will not be able to mount sd as swapfile is active and set to read only which will deny request to mount USB Storage.​Confirmed Working:
works on my ace Rom StockLite v6 with kernel : cf-root b83 from ketut​
Thanks!
Very helpful - noob notwithsanding
thanks for the info. Will it show in task manager the total ram size increase?
\\
says swapper 2 is incompatible ace. can i have the apk?
BUMP !! Anyone?
lukip005 said:
BUMP !! Anyone?
Click to expand...
Click to collapse
No
Sent from my GT-S5830 using Tapatalk 2
does anyone have tried this. ?
is this really working . ?
manthan2611 said:
does anyone have tried this. ?
is this really working . ?
Click to expand...
Click to collapse
its impossible to increase the ram size. it is a Hardware part. swapping will destroy your flashmemory
Sent from my GT-S5830 using Tapatalk
I try these steps More than once, but also each time have 1 error when try turn on swap:
Code:
swapoff /dev/block/mmcblk0p2 invalid argument
Thanks for this post
Friends, you can't increase your RAM. It's size is fixed in the RAM chip. There's nothing like a Linux swap partition/Windows ReadyBoost to help with this but overclocking your CPU can increase your performance and also try to install lighter ROMs like AOSP ROM. I hope this will help you.
Kindly,
MZ
Does it affect on battery's life? shorter?
nambont12 said:
Does it affect on battery's life? shorter?
Click to expand...
Click to collapse
Yes, it will affect your battery life a bit as it is always running in the background. Hope I Helped

Fix for faulty Acer B1 "Partition Error" Workaround

Hi devs,
hoping on help of people who better know about this materia than me, I hope to create a workaround for OTA repair on faulty Iconia B1-A71 from Acer.
In this case we need devs who has knowledge about stock JB and also testers, who has a B1 with problems on installing OTA Updates with "Invalid partition settings" on FAT.
Status:
More and more user of B1 report the problem of updating their device by OTA. It appears to be a mass problem, which Acer has no solution for.
After checking on rooting issues we already know, that there is a difference in dumchar_info between "normal" and "faulty" B1´s:
Android Partition:
http://forum.xda-developers.com/showpost.php?p=40987372&postcount=197
Normal - android 0x0000000026500000 0x00000000020e8000 2 /dev/block/mmcblk0p3
Faulty - android 0x0000000015e00000 0x00000000020e8000 2 /dev/block/mmcblk0p3
Furthermore there is a difference (and this I assume is the problem for OTA routines) on FAT partition:
Normal - fat 0x0000000148638000 0x00000000882e8000 2 /dev/block/mmcblk0p6
Faulty - fat 0x00000001b0a38000 0x00000000232e8000 2 /dev/block/mmcblk0p6
Those who was in charge of rooting the B1 knows, that we have dumped the android partition by dd using the offset shown in dumchar_info.
In this logic it would be impossible to dump a faulty B1 system.img by using the normal offests - you would not "meet the partition/bits", if you use wrong data.
BUT - as we found out it was possible to dump the system.img from a faulty B1 using the offset of a normal B1! User agentdeep confirms a successful root from scratch on Linux base using the normal offsets: http://forum.xda-developers.com/showpost.php?p=40988791&postcount=202
Now my idea:
- According entonjackson pawitp already assume, that the dumchar_info may be wrong, since otherwise agentdeep would have a bricked device. IF we can proof that OTA checks this value - would it make sense to push a corrected dumchar_info through the ENGMODE backdoor? Anyone out there, who is able to save and extract the OTA, to see the routine?
- If it dont work, does it make sense to try a root from scratch on Linux - and fix the dumchar_info afterwards? Is it possible?
- How can I check a report of existing partitions on Android? Do I have to run busybox from terminal, to start fdisk? I would like to validate the partition information inside the dumchar_info...
This subject may be not as hot as a rooting thread - but more and more user report their problem with update errors, and we may help lots of them ... and show Acer, how this work has to be done...
Thank you in advance!
Sub.
I would like to try that procedure enton asked me by replacing 15e to 265 in dumchar_info. But knowing there is no way I can restore my nandroid backup if something bad happens, I will hold for now
Nice to meet you here, agentdeep I was hoping you will join this thread, since you are the one who made me thinking about this solution...
From my point of view the risk of bricking the tab after changing the dumchar_info is ... pretty low. As long as we have a working system you still can switch back to your origin value. But at that point I would also like to get some more background from the Linux masters in here. Currently I have a problem to understand about the dumchar_info - what is it? How it is created? Do I understand right, that it is an output from Linux kernel?
When this file is accessed? On boot? Which result we will have, if we change it? Is it a properties file, used to set up partitions - or just an info? IF it is only an information we can change it without any fear...
https://github.com/ameer1234567890/...To-Gather-Information-About-Partition-Layouts
This page gives us the information, that "fat" is not just the format - it is the internal memory on MTK based devices. Which finally gives me more inscentive to believe that we have an issue with 8gb and 16gb versions. On that I have seen a thread in a different forum, where a user reported to have opened the B1 and found out that there were 16gb internal memory instead of 8gb as shown in the device properties.
Probably we have "masked" 16gb-versions declared as 8gb???
alba81 said:
Nice to meet you here, agentdeep I was hoping you will join this thread, since you are the one who made me thinking about this solution...
From my point of view the risk of bricking the tab after changing the dumchar_info is ... pretty low. As long as we have a working system you still can switch back to your origin value. But at that point I would also like to get some more background from the Linux masters in here. Currently I have a problem to understand about the dumchar_info - what is it? How it is created? Do I understand right, that it is an output from Linux kernel?
When this file is accessed? On boot? Which result we will have, if we change it? Is it a properties file, used to set up partitions - or just an info? IF it is only an information we can change it without any fear...
Click to expand...
Click to collapse
1st, thanks for the thread! It's really been time to create one for this issue.
I will put a link on the 1st post of my thread to this one, for people experiencing this issue.
Regarding agentdeep, I also think changing the dumchar_info won't brick the device. But we should first make sure it won't brick.
Although I'm using Linux for like 10 years now, I cannot help a lot at this moment.
But if there will be a solution, I will put it immediatly into my toolkit
So, I made a small calculation for the offsets, and this seems to confirm a wrong information in the dumchar_info:
Normal B1 Offset Android size:
Hex: 26500 Dez: 156928 Multiplied with 4096=642777088 Divided by 1024 = 627.712kB
Faulty B1 Offset Android size:
Hex: 15e00 Dez: 89600 Multiplied with 4096=367001600 Divided by 1024 = 358.400kB
If you take into consideration, that the system.img.gz takes (in packed form!) about 350 MB, unpacked even 627,712kB (size of the parition, see above) - then it appears that the information MUST be wrong - if I am right with my calculation...
Following this we have these values for internal memory on both versions:
Normal B1 Offset FAT size:
Hex: 148638 Dez: 1345080 Multiplied with 4096=5509447680 Divided by 1024 = 5.380.320kB
Faulty B1 Offset FAT size:
Hex: 1b0a38 Dez: 1772088 Multiplied with 4096=7258472448 Divided by 1024 = 7.088.352kB
Anyone with 15e can check available space on internal memory? In fact it should be about 5GB as I remember (have the B1 not with me now).
Maybe I am writing complete bull**** here? Anyone can confirm my calculation..??
Thanks in advance!
alba81 said:
So, I made a small calculation for the offsets, and this seems to confirm a wrong information in the dumchar_info:
Normal B1 Offset Android size:
Hex: 26500 Dez: 156928 Multiplied with 4096=642777088 Divided by 1024 = 627.712kB
Faulty B1 Offset Android size:
Hex: 15e00 Dez: 89600 Multiplied with 4096=367001600 Divided by 1024 = 358.400kB
If you take into consideration, that the system.img.gz takes (in packed form!) about 350 MB, unpacked even 627,712kB (size of the parition, see above) - then it appears that the information MUST be wrong - if I am right with my calculation...
Following this we have these values for internal memory on both versions:
Normal B1 Offset FAT size:
Hex: 148638 Dez: 1345080 Multiplied with 4096=5509447680 Divided by 1024 = 5.380.320kB
Faulty B1 Offset FAT size:
Hex: 1b0a38 Dez: 1772088 Multiplied with 4096=7258472448 Divided by 1024 = 7.088.352kB
Anyone with 15e can check available space on internal memory? In fact it should be about 5GB as I remember (have the B1 not with me now).
Maybe I am writing complete bull**** here? Anyone can confirm my calculation..??
Thanks in advance!
Click to expand...
Click to collapse
Yeah internal space is 5.12 GB like posted here in bullbrands post:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Note: this is after swapping internald and external sd...
The calculation looks good, but i don't know why the f... you multiply with 4096 and divide by 1024... I'm working as a developer and now I really feel stupid, because I really just don't know.
entonjackson said:
The calculation looks good, but i don't know why the f... you multiply with 4096 and divide by 1024... I'm working as a developer and now I really feel stupid, because I really just don't know.
Click to expand...
Click to collapse
Dont worry I could explain as follows: 4096 is the qty of bits you write at once on dd, and 1024 - logically to convert bits to KB.
Well, so we see that nothing is right in the dumchar_info, at least on Android and FAT partition, on faulty B1´s. Now we know there is a mistake - and need to validate the right offsets. Anyone has experience with fdisk on Android? Do I have to run it from busybox from terminal emulator?
And can anyone experienced tell us the specifications of dumchar_info? I found out it is a MTK-own chart, which is not existing on other CPU based devices .... which means for me - it can not be that critical in regards to format table, right?
On a rooted device - can we use a log to see when the dumchar_info is triggered?
alba81 said:
Dont worry I could explain as follows: 4096 is the qty of bits you write at once on dd, and 1024 - logically to convert bits to KB.
Well, so we see that nothing is right in the dumchar_info, at least on Android and FAT partition, on faulty B1´s. Now we know there is a mistake - and need to validate the right offsets. Anyone has experience with fdisk on Android? Do I have to run it from busybox from terminal emulator?
And can anyone experienced tell us the specifications of dumchar_info? I found out it is a MTK-own chart, which is not existing on other CPU based devices .... which means for me - it can not be that critical in regards to format table, right?
On a rooted device - can we use a log to see when the dumchar_info is triggered?
Click to expand...
Click to collapse
Ah I see. very easy. so bs=4096 is blocksize and well ok 1024 I already guessed could be convertion from bits to bytes. alright.
Then I would say, yes. the calculation makes sense indeed.
Now we only need someone that tries to write the right parition info into dumchar_info.
volunteers hands up! :victory:
entonjackson said:
Now we only need someone that tries to write the right parition info into dumchar_info.
volunteers hands up! :victory:
Click to expand...
Click to collapse
The biggest problem on that point is - you need to have either root, or do it by obtaining "temporary backdoor root" through ENGMODE. And the qty of user having root on faulty B1 is still pretty low...
alba81 said:
The biggest problem on that point is - you need to have either root, or do it by obtaining "temporary backdoor root" through ENGMODE. And the qty of user having root on faulty B1 is still pretty low...
Click to expand...
Click to collapse
i know busybox has fdisk binary.
adb doesn't know fdisk?
Where can I call it thru ADB?
Starting busybox from internal memory thru Terminal Emulator also makes me problems ... permission denied.
alba81 said:
Where can I call it thru ADB?
Starting busybox from internal memory thru Terminal Emulator also makes me problems ... permission denied.
Click to expand...
Click to collapse
There is none. I thought fdisk comes with adb, but... no.
But maybe we need no fdisk. If i understood it right, wie only must edit the dumchar_info so the system "believes" it has the right partitions again.
Yes, obviosly the update process checks this value. As you already checked the /proc/emmc shows different values, and /proc/mtd is empty. /proc/partitions contain different information type.
Before changing an important value I think we need to validate that any change in dumchar_info remains after reboot, since the update failure notification appears in recovery mode during update - right?
Edit:
I do not get access to dumchar_info. Going through ES File Manager I set the properties, and even it shows after changing its saved - its not. How can I get the rights? And how I can take the rights for system away to not be able to access it any more? Each time I open the properties of it I see a different date ... is it in permanent access?? Or do I need a different file Explorer?
Edit2:
Wikipedia is my friend. Ok, now I know - dumchar_info is a procfs, generated by the kernel during boot and not saved. So I am affraid ... we are stuck on a faulty kernel issue?
Where does the kernel gain this Information from during boot? Anybody an idea?
I hope this helps
agentdeep said:
I hope this helps
Click to expand...
Click to collapse
Thank you - I will validate later on, once I am at home ... have now only my n8000 with me.
Ok, checked - my version is the same, except:
[email protected] (after Linux version 3.4.0)
which I think can not be that important, since all other release data is similar. So it is not the kernel we have to fight with - at least...
Ok, so following on this subject we need to see what comes up in the future:
http://forum.xda-developers.com/showpost.php?p=41168837&postcount=295
At least the reason seems to be confirmed from Acer site - a faulty format which is reported.
IMHO it can not be only the update with the problem, the device itself reports a different format in dumchar_info, not the update.
Well - we´ll stay tuned...
hi there,
i have a faulty B1 with root....also i tried the Factory Reset Workaround several times, it does not work for me....everytime about 10-15% i got the message "partition error...bla".
So if you want me to to test things...go on
I'm new here, however I successfully rooted my device using the "toolkit" even though I have
Code:
Faulty - android 0x0000000015e00000 0x00000000020e8000 2 /dev/block/mmcblk0p3
Thanks to Enton.
My internal storage is reported to be just 5.17GB (not 8GB as expected) confirming the figures in a previous post.
I complained to acer support about the size of the internal storage being nearly 3GB short of what it should be and that I thought it was down to a "memory allocation error".
There response was " As you have mentioned in the previous e-mail internal storage shows as a 5.17GB, I would like to inform you that the other space of the unit is occupied by Android Operating System, customer will not be able to use the complete 8GB from the unit, as Operating system needs a space. "
Is this complete and utter BS? I understand 4.1.2 Jelly Bean is just over 200MB.
Can someone please confirm.
BTW if any dumps are required from my "faulty" device (I do not have the partition error though) I'm happy to try.
BTW2 I've installed the new PMTUpdate patch "FixG1PMT" and that did nothing for my problem.

Swapping SD cards adoptable storage

Hey there folks,
I've been using adoptable storage on my Moto X pure with great success.
I'm hoping that someone has more experience with adoptable storage than me that can help.
I am currently using a 32 gigabyte SD card and want to swap it with a new 64 gigabyte SD card. Can I just copy the contents from my old 32 gigabyte card to my new 64 gigabyte card and put the new 64 gigabyte card in the phone and expect it to work as before?
Thanks for any insight.
bumpbump
I have the same problem with a S5 (cm13). Used a 32gb card initially. Now bought a 128gb card and I want to upgrade it moving everything from the old card to the new one.
I found no documentation on internet so if no one has a better suggestion I think I'll go for the "raw" way.
I'll turn off phone, take out old card, attach it to a linux box along with the new one and "sudo dd if=/dev/oldcard of=/dev/newcard"
Once data is copied I'll try to insert the "new" card in the phone and see what happens. If the device works normally I'll power it off again, connect to the linux box again and create a new entry in the partition table to use the "remaining" empty space as an external "portable" SD.
I hope this will lead to the same "resulting" configuration when you use the command "sm partition disk:XXX mixed yy"
I wish the best, I ended up needing to update my rom so I just wiped everything and started fresh with the new Microsd. However I'm still curious if your method will work for future reference.
Thanks. If I succeed I'll post a tutorial on how to do that. Maybe someone finds it useful.
It works.
So...How to do that?
turn off phone (wait for it to be really off).
extract microsd.
insert into microsd reader (it's faster if you have TWO microsd readers, usb3. I had just one and times were longer)
boot ubuntu (or any other linux)
copy the image of the old sd card on the disk.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
once done take out the microsd reader from usb port, swap card with the new one and plug it again in usb port.
(optional) verify that your microsd reader works good with the new card.
Good! device contains only one partition (a big exfat one).
ensure that the system DOESN'T mount automatically the card. if it does "eject" (unmount) it.
copy back the data onto the new sdcard.
once done we got to tell the kernel to refresh the partition table.
the error just means the disk is bigger than what the partition table knows. We got to fix that and another problem. GPT has a backup partition table at the end of the disk (which on the new disk isn't "at the end" any more 'cause it's located at the end of the "source" disk)
check the partprobe result on dmesg. we should see that the kernel saw the new partitions and complains about the backup. let's fix it.
(optional) take out the reader from the usb port, put card in the phone, boot up, let it settle, check everything works fine (it should work exactly as before, no extra space yet).
turn off phone again (let it turn off completely), extract sd, put sd in reader, put reader in USB port (i plugged it in another usb port and the device became sdb...but it's just the same card)
let's create the "portable" space with the unused space. I used parted, you can use whatever you like.
and create the filesystem... (I did also a check on the new FS to see it is everything ok)
do not forget to set the partition type you just created as type 0700 (windows).
when you first create the "unformatted" partition entry in the partition table, by default, it gets "Linux filesystem" type. before putting the card back into the phone you gotta change the type to windows or android won't see it.
put card back in the phone...et voilà, the system says "hey, you inserted a new card, what do you want to do?" choose portable to leave the partition AS IS (I don't want to convert the new one to adopted storage too).
when you connect the phone through MTP you will see both the storage spaces
it's worth to note that this "raw copy" method creates problems if you try to read the card on windows 7 or earlier. why?
windows sucks (we all know it) and requires that the "portable" partition is the first in the gpt disk. (it is not, we added it at the end of the disk)
on windows 10 microsoft realized the world isn't all about windows and corrected this bug so you can just plug the sdcard on the port to read/write data.
Clarify please
LinoX said:
So...How to do that?
turn off phone (wait for it to be really off).
extract microsd.
insert into microsd reader (it's faster if you have TWO microsd readers, usb3. I had just one and times were longer)
boot ubuntu (or any other linux)
copy the image of the old sd card on the disk.
once done take out the microsd reader from usb port, swap card with the new one and plug it again in usb port.
(optional) verify that your microsd reader works good with the new card.
Good! device contains only one partition (a big exfat one).
ensure that the system DOESN'T mount automatically the card. if it does "eject" (unmount) it.
copy back the data onto the new sdcard.
once done we got to tell the kernel to refresh the partition table.
the error just means the disk is bigger than what the partition table knows. We got to fix that and another problem. GPT has a backup partition table at the end of the disk (which on the new disk isn't "at the end" any more 'cause it's located at the end of the "source" disk)
check the partprobe result on dmesg. we should see that the kernel saw the new partitions and complains about the backup. let's fix it.
(optional) take out the reader from the usb port, put card in the phone, boot up, let it settle, check everything works fine (it should work exactly as before, no extra space yet).
turn off phone again (let it turn off completely), extract sd, put sd in reader, put reader in USB port (i plugged it in another usb port and the device became sdb...but it's just the same card)
let's create the "portable" space with the unused space. I used parted, you can use whatever you like.
and create the filesystem... (I did also a check on the new FS to see it is everything ok)
do not forget to set the partition type you just created as type 0700 (windows).
when you first create the "unformatted" partition entry in the partition table, by default, it gets "Linux filesystem" type. before putting the card back into the phone you gotta change the type to windows or android won't see it.
put card back in the phone...et voilà, the system says "hey, you inserted a new card, what do you want to do?" choose portable to leave the partition AS IS (I don't want to convert the new one to adopted storage too).
when you connect the phone through MTP you will see both the storage spaces
it's worth to note that this "raw copy" method creates problems if you try to read the card on windows 7 or earlier. why?
windows sucks (we all know it) and requires that the "portable" partition is the first in the gpt disk. (it is not, we added it at the end of the disk)
on windows 10 microsoft realized the world isn't all about windows and corrected this bug so you can just plug the sdcard on the port to read/write data.
Click to expand...
Click to collapse
SO for clarity if we are using the exact same size and brand of storage, just faster, and want everything exactly the same we stop at step 10? Correct? I will use a usb c reader if I want removable storage. The primary thing for me is identical to original.
EDIT I meant step 9.
nooneelsesdroid said:
SO for clarity if we are using the exact same size and brand of storage, just faster, and want everything exactly the same we stop at step 10? Correct? I will use a usb c reader if I want removable storage. The primary thing for me is identical to original.
EDIT I meant step 9.
Click to expand...
Click to collapse
if you don't need the extra space yes, you just "dd" the "disks" (it's like a 1-1 copy of the card)...but nowadays it's kinda pointless and good quality, huge cards are very cheap...
Well shoot I tried it and it yelled at me to put back in the other card. My bad was they are in fact different brands, I think you need to stick with the same brand. I was coming from a Samsung Evo Plus Grade 3, Class 10, A1 and went to a SanDisk Extreme Grade 3, Class 10, A2, v30. I even dd'd the whole thing /dev/sdb. It knew new the brand... bummer.

[CLOSED][GUIDE] Resizing partitions

OUTDATED METHOD, CAN RESIZE PARTITIONS DIRECTLY IN "HEKATE".
This seems to be a popular question on the release thread, so I thought I would share the method I used to resize the partitions included in the stock switchroot android image.
You can do this a number of ways, I'm lazy tho.. so I went the fastest route I could think of.
All of the following steps were done on a linux virtual machine running the gparted live ISO.. this is not a tutorial how to setup a virtual machine or linux, I'm going to assume you're competent enough to do that as all the steps will require one or the other!
What tools are we going to be using?
gparted (GUI interface)
gdisk (terminal)
The only steps taken prior to what I'm going to share here is that I flashed the 16gb image to my microsd.
So what is the end goal?
Expand the general storage (fat32) partition.
Expand the android user data partition.
Allocate a partition for emummc (optional).
Repair the MBR which we destroy by resizing the partitions.
First thing I did was capture some data of the default partition layout for reference:
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Great now that we have that, lets get stuck into it.
GPARTED
Fire up gparted and you'll be presented with the following popup:
We want to hit the "Fix" button.. this will allow us to utilise all the remaining space on the microsd card.
As soon as we do this tho, there is no turning back.. you'll need to complete the tutorial.
What we're looking at here is the default layout, note the unallocated space highlighted below:
The first thing we're going to do is expand the android user data partition (sdd7 in the screenshot above).. Right click "userdata" -> "Resize/move".
I decided to go with 32GB which should be plenty, how large you want to make this partition is entirely up to you.
The next thing we're going to do is move the partition down the stack, we do this by entering "0" into the "free space following" field.
You'll notice the white box surrounded by the dark purple border has moved position to the far right to reflect your changes.. hit the "resize/move" button and confirm the warning window.
You can now see the "userdata" partition has moved down the stack, will be resized to 32GB and our unallocated space has moved up.
We're now going to repeat this process for the remaining android partitions (without resizing tho).. starting from the "dtb" partition and working our way up to "vendor".
Right click partition -> "Resize/move".
Modify "free space following" to "0".
Hit the "Resize/move" button.
Confirm the warning.
You get the idea.. repeat this process until you reach the "hos_data" partition.
Eventually you'll be left with something like this, note the unallocated space is now directly under our "hos_data" partition.
It's time to expand our fat32 partition, you can drag the black arrow on the right hand side all the way to the end to set the maximum size.
[EMUMMC USERS ONLY] If you intend on using emummc we can allocate some space for the partition by entering "29856" in the "free space following field", this will automatically reduce the partition size to accommodate the required free space.. this step is completely optional.
[EMUMMC USERS ONLY] We need to create a new partition (right click "unallocated" -> "new").. the only option we're going to change here is the "file system" field to "unformatted".
Now is the time to verify all our settings are correct before finally hitting the apply button.. confirm the warning and let it do its thing.
Before closing gparted, we want to take note of the drive identifier located on the top right of the screen.. mine is "/dev/sdd", we're going to be using the next steps.
GDISK
All the remaining steps will be executed using gdisk in a terminal window.. first of which will be the following command:
Code:
sudo gdisk /dev/sdd
Replace "/dev/sdd" with your drive identifier.
Input "r" as a command, this will enter us into the "recovery/transformation" submenu.
You can output the MBR & partition table by inputting "o" & "p" as commands, since we used gparted the MBR has been modified.. we need to revert this back to ensure everything plays nice.
Input "h" as a command, this will create a new hybrid MBR to replace the one we destroyed with gparted. If you intend on using emummc we need to add both the hos_data partition (#1) & the emummc partition (#8)..
You would do this by entering:
Code:
1 8
Otherwise if you're not planning to use emummc, we just add the hos_data partition (#1):
Code:
1
Place EFI GPT parition first in MBR?
Code:
N
Creating entry for GPT partition #1 (MBR partition #1)
Enter an MBR hex code:
Code:
EE
Set bootable flag?
Code:
N
[EMUMMC USERS ONLY] Creating entry for GPT partition #8 (MBR partition #2)
Enter an MBR hex code:
Code:
0b
[EMUMMC USERS ONLY] Set bootable flag?
Code:
N
Unused partition space found. Use one to protect more partitions?
Code:
N
Great, now lets output the MBR & partition table by inputting the "o" & "p" commands once again to confirm our changes.
Looking good! :good:
The last thing to do is write our changes, we do this by entering the "w" command.
Do you want to proceed?
Code:
Y
That's it folks, we're done! I know this was a little lengthy... hopefully this helps some of you out!
If you're interested in knowing more in-depth info about hybrid MBR's I came across the following website that contains invaluable information: HERE.
Awesome. Thanks for the guide! It seems as though my suspicions weren’t unfounded. Seems like we do have to write the android image to SD first before an easy change can be made. I’ve been trying to do this manually for the past week or two, but I’ve always failed because I never got the partition map setup correctly(have only tried a few times as well).
Are you familiar with how the partition map needs to be set? I’d love to practice getting this setup manually.
This is interesting. I'll give this a try. Thanks for putting this up.
Are steps 9 & 10 needed if I'm planning to create a fresh emummc via SX OS?
My current setup is one emummc/emunand and I'm using it for both Atmos and SX.
Thank you very much, especially for the gdisk part!
Move/Resize "Unknown filesystem" partitions?
Having trouble moving these. Gparted doesn't seem to want to let me do it. Any known variables that may influence this?
~~Tito~~ said:
Awesome. Thanks for the guide! It seems as though my suspicions weren’t unfounded. Seems like we do have to write the android image to SD first before an easy change can be made. I’ve been trying to do this manually for the past week or two, but I’ve always failed because I never got the partition map setup correctly(have only tried a few times as well).
Are you familiar with how the partition map needs to be set? I’d love to practice getting this setup manually.
Click to expand...
Click to collapse
You're very welcome!
What other info did you need beside what is shown above? Nothing is stopping you from creating the partitions manually, but why would you.. seems like a waste of time to me!
geckoquiver said:
This is interesting. I'll give this a try. Thanks for putting this up.
Are steps 9 & 10 needed if I'm planning to create a fresh emummc via SX OS?
My current setup is one emummc/emunand and I'm using it for both Atmos and SX.
Click to expand...
Click to collapse
Zero experience with SX OS, can't say for sure.
If it were me, I would backup my current emummc, create a new partition & restore it (this is actually exactly what I did, I was migrating sdcards tho).
tabzer said:
Having trouble moving these. Gparted doesn't seem to want to let me do it. Any known variables that may influence this?
Click to expand...
Click to collapse
I'm assuming you're not using the gparted live CD? You need to make sure the partitions are not mounted.
If you continue to struggle just do yourself a favour and use the gparted live CD/USB, don't waste your time chasing your tail trying to troubleshoot.
fOmey said:
I'm assuming you're not using the gparted live CD? You need to make sure the partitions are not mounted.
If you continue to struggle just do yourself a favour and use the gparted live CD/USB, don't waste your time chasing your tail trying to troubleshoot.
Click to expand...
Click to collapse
Thanks. I was using Ubuntu, and even with the partititons unmounted, I was only allowed to resize/move the partitions that were not "unknown". It seems the gdisk live is even more powerful. I don't really understand what the difference is. But it works.
If I resize after mounting the 128gb image to 64gb, will I'll be able to use the remaining 64gb like a normal sd card?
So after doing this, I can't run any of the games that are installed to my SD card (I copied my old fat32 partition off and back after following this guide). Any idea why this happened?
Also, any way to access the fat32 partition from within Android itself?
Did you restore an image to the partition, or did you copy your files manually?
~~Tito~~ said:
Did you restore an image to the partition, or did you copy your files manually?
Click to expand...
Click to collapse
Copied my files manually. I've done that before when upgraded SD card to a larger card and no issues.
First, Nice guide..... As the person that wrote the original guide, I would recommend creating the partition scheme from scratch, so you dont have to move the data a bunch. Then copy the partition info from the individual partitions manually, like my original guide said.
BTW @op congrats on posting a decent guide before me. I was getting there, but got caught up in life.
bfenty said:
So after doing this, I can't run any of the games that are installed to my SD card (I copied my old fat32 partition off and back after following this guide). Any idea why this happened?
Also, any way to access the fat32 partition from within Android itself?
Click to expand...
Click to collapse
Verify the hybrid MBR is setup correctly.
gavin_darkglider1 said:
First, Nice guide..... As the person that wrote the original guide, I would recommend creating the partition scheme from scratch, so you dont have to move the data a bunch. Then copy the partition info from the individual partitions manually, like my original guide said.
BTW @op congrats on posting a decent guide before me. I was getting there, but got caught up in life.
Click to expand...
Click to collapse
Original guide?
Creating partitions manually is a waste of time in my opinion.. much easier and faster to simply move them.
EDIT: I will add there's no wrong way to do this, if you prefer to create the partitions manually go for it.. whatever works!
fOmey said:
I'm assuming you're not using the gparted live CD? You need to make sure the partitions are not mounted.
If you continue to struggle just do yourself a favour and use the gparted live CD/USB, don't waste your time chasing your tail trying to troubleshoot.
Click to expand...
Click to collapse
I also cannot move the partitions with unknown filesystems in gparted. No partition is mounted and isn't possible via ubuntu gparted and also not via gparted live usb...
Any ideas?
Edit: Tried to write the 3 partitions with unknown filesystem to .img files, format the partitions, move them, write the .img files back and do the gdisk stuff.
This also didn't work, hekate says no fat32 partition recognized though I can mount it just fine in ubuntu...
...No idea how you moved the partitions with unknown filesystems, I read gparted doesn't allow this by default.
hey, I've been trying to get this done for some time now but I haven't has thought your guide would help me but I keep running into the same problem.
keeps telling me that it's unable to mount SD card
The flag for the main FAT partition needs to be 0C. Gdisk will be your friend.
trohn_javolta said:
I also cannot move the partitions with unknown filesystems in gparted. No partition is mounted and isn't possible via ubuntu gparted and also not via gparted live usb...
Any ideas?
Edit: Tried to write the 3 partitions with unknown filesystem to .img files, format the partitions, move them, write the .img files back and do the gdisk stuff.
This also didn't work, hekate says no fat32 partition recognized though I can mount it just fine in ubuntu...
...No idea how you moved the partitions with unknown filesystems, I read gparted doesn't allow this by default.
Click to expand...
Click to collapse
I didn't do anything special..
Post the output of gdisk o & p command from the recovery menu.
JaRocker said:
hey, I've been trying to get this done for some time now but I haven't has thought your guide would help me but I keep running into the same problem.
keeps telling me that it's unable to mount SD card
Click to expand...
Click to collapse
Post the output of gdisk o & p command from the recovery menu.
Any changes you make in gparted will require you to go back to gdisk and restore the hybrid MBR.
hey so i followed the guide before with 16gb and it worked great.
i'm redoing it with 64 gb and i can't get around the very first step of moving userdata to the end.
anytime i try to do anything to it i get a warning saying "moving a partition might cause your OS to fail to boot" which i didn't get the first time around.
then when i apply the changes, it immediately gets an error.
any suggestions for this problem? Thank you!
So i followed the guide and it works. Now i have some questions to further improve my current setup below:
256gb microsd with SX OS, Atmos, Android (No more swapping of cards).
My problem now is I cannot use SX OS to create hidden partition emunand as this will format the sd card and i will lose the android partitions and configs.
One option is file based partition but my preference is hidden partition so i can again use same emunand if i want to toggle between SX OS/Android/Atmos.
This is because atmosphere file based emunand is not stable as per devs and i also cannot get it to work using my SX OS file based partition.
I used atmos emummc but SX OS is not detecting it obviously.
The questions are:
1. For emummc, can i put that in front so it will be at sector 0X2 which i believe what SX OS config is looking for?
2. If i just use gpart to move the emummc partition in front do i need to repeat all the gdisk commands again?
3. If my aspiration is not possible at all then i will just stick with SX OS file based partition. Can i delete the atmos emummc and just extend the fat32 partition so i can reclaim space? Do i need to run the gdisk commands again?
~~Tito~~ said:
The flag for the main FAT partition needs to be 0C. Gdisk will be your friend.
Click to expand...
Click to collapse
Oh so flag is the mbr hex code, right? And you say it should be 0C? I will try that.
In the guide it says enter EE for mbr hex code.

Categories

Resources