[Galaxy S II Android Development] mparus:
howto - external memory

reboot phone to recovery

connect usb cable to linux computer

mount usb storage from cmw

dmesg from linux:

14463.003066] sd 19:0:0:0: [sdc] 18890752 512-byte logical blocks: (9.67 GB/9.00 GiB)
[14463.006070] sd 19:0:0:1: [sdd] 7743267 512-byte logical blocks: (3.96 GB/3.69 GiB)
[14463.009070] sd 19:0:0:0: [sdc] Write Protect is off
[14463.009078] sd 19:0:0:0: [sdc] Mode Sense: 0f 00 00 00
[14463.012193] sd 19:0:0:1: [sdd] Write Protect is off
[14463.012196] sd 19:0:0:1: [sdd] Mode Sense: 0f 00 00 00
[14463.015054] sd 19:0:0:0: [sdc] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[14463.018075] sd 19:0:0:1: [sdd] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA
[14463.072089] sdc: unknown partition table
[14463.101098] sdd: sdd4
[14463.101108] sdd: p4 start 2063597568 is beyond EOD, enabling native capacity
[14463.109073] sd 19:0:0:0: [sdc] Attached SCSI removable disk
[14463.184082] sdd: sdd4
[14463.184088] sdd: p4 start 2063597568 is beyond EOD, truncated
[14463.253069] sd 19:0:0:1: [sdd] Attached SCSI removable disk
[14464.635105] FAT-fs (sdd): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
[14464.656294] EXT4-fs (sdc): mounted filesystem with ordered data mode. Opts: (null)

mparus-OptiPlex-360 mparus # mount

/dev/sdd on /media/mparus/NEW VOLUME type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
/dev/sdc on /media/mparus/6b7f1440-ed81-48c8-96e3-373c918d6ee5 type ext4 (rw,nosuid,nodev,uhelper=udisks2)

sdd is external memory

mparus-OptiPlex-360 mparus # umount /media/mparus/NEW\ VOLUME

mparus-OptiPlex-360 mparus # parted /dev/sdd

GNU Parted 2.3
Using /dev/sdd
Welcome to GNU Parted! Type 'help' to view a list of commands.

(parted) print

Model: Linux File-CD Gadget (scsi)
Disk /dev/sdd: 3965MB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags

(parted)

(parted) mklabel msdos

Warning: The existing disk label on /dev/sdd will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? [B]Yes[/B]

(parted) quit

Information: You may need to update /etc/fstab.

mparus-OptiPlex-360 mparus # mkfs.ext4 /dev/sdd

mke2fs 1.42.9 (4-Feb-2014)
/dev/sdd is entire device, not just one partition!
Proceed anyway? (y,n) [B]y[/B]
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
Stride=0 blocks, Stripe width=0 blocks
242400 inodes, 967908 blocks
48395 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=994050048
30 block groups
32768 blocks per group, 32768 fragments per group
8080 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736

Allocating group tables: done
Writing inode tables: done
Creating journal (16384 blocks): done
Writing superblocks and filesystem accounting information: done

umount from cwm

reboot android system

from linux after start android system

mparus@mparus-OptiPlex-360 ~ $ adb shell

shell@GT-I9100:/ $ su

root@GT-I9100:/ #

root@GT-I9100:/ # df

Filesystem Size Used Free Blksize
/dev 395.6M 136.0K 395.5M 4096
/sys/fs/cgroup 395.6M 12.0K 395.6M 4096
/mnt/asec 395.6M 0.0K 395.6M 4096
/mnt/obb 395.6M 0.0K 395.6M 4096
/mnt/fuse 395.6M 0.0K 395.6M 4096
/system 1007.9M 716.4M 291.5M 4096
/cache 98.4M 4.2M 94.3M 4096
/efs 19.7M 9.2M 10.5M 4096
/data 3.9G 1.5G 2.4G 4096
/preload 503.9M 343.6M 160.4M 4096
/mnt/media_rw/sdcard1 3.6G 71.4M 3.6G 4096
/storage/sdcard1 3.6G 71.4M 3.6G 4096
/mnt/media_rw/sdcard0 8.9G 246.0M 8.6G 4096
/mnt/secure/asec 8.9G 246.0M 8.6G 4096
/storage/sdcard0 8.9G 246.0M 8.6G 4096

root@GT-I9100:/ # cd /mnt/media_rw/

root@GT-I9100:/mnt/media_rw # ls -la

drwxr-xr-x media_rw media_rw 2014-08-29 11:51 sdcard0
drwxr-xr-x root root 2014-08-29 13:40 sdcard1
drwx------ media_rw media_rw 2000-01-01 01:11 usbdisk0

root@GT-I9100:/mnt/media_rw # chown media_rw:media_rw sdcard1/

root@GT-I9100:/mnt/media_rw # ls -la

drwxr-xr-x media_rw media_rw 2014-08-29 11:51 sdcard0
drwxr-xr-x media_rw media_rw 2014-08-29 13:40 sdcard1
drwx------ media_rw media_rw 2000-01-01 01:11 usbdisk0

root@GT-I9100:/ # mount

rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,seclabel,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,seclabel,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,seclabel,relatime 0 0
selinuxfs /sys/fs/selinux selinuxfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
none /sys/fs/cgroup tmpfs rw,seclabel,relatime,mode=750,gid=1000 0 0
tmpfs /mnt/asec tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,seclabel,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/fuse tmpfs rw,seclabel,relatime,mode=775,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/mmcblk0p9 /system ext4 ro,seclabel,noatime,user_xattr,barrier=1,data=ordered 0 0
/dev/block/mmcblk0p7 /cache ext4 rw,seclabel,nosuid,nodev,noatime,errors=panic,user_xattr,barrier=1,journal_async_commit,data=ordered 0 0
/dev/block/mmcblk0p1 /efs ext4 rw,seclabel,nosuid,nodev,noatime,errors=panic,user_xattr,barrier=1,journal_async_commit,data=ordered 0 0
/dev/block/mmcblk0p10 /data ext4 rw,seclabel,nosuid,nodev,noatime,errors=panic,user_xattr,barrier=1,journal_async_commit,data=ordered,noauto_da_alloc,discard 0 0
/dev/block/mmcblk0p12 /preload ext4 rw,seclabel,nosuid,nodev,noatime,user_xattr,barrier=1,journal_async_commit,data=writeback 0 0
/sys/kernel/debug /sys/kernel/debug debugfs rw,relatime 0 0
/dev/block/vold/179:9 /mnt/media_rw/sdcard1 ext4 rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,user_xattr,barrier=1,data=ordered 0 0
/dev/fuse /storage/sdcard1 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0
/dev/block/vold/259:3 /mnt/media_rw/sdcard0 ext4 rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,user_xattr,barrier=1,data=ordered 0 0
/dev/block/vold/259:3 /mnt/secure/asec ext4 rw,dirsync,context=u:object_r:sdcard_external:s0,nosuid,nodev,noexec,noatime,user_xattr,barrier=1,data=ordered 0 0
/dev/fuse /storage/sdcard0 fuse rw,nosuid,nodev,relatime,user_id=1023,group_id=1023,default_permissions,allow_other 0 0