• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

SD hack for storage expansion

@WarrantyVoider, you once gave me the following help/explanation:

"One thing that might cause a slowdown is when most memory cells on the card have been used, each write operation now incurs an extra erasure or a copy+erasure step (as SD cards don't support trim commands, as far as I know). Browsers and social networking apps read/write a lot of small files, so the impact on their performance is greater. If this is the case, you can try to erase all memory cells with SD Formatter. If you know how, you can also use F2FS instead of Ext4. F2FS should be more efficient on an SD than ext4. Another tip is to mount the partition with the noatime flag. Also, make sure your partitions aren't misaligned."

Does this:
"each write operation now incurs an extra erasure or a copy+erasure step"
not happen when using f2fs?

I've tried to Google a more in depth description regarding f2fs way of handling things compared to for example ext4, but it's hard to find...

I'm guessing that f2fs doesn't wear down the sdcard as much as ext4, but I might be wrong?
 
Upvote 0
Does this:
"each write operation now incurs an extra erasure or a copy+erasure step"
not happen when using f2fs?

I've tried to Google a more in depth description regarding f2fs way of handling things compared to for example ext4, but it's hard to find...

I'm guessing that f2fs doesn't wear down the sdcard as much as ext4, but I might be wrong?
A memory cell needs to be erased before it can be overwritten. Wear-leveling mechanism implemented by the flash memory microcontroller could possibly add a step to move existing data to a "fresher" memory cell. These things are intrinsic to the way the hardware functions, so they apply to any file systems including f2fs.

Before going further, I would say that most users with typical usage patterns don't need to worry about SD cards wearing down. So use ext4, f2fs, or whatever works. Back up your data (to somewhere else) often to guard against data loss, as there are many potential causes of data loss unrelated to the storage medium or choice of file system.

I am no expert on this subject, but based on my understanding, I would say that f2fs can help reduce wear (potentially fewer erase cycles). Flash memory uses a flash translation layer (FTL) to map logical blocks to physical memory cells. F2fs was specifically designed with flash memory characteristics and FTL in mind. I am not sure how technical you want me to get, but the basic idea is that f2fs organizes information (files, folders, metadata, etc.) in such ways that the FTL works more efficiently.
 
Upvote 0
A memory cell needs to be erased before it can be overwritten. Wear-leveling mechanism implemented by the flash memory microcontroller could possibly add a step to move existing data to a "fresher" memory cell. These things are intrinsic to the way the hardware functions, so they apply to any file systems including f2fs.

Before going further, I would say that most users with typical usage patterns don't need to worry about SD cards wearing down. So use ext4, f2fs, or whatever works. Back up your data (to somewhere else) often to guard against data loss, as there are many potential causes of data loss unrelated to the storage medium or choice of file system.

I am no expert on this subject, but based on my understanding, I would say that f2fs can help reduce wear (potentially fewer erase cycles). Flash memory uses a flash translation layer (FTL) to map logical blocks to physical memory cells. F2fs was specifically designed with flash memory characteristics and FTL in mind. I am not sure how technical you want me to get, but the basic idea is that f2fs organizes information (files, folders, metadata, etc.) in such ways that the FTL works more efficiently.

Thanks for always putting your mind into your explanations ☺
My data partition and my sd card (ext partition) is f2fs now and I think it sounds good enough to keep it this way. I might imagine this, but it feels smoother than before, especially chrome and Facebook...
 
Upvote 0
Hey WarrantyVoider. Did you have any slowness with your phone with this mod because after like a day it becomes really slow. I don't think it's the Class 10 U1 kingston memory card . I just had to uninstall it because it truly was impossible to use.
No, can't say that I did.

The hack itself doesn't do anything to slow things down. All it does is to mount the partition (and the workarounds just restart some processes) and after it does that, it's not even in RAM. Since the only significant change before and after the hack is internal memory vs. SD, the most likely cause of slowness is the SD card.

To verify, use a benchmark to check whether your card has decent random I/O performance. With the hack active, do the test on "internal memory" since the SD is being used as internal memory. Try the Random I/O test in A1 SD Bench https://play.google.com/store/apps/details?id=com.a1dev.sdbench to get an idea of the card's performance. You can compare the performance numbers here:
http://androidforums.com/threads/sandisk-32gb-extreme-plus-uhs-1-u3-sd-card-review-test.893742/
http://androidforums.com/threads/samsung-evo-micro-sd-feel-as-fast-as-internal.890591/
Try a more stressful test with Androbench https://play.google.com/store/apps/details?id=com.andromeda.androbench2 . My EVO numbers are here:
http://androidforums.com/threads/sd-hack-for-storage-expansion.908126/page-2#post-6945887

