[SOLVED] Forced Close of core (or all) apps, Internal SD removed unexpectedly... - Samsung Galaxy SL i9003

Hi All,
I got errors mentioned in the title and after few searches, found that there are few Galaxy SL owners who had got into this issue.
Currently Known Root Cause:
A hardware issue possibly due to a board issue or loose attachment of internal SD card to the motherboard (Grrrrrrr SAMSUNG!)
Symptoms:
- Suddenly core applications like phone/messaging start force closing (sometimes all open apps). Only a reboot will solve the issue.
- Sudden reboot of the phone after few hours of running (or even sleeping)
- Sometimes the restart itself hanging with a yellow message "Unknown Upload Mode"
- Message in status bar "Internal SD card has been removed unexpectedly" or "Internal SD card not accessible" or something like "Damaged SD card"
Known Solution:
1. Replacement of board from Samsung Service Center (Good for you if you are within the warranty period)
2. Do some hardware hack to remove the internal SD completely (http://forum.xda-developers.com/showthread.php?t=1651619)
I got this issue just after I finished my warranty period, and hence, I was trying to find if I can do something about this issue by my own. What I wanted was to actually swap my internal SD storage with a proper external SD storage. This is not same as the popular "swapping the internal and external SD card" topic, but that and something more as well!! This will solve the issue of force closes and sudden reboots (may still not solve issue of reboot getting stuck, but I assume phone will not need frequent reboot after solving first 2 issues!)
Galaxy SL has 3 partitions created in the card:
1. ext3 partition for data
2. another small FAT partition - (for what? not sure)
3. Third FAT partition which acts as the normal internal SD card (which is accessible when working as USB mass storage)
Intention here is to move all the partitions to the external SD. Looking at the mount points and vold.fstab, I could not find where the 2nd partition in the above list is mounted/used (If anyone knows, please let me know). So I decided to move atleast the ext3 (data) and fat (/sdcard) to the external SD.
Following are the steps I followed for doing the same:
WARNING!!!
1. Copy these at your own risk. I am not responsible if you brick your phone or lose your data/applications/settings or if the phone goes to a boot loop!
2. Do not continue if you do not understand what is written here
3. Doing this will change the /data partition. So wiping data partition in the normal way will not work (say from CWM). You may need to do 2 steps - wipe (internal) data normally (say using CWM), wipe (external SD) data manually by disabling the script mentioned in the procedure and wiping using make_ext4fs tool (steps are given in PART 3 of this post).
4. This has been tested only on CM9 Alpha 6-11 / rooted DDLF2. Theoretically it may or may not work on other ROMs, depending on other tweaks and changes in the system, no guaranty offered!
5. In case you mess it up, most of the time (but no guarantees!), you can recover by flashing from beginning using ODIN some base versions like KPE and then come to your normal ROM, followed by a nandroid recovery (so better do a nandroid backup before you try anything .
Pre-requisites:
- Rooted Phone
- Kernel with init.d support (and preferably ext4 as well if you want that)
- Basic ADB knowledge
- A blank micro SD card with at least class 4 (class 6 or greater preferred) speed and with sufficient capacity - say 8/16/32 GB
PART 1 - PREPARING THE EXTERNAL SD
--------------------------------------------------------------------
0. !!! FIRST !!!
Do a Nandroid Backup (and also other app level backups like Titanium or MyBackup)
Backup contents of your FAT partition (mmcblk0p1) - ie, the internal SD card card
Backup contents of your external SD card
1. Download sdparted-recovery.zip from web (http://forum.cyanogenmod.com/topic/6433-solved-messed-up-partitions-on-internal-storage - check messages like 11 to see the basic usage) and extract the contents
2. Using ADB, copy the extracted files in sdparted directory into /system/bin, change permission for all of them to 755 using chmod
3. Put a clean external SD card into the phone
4. In an ADB shell, run /system/bin/parted giving mmcblk1 as the target. Now resize the existing FAT partition (this is the first and default partition in the card). Tips:
print gives the existing partition(s)
help gives help on various options
for resizing and creating partitions, inputs should be derived from the initial print output (which gave the first and last points)
Eg: If card is 16GB, and you want to reserve 4GB for data, then resize the first partition to 12GB
5. Create a new partition of type ext2 with remaining size (say 4G in our case). Save and quit parted.
7. (Do this only if your kernel supports ext3/ext4) Run "tune2fs -j /dev/block/mmcblk1p2" to convert ext2 to ext3
8. (Do this only if your kernel supports ext4) Using ADB, copy "make_ext4fs" (attached) to /system/bin
9. (Do this only if your kernel supports ext4) Convert ext3 partition to ext4 using make_ext4fs ("make_ext4fs /dev/block/mmcblk1p2")
10. Now the partitions are ready
- They will be visible as mmcblk1p1 (FAT) and mmcblk1p2 (ext4) when you cat the /proc/partitions
- They will be visible as partitions 1(FAT) and 2 (ext4) in the print output of parted.
Confirm the above before proceeding further.
PART 2 - SWAPPING EXTERNAL AND INTERNAL SD
---------------------------------------------------------------------------------
1. Write a script, say 00remnt similar to the attached sample file which currently I am using (If you do not follow the script, better don't proceed. Else check if things are fine for your current base ROM settings)
2. Push this into /etc/init.d/ using ADB
3. Change permissions of the file to 755
4. If you need, copy the contents of your internal SD card FAT partition (/sdcard) to the external SD card FAT partition (/sdcard/external_sd or /emmc)
5. Use the popular (relevant methods) to swap the internal and external FAT partitions (which actually changes the vold.fstab contents). Normal search in the forum will give you the available methods - some ROMs support it as options, others have mods which will accomplish the same
5. Reboot and enjoy
Voila!!! Now the system is not using internal SD card (for most purposes) at all!! And your phone can now run for days without abrupt force closes and reboot. You still may get a message like SD card is removed/damaged, (and /emmc or /sdcard/exteranal_sd may become inaccessible - so better use it only as a temporary storage!). But you can safely ignore these messages as that is the internal SD card which we are not using anyway... Enjoy...
PART 3 - WIPING DATA PARTITION (in case you need this step later)
-----------------------------------------------------------------------------------------------------------
1. Change permission of the 00remnt to 644
2. Reboot the phone (now the phone will come up with default internal SD partition for data)
3. From ADB shell, execute "make_ext4fs /dev/block/mmcblk1p2" (see PART 1 on how to get this tool)
4. Change permission of the 00remnt to 755
5. Reboot the phone to recovery, wipe the /data as normal
rgds,
Dipu.
PS: If any one knows how our phone uses the 2nd partition in the internal SD card, please let me know... I am assuming that it is not used for any critical purposes (as my phone ran successfully for few days without any issue). May be it is used in some kernel/ROM, if so, please let me know.

Though i didn't understand a word(being an internee dentist) it will be useful to others.appreciate your efforts!!
Sent from my GT-I9003 using xda app-developers app

This is what i call a complete and useful guide.
This should become a sticky.. now... NOW!

+1 for sticky, superb info.

that would be a really nice sticky
i had the motherboard changed..

Thanks Dipu K for your efforts.
I've tried this solution in my I9003, and I have only a problem: When reboot the phone, /data is copied into de Ext4 partition on SD card, but all aplications have errors because isn´t possible to unmount /data,
Here is the messaje in remnt-log (only a few lines):
Code:
...
3. Make Directory --->
4. Mount new data partition from external SD --->
5. Copy the current files in /data
6. Remove current files in /data
7. Unmount /data
umount: can't umount /data: Device or resource busy
8. Remove dir /data as a safety measure
9. Linking external sd data partition as /data
10. Final Mount status --->
...
What can I do to correct this?
Thanks

bfsa said:
...
What can I do to correct this?
Thanks
Click to expand...
Click to collapse
Finally, I've changed a line on 00remnt, and seems to work properly: busybox umount -l /data 2>> /system/remnt-log

Where can I get make_ext4fs? Sadly the same case has happened to me...

Hi Guys.
I am using alpha 4 from last one month and experience was awesome but from last 1 week I am getting lot of FC for lot of services like exchange service gapps what's up camera and lot more. I am not sure why FC issue started happening from last one week.
History :
I was using CM 10 alpha 1 then alpha 2 then alpha 3 and now on alpha 4.
I really fed up with Force close issue from last one week . I tried reboot but still 80% of apps and services getting FC. Please guide me on this .
Sent from my GT-I9003 using xda app-developers app
Sent from my GT-I9003 using xda app-developers app

hi all, i have a galaxy i9003 with a corrupted or completely dead (not sure) internal memory chip. I have come to this conclusion after 3 days of trying to install custom and stock roms. I can access recovery and download mode but i cant install any ROM, the phone keeps rebooting after the SAMSUNG (whole screen black except SAMSUNG in the middle). All i have is atm this http://forum.xda-developers.com/showthread.php?t=1351056 installed on my phone via ODIN. I dont have knowledge about ADB, can somebody help me out with instructions more?

Pre-requisites:
- Rooted Phone
Click to expand...
Click to collapse
Is there a solution without a rooted phone or can I root it somehow, even if the there is a hardware defect? I got an error with /dev/block/mmcblk1p that rfs can't be written.

I have a problem. My friend gave me an i9003. Wipe is not working at all, even from Recovery. I connect the phone to PC and use the internal card, no matter what I do, changes don't apply. I copy/paste/delete/format/even odin flash, no good. Everything comes back as before reboot. What is it related to?
I used to have an i9000, but nothing applies to i9003. I flashed i9000 1000 times and at last got a mmcblk02 error, fixed it with external sd swap. I'm thinking of swapping emmc with sd on this one too, but cant install a rom from CWM, I can install CWM from ODIN though and can flash CFROOT too, but in CWM internal storage can't be mounted... Motherboard problem?
I will try to use this guide and report back soon...

allxx said:
I have a problem. My friend gave me an i9003. Wipe is not working at all, even from Recovery. I connect the phone to PC and use the internal card, no matter what I do, changes don't apply. I copy/paste/delete/format/even odin flash, no good. Everything comes back as before reboot. What is it related to?
I used to have an i9000, but nothing applies to i9003. I flashed i9000 1000 times and at last got a mmcblk02 error, fixed it with external sd swap. I'm thinking of swapping emmc with sd on this one too, but cant install a rom from CWM, I can install CWM from ODIN though and can flash CFROOT too, but in CWM internal storage can't be mounted... Motherboard problem?
I will try to use this guide and report back soon...
Click to expand...
Click to collapse
Please do send us a report, I'd appreciate it very much. Have to deal with a similar situation as well for an old i9003. I've tried to employ the steps mentioned here but could not get it to work as well.

Hi everybody!
Had to remove the internal SD to install everything on the external one by following the mentioned post. Nothing else worked.
http://forum.xda-developers.com/showthread.php?t=1651619

can anyone here recomended me custom rom that already with swap sdcard?

Dipu K said:
Hi All,
I got errors mentioned in the title and after few searches, found that there are few Galaxy SL owners who had got into this issue.
Currently Known Root Cause:
A hardware issue possibly due to a board issue or loose attachment of internal SD card to the motherboard (Grrrrrrr SAMSUNG!)
Symptoms:
- Suddenly core applications like phone/messaging start force closing (sometimes all open apps). Only a reboot will solve the issue.
- Sudden reboot of the phone after few hours of running (or even sleeping)
- Sometimes the restart itself hanging with a yellow message "Unknown Upload Mode"
- Message in status bar "Internal SD card has been removed unexpectedly" or "Internal SD card not accessible" or something like "Damaged SD card"
Known Solution:
1. Replacement of board from Samsung Service Center (Good for you if you are within the warranty period)
2. Do some hardware hack to remove the internal SD completely (http://forum.xda-developers.com/showthread.php?t=1651619)
I got this issue just after I finished my warranty period, and hence, I was trying to find if I can do something about this issue by my own. What I wanted was to actually swap my internal SD storage with a proper external SD storage. This is not same as the popular "swapping the internal and external SD card" topic, but that and something more as well!! This will solve the issue of force closes and sudden reboots (may still not solve issue of reboot getting stuck, but I assume phone will not need frequent reboot after solving first 2 issues!)
Galaxy SL has 3 partitions created in the card:
1. ext3 partition for data
2. another small FAT partition - (for what? not sure)
3. Third FAT partition which acts as the normal internal SD card (which is accessible when working as USB mass storage)
Intention here is to move all the partitions to the external SD. Looking at the mount points and vold.fstab, I could not find where the 2nd partition in the above list is mounted/used (If anyone knows, please let me know). So I decided to move atleast the ext3 (data) and fat (/sdcard) to the external SD.
Following are the steps I followed for doing the same:
WARNING!!!
1. Copy these at your own risk. I am not responsible if you brick your phone or lose your data/applications/settings or if the phone goes to a boot loop!
2. Do not continue if you do not understand what is written here
3. Doing this will change the /data partition. So wiping data partition in the normal way will not work (say from CWM). You may need to do 2 steps - wipe (internal) data normally (say using CWM), wipe (external SD) data manually by disabling the script mentioned in the procedure and wiping using make_ext4fs tool (steps are given in PART 3 of this post).
4. This has been tested only on CM9 Alpha 6-11 / rooted DDLF2. Theoretically it may or may not work on other ROMs, depending on other tweaks and changes in the system, no guaranty offered!
5. In case you mess it up, most of the time (but no guarantees!), you can recover by flashing from beginning using ODIN some base versions like KPE and then come to your normal ROM, followed by a nandroid recovery (so better do a nandroid backup before you try anything .
Pre-requisites:
- Rooted Phone
- Kernel with init.d support (and preferably ext4 as well if you want that)
- Basic ADB knowledge
- A blank micro SD card with at least class 4 (class 6 or greater preferred) speed and with sufficient capacity - say 8/16/32 GB
PART 1 - PREPARING THE EXTERNAL SD
--------------------------------------------------------------------
0. !!! FIRST !!!
Do a Nandroid Backup (and also other app level backups like Titanium or MyBackup)
Backup contents of your FAT partition (mmcblk0p1) - ie, the internal SD card card
Backup contents of your external SD card
1. Download sdparted-recovery.zip from web (http://forum.cyanogenmod.com/topic/6433-solved-messed-up-partitions-on-internal-storage - check messages like 11 to see the basic usage) and extract the contents
2. Using ADB, copy the extracted files in sdparted directory into /system/bin, change permission for all of them to 755 using chmod
3. Put a clean external SD card into the phone
4. In an ADB shell, run /system/bin/parted giving mmcblk1 as the target. Now resize the existing FAT partition (this is the first and default partition in the card). Tips:
print gives the existing partition(s)
help gives help on various options
for resizing and creating partitions, inputs should be derived from the initial print output (which gave the first and last points)
Eg: If card is 16GB, and you want to reserve 4GB for data, then resize the first partition to 12GB
5. Create a new partition of type ext2 with remaining size (say 4G in our case). Save and quit parted.
7. (Do this only if your kernel supports ext3/ext4) Run "tune2fs -j /dev/block/mmcblk1p2" to convert ext2 to ext3
8. (Do this only if your kernel supports ext4) Using ADB, copy "make_ext4fs" (attached) to /system/bin
9. (Do this only if your kernel supports ext4) Convert ext3 partition to ext4 using make_ext4fs ("make_ext4fs /dev/block/mmcblk1p2")
10. Now the partitions are ready
- They will be visible as mmcblk1p1 (FAT) and mmcblk1p2 (ext4) when you cat the /proc/partitions
- They will be visible as partitions 1(FAT) and 2 (ext4) in the print output of parted.
Confirm the above before proceeding further.
PART 2 - SWAPPING EXTERNAL AND INTERNAL SD
---------------------------------------------------------------------------------
1. Write a script, say 00remnt similar to the attached sample file which currently I am using (If you do not follow the script, better don't proceed. Else check if things are fine for your current base ROM settings)
2. Push this into /etc/init.d/ using ADB
3. Change permissions of the file to 755
4. If you need, copy the contents of your internal SD card FAT partition (/sdcard) to the external SD card FAT partition (/sdcard/external_sd or /emmc)
5. Use the popular (relevant methods) to swap the internal and external FAT partitions (which actually changes the vold.fstab contents). Normal search in the forum will give you the available methods - some ROMs support it as options, others have mods which will accomplish the same
5. Reboot and enjoy
Voila!!! Now the system is not using internal SD card (for most purposes) at all!! And your phone can now run for days without abrupt force closes and reboot. You still may get a message like SD card is removed/damaged, (and /emmc or /sdcard/exteranal_sd may become inaccessible - so better use it only as a temporary storage!). But you can safely ignore these messages as that is the internal SD card which we are not using anyway... Enjoy...
PART 3 - WIPING DATA PARTITION (in case you need this step later)
-----------------------------------------------------------------------------------------------------------
1. Change permission of the 00remnt to 644
2. Reboot the phone (now the phone will come up with default internal SD partition for data)
3. From ADB shell, execute "make_ext4fs /dev/block/mmcblk1p2" (see PART 1 on how to get this tool)
4. Change permission of the 00remnt to 755
5. Reboot the phone to recovery, wipe the /data as normal
rgds,
Dipu.
PS: If any one knows how our phone uses the 2nd partition in the internal SD card, please let me know... I am assuming that it is not used for any critical purposes (as my phone ran successfully for few days without any issue). May be it is used in some kernel/ROM, if so, please let me know.
Click to expand...
Click to collapse
Somebody's Samsung Galaxy SL i9003 had wiped the internal SD card by itself! Is this even possible that it just wipes/formats on it's own? Is there any advice? The contacts appear to still be there.

Related

[Utility] ext4 data2sd for Froyo ROMs

If you are always low on program memory, this data2sd might be for you. It works with any Froyo for the G3.
Note: This won't wipe your data, but you should have a backup, just in case. First backup the phone to the SD card, then the SD card to your computer. Be cautious. I give no guarantee whatsoever. If your phone behaves funny, even eats your cat afterwards, I take no responsibility.
Note: starting with version 3, the new storage size will NOT be reflected in the Task Manager or in Titanium Backup. I'll see what I can do about it.
You need a rooted phone and an SD card, preferably 2 GB or more and class 6 or better (higher). data2sd doesn't make your phone faster. Much to the contrary: it extends your memory at the cost of speed. That said, if your SD card is of a class smaller than 6, this will work too. The slowdown, however, will be noticeable in some situations.
Three steps are needed. First, we need a kernel with built-in ext4 if you don't have one. Second, we bring the data2sd into its place. And third, we create an ext 4 partition with the desired size. Now follows a detailed description of these steps.
Step 1: Check your kernel
You need a kernel with built-in ext4 capability. The custom ROMs mostly have one. If you are running a stock kernel, you must install one, e.g. from http://forum.xda-developers.com/showthread.php?t=978823 . Follow the installation steps detailed there. (Changing the kernel does not wipe your phone).
Step 2: Install data2sd
You now must install data2sd onto your phone. As long as you didn't modify your SD card (as long as partition #2 is not ext4), this will have no further impact on your phone.
Download data2sd.zip from below and unzip it. There's a single file in there: data2sd.sh. Use the tool that suits you best to transfer it to the SD card of your phone. With adb, you would do
Code:
adb push data2sd.sh /mnt/sdcard
Now either start a terminal emulator with a root shell or use adb again. With adb, you would execute
Code:
adb shell
Make sure you are root (the prompt reads '#'), else run "su". Now type in:
Code:
# sh /mnt/sdcard/data2sd.sh
You will see some lines about what is happening and a final confirmation.
That's it. Again, your phone will continue to behave as usual.
Step 3: Prepare your SD card
You can use any amount of program memory up to the size of your SD card, but be sure to leave some room for application data on the normal (#1, vfat) partition. As a rule of thumb, 0.5 GB of program memory will satisfy most needs, 1 GB is plenty.
If you're running Linux, prepare a second partition (must be partition #2) with the desired size. Use the usual utilities to do so. This includes gparted, but there are also other means. If you use gparted, you can follow the description for Parted Magic below.
If you have no access to a Linux computer, even not your friend's, your (probably) best choice is to run Parted Magic from a live CD. For this, go to http://partedmagic.com, and burn your CD. Instructions on how to do it with different burning tools are also there.
Step 3.1: Partition and format your SD card with Parted Magic (also applies to gparted)
The following describes the steps to partition your SD card with Parted Magic. You don't need to use this method - use the tool that suits you best.
I assume you have gparted or Parted Magic running and your SD card inserted into the card reader of your PC. Now select your card from the drop-down menu of available drives in the upper right corner. You better double check that you're on the correct drive (card). It will happily erase your system disk if told to do so.
Right click near top into the block designating your current partition #1. Select "resize". (I assume that your partition #1 is the only one. If not, delete the other partition(s)). Change the size to the total size of your SD card minus the desired size for program storage (/data). Confirm your selection.
There is now a gray block designating free space to the right of your first partition. Right click it and select "New". In the following window, leave the sizes as they are. Leave "create as" to be a primary partition, and change "file system" to ext4. Confirm your selection ("Add").
The gray block at the right has changed to a colored frame. Right click it again and select "Format as". Select "ext4".
If everything went well, you can now click on the green check mark in the icon bar near the top, confirm, and watch Parted Magic resizing your normal (#1, VFAT) partition and creating the new ext4 one.
4. Finale furioso
Now insert the SD card and reboot your phone. The Task Manager will report the new size in its rightmost tab, as do the other utilities like Titanium. All user apps and data should be in place. All will look like you have soldered in an extra chunk of internal memory. Despite not being directly visible, your program memory is resized to be the new partition. You see its size and its usage (in percent) by running
Code:
df
from adb or from a terminal emulator. Have a look at the subdirectories of /data displayed there.
As a final step, you can safely remove data2sd.sh from your SD card (/sdcard). It is not needed any more.
Q&A
* How can I remove my SD card while the phone is on?
You can't. Don't try. Always switch your phone off before you remove the SD card.​* How can I return to the state before data2sd?
Remove the SD card. All user data and apps will be there in the state you left them before you installed data2sd. The data2sd script you have installed simply does nothing as long as there is no ext4 #2 SD partition.
If you want to reuse the SD card, remove partition #2. This can be done with each partitioning tool, you don't need Linux.​• What about app2sd from Kyrillos 3.0? Is it compatible?
Yes. But "no" for the "no wipe" version which was offered for a short period of time. In the latter case, clear out the ext4 partition (important: do not forget the hidden .data2sd_initialized file) or simply reformat it before reusing it.​* It doesn't work. What can I do to help diagnose the problem?
See if the file /mnt/asec/data2sd/log.txt exists. If it does, have a look at it and try to make sense of it. If it doesn't tell you anything useful, add it to your error description in the forum here. If there is none, mention that in the description.​* What things must be considered if I flash a new ROM?
As always with such actions, make sure you have a backup. That said, just flash the new ROM and then install data2sd. When you reboot with the SD card in place, all user Apps and all data should be there. No restore from backup required.
Only in the rare case that the new ROM explicitly requires you to NOT restore your old data, e.g., from Titanium, you should reformat your ext4 partition (to clear it out) and proceed as advised by the ROM makers.​Versions:
2011-03-19 Initial release
2011-03-21 Version 2
- Updated for ROMs without /system/etc/init.d
- Simplified installation of the core parts
2011-03-23 Version 3
- Vibration bug fixed
- App2SD mode added: If the ext4 partition bears the volume label "app2sd" on a new blank SD, only /data/app is moved. This greatly reduces size benefits, but results in nearly no speed loss.
- Just run the data2sd.sh file (as described in step 2) to upgrade without data loss.
- Note: the actual size will NOT be reflected as described in the Task Manager or in Titanium.
Gosh this sounds so complex and risky! Isn't there a easier way?
☞★sent from my Galaxy3!!
♪drajax!! ♬♂ツ
drajax said:
Gosh this sounds so complex and risky! Isn't there a easier way?
☞★sent from my Galaxy3!!
♪drajax!! ♬♂ツ
Click to expand...
Click to collapse
Flash Kyrillos' v3.1 where's the script's allready built in...
It is less complex than it sounds. The description is just really very detailed. The details may sound confusing until you try it. And if you have access to Linux, it is really simple. We Linux users also have to use a different operating system when we flash our phones.
Alternative: Install Kyrillos 3.1. It contains the same data2sd and comes with a partitioning tool. But, as far as I can tell, you need to reformat the SD card's vfat part on the phone and lose the data there (not sure, however).
when i try to set permissions it says permission denied . Any help?
http://www.appbrain.com/app/move2sd-enabler-(root-only)/com.leinardi.setinstalllocation
Just one quick question....
I am having the stock JPM ROM... in that case do i need to have some new Kernel to use your data2sd???
I'll be using this!
Sent from my ACID Lestatious v1.4.5.5 Galaxy 3 FROYO
When i write down "/ # cd /system/etc/init.d/"
it says "sh: cd: can't cd /system/etc/init.d/"
What am i doing wrong???
Pinak.ahuja said:
when i try to set permissions it says permission denied . Any help?
Click to expand...
Click to collapse
You're not in a root shell. Enter "su" as your first command.
next2devil said:
When i write down "/ # cd /system/etc/init.d/"
it says "sh: cd: can't cd /system/etc/init.d/"
What am i doing wrong???
Click to expand...
Click to collapse
Don't know. Try this:
cd /system
cd etc
cd init.d
and report where it fails and if you are using adb or a terminal emulator. If it doesn't fail, continue with the line after the cd command.
Awesome work mizch!
We can refer to below link for partitioning of sd card to ext4 using adb
http://forum.xda-developers.com/showthread.php?t=534714
Hi Mizch,
Thanks for the script. have few questions; requesting for an answer:
1. Once data2sd is done, will sd card be auto mounted on reboot?
2. I am running JPM with Apollo's data2sd (ext2 partition for apps 1.1GB). What will be the benefit of ext4 over ext2?
3. I understand that i have to remove apollo's lagfix and then apply ext4 data2sd. Is there a way, i can also apply lagfix?
Thanks
jaskiratsingh said:
Hi Mizch,
Thanks for the script. have few questions; requesting for an answer:
1. Once data2sd is done, will sd card be auto mounted on reboot?
Click to expand...
Click to collapse
Yes. And for the first boot, it gets initialized too.
2. I am running JPM with Apollo's data2sd (ext2 partition for apps 1.1GB). What will be the benefit of ext4 over ext2?
Click to expand...
Click to collapse
Reliability, especially in crash cases and generally when the phone is shut down without a clean unmount. Ext 4, being a journaling file system, tries to keep the file system in a consistent state whenever possible. ext2 does nothing like that. So, when you forcible switch off your phone by long pressing the power button, most likely you are continuing with a damaged file system whose errors accumulate from now on and will eventually become visible at some time later.
There's one drawback, however: ext4 has to write more data than ext2. ext4 must always write the information needed to reconstruct a consistent file system to its journal.
3. I understand that i have to remove apollo's lagfix and then apply ext4 data2sd. Is there a way, i can also apply lagfix?
Click to expand...
Click to collapse
If I'm correct, the lagfix converts /data (your program storage) to ext2. Since /data is now handled by data2sd and converted to eyt4 anyway, you cannot use lagfix any more. You need to remove it.
mizch said:
If I'm correct, the lagfix converts /data (your program storage) to ext2. Since /data is now handled by data2sd and converted to eyt4 anyway, you cannot use lagfix any more. You need to remove it.
Click to expand...
Click to collapse
Thanks for the quick reply mizch. If i have to check apart from data, if anything else is converted into ext2, how can i do that?
jaskiratsingh said:
Thanks for the quick reply mizch. If i have to check apart from data, if anything else is converted into ext2, how can i do that?
Click to expand...
Click to collapse
have a look at the output of 'mount' or 'busybox mount'.
rm 02-app2sd for who use kyrillos ROM...i didn't do that command..but it seems works fine...what does it change if i use that command???
mizch said:
Don't know. Try this:
cd /system
cd etc
cd init.d
and report where it fails and if you are using adb or a terminal emulator. If it doesn't fail, continue with the line after the cd command.
Click to expand...
Click to collapse
I tried what you mentioned.... but again it shows the same error. It works well till "cd etc". Then, for init.d it shows out the error.
It seems the location for init.d is different in my device
next2devil said:
I tried what you mentioned.... but again it shows the same error. It works well till "cd etc". Then, for init.d it shows out the error.
It seems the location for init.d is different in my device
Click to expand...
Click to collapse
Yes. Probably there is none. What ROM are you using? Is it a Froyo ROM and from where?

[MOD] Data2SD (Enhanced) - I/O Fix

At the suggestion of several users, I am forking the previous thread. I am planning on supporting several ROMs and this is the best course to keep everything organized and provide support.
What is this?
Background:
The speed of the flash memory in the Transformer line of tablets is very poor. This is very apparent when installing or updating applications from the Play Store, copying files over USB, or using an app that caches lots of data like a web browser. The tablet will hiccup and stutter due to the I/O bottleneck. Running Androbench shows random write speeds averaging less than .2MB/sec.
The workaround:
Utilizing a fast, class 10 microSD card, we can move the /data partition to something significantly faster. The /data partition is where apps are installed to and where they store their configuration information and data. By redirecting /data to these fast microSD cards, we eliminate this bottleneck from our devices. With a properly fast card, users have reported a complete elimination of I/O related hiccups and system freezes. I have based my enhancements on the initial work by TweakerL on the Transformer Prime. Credit to fordwolden to porting his work to the Infinity.
The enhancements:
Previous implementations of this mod had the internal data partition mounted to /data2, with the media subfolder (your internal user storage) only available via root apps. There were symlinks set up at /sdcardi, etc, but these still required root permission to access. This is due to permissions on the /data partition and applies to both /data and /data2. Google gets around this by creating a "virtual" sdcard that points to /data/media. I have created a second "virtual" sdcard that points to /data2/media. This mod creates the scenario below:
/data = ext4 partition on microSD (fast)
/data2 = ext4 partition on internal storage (slow)
New changes:
/data/media -> Virtual SD Card Daemon -> /storage/sdcard0
/data2/media -> Virtual SD Card Daemon -> /storage/sdcardi
/sdcardi -> Symlink -> /storage/sdcardi
/mnt/sdcardi -> Symlink -> /storage/sdcardi
/storage/sdcardi is the virtual SD card for the internal storage. You should see all the files you had saved to this space before using data2sd. These files should be accessibly by any standard non-root Android app.
Note to kernel developers: This mod is more than just changes to the kernel. In order for the internal storage to be properly mounted at /storage/sdcardi, I have modded the Virtual SD Card Daemon that comes with Android. The stock binary is /system/bin/sdcard. I made a copy, modified it using a hex editor, called it /system/bin/sdcardi, and included it in my flashable zips. If you wish to make a data2sd version of your kernel, you must include this file in your zip. Additionally, be sure to add the "service sdcardi" line to your init.cardhu.rc that I have in mine.
Installation
Requirements
1) Class 10 microSD, at least 8gb
2) A computer with card reader
3) Partitioning software. Recommended: gparted LiveCD
Instructions
1) Decide how big you want to make the ext4 partition for /data. Remember, this is going to be the space for installing applications AND the /sdcard space that games will use the cache their extra data. Kindle books, Dropbox files, pics from the camera WILL ALL GO HERE. Personally, I decided to make the ext4 partition the whole 64gb of my card.
The ext4 partition has to be partition #2 on the microSD card. Why? This is to give people with large cards the option of creating a FAT32 or NTFS area as partition #1. This allows the card to be read by a Windows or Mac computer using a card reader. I use my tablet as my card reader with the USB cable, so I wasn't worried about this. I used gparted to create a small 8mb unformatted partition as partition #1, then a second 64gb partition to fill the rest of the card. I formatted this second partition in ext4.
2) Format your microSD card - Download Gparted Live CD (http://goo.gl/dJQAu) and use Imgburn (http://goo.gl/33MY9) to write to disc. Boot to Gparted using your CD after setting the CD as the primary boot device in your BIOS. Once in Gparted, create the 2 partitions described above, the first partition is Fat32, the second partition is ext4 or ext2. Set both partitions to type: Primary.
3) Insert microSD into tablet and flash any data2sd kernel for your ROM. (Note: Flashing any ROM will overwrite your data2sd kernel. You will have to re-flash the data2sd kernel if you change ROM or even upgrade your current one) After booting back into Android, you should be greeted with the Setup Wizard. Remember, this is a fresh /data partition, so it's a clean slate. It's a good idea to take a TitaniumBackup** ahead of time. I am experimenting with ways to make the transition more painless.
**Note about taking a TitaniumBackup before switching to data2sd. After the conversion, your internal storage will be mounted to /sdcardi. By default, TitaniumBackup looks for previous backups in /sdcard not in /sdcardi. You have two choices. Copy the TitaniumBackup folder from /sdcardi to /sdcard and restart the app, or change the backup location to /sdcardi/TitaniumBackup in the app preferences. Either of these options should work fine.
Optional: Verify data2sd is working. Pick any method you like:
a) Open a file explorer such as Root Explorer, ES, etc. You should see /sdcard and /sdcardi and be able to browse the files within. /sdcard is your ext4 partion on the microSD while /sdcardi is the internal storage. You should able to copy data between them.
b) Download "Androbench" app from the market and run "micro" sdcard check, if you see 0.4mb/sec or more in random write you're on data2sd.
c) Power off your device, remove your microSD card, then power back on your device. You should received an error message "Encryption unsuccessful". Insert microSD and reboot to fix.
Uninstallation
Don't like data2sd? Just flash a non-data2sd kernel using recovery and when you boot back into Android your /data will be on the internal storage. This could also be accomplished by flashing your ROM on top of itself without wiping.
Troubleshooting
1) Grab the mount-data2sd.zip from the second post.
2) Boot into TWRP and flash the mount-data2sd.zip. This will mount the microSD as /data in recovery. It will allow us to wipe it, format, etc using recovery.
3) Wipe "Internal Storage". This will erase the entire ext4 partition on your microSD.
4) Flash ROM
5) Flash data2sd kernel for ROM
*CAUTION*: If you don't flash mount-data2sd.zip before your wipe, you will be wiping your internal memory.
Download data2SD kernels
These are flashable zips. It will disable journaling on the microSD ext4 partition. You do not have to do this manually! Flash these after flashing the ROM.
CyanogenMOD 10.1 - beta2: http://d-h.st/rOe (Based on 4-2 nightly and may behave unexpectedly on other builds)
CleanROM 3.2.2: http://d-h.st/sCa - WORKS WITH CleanROM 3.3!
clemsynTFUniversalCyano650GPUFsyncver3: http://d-h.st/duw
ClemsynTFUniversalStock: http://d-h.st/IBm
clemsynTFUniversal650GPUver7 (Stock/CleanROM): http://d-h.st/S4k
Recovery
I made a flashable zip to help the recovery console understand our modification. By default, if you go into recovery and do a factory reset, it is formatting the /data partition on the internal storage. The issue same applies to nandroids. We may be using the second partition of our microSD card for /data, but the recovery does not know this. It will look to the internal /data partition during backup and restores.
This zip does not make any modifications to your tablet or copy any files. It simply updates your recovery mount points. The changes are temporary and are lost during the next reboot. You will need to flash it each time you boot into recovery.
After flashing this zip you will be able to:
1) Wipe data / Factory reset. The /data partition on the microSD will be wiped
2) Backup and restore nandroids. The /data partition on the microSD will be backed up or restored.
3) Choose "Flash zip from internal sdcard" and browse the files on the internal storage
4) Access and flash zips from the microSD storage. Choose "Flash zip from internal sdcard" and notice the !microSD folder at the top. This is a symlink that will kick you over to the microSD storage. This !microSD folder appears on your internal storage after you flash this zip for the first time. It remains unless you delete it. Even so, next time you enter recovery this !microSD symlink will not go anywhere until you flash this zip.
Please report your experience with this.
http://d-h.st/pPe
This one too.
So this is basically flashable on CleanRom 2.3 right? Only thing wrong is that it doesn't show up in windows over USB? I can live with that as long as apps can read it in the Android OS itself.
can I use flash this on cleanrom 2.3 to diasable journalling on my ext4 partition
Diogenes5 said:
So this is basically flashable on CleanRom 2.3 right? Only thing wrong is that it doesn't show up in windows over USB? I can live with that as long as apps can read it in the Android OS itself.
Click to expand...
Click to collapse
Nope. This has changes to framework-res.apk which is ROM specific. I will post a CleanROM 2.3 version in a few minutes for you guys.
Thanks - Appreciate your hard work
---------- Post added at 08:46 PM ---------- Previous post was at 08:37 PM ----------
wow that was fast-thanks
---------- Post added at 08:58 PM ---------- Previous post was at 08:46 PM ----------
i was getting 6000 with clemsyn -I got low 5000's with this new mod
clownberg said:
i was getting 6000 with clemsyn -I got low 5000's with this new mod
Click to expand...
Click to collapse
This is not clemsyn's kernel, this is the stock CleanROM 2.3 kernel. I will mod clemsyn's latest kernel and post it for you.
Mistar Muffin said:
This is not clemsyn's kernel, this is the stock CleanROM 2.3 kernel. I will mod clemsyn's latest kernel and post it for you.
Click to expand...
Click to collapse
Unable to have it work with cleanrom. Boot loop
titou00075 said:
Unable to have it work with cleanrom. Boot loop
Click to expand...
Click to collapse
Use recovery to wipe the /cache partition. Due to the changes in framework-res.apk this may be necessary if you aren't coming from a completely clean install of a ROM.
I just booted to recovery and wiped my microSD /data partition. I also wiped /cache and /system. I installed CleanROM 2.3 and in the same recovery session I flashed the clemsynTF700ver22GPU650VC-data2sd kernel and it booted right up.
May be a stupid question but do you still need TWO primary partitions on the SD card (i.e., first is FAT32 while second is Ext4 and used by the mod)? If this isn't necessary or not possible, should the recovery (i.e., installation) files be placed in internal storage?
Forgot to mention I'm using Windows 7 MTP and CleanROM 2.3
Mistar Muffin said:
Use recovery to wipe the /cache partition. Due to the changes in framework-res.apk this may be necessary if you aren't coming from a completely clean install of a ROM.
I just booted to recovery and wiped my microSD /data partition. I also wiped /cache and /system. I installed CleanROM 2.3 and in the same recovery session I flashed the clemsynTF700ver22GPU650VC-data2sd kernel and it booted right up.
Click to expand...
Click to collapse
Ok thanks. Will do:thumbup:
Your Awesome, Thank you!
cheers
Thanks Gonna try this.
done the work install all three files in the OP, however it is taking a long time to boot....Can someone give me an idea as to how long this normally take onn first bootup after a fresh install?
please advise
tyfoxx
Couldyou make one for blackbean? i tried thecm 1029,but it doesnt boot. Would greatly appreciate it.
Sweet
I just ran every shortcut I could think of:
I used Mini partition tool to reduce reduce my 32 gig fat down to 16 gigs & then created a 16 gig ext4 partition.
Wiped everything in twrp and re flashed Clean 2.3 then the new zip.
All I can say is WOW.
Restored everything. Works great no more stalls and stable so far. Hope it stays this way. Now to focus on battery life.
Sent from my HTC Ruby using xda app-developers app
Diogenes5 said:
Restored everything. Works great no more stalls and stable so far. Hope it stays this way. Now to focus on battery life.
Sent from my HTC Ruby using xda app-developers app
Click to expand...
Click to collapse
Glad it's working! I've prepared a little treat for everyone to make our recovery lives a little easier. Need to test a few more things before I post!
I'm running CleanROM 2.3 and ClemsynTF700ver22GPU650VC (awesome combo, btw). If I want to use this MOD, should I need to flash first CleanROM-2.3-data2sd.zip and later ClemsynTF700ver22GPU650VC-data2sd.zip, right? Of course, also, formating my microSD using ext4.
Awesome work here Mistar!!!! Thank you so very much for this!!! Gonna replace my SanDisk 32gb Class 4 card with a SanDisk 64gb Class 10 before I run this on CleanRom. I'm super excited about this mod!!!!!! Thanks a million!!!!!!
Sent from my EVO 4G LTE using xda premium

