[Q] Mount arbitary phone partition on PC? Change partition "names"?


I am running rooted stock Android 2.3 on LG E405 (no working 4.x ROMs exist for the device)

I have two questions:

1) What is the shell command to manually make android allow the PC to mount androids' (internal) partition as USB-drive? (I cannot think of right keywords to google this one up - please help!)

2) How does android determine which partition is which (i.e. which one to remount for the PC when connecting in "USB storage" mode), beside vold.fstab and init.rc? On android 2.3 that info is not in "framework-res.apk", so where is it? In the partition table itself?

Please help me search the forums for an answer. ANY advise is much appreciated!

This is why I ask:

I had switched data partition with internal sdcard partition.

Here's how:

Phone had a very small "/data" partition on /dev/block/mmcblk0p21 and large internal "/sdcard" partition on mmcblk0p20

So I reformatted mmcblk0p20 (ex-sdcard partition) into EXT4 and mmcblk0p21 (ex-data partition) into FAT32

Then I changed init.rc to mount mmcblk0p20 as /data type EXT4 and mmcblk0p21 as /sdcard type VFAT (mounting /sdcard was commented out in stock init.rc for some reason). This required modifying my boot image.

I have also set correct partition number in vold.fstab:
[#]dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_sdcc.3/mmc_host[/#]

So basicly I now have a large /data partition and small internal /sdcard.
I'm able install up to a gigabyte of APKs and it works fine.

However, when I connect to my PC via USB into "USB Storage" mode, the phone seems to still try to unmount what was previously sdcard partition (/dev/block/mmcblk0p20), instead of what is NOW an sdcard partition (/dev/block/mmcblk0p21)

I can still send files to the phone via wi-fi and ADB, but the ability to mount it directly would be nice.

If I accidentally select "erase internal sdcard" from storage menu, that will also most likely erase what is now my /data partition, softbricking the phone.
The "factory reset" option will probably only corrupt the sdcard.
There may be other problems with that.

Show Accepted Answer

Guest Quick Reply (No URL, BBcode or HTML)

Last post by sromaguera
2 hours ago
Last post by christophe.kautzer
20 minutes ago
Last post by alexandrea.greenholt
49 minutes ago
Last post by nettie03
4 hours ago
Last post by kuhn.rogers
4 hours ago
Last post by evans.morissette
3 hours ago
Last post by pagac.marcelle
4 hours ago
Last post by oemmerich
4 hours ago
Last post by orunte
3 hours ago
Last post by reece.hintz
2 hours ago
Last post by balistreri.karson
3 hours ago
Last post by naomi94
42 minutes ago
Started by brath
Last post by vbogan
2 hours ago
Last post by aaliyah.rosenbaum
4 hours ago
Last post by pcollins
1 hour ago