If you want a new card and you're in the US, Walmart has the 32GB EVO for under $11 and 64GB for under $18:
http://www.walmart.com/ip/Samsung-32GB-EVO-Class-10-microSD-Card-with-Adapter/37455695
http://www.walmart.com/ip/Samsung-64GB-EVO-Class-10-microSD-Card-with-Adapter/37455295
Amazon and other retailers probably have similar prices.

If the problem is not with the card, try wiping cache and dalvik (use my -wipe-dalvik.zip for wiping dalvik) to see if cleaning things up would help.
 
Upvote 0
Thanks WarrantyVoider

I've had mixed results using this hack because it has stopped working, out of the blue @ times
Some times I've been able to recover using some of the other tools you've made available, other times, not so lucky
I was planning on buying a 128GB microsd card and using this hack allows to install everything directly to the card without having to manually move OBB files (Link2SD / FolderMount
We'll see :)
 
  • Like
Reactions: WarrantyVoider
Upvote 0
The hack can't deal with errors too well because it can't control the booting process. There are better, more device-specific ways to deal with the storage limitation that allow the rom itself to deal with mounting, error-checking, etc. I'm personally using a custom mod that modifies the boot image but leaves the system partition unchanged. On top of that, I use f2fs instead of ext4 to theoretically help reduce wear on the SD card. Long time ago I had some thoughts to release something for the F6, but I think that the lower level a hack/mod is, the more time and effort I would need to spend to support it. So for now I just stay with support of this hack and deal with the users' problems as they come. These days I don't get too many reported problems, so either the hack is rarely causing problems or no one is using it anymore. ;)
 
Upvote 0
Hi WarrantyVoider,

First of all thank you for your work doing this. The F6 is it a really good phone, except for the storage issue, so fixing this is key to make the perfect mid-range phone.

I have installed your hack and it works really well, but... my phone has become much more unstable with it. Before I installed the hack it never crashed, now it does 2 to 3 times per day. The problem that happens more often to me is that the phone won't wake up on pressing the power key, so I'm forced to keep a long press on the power key to restart it.

I'm using the Xperion ROM and a Sandisk Ultra class 10, 32GB.

Any ideas on why is this happening and how to fix it? I'll be happy to try other ROM if you think that my help.

Thanks
 
  • Like
Reactions: WarrantyVoider
Upvote 0
Any ideas on why is this happening and how to fix it?
Not sure. If the card has been used for a while, maybe some memory cells are becoming flaky.
You can remove the SD card and the hack from the equation by temporarily uninstalling the hack or removing the SD card. If the phone/rom is stable, then check the card to make sure there are no errors or data corruptions.

If it's not some hardware issue with the card, try wiping cache and letting the OS rebuild it.
If the issue turns out to be the card, back up all data and maybe try to format/erase it, making sure all memory cells are okay.

You might need to do some troubleshooting to figure things out. Let me know if you still need help. Good luck.
 
Upvote 0
Hello all,

We've had LG F6's in the family for a couple years. At first 5 of us (not me though, I only set them up) were using the F6 but 3 moved on to different phones last Christmas. A big thanks to WarrantyVoider since the F6 wouldn't have been an option without his memory hack.

Two weeks ago my phone dropped about 15 feet onto a hard surface so I was forced to find a new phone. Since we still had the 'abandoned' F6's I thought I would use one until something else caught my fancy. At first I was just going to set the phone up the way I always did using WarrantyVoider's hack. Then I remembered reading about a different approach here http://androidforums.com/threads/swap-external-sd-card-as-internal-storage.920196/ so I decided to try it just for the academic exercise.

That method worked very well except once the combined size of all the app binaries got too big to fit in the (still small) internal memory no new apps could be installed. So, I went ahead and partitioned the SD card and installed WarrantyVoider's hack (init.d version on Xperion ROM). After the phone booted and settled for a while I realized I had forgotten to "uninstall" the first memory hack. So, I just went with it to see how it worked. This tuned out to be a really good mistake I made.

Now, everything except the ROM is safely on my SD card. In "storage" it shows I have about 16GB for apps and about 45GB for 'internal' memory. There is no detected external card (because of the first hack). Since it is a class 10 UHS-1 card it is smooth and most likely the reassigned SD card memory is faster than the original internal memory would have been. So far it's been working quite well under very heavy load except every now and then there seems to be a quick freeze but after a few seconds it clears itself. It doesn't happen often enough to bother me.

The only negative for me is the fact that I don't make use of either internal memories but that is more than made up for by my 'reassigned' 64GB SD card. The added benefit is that if anything goes wrong with the phone (like dropping 15 feet to a hard surface) I can just quickly grab another F6 we have, install both hacks, pop in my SD card and SIM card and I'm up and running where I left off with the first F6.

Sorry for this long post but I thought someone else with a fast SD card might want to give it a try (I'm going to pick up a class 10 UHS-3 to see what it does).

And, I have a question for the mighty Mister WarrantyVoider:

To make sure the sensors 'wake up' how they should I took part of your sensorfix and copied it into an 'extensionless' file and put that in init.d. This is what I put there:

for cmd in /proc/+([0-9])/cmdline
do
if [[ "$(cat $cmd)" == "/system/bin/sensord" ]]; then
stop sensord
sleep 1
start sensord
break
fi
done

Will that do what I'm hoping it will?
Thanks!
 
Upvote 0
To make sure the sensors 'wake up' how they should I took part of your sensorfix and copied it into an 'extensionless' file and put that in init.d. This is what I put there:

for cmd in /proc/+([0-9])/cmdline
do
if [[ "$(cat $cmd)" == "/system/bin/sensord" ]]; then
stop sensord
sleep 1
start sensord
break
fi
done

Will that do what I'm hoping it will?
Thanks!
Someone has asked about this before in the other thread. My solution to the issue is here:
http://androidforums.com/threads/pr...ge-solution-on-f6.819792/page-25#post-7055227
You can read the other posts if you're interested in that discussion.

The script you used (from sensorfix) is coded to work with most, if not all, roms, including ones without busybox. Since xperion includes busybox, the command "pgrep" should be available and more efficient.

Let me know in this thread if you run into problems, have questions, or need more help. Good luck.
 
Upvote 0
Thank you very much!

That seems to have done the trick. I just added the stop, sleep, start commands to the bottom of the swapping script. Just to be sure I deleted the dalvik cache and when the phone finally got done rebooting the screen rotated just like normal. In the past it would always take an extra reboot or two after wiping the dalvik.

Thanks again!
 
  • Like
Reactions: WarrantyVoider
Upvote 0
Thanks for the hack, I can now see my internal memory increased (equal to partition I made on SD card) and the external memory is equal to original internal one. But whatever I install is going on the external memory (original internal memory). Did anyone have this problem?
Are you also using another hack/mod at the same time? With this hack by itself, the "original internal memory" (the partition originally used for the /data folder) should be hidden, and user apps go to (the 2nd partition of) the SD card instead. So, I am not sure why "the external memory is equal to original internal one."

You can download and install an app like DiskInfo.
https://play.google.com/store/apps/details?id=me.kuder.diskinfo
It should show you which partitions are located in internal storage (emmc) and which ones are on the SD card. Before the hack, the data/userdata partition should be under internal storage. After the hack, that partition should appear under SD card. All user apps should go to the data/userdata partition, so wherever the data/userdata partition is located is where user apps are physically located.
 
  • Like
Reactions: qwerty2000
Upvote 0
Thank you, I think I had downloaded another hack and it was probably interfering with this one. I reinstalled everything and it seems to be working fine now.

Thank you very much for the hack.


Are you also using another hack/mod at the same time? With this hack by itself, the "original internal memory" (the partition originally used for the /data folder) should be hidden, and user apps go to (the 2nd partition of) the SD card instead. So, I am not sure why "the external memory is equal to original internal one."

You can download and install an app like DiskInfo.
https://play.google.com/store/apps/details?id=me.kuder.diskinfo
It should show you which partitions are located in internal storage (emmc) and which ones are on the SD card. Before the hack, the data/userdata partition should be under internal storage. After the hack, that partition should appear under SD card. All user apps should go to the data/userdata partition, so wherever the data/userdata partition is located is where user apps are physically located.
 
  • Like
Reactions: WarrantyVoider
Upvote 0
Hello WarrantyVoider,

Here's another question you answered once upon a time in the other thread but I'm not sure it applies to what I have.

Since I'm using this "doudble-hack" method (which works crazy good) I'm not sure how to make a backup or, if I could do that, how I would go about restoring from it. I know you created those zips in post #460 and #476 of the other thread for doing backup and restore but I'm a bit confused if that applies to my situation.

With a fast SD card and these hacks I'm in no hurry to get a different phone now because it just works so well. What I am interested in is being able to easily move to another F6 if I happen to destroy this one.

Just to clarify, I'm taking about how to backup (and restore) the ROM and everything else for that matter. I can backup the ROM with TWRP but I think the backup is going to the internal phone memory. I want it to go to the SD card.
 
Last edited:
Upvote 0
Since I'm using this "doudble-hack" method (which works crazy good) I'm not sure how to make a backup or, if I could do that, how I would go about restoring from it. I know you created those zips in post #460 and #476 of the other thread for doing backup and restore but I'm a bit confused if that applies to my situation.

With a fast SD card and these hacks I'm in no hurry to get a different phone now because it just works so well. What I am interested in is being able to easily move to another F6 if I happen to destroy this one.

Just to clarify, I'm taking about how to backup (and restore) the ROM and everything else for that matter. I can backup the ROM with TWRP but I think the backup is going to the internal phone memory. I want it to go to the SD card.
If you make a backup of all the relevant partitions (or files, if backing up by files) and restore all of the pieces, you should in theory get back the same configuration. In particular, the backup should contain boot, system, data/userdata, and sd-ext (SD's 2nd volume in recovery's term). You've said you have several F6's. So what you can try is doing a backup on one phone and then restoring that on another phone to verify everything works as you'd expect. Get another SD card and restore data to the new card (so that the old data remain completely unchanged in case of a problem with the method) and see if you can transfer to the second phone without trouble. Maybe some apps or settings that uniquely identify the phone (using e.g. IMEI or MAC address) would fail, but my guess is most things would be okay.

If I remember correctly, in TWRP you can choose where you want the backup to go, internal storage or external SD. I don't use custom recovery to do backup anymore, so I can't really comment on how well it might work for you. To me, the biggest problem with backing up sd-ext is that we would be trying to save all files in the 2nd partition of the SD to the 1st. Obviously, it would fail if the amount of data exceeds the amount of free space. In the past, I've experimented with making a whole partition backup (either by files or by image) directly to a PC (by "directly," I mean no temporary file on the phone/SD itself), but I've never bothered with making those methods into user-friendly packages or instructions. Maybe some developer has made an app that can do just that.
 
Upvote 0
Thanks for the reply.

I thought I remembered in TWRP that there was a way to choose the backup location but I looked around and didn't see it. I went ahead and did a backup and afterwards found the backup saved on the internal SD. I know there are other recoveries for the F6 so I will look at those. If I could just get a backup done in recovery it would make it much easier to move to a backup phone if need be.

I ordered a second (faster) SD card to play around with as well.

EDIT: Installed pressy4pie's CWM recovery and there are options for saving/restoring to either internal or external SD. Choosing external puts the backup files on the micro SD card. As long as I have my SD card (and it still works) I should be able to move to another F6 quite easily now.
 
Last edited:
Upvote 0
I thought I remembered in TWRP that there was a way to choose the backup location but I looked around and didn't see it.
From the main menu, go into Backup. Under "No Encryption" and "Refresh Sizes" and above "Enable compression" is "Storage:". Tap "Storage:" and you should be able to choose where your backup files would go. This is from TWRP v2.6.3.0, but I think other versions have a similar option.
 
  • Like
Reactions: The-Truth
Upvote 0
Thanks for the reply.

I thought I remembered in TWRP that there was a way to choose the backup location but I looked around and didn't see it. I went ahead and did a backup and afterwards found the backup saved on the internal SD. I know there are other recoveries for the F6 so I will look at those. If I could just get a backup done in recovery it would make it much easier to move to a backup phone if need be.

I ordered a second (faster) SD card to play around with as well.

EDIT: Installed pressy4pie's CWM recovery and there are options for saving/restoring to either internal or external SD. Choosing external puts the backup files on the micro SD card. As long as I have my SD card (and it still works) I should be able to move to another F6 quite easily now.
All you do is choose backup and make sure you're backing up to ext SD card within TWRP. Nice and simple[emoji6]
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones