Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,734,168 Members 50,827 Now Online
XDA Developers Android and Mobile Development Forum

[Q] Tweaking fstab for /mnt/sdcard/external_sd backwards compatibility

Tip us?
 
jago25_98
Old
(Last edited by jago25_98; 3rd May 2012 at 08:50 PM.) Reason: appending to bold
#1  
Senior Member - OP
Thanks Meter 25
Posts: 370
Join Date: Jul 2007
Default [Q] Tweaking fstab for /mnt/sdcard/external_sd backwards compatibility

Here's the original

/system/etc/vold.fstab

file:

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
######################

# internal sdcard
dev_mount sdcard /mnt/sdcard 1 /devices/platform/s3c-sdhci.0/mmc_host/mmc0

# external sdcard
dev_mount emmc /mnt/emmc auto /devices/platform/s3c-sdhci.2/mmc_host/mmc2
I believe there's no reason not to mount emmc to /mnt/sdcard/external_sd in addition to the ICS default of /mnt/emmc

As a result I am thinking of appending (not replacing) the following line:

Code:
# external sdcard
dev_mount emmc /mnt/sdcard/external_sd auto /devices/platform/s3c-sdhci.2/mmc_host/mmc2
But such a change can really mess up a phone so first I want to check a few things.

1) If we have a error with fstab will we have adb access at that point to reverse the change we've made or it it giong to have to be a case of nandroid restore only?

2) Linux can mount something to an area that is already mounted, I am assuming Android can do this too.

This person had a slightly different approach:
http://forum.xda-developers.com/show....php?t=1141750

Personally I prefer to keep the external_sd in vfat format because then you're more able to transfer things to&from Windows computers and even other phones. Bit of a shame as there are probably many advantages to ext4.
RSS feed for NookTouch Dev forum: http://forum.xda-developers.com/exte...&forumids=1201 Refer to each phone by it's model name where possible - i.e. "i9000", not "Galaxy S" - easier searching
 
bhu1
Old
#2  
bhu1's Avatar
Senior Member
Thanks Meter 4474
Posts: 4,952
Join Date: Aug 2011
Location: Jaipur

 
DONATE TO ME
oops!! Ignore.

 
frankind
Old
#3  
Member
Thanks Meter 11
Posts: 49
Join Date: Nov 2010
Default I would like to know too.

I would like to know too.
 
vechthra
Old
#4  
Junior Member
Thanks Meter 1
Posts: 23
Join Date: Dec 2007
Quote:
Originally Posted by jago25_98 View Post
Here's the original

/system/etc/vold.fstab

file:

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
######################

# internal sdcard
dev_mount sdcard /mnt/sdcard 1 /devices/platform/s3c-sdhci.0/mmc_host/mmc0

# external sdcard
dev_mount emmc /mnt/emmc auto /devices/platform/s3c-sdhci.2/mmc_host/mmc2
I believe there's no reason not to mount emmc to /mnt/sdcard/external_sd in addition to the ICS default of /mnt/emmc

As a result I am thinking of appending (not replacing) the following line:

Code:
# external sdcard
dev_mount emmc /mnt/sdcard/external_sd auto /devices/platform/s3c-sdhci.2/mmc_host/mmc2
But such a change can really mess up a phone so first I want to check a few things.

1) If we have a error with fstab will we have adb access at that point to reverse the change we've made or it it giong to have to be a case of nandroid restore only?

2) Linux can mount something to an area that is already mounted, I am assuming Android can do this too.

This person had a slightly different approach:
http://forum.xda-developers.com/show....php?t=1141750

Personally I prefer to keep the external_sd in vfat format because then you're more able to transfer things to&from Windows computers and even other phones. Bit of a shame as there are probably many advantages to ext4.




My tablet shows it like this:
## 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
######################



## Example of a standard sdcard mount for the emulator / Dream

# Mounts the first usable partition of the specified device

dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/mt6573-sd.0/mmc_host/mmc0



## Example of a dual card setup

# dev_mount left_sdcard /mnt/sdcard1 auto /devices/platform/goldfish_mmc.0 /devices/platform/mt6516-sd.0/mmc_host/mmc0

# dev_mount right_sdcard /mnt/sdcard2 auto /devices/platform/goldfish_mmc.1 /devices/platform/mt6516-sd.2/mmc_host/mmc2



## Example of specifying a specific partition for mounts

# dev_mount sdcard /mnt/sdcard 2 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1



But when I introduced the code as above, my tablet stopped recognizing the sdcard, so I had to recover to an image before in order to recognize it again.
Any suggestions that it will not happen again???
 
jago25_98
Old
#5  
Senior Member - OP
Thanks Meter 25
Posts: 370
Join Date: Jul 2007
You probably need to adjust my

Code:
/devices/platform/s3c-sdhci.2/mmc_host/mmc2
to the device matching your setup, something like

Code:
dev_mount emmc /mnt/emmc auto /devices/platform/mt6516-sd.2/mmc_host/mmc2
because I'm on a i9000 samsung phone and your on some kind of tablet
RSS feed for NookTouch Dev forum: http://forum.xda-developers.com/exte...&forumids=1201 Refer to each phone by it's model name where possible - i.e. "i9000", not "Galaxy S" - easier searching
 
vechthra
Old
#6  
Junior Member
Thanks Meter 1
Posts: 23
Join Date: Dec 2007
Could you explain it to me a bit further????
What does any of the commands in the line mean?
Yhanks
 
Forssound
Old
#7  
Forssound's Avatar
Member
Thanks Meter 3
Posts: 44
Join Date: Mar 2012
Location: Wijnegem
Quote:
Originally Posted by vechthra View Post
Could you explain it to me a bit further????
What does any of the commands in the line mean?
Yhanks
It seems I found a solution here http://forum.xda-developers.com/show....php?t=1511619

In brief

install a app like SSHDroid
on your desktop connect with putty to your phone so hook up your phone with the usb cable
login is or was "root" and password is "admin"

ls /dev/block/vold will give you some figures 179.0 179.2 179.2 179.8 179.9
ls /dev/block/platform will give some folders s3c-sdchi.0 s3c-sdchi.2 s5pc110-onenand

One can chose between several ways how the folders appear on a windows explorer folder
like a USB stick or a mediaplayer

setprop persist.sys.usb.config mtp,adb results in the little walkman icon on your explorer
setprop persist.sys.usb.config mass_storage,adb results in the appearing of a usb stick

mount is also a commando when given alone which will show you everything that is mounted

In the putty window i did a feel free to experiment

setprop persist.sys.usb.config mass_storage,adb
echo /dev/block/vold/179:9 > /sys/devices/platform/s3c-usbgadget/gadget/lun1/file"

This would result in the appearing of a USB stick with name sdcard on your file explorer in windows.

To make this flash persistent
Look if your rom has support for userinit.d or bootcompletehook.sh somewhere in /data

cm 10.1 has support for userinit.d

in /system/etc/init.d I found 2 files 00banner and 90userinit

vi /system/etc/init.d/90userinit is this

#!/system/bin/sh
# call userinit.sh and/or userinit.d/* scripts if present in /data/local

if [ -e /data/local/userinit.sh ];
then
log -p i -t userinit "Executing /data/local/userinit.sh";
logwrapper /system/bin/sh /data/local/userinit.sh;
setprop cm.userinit.active 1;
fi;

if [ -d /data/local/userinit.d ];
then
logwrapper busybox run-parts /data/local/userinit.d;
setprop cm.userinit.active 1;
fi;

now the folder wasn't there so
mkdir /data/local/userinit.d

in this folder make a file.The name isn't important
cd /data/local/userinit.d
vi mountsdcard
setprop persist.sys.usb.config mass_storage,adb
echo /dev/block/vold/179:9 > /sys/devices/platform/s3c-usbgadget/gadget/lun1/file
make sure you give rights to this file and the folder one can do that with es file explorer or probable
chmod 751 mountsdcard

I think that's it
This will mount your second sdcard (if you have one ) on your windows like a usb stick. It will do this even if your phone isn't completely started up.
You will not have to do a "mount usb" on your phone. If you do this anyway your first card is also mounted.
This is a neat trick to make your CAR find your music on your phone. If your car has a usb port and the functionality to play music from usb sticks.

Kind Regards
Guy
 
jangra53053
Old
#8  
Junior Member
Thanks Meter 0
Posts: 1
Join Date: Oct 2013
Default want to change

dev_mount sdcard /mnt/sdcard auto /devices/platform/goldfish_mmc.0 /devices/platform/mt6573-sd.0/mmc_host/mmc0

## Example of a dual card setup
# dev_mount left_sdcard /mnt/sdcard1 auto /devices/platform/goldfish_mmc.0 /devices/platform/mt6516-sd.0/mmc_host/mmc0
# dev_mount right_sdcard /mnt/sdcard2 auto /devices/platform/goldfish_mmc.1 /devices/platform/mt6516-sd.2/mmc_host/mmc2

## Example of specifying a specific partition for mounts
# dev_mount sdcard /mnt/sdcard 2 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1

u
 
addoaryee
Old
#9  
Junior Member
Thanks Meter 0
Posts: 7
Join Date: Jun 2009
Default need help

can someone please help me with this. not sure where to edit

## 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
######################

## Example of a standard sdcard mount for the emulator / Dream
# Mounts the first usable partition of the specified device
dev_mount sdcard /mnt/sdcard emmc@fat /devices/platform/goldfish_mmc.0 /devices/platform/mtk-msdc.0/mmc_host
dev_mount sdcard2 /mnt/sdcard/sdcard2 auto /devices/platform/goldfish_mmc.1 /devices/platform/mtk-msdc.1/mmc_host
## Example of a dual card setup
# dev_mount left_sdcard /mnt/sdcard1 auto /devices/platform/goldfish_mmc.0 /devices/platform/mtk-sd.0/mmc_host/mmc0
# dev_mount right_sdcard /mnt/sdcard2 auto /devices/platform/goldfish_mmc.1 /devices/platform/mtk-sd.2/mmc_host/mmc2

## Example of specifying a specific partition for mounts
# dev_mount sdcard /mnt/sdcard 2 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.2/mmc_host/mmc1

Tags
emmc
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


TRENDING IN THEMER...