Jump to content


Photo

[Q]How To Mount Directories Between Internal And External Sd Card


  • Please log in to reply
3 replies to this topic

#1 ibolski

ibolski

    Droid Master

  • Dedicated Supporter
  • PipPipPip
  • 535 posts
  • Twitter:iBolski
  • Google+:Ivan Samuelson
  • LocationColumbus, Ohio
  • Current Device(s):Samsung Galaxy S7

Posted 09 August 2012 - 04:40 AM

Okay, here is what I want to do. Under Linux, it would be done via /etc/fstab, but Android has changed some things up.

Certain apps store files and other things on the internal SD card of the RAZR. For example, the Amazon MP3 Cloud player stores all downloaded music files to /sdcard/amazonmp3. There is no way to change this. However, I store all my music on my external SD card. So, what I want to do is create a mount point on the internal sdcard for the /sdcard/amazonmp3 directory that points to a directory on my external sd card (/sdcard-ext/amazonmp3).

That way, when I download music, it will still attempt to save it to /sdcard/amazonmp3 which really is a mount point that points to /sdcard-ext/amazonmp3.

Now, there is an app called FoldersPlug which does this. However, it's not doing it across reboots and it's a little buggy in how it works. I'd rather just fix the /etc/vold.fstab file (if that's possible) to mount my directories for me, but I don't completely understand all the needs to be set up in it.

If I have the following directories set up:

/sdcard/amazonmp3 (this will be empty)
/sdcard-ext/amazonmp3 (this will contain all the files and folder structures that would normally be in /sdcard/amazonmp3)

I want it so that the /sdcard-ext/amazonmp3 directory is mounted to the /sdcard/amazonmp3 directory.

Here is what I see when I run the "mount" command to look at the current mount points that are mounted:

rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/mmcblk1p22 /system ext3 ro,relatime,barrier=0,data=ordered 0 0
/dev/block/mmcblk1p7 /pds ext3 rw,nosuid,nodev,noatime,nodiratime,errors=continue,barrier=0,data=ordered 0 0
/dev/block/mmcblk1p24 /data ext3 rw,nosuid,nodev,noatime,nodiratime,errors=continue,barrier=0,data=ordered 0 0
/dev/block/mmcblk1p21 /cache ext3 rw,nosuid,nodev,noatime,nodiratime,errors=continue,barrier=0,data=ordered 0 0
/dev/block/vold/179:25 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:25 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /mnt/sdcard/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
/mnt/sdcard /mnt/sdcard ecryptfs rw,dirsync,nosuid,nodev,noexec,relatime,ecryptfs_sig=6e4a9c31b29e3ce2,ecryptfs_cipher=aes,ecryptfs_key_bytes=32,ecryptfs_passthrough,no_new_encrypted 0 0
/dev/block/vold/179:97 /mnt/sdcard-ext vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:97 /mnt/sdcard/amazonmp3 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:97 /mnt/sdcard/DCIM vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:97 /mnt/sdcard/Pictures vfat
rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:97 /mnt/sdcard/Android/data/com.google.android.youtube vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:97 /mnt/sdcard/amazonmp3 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:97 /mnt/sdcard/DCIM vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:97 /mnt/sdcard/Pictures vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:97 /mnt/sdcard/Android/data/com.iconology.comics.app vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0



What's in bold are the mount points that FoldersPlug set up and what I want to do instead is define them in the /etc/vold.fstab file but I don't know how they should be entered into the /etc/vold.fstab file.

Any help would be greatly appreciated!

Thanks!

VZW Samsung Galaxy S7 Stock and unrooted running Marshmallow 46A, 32gb Nexus 7 unlocked
2cqd4t2.png


#2 ibolski

ibolski

    Droid Master

  • Dedicated Supporter
  • PipPipPip
  • 535 posts
  • Twitter:iBolski
  • Google+:Ivan Samuelson
  • LocationColumbus, Ohio
  • Current Device(s):Samsung Galaxy S7

Posted 10 August 2012 - 10:56 AM

Figured out how to get the mounting to work. Using busybox, I just issue a mount --bind command and that will mount my directories.

Now I'm just trying to get this to work on booting using scripts in the /etc/init.d directory. I know the others scripts in there are running (99tweaks from Eclipse, and S99SuperCharger), but my script isn't running at all. It is set to be executable and if I run it interactively in the shell, it works.

Here is the script:

Please Login or Register to see this Hidden Content


Any ideas?

VZW Samsung Galaxy S7 Stock and unrooted running Marshmallow 46A, 32gb Nexus 7 unlocked
2cqd4t2.png


#3 ibolski

ibolski

    Droid Master

  • Dedicated Supporter
  • PipPipPip
  • 535 posts
  • Twitter:iBolski
  • Google+:Ivan Samuelson
  • LocationColumbus, Ohio
  • Current Device(s):Samsung Galaxy S7

Posted 10 August 2012 - 11:31 AM

Okay. Finally gave up and decided to use ScriptManager instead to run the script on boot and that seems to work. It takes it a minute or two after booting up to run the script, but at least it works.

VZW Samsung Galaxy S7 Stock and unrooted running Marshmallow 46A, 32gb Nexus 7 unlocked
2cqd4t2.png


#4 tucstwo

tucstwo

    www.drdevs.com

  • Administrator
  • 14,435 posts
  • Twitter:tucstwo
  • Google+:tucstwo@gmail.com
  • LocationNJ
  • Current Device(s):LG G3 VS985, Nexus 7 (flo)

Posted 10 August 2012 - 04:48 PM

Thinking out loud, eh? Thank god you figured it out, cuz I am LOST! Lol

Visit DRDevs.com hosting site for all official Droidrzr.com ROMs, Apps, GApps and other mods/files!!
Please PM me if you need help!
I will be hosting AOSP-Based ROM GApps packages!
Download the most Up-to-Date GApps Packages for AOSP ROMs from me here!





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users