[Galaxy Tab 2 7" Android Development] DivinityCycle:
OH MY GOD.

That took entirely too much effort, but yes, I have successfully gotten the mount points to switch around.

poulsen93, you were right, a combination of a script AND an edited vold.fstab was the trick.

For the record, I am working with CM9-RC2 on a GT-P3113.

I believe the same tricks should work exactly the same on any P3XXX device, and probably other ICS ROMs as well.

Here's the script I'm running @ boot via Script Manager:

#!/system/bin/sh
LOG=/data/local/log.txt
exec 3>&1 4>&2 >$LOG 2>&1
echo "Script start"
echo "Remounting root filesystems to make them writable."
mount -o remount,rw /
mount -o remount,rw /system
echo "Unmounting /mnt/sdcard"
umount /mnt/sdcard
echo "Mounting micro SD card to /mnt/sdcard"
mount -t vfat -o rw,umask=0000 /dev/block/vold/179:25 /mnt/sdcard
echo "Removing /mnt/extSdCard"
rm -r /mnt/extSdCard
echo "Linking /data/media to /mnt/extSdCard"
ln -s /data/media /mnt/extSdCard
echo "Script done"

The script was designed to "live" in /data/local/ which is why it outputs to a logfile there. You don't NEED to have any logging to accomplish what it does, its just helpful for figuring out why its breaking if it isn't working.

Here is a "no logging" version of the same script:

#!/system/bin/sh
mount -o remount,rw /
mount -o remount,rw /system
umount /mnt/sdcard
mount -t vfat -o rw,umask=0000 /dev/block/vold/179:25 /mnt/sdcard
rm -r /mnt/extSdCard
ln -s /data/media /mnt/extSdCard

Either version can be run from pretty much any location as long as you can set the file to be executable. Usually that means you cannot store it on a FAT-formatted sdcard.

The edit I made to vold.fstab is VERY minor.

original text:

dev_mount sdcard /mnt/extSdCard auto /devices/platform/omap/omap_hsmmc.0/mmc_host/mmc1

modified text:

dev_mount sdcard /mnt/sdcard auto /devices/platform/omap/omap_hsmmc.0/mmc_host/mmc1

Note that this is very counter intuitive given what we are trying to accomplish. Also, if you just use the modified vold.fstab, it makes the microSD card not mount anywhere. Talk about frustrating!

However, the result of these two together is that when the device boots up, you have the contents of the "fake" sdcard mounted to /mnt/extSdCard and the real sdcard mounted to /mnt/sdcard. This makes it so virtually all applications that are smart enough to use an sdcard will use your big micro SD card as opposed to just taking up space on the /data partition (which is where the fake sdcard actually lives).

I believe that behind the scenes, there's actually an sdcard "service" app that runs from /system/bin/sdcard. From what I can tell, its just doing some sort of fancy mount and handling the permissions so that the directory /data/media works like an sdcard is supposed to even though its in the /data partition, which I believe is formatted with ext4 as opposed to FAT32. Very sneaky, Samsung!

I plan on packaging up the JellyBean sdcard swap mod as a flashable ZIP next.

The ICS solution cannot be packaged in that way given the timing of the script involved. Obviously, I have posted all of my findings and code here, so if some smart person can figure out a better way to do this, go for it! Maybe if there's a freely redistributable app that can be used to configure the script to auto-run, it'd be possible to package that app + the script + the vold.fstab file into a zip together.

I am pretty sure it won't be too big of a deal since I am willing to bet most people will be jumping to JB ASAP, especially the type of guys who are like "Man, I want my mount points to work differently!" :P