Search code examples
androidubuntumountsmartphone

What are the steps required to mount the external storage (SD card) of Samsung Galaxy S from a chroot shell


I have placed an ubuntu.img file in a folder on my SD card as well as the following scripts obtained from - http://blog.coralic.nl/2010/08/17/ubuntu-on-samsung-galaxy-s-android/

/mnt/sdcard/ubuntu/start

#!/bin/bash
#Created by Armin Coralic http://blog.coralic.nl
if [ "$1" == "" ] ; 
then
    echo "You need to specify the img file!"
    exit 9;
fi

if `test -d /data/local/mnt` ; then
   echo "/data/local/mnt"
else
   mkdir /data/local/mnt
fi

export HOME=/root
export USER=root
export PATH=$bin:/usr/bin:/usr/sbin:/bin:$PATH

mount -o loop,noatime -t ext2 $1 /data/local/mnt
sleep 3
mount -t proc proc /data/local/mnt/proc
mount -t devpts devpts /data/local/mnt/dev/pts
chroot /data/local/mnt /bin/bash

/mnt/sdcard/ubuntu/stop

#!/bin/bash
#Created by Armin Coralic http://blog.coralic.nl

umount /data/local/mnt/dev/pts
umount /data/local/mnt/proc 
umount /data/local/mnt

After running the start script, I get an ubuntu chrooted shell, but I do not have access to my external storage SD card from within the chroot.

I would like to know the answer for the following two questions:

  • 1) what is the /dev/block/ device file name for the external SD card which I should mount on a Samsung Galaxy S I9000?

  • 2) what is the exact syntax that I should use before/after entering chroot to get read/write/execute access to the external SD storage?

It would be helpful if the start/stop scripts could be modified with the required changes.


Solution

  • You can check the block devices by running ls in /dev/block/ But actually, there are multiple ways to address the devices, for instance through vold, or sys etc.

    you might check a file cald vold.fstab, it should give you an idea of which device is your external SD car