SD Card partitioning on MTD ROMs

Hi There
Can someone explain what he\she did to partition SD card, and make all apps get installed on it.
Please note :
1. I don't want to use Titanium backup for this usage. I don't have the paid version and I'm tired of doing this one app at a time.
2. I saw some guides on the net, but they were all for GB.
(partition the microSD on PC using minitool) -can we use ext4 on our MTD ROMs ? What is the 1st partition for ? and the 2nd ?
(install busybox and super user) - Is it still needed ? (MIUI for example has LBE as su).
(install Link2SD) - Is it always in memory ?
(reboot and put partitioned SD card)
(Define Link2SD)
3. I also saw swapper instructions but I can manage with 170MB free RAM memory I get after removing all unnecessary system apps, and I remember ppl saying then that it kills the SDCard very quickly.
If someone has a clear guide or instructions that he knows work, that will be nice.
Thanks in advance.
Step 1. Partition your SD card to have a sd-ext partition. This can definitely be ext2 or FAT16. Anything else depends on your kernel. Most of them do support ext3 and 4, but... start with something fairly basic.
Regarding recoveries:
TWRP has always failed for me on this, so I'd avoid that.
This may be doable in CWM. I've seen reference to that newer versions of CWM removed the partition option, so you might need to flash an ICS ROM with an older kernel, repartition, and then flash back to the one you want.
Also note that if you use CWM to repartition, your SD-card will be wiped. So do a backup first.
Step 2. Install Mounts2SD. Either from XDA or the Play Store. Even if you do take it from the Play Store to get update notifications, I highly suggest grabbing the recovery script from the XDA thread so that you can get back your shifted applications without needing to re-download and install M2SD, since it likes to be on internal which means... shifted off.
Step 3. Open Mounts2SD. Grant SU rights at whatever point it asks for it during step 3. Hit the menu button. Go to Application Settings. Install the Startup Script. Tell it to use the built-in busybox as well, so that you don't need to install anything or worry about it failing. Back out of the Application Settings.
Step 4. Press on the Wrench to go into the actual specific settings. I currently have forced Cache, 1% Storage Threshold, Applications are the only bit moved, the File System Check is on and using the Ext4 Driver, 128KB Deadline for Internal and 4096 with Deadline for External, and Safe Mode is disabled. But decide on what you want yourself, set it, go back to the Eye to see your current info.
Step 5. Reboot.
Step 6. Wait 1-30 minutes for it to finish moving all your stuff around.
Step 7. Unlock your phone, open Mounts2SD, and make sure everything looks pretty on that first 'Eye' info tab. If you like it then close Mounts2SD and keep going on your merry way. If you don't like it or you've done something like offload your data and now your phone is wretchedly slow, go to the Wrench, change your settings, go back to the Eye, and reboot again. Repeat until satisfied.
I thought it would be simplier.
A few more questions:
1. If I partition SD on PC, then I don't need any partitioning on recovery so it should work fine even on TWRP or advanced CWMs. Am I right?
2. Why do I need scripts for? Isn't the app enough?
3. Why should/could it possibly slow down my device? TB 'move to SD' for all doesn't slow my device what so ever.
4. How and where do I see what partition is used for what?
5. How much RAM does the app take?
6. Have you tried other apps link2sd or something CM has built in I think.?
Thanks.
sent from me
New answers to new questions.
1. Skip step 1 if you've done it on your PC. I just suggested recovery as that's easy... if you've made your sd-ext partition on the PC, step 1 is done.
2. No clue on Link2SD. I use Mounts2SD instead since it lets me set things. It probably does the same thing though and sets a init.d script that gets run during startup.
3. True. For some reason though having all your data moved to sd-ext makes our phone go to a crawl. Same if you move off the dalvik.
4. That's in Mounts2SD. No clue how you can see if you're using Link2SD.
5. For Mounts2SD, none while it's being used, since it just runs as a startup script. The app is just to control the script.
6. Not successfully. I had tried 5 or 6 different apps back a year ago or so when I first started playing with sd-ext and Mounts2SD was the best and free, so... never looked back after that. Now you can also do some system-flag tweaking if you want to donate, but the sd-ext stuff is all free.
I was able to successfully partition SD and use mount2sd on 4.3 SlimBean.
however, it was rather slow.
CM 10.1 and CM10.2 by DJL. did not allow me to partition nor did they recognize SlimBean's partition even if I replaced them kernel (to NilTMT).
I'm currently using CM10.1 which is stable as a daily driver and manually swapping apps with TB, I hate it, but this is the best combination I've come so far.
I sold my wife's SGS4G and upgraded her to SGS3 and hopefully in a year I will do the same. it had its moments, but on the bottom line it's a pretty ****ty phone with its lack of internal mem...but hey, it drove so many of us to go deeper and deeper trying to understand and made us more tecnolgical and solution oriented.
Mounts2SD worked for me on CM10.1, so not sure why it failed for you. Ah well.
A few things I have found...
Yes, you can partition on Windows, but you're really asking for trouble. It's not too bad download Ubuntu or the like and you can boot off a USB stick without touching your Windows install.
The TeamAcid kernels that I know of handle ext2/3/4 file systems. All kinds of arguments as to which are better. I personally use ext4 and don't find it obviously "slow" for the way I use my phone.
That said, what the boot scripts (which are part of a flashed "kernel" for the SGS4G) actually do with a "special" partition is another story. In some cases the first stages of booting will look for special partitions and mount them in pre-configured places. For example, the second partition of the removable card might be mounted on /sd-ext/ in many CyanogenMod ROMs. Many (most?) SGS4G ROMs don't have these "special" mount rules defined.
Moving an app to SD using the "native" approach just moves the app and none of its data to the SD card. It won't for example, move 25 MB of mail from /data/data to your microSD
Moving an app to SD (or anywhere else) doesn't keep it from generating its classes in /data/dalvik-cache -- It isn't "free" to have an app on SD as far as internal storage goes, even if it doesn't write any data.
Moving an app to SD will absolutely slow down your boot time. It does it by creating a file that contains a file system that then gets read and mounted at boot time. You can watch the parade of them getting mounted using adb logcat. It can take a minute or two to mount them all. Once mounted, that double layer of file systems shouldn't slow you down too much, since it is basically a read-only kind of thing.
Scripts are required since you need to be able to "fake out" the operating system as to where things are stored for anything (except if you just use the native app to SD method). In most cases you need new partitions mounted before the Android part of the OS starts running.
Some scripts are more robust than others.
TitaniumBackup (paid version) has a way to move data to an external partition. It works like a charm for me (64 GB Sandisk UHS-1 / Class 10 microSD). It was very tweaky for me to get it to recognize the ext4 partition the first time. It can bulk-move app data to the partition. I don't know which, if any, of the other scripts move the data to an external partition.
On my phone, an ext4 file system can be significantly faster than the internal yaffs, especially for write. Alas, it usually seems to be read that is a killer for most things in an well-written app. On my phone, yaffs can be faster than ext4 for short reads. Who knows how this would play out in real-world usage.
Other things that TitaniumBackup can do that help free up internal storage, at least in the paid version, are:
Dalvik cache cleanup
Integrate system Dalvik cache into ROM
Integrate update into ROM
Convert to system app
I can confirm Link2SD works where Mount2SD fails, which is an ext3 partitioned sd-ext on AOKP. it doesn't get any simpler than that.
sent from me

