5,606,779 Members 38,124 Now Online
XDA Developers Android and Mobile Development Forum

[Help] Changing Around Mountpoints for sdcard and extSdCard?

Tip us?
 
DivinityCycle
Old
#1  
DivinityCycle's Avatar
Senior Member - OP
Thanks Meter 217
Posts: 433
Join Date: Jul 2010
Location: Portland, OR
Default [Help] Changing Around Mountpoints for sdcard and extSdCard?

Hey guys.
Some previous Samsung devices had no external storage at all but still mapped the biggest flash partition to /mnt/sdcard.
The Galaxy Tab 2 7.0 has a Micro SD card slot on it (one of the reasons I bought the thing!), but I guess for compatibility they still mount an internal flash storage partition to /sdcard. The actual micro SD card gets mounted to freaking /mnt/extSdCard.

Why does this matter?
Basically, tons of stuff in Android is setup to dump the large files to /sdcard by default. Things like games that require an extra download, the Camera app, etc. I've got a 32GB microSD card in there, and it makes me really frustrated that stuff won't just automatically use that.

So. What I'm looking to do is switch them around, so the internal fake flash partition ends up mounting to /mnt/extSdCard and the REAL microSD card mounts to /mnt/sdcard. That way my big huge card is where most data will end up automagically. Ultimately if I could just dump the internal "sdcard" partition and give that space to other parts of the system, that'd be sweet, but at this point I'm still kindof in la la land with Android, so I'll be happy just to get the mounts flipped around.

I do Linux stuff for work, and use a 5-disk file server at home running Ubuntu Server, so I approached this problem in a Linux way: why not mount via fstab??
Turns out Android doesn't actually directly have a /etc/fstab. Instead you've got /system/etc/vold.fstab.
From my brief research, this file appears to work pretty much the same way as fstab in Linux.
However, the stock one doesn't contain any mountpoint for the fake internal sdcard. vold.fstab seems to tell the vold executable what to do during boot-time.

My first problem: the vold.fstab file on my device doesn't contain any mount instructions for the /sdcard device.
Not a problem, I have SSH and WinSCP working, so I got a read on the mount points likeso:
Code:
127|root@android:/dev/block # cat /proc/mounts
rootfs / rootfs ro,noatime 0 0
tmpfs /dev tmpfs rw,nosuid,noatime,mode=755 0 0
devpts /dev/pts devpts rw,noatime,mode=600 0 0
proc /proc proc rw,noatime 0 0
sysfs /sys sysfs rw,noatime 0 0
none /acct cgroup rw,noatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,noatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,noatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,noatime,cpu 0 0
/dev/block/platform/omap/omap_hsmmc.1/by-name/FACTORYFS /system ext4 ro,noatime,barrier=1,data=ordered 0 0
/dev/block/platform/omap/omap_hsmmc.1/by-name/DATAFS /data ext4 rw,nosuid,nodev,noatime,barrier=1,data=ordered,noauto_da_alloc,discard 0 0
/dev/block/platform/omap/omap_hsmmc.1/by-name/CACHE /cache ext4 rw,nosuid,nodev,noatime,errors=panic,barrier=1,nomblk_io_submit,data=ordered 0 0
/dev/block/platform/omap/omap_hsmmc.1/by-name/EFS /efs ext4 rw,noatime,barrier=1,data=ordered 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,noatime 0 0
/dev/fuse /mnt/sdcard fuse rw,nosuid,nodev,noatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/block/vold/179:25 /mnt/extSdCard vfat rw,dirsync,nosuid,nodev,noexec,noatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
OK. so the vold.fstab file contains:
Code:
## Vold 2.0 Generic fstab
## - San Mehat (san@android.com)
##

#######################
## Regular device mount
##
## Format: dev_mount <label> <mount_point> <part> <sysfs_path1...>
## label        - Label for the volume
## mount_point  - Where the volume will be mounted
## part         - Partition # (1 based), or 'auto' for first usable partition.
## <sysfs_path> - List of sysfs paths to source devices
######################

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

#usb host device 
dev_mount usbdisk /mnt/usbdisk auto /devices/platform/omap/musb-omap2430/musb-hdrc/usb1
So, I have made a backup of my vold.fstab file, but I'm a little gun shy about making changes to it, particularly adding a new line for the "internal" sdcard. I know there are a couple of other ways to probably do this, like an init.d shell script that just executes the needed mount commands, and I'm honestly not sure if putting an entry for /mnt/sdcard into vold.fstab will override the mounts that are (I guess?) coming from the ramdisk init sequence. Any input, XDA devs?
The Following 11 Users Say Thank You to DivinityCycle For This Useful Post: [ Click to Expand ]
 
CXENTE
Old
#2  
CXENTE's Avatar
Senior Member
Thanks Meter 84
Posts: 528
Join Date: Oct 2011
Location: HOUSTON

 
DONATE TO ME
Go for it :thumbup:

Sent from my GT-P3100 using xda app-developers app
The Following User Says Thank You to CXENTE For This Useful Post: [ Click to Expand ]
 
CYBERFANT
Old
#3  
Member
Thanks Meter 7
Posts: 30
Join Date: Jul 2006
Location: Hamburg
I have the same Problem on my Galaxy Tab2 7.0 WIFI (GT-P3110 8 GB). I found a temporary Soloution for me. The App that i use is LINK2SD. You should have two partitions on SD card and both should be primary.
The first FAT partition is your standard sdcard (mountetd on extSdCard). The second partition /data/sdext2 is used for application files and can be ext2, ext3, ext4 or FAT32. Here are more informations about it: http://rootzwiki.com/topic/24500-if-...10#entry701146

In this thread are the same Question: http://forum.xda-developers.com/show....php?t=1679037
CYBERFANT
ASUS PadFone2 64GB @ 1,7 GHz
- ROM: GuerillaROM-v1.6_OC

HTC Desire HD @ 1,5 GHz
- ROM: ViperDHD v2.2.0
- Bootloader: 0.85.2007 ENG-S-OFF
- Radio: 12.65.60.29U_26.14.04.28_M
- RIL: 12.65.60.29U_26.14.04.28_M
- 32 GB microSDHC CLASS-10
The Following 2 Users Say Thank You to CYBERFANT For This Useful Post: [ Click to Expand ]
 
RomsWell
Old
#4  
RomsWell's Avatar
Senior Member
Thanks Meter 864
Posts: 1,393
Join Date: Jul 2011
Location: Venice
I think it will read the changes. For example on the htc rezound the firmware update for ics changed the mount points from what was used in gb.So in order to run a gb Rom on ics firmware and vice versa the Fix was swaping vstab. Figure as long as u only mess with the sd mounts internal and ext. It will still boot and u can swap file as needed for testing.

Sent from my ADR6425LVW using xda premium
 
DivinityCycle
Old
#5  
DivinityCycle's Avatar
Senior Member - OP
Thanks Meter 217
Posts: 433
Join Date: Jul 2010
Location: Portland, OR
I'll try and figure it out.
Already found one thing: running the mount command with no switches will list all current mounts (can't believe I forgot that!).
 
RomsWell
Old
#6  
RomsWell's Avatar
Senior Member
Thanks Meter 864
Posts: 1,393
Join Date: Jul 2011
Location: Venice
Quote:
Originally Posted by DivinityCycle View Post
I'll try and figure it out.
Already found one thing: running the mount command with no switches will list all current mounts (can't believe I forgot that!).
Im workin on it too. Im used to seeing them on separate lines. Ill let u know if i beat ya to it lol

Sent from my GT-P3113 using xda premium
The Following 3 Users Say Thank You to RomsWell For This Useful Post: [ Click to Expand ]
 
DivinityCycle
Old
#7  
DivinityCycle's Avatar
Senior Member - OP
Thanks Meter 217
Posts: 433
Join Date: Jul 2010
Location: Portland, OR
Something else useful that I found:

Code:
root@android:/dev/block # cat /proc/partitions
major minor  #blocks  name

 179        0    7634944 mmcblk0
 179        1      20480 mmcblk0p1
 179        2       2048 mmcblk0p2
 179        3       2048 mmcblk0p3
 179        4       8192 mmcblk0p4
 179        5       8192 mmcblk0p5
 179        6       8192 mmcblk0p6
 179        7     716800 mmcblk0p7
 259        0      20480 mmcblk0p8
 259        1    1433600 mmcblk0p9
 259        2    4886511 mmcblk0p10
 259        3     524288 mmcblk0p11
 179       16       2048 mmcblk0boot1
 179        8       2048 mmcblk0boot0
 179       24   30318592 mmcblk1
 179       25   30314496 mmcblk1p1
and

Code:
root@android:/dev/block # df
Filesystem             Size   Used   Free   Blksize
/dev                   347M    48K   347M   4096
/mnt/asec              347M     0K   347M   4096
/mnt/obb               347M     0K   347M   4096
/system                  1G   259M     1G   4096
/data                    4G     2G     2G   4096
/cache                 688M    58M   630M   4096
/efs                    19M     4M    15M   4096
/mnt/extSdCard          28G    13G    15G   32768
/mnt/sdcard              4G     2G     2G   4096
I'm pretty sure the partitions listed are found at /dev/block/mmcblk0pX, so maybe that's what needs to be mounted. I've not been successful yet in mounting anything manually but I just found this stuff, so hopefully will have it soon.
The Following 2 Users Say Thank You to DivinityCycle For This Useful Post: [ Click to Expand ]
 
rostol
Old
#8  
rostol's Avatar
Junior Member
Thanks Meter 9
Posts: 24
Join Date: Jul 2007
Hey DivinityCycle,

This post and tool in the S3 forum might be useful to you as it does the exact same thing in the GS3.

http://forum.xda-developers.com/show....php?t=1772234

If I recall correctly it needs a kernel with init.d support. But I think it will definitely help.

Rgrds

Sent from my GT-I9300
The Following 5 Users Say Thank You to rostol For This Useful Post: [ Click to Expand ]
 
RomsWell
Old
#9  
RomsWell's Avatar
Senior Member
Thanks Meter 864
Posts: 1,393
Join Date: Jul 2011
Location: Venice
I have this in mine i didnt see it in yours

#storage_struct = series, "/mnt/sdcard/extStorages"
#storage_struct = parallel
 
DivinityCycle
Old
#10  
DivinityCycle's Avatar
Senior Member - OP
Thanks Meter 217
Posts: 433
Join Date: Jul 2010
Location: Portland, OR
Making progress, I was able to mount the "external" sdcard to my test mountpoint using:
mount -t vfat -o umask=0000 /dev/block/vold/179:25 /mnt/testing
So, that's part of the puzzle figured out. Now, just need to sort of out the internal "sdcard" device path and then I guess I can try throwing stuff into vold.fstab

The Following 3 Users Say Thank You to DivinityCycle For This Useful Post: [ Click to Expand ]
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes