Now Gesture Tweaks Replaces Google Now with Custom Action

On most modern Android devices with software navigation keys, swiping up from the … more

ToqAN Fixes Android 5.0 Notification Bug on Qualcomm Toq

The Qualcomm Toq is probably one of the lesser known smartwatches on the market … more

How to Root and Unlock the Google Nexus 6 on a Mac – XDA TV

In the past, XDA Developer TV Producer droidmodd3rx has shown you how to … more

Set Up Your MediaTek Device with Comprehensive Beginner’s Guide

As can be seen with the use of MediaTek chips in Android One devices … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

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

OP jago25_98

3rd May 2012, 09:49 PM   |  #1  
OP Senior Member
Thanks Meter: 25
 
390 posts
Join Date:Joined: Jul 2007
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.
Last edited by jago25_98; 3rd May 2012 at 09:50 PM. Reason: appending to bold
3rd May 2012, 10:36 PM   |  #2  
bhu1's Avatar
Senior Member
Flag Jaipur
Thanks Meter: 4,481
 
4,993 posts
Join Date:Joined: Aug 2011
Donate to Me
More
oops!! Ignore.
12th June 2012, 02:11 PM   |  #3  
Member
Thanks Meter: 11
 
49 posts
Join Date:Joined: Nov 2010
I would like to know too.
I would like to know too.
29th July 2012, 06:45 PM   |  #4  
Junior Member
Thanks Meter: 1
 
23 posts
Join Date:Joined: Dec 2007
Quote:
Originally Posted by jago25_98

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???
29th July 2012, 10:44 PM   |  #5  
OP Senior Member
Thanks Meter: 25
 
390 posts
Join Date:Joined: 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
4th August 2012, 06:18 PM   |  #6  
Junior Member
Thanks Meter: 1
 
23 posts
Join Date:Joined: Dec 2007
Could you explain it to me a bit further????
What does any of the commands in the line mean?
Yhanks
23rd January 2013, 09:38 AM   |  #7  
Forssound's Avatar
Member
Flag Wijnegem
Thanks Meter: 3
 
44 posts
Join Date:Joined: Mar 2012
More
Quote:
Originally Posted by vechthra

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
15th October 2013, 04:13 AM   |  #8  
Junior Member
Thanks Meter: 0
 
1 posts
Join Date:Joined: Oct 2013
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
22nd May 2014, 11:29 PM   |  #9  
Junior Member
Thanks Meter: 0
 
7 posts
Join Date:Joined: Jun 2009
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

Post Reply Subscribe to Thread

Tags
emmc
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes