Jump to content


Photo

How can I bind mount e.g. /system/sd/xxx /sdcard/xxx


  • Please log in to reply
3 replies to this topic

#1
1of2

1of2

    Newbie

  • Members
  • Pip
  • 3 posts
Ho all,

I've rooted my desire with r3 and all is well, however I still have a few questions (I'm a noob on Android)

I have partitioned 14G mounted @ /system/sd (ext3) and 1.5G mounted /sdcard (vfat)

Ideally, I'd like to get rid of vfat altogether and just have single ext3/4 partition and bind mount /sdcard to /system/sd/sdcard, bhut that is the future, For now, I'm trying to figure out how I can add the following two commands to the start up init.

mount /system/sd/music /sdcard/mp3 -o bind
mount /system/sd/photos /sdcard/dcim -o bind

I want the default apps (music player and camera to access the larger partition and not the vfat).

Also, somewhere during bootup (before /sdcard is mounted), the system does an fsck -t vfat /sdcard (actually the /dev/ name), we need to add fsck -t ext3 to the /dev/block/mmcblk0p2 because if you lose power, you can corrupt the ext3 fs and fsck must be performed the phone will not boot.

Anyone know were this is mounted from ?

Thanks.

Albert.

Edited by 1of2, 14 May 2010 - 05:58 AM.

  • 0

#2
burst

burst

    Newbie

  • Members
  • Pip
  • 11 posts
  • Devices:HTC Desire
  • Twitter:@chrbas

Ho all,

I've rooted my desire with r3 and all is well, however I still have a few questions (I'm a noob on Android)

I have partitioned 14G mounted @ /system/sd (ext3) and 1.5G mounted /sdcard (vfat)

Ideally, I'd like to get rid of vfat altogether and just have single ext3/4 partition and bind mount /sdcard to /system/sd/sdcard, bhut that is the future, For now, I'm trying to figure out how I can add the following two commands to the start up init.

mount /system/sd/music /sdcard/mp3 -o bind
mount /system/sd/photos /sdcard/dcim -o bind

I want the default apps (music player and camera to access the larger partition and not the vfat).

Also, somewhere during bootup (before /sdcard is mounted), the system does an fsck -t vfat /sdcard (actually the /dev/ name), we need to add fsck -t ext3 to the /dev/block/mmcblk0p2 because if you lose power, you can corrupt the ext3 fs and fsck must be performed the phone will not boot.

Anyone know were this is mounted from ?

Thanks.

Albert.


set symlinks?
in recovery:
adb shell
ln -s /system/sd/music /sdcard/mp3
ln -s /system/sd/photos /sdcard/dcim

Edited by burst, 14 May 2010 - 09:30 AM.

  • 0

#3
1of2

1of2

    Newbie

  • Members
  • Pip
  • 3 posts

set symlinks?
in recovery:
adb shell
ln -s /system/sd/music /sdcard/mp3
ln -s /system/sd/photos /sdcard/dcim


you cannot symlink from vfat ?

  • 0

#4
ddvo

ddvo

    Newbie

  • Members
  • Pip
  • 1 posts
  • Devices:HTC Desire 2.2
This is how to got automounting an ext3 data partition on the SD card to work on my HTC Desire running 2.2 (Froyo).

I formatted the card with a tiny (50 MB), essentially unused, vfat partition - just in case Froyo insists in finding/mounting it - and all the rest with a single large ext3 (or ext2 or ext4) partition.
I use the latter partition flexibly both for data (in a directory "/card", which I bind mount to "/sdcard" as described below) and for app storage (in directories "/app", "/app-private", and "/dalvik-cache", which are sym-linked from "/data/app" etc. using "/etc/init.d/02stuff2sd" - attached -, which is some older version of http://pastebin.com/8LJj8rVz).

Since the /etc/init.d/02stuff2sd script already mounts at boot time the ext3 partition to /system/sd, I just added a second script as /etc/init.d/20autostart, which essentially bind mounts the "/system/sd/card" directory of the ext3 partition to the /sdcard directory:

busybox mount -o bind /system/sd/card /sdcard

Optionally, one may remount the "/sdcard" directory with stricter security settings:

busybox mount -o remount,nosuid,nodev,noexec,rw,errors=remount-ro,dirsync,relatime /mnt/sdcard
where unfortunately it is not possible to give the following extra parameters, which would give uniform access rights to all files:

uid=1000,gid=1015,fmask=0113,dmask=0002,allow_utime=0020

It turned out that that android.process.media (app_21) messes with the access rights of the photos taken by com.android.camera (app_42) and stored as /sdcard/DCIM/100MEDIA/IMAG0001.jpg etc., which does not surface when DCIM is part of the vfat partition because there is essentially no access right restrictions. As a workaround for the ext3 partition, to prevent errors like "no photos or videos found", my boot script additionally does

chmod 666 /sdcard/DCIM/*/*

One caveat: after unmounting the SD card directory /sdcard, mounting it again via the regular Froyo user menu results in the vfat partition being mounted instead of /system/sd/card . So either you need to mount it manually via the terminal emulator (or via adb), or simply re-boot.

Attached Files


Edited by ddvo, 11 December 2010 - 10:31 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users