[Q] Replace Internal Data Partition for External SD

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

Problems with TWRP Backup - unable to mount sd/ext

I've been searching both this forum and the net generally and not found an answer to my specific problem so I'm hoping someone can help.
I'm trying to swap out my ROM, I'm currently running CM 11 nightly but I'm getting endless FCs with apps so thought I'd try something different.
When I try to run the nandroid backup with TWRP v2.7.0.1 the backup fails every time with the error E: unable to mount '/sd-ext'
Can anyone advise? Thanks
tht looks like external sd card.
Try changing location for your backup to internal memory or make sure you got SD card plugged in to SD slot.
you may also try command on terminal emulator (or via adb shell):
ln -s /storage/emulated/0/ /sd-ext/
it will create symbolic link named sd-ext in root of your system and it will point to internal storage (if I am not mistaken, from now on it should not matter if you select internal or external storage as target for your backup - it will end up as internal anyways)
Sent from my TF300T using XDA Free mobile app
Thanks, the backup was to be created on the internal SD card, but you are right it is almost certainly a problem with the external card. I'm unable to mount either the dock SD or micro SD cards in TWRP - the options are just greyed out and can't be selected.
I can't get either card to mount when I boot to system ether I have noticed. I've tried formatting them as FAT32, EXFAT and NTFS and no dice so I'm wondering if this is a KK issue - they both worked flawlessly when I was running PA and Omnirom JB ROMs.
I've managed to find a workaround - I've flashed CWM and have been able to do a nandroid backup with that - but I still can't mount either the micro SD or dock SD cards with CWM or in system when I flashed KatKISS ROM - and of course now I can't use any old TWRP nandroids I have from JB ROMs without reflashing TWRP. I'd also rather be running TWRP ultimately if I can so it would be good to get to the bottom of what is causing this issue.
Not quite sure what the command line you suggested does, but I'm guessing it won't be useful with the problem as it stands now?
sorry for late reply as I was out of internet lately.
that command creates /sd-ext/ folder that acts similar to shortcut to intertnal sdcard
any call for /sd-ext (for example: cd /sd-ext) will end up on internal sdcard.
That wont help with accessing your external sdcard (as this was main issue here) - it would merely fool installer to 'think' it is working on external sd while it was still on internal.
Sent from my TF300T using XDA Free mobile app
Thanks for your help. I've had endless troubles which ultimately ended in a hard brick during a failed flash of the stock ROM. I'm waiting for a replacement motherboard - something wasn't right with the old board anyway, it doesn't seem that it was just ROM issue. Hopefully when it comes I'll find that it wasn't a hardware issue associated with the SD cards as well.

Categories

Resources