[Samsung Galaxy SL i9003] Dipu K:
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://xdaforums.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.