[Solved] Problem Using Ext. Partitions...Need Help!!!! - Sony Ericsson XPERIA X10 Mini

Guyz i am not a noob,but this is really like a noob question... please help me...
I started using a Ext. partition's just one month after i purchased my phone on my free 2GB memory card which cum along with MINI....and there were no prob. using it though.Then i purchased 4GB SD card and again i applied Ext. 3 partition on it and used app2sd.dc2sd....and it ran over 8 months without a prob.
Then i Used MINI-CM 6.0-RC1 and deleted my ext.3 partition to make it larger than it previous condition,watever when i created it and again and when i unmounted my SD my phone said "The SD card Is Empty or Corrupt"....and thats it....it prompts me to formate it....So i did so....but when i plug the phone to USB and connected the phone to computer....it again refreshed it to 4GB and my ext. partition gone for hell.
I thought that it worths another chance so i again created ext. partition in xRecovery Mode.....And i sum how got success.....But when i tries to install App2sd.dc2sd it says
"E:Can't chown/mod /system/etc/bluez
(No such file or directory)
E:Failure at Line 7:
set_perm_recursive 1002 1002 0755 0440 ,SYSTEM:etc/bluez
installation Aborted"
I tried many times to solve it,even every method but no results.....i think my card got corrupted,but it shows and runs other media files...I am so confused....
Please Help Me Guyz!!!!

this >> set_perm_recursive 1002 1002 0755 0440 ,SYSTEM:etc/bluez should look like this set_perm_recursive 1002 1002 0755 0440 SYSTEM:etc/bluez
and if that doesn't do trick check is folder bluez exist.

Chumby_666 said:
this >> set_perm_recursive 1002 1002 0755 0440 ,SYSTEM:etc/bluez should look like this set_perm_recursive 1002 1002 0755 0440 SYSTEM:etc/bluez
and if that doesn't do trick check is folder bluez exist.
Click to expand...
Click to collapse
Yeahh bro. there is a folder at /system /lib/bluez-plugin ........And it got two files "audio.so and "input.so"".So Basically what i have to do with this....pls explain....!!!

pratyush_gamer said:
Yeahh bro. there is a folder at /system /lib/bluez-plugin ........And it got two files "audio.so and "input.so"".So Basically what i have to do with this....pls explain....!!!
Click to expand...
Click to collapse
edit META-INF/...../update-script and fix this line set_perm_recursive 1002 1002 0755 0440 ,SYSTEM:etc/bluez. you can open update-script with notepad++

Chumby_666 said:
edit META-INF/...../update-script and fix this line set_perm_recursive 1002 1002 0755 0440 ,SYSTEM:etc/bluez. you can open update-script with notepad++
Click to expand...
Click to collapse
Thanks for concentrating on my problem(Thats so kind of you).....But bro. i just solved it before reading your post........I used SEUS and go back to original FW and from there i created my partitions again.....And WOW now i can able to use Ap2SD.Dc2SD.........BTW thanks for all your efforts......And also i am a Big FAN of you & your works(ROM)...I really Appreciate your work.
THANKS!!!!

Related

[DEV] Update-script syntax error message ?

Hello everyone ,
I`m currently working on a project called "rtl-4-android" and my main goal is to give fully RTL (Right-To-Left) support to the users ,
that is until the Android operation system will officially support RTL .
I ran across an odd problem with my update-script -
This is the simple script :
show_progress 0.1 0
copy_dir PACKAGE:system SYSTEM:
copy_dir PACKAGE:data DATA:
set_perm_recursive 0775 0775 0775 0775 SYSTEM:app
set_perm_recursive 0775 0775 0775 0775 DATA:app
show_progress 0.1 10
Click to expand...
Click to collapse
As you can probably see -it supposed to copy the content of the package system dir to /system , and the package data dir to /data ,
after that it changes the permissions of the /system/app and /data/app to 775 .
The error is : "E:Syntax error in update script" and it comes after the "installing update..." part.
Any thoughts ?
The first two fields in set_perm_recursive are supposed to be a uid, not octal permissions.
For example:
set_perm_recursive 0 0 0755 0644 DATA:app

[HOWTO][Xperia P]save some space on sdcard via init.d script

i dont have many apps on my phone and need the space on sdcard for photos and videos....
so i made an init.d script to move some big folders (games) from sdcard to /data/ and /system/ partition because there is much space left.
Code:
busybox mkdir -p /sdcard/Android/obb/com.nextgenreality.minimoto
busybox mkdir -p /data/Android/obb/com.nextgenreality.minimoto
mount -o bind /data/Android/obb/com.nextgenreality.minimoto /sdcard/Android/obb/com.nextgenreality.minimoto
busybox mkdir -p /sdcard/Navigon
busybox mkdir -p /data/Navigon
mount -o bind /data/Navigon /sdcard/Navigon
rm -r /sdcard/Android/data/com.eamobile.sims3_row_qwf
busybox mkdir -p /sdcard/Android/data/com.eamobile.sims3_row_qwf
busybox mkdir -p /data/Android/data/com.eamobile.sims3_row_qwf
mount -o bind /data/Android/data/com.eamobile.sims3_row_qwf /sdcard/Android/data/com.eamobile.sims3_row_qwf
rm -r /sdcard/Android/data/com.eamobile.nfshp_row_wf
busybox mkdir -p /sdcard/Android/data/com.eamobile.nfshp_row_wf
busybox mkdir -p /system/Android/data/com.eamobile.nfshp_row_wf
mount -o bind /system/Android/data/com.eamobile.nfshp_row_wf /sdcard/Android/data/com.eamobile.nfshp_row_wf
after a reboot i have moved around 1gb to data and 320mb to system ->
Code:
Filesystem Size Used Free Blksize
/dev 386.3M 64.0K 386.3M 4096
/mnt/asec 386.3M 0.0K 386.3M 4096
/mnt/obb 386.3M 0.0K 386.3M 4096
/dev/shm 386.3M 0.0K 386.3M 4096
/system 1007.9M 891.6M 116.3M 4096
/modemfs 2.8M 1.1M 1.7M 1024
/data 2.0G 1.7G 269.0M 4096
/cache 246.1M 4.2M 241.8M 4096
/mnt/sdcard 11.3G 5.1G 6.1G 32768
/mnt/secure/asec 11.3G 5.1G 6.1G 32768
/mnt/sdcard/Android/obb/com.nextgenreality.minimoto 2.0G 1.7G 269.0M 4096
/mnt/sdcard/Navigon 2.0G 1.7G 269.0M 4096
/mnt/sdcard/Android/data/com.eamobile.sims3_row_qwf 2.0G 1.7G 269.0M 4096
/mnt/sdcard/Android/data/com.eamobile.nfshp_row_wf 1007.9M 891.6M 116.3M 4096
be aware that these data are lost if you reflash your rom !!!
have fun
inteks
[edit]
to let you know. i faced a small problem and found a solution
after i moved some big folders to phone memory i got a "low phone memory" at 200mb ?! witch i find is MORE than enogh !
this warning come usally at 10% ....
i found a mod to change the threshold to i.e. 2 or 5% :good:
http://forum.xda-developers.com/showthread.php?t=877793
so i can use this script ( or make my own, which would be very similar) on the xperia u too rite?
unreal3000 said:
so i can use this script ( or make my own, which would be very similar) on the xperia u too rite?
Click to expand...
Click to collapse
Yep, you should be able to.
@OP: what you need is to write a generic script that moves directories based on a plain text list on /sdcard.
there is a sd card in xperia P ? oO
ilgreco112 said:
there is a sd card in xperia P ? oO
Click to expand...
Click to collapse
There is no sdcard, but /sdcard is a separate partition.
the main idea stays the same. the xperia u has a partition which acts as an internal sd. so lets say i want to move my music folder on the sdcard to the /data partition. will this work? -
Code:
busybox mkdir -p /sdcard/music
busybox mkdir -p /data/music
mount -o bind /data/music /sdcard/music
tks fr the help!
unreal3000 said:
the main idea stays the same. the xperia u has a partition which acts as an internal sd. so lets say i want to move my music folder on the sdcard to the /data partition. will this work? -
Code:
busybox mkdir -p /sdcard/music
busybox mkdir -p /data/music
mount -o bind /data/music /sdcard/music
tks fr the help!
Click to expand...
Click to collapse
should work, but you should use it for i. e. gamedata that you can always redownload. because if you reflash your phone this data will be lost.
btw. next version of setxperia is able to execute /sdcard/userinit.sh then you can easily edit this file on pc when phone is docked...
Gesendet von meinem LT22i
inteks said:
should work, but you should use it for i. e. gamedata that you can always redownload. because if you reflash your phone this data will be lost.
btw. next version of setxperia is able to execute /sdcard/userinit.sh then you can easily edit this file on pc when phone is docked...
Gesendet von meinem LT22i
Click to expand...
Click to collapse
so your saying once i have my music folder on the /data partition, i cant edit it through the sdcard partition? (like copy things to the music folder on the sd from my comp, but it would actual get stored on the /data partition?)
unreal3000 said:
so your saying once i have my music folder on the /data partition, i cant edit it through the sdcard partition? (like copy things to the music folder on the sd from my comp, but it would actual get stored on the /data partition?)
Click to expand...
Click to collapse
Yeah, that's exactly it.
unreal3000 said:
so your saying once i have my music folder on the /data partition, i cant edit it through the sdcard partition? (like copy things to the music folder on the sd from my comp, but it would actual get stored on the /data partition?)
Click to expand...
Click to collapse
no you can't access them through PC. on PC these folders are empty. as i said this is only useful for i. e. big game folder to save some space...
Gesendet von meinem LT22i
to let you know. i faced a small problem and found a solution
after i moved some big folders to phone memory i got a "low phone memory" at 200mb ?! witch i find is MORE than enogh !
this warning come usally at 10% ....
i found a mod to change the threshold to i.e. 2 or 5% :good:
http://forum.xda-developers.com/showthread.php?t=877793
ok.... last version of setxperia can execute "/sdcard/userinit.sh"
btw. i change the script to use a function to mount folders. its easier to add new locations here is the act version of my /sdcard/userinit.sh -->>
Code:
echo '/dev/block/mmcblk0p14' > /sys/devices/platform/usb_mass_storage/lun0/file
echo '1' > /sys/devices/virtual/usb_composite/usb_mass_storage/enable
checkMount(){
if grep -qs $1 /proc/mounts; then
echo "$1 is allready mounted"
else
busybox rm -r $1
busybox mkdir -p $1
busybox mkdir -p $2
mount -o bind $2 $1
echo "$1 successfully mounted"
fi
}
checkMount '/sdcard/Navigon' '/data/Navigon'
checkMount '/sdcard/Android/data/com.eamobile.sims3_row_qwf' '/data/Android/data/com.eamobile.sims3_row_qwf'
checkMount '/sdcard/Android/data/com.eamobile.nfshp_row_wf' '/system/Android/data/com.eamobile.nfshp_row_wf'
checkMount '/sdcard/Android/data/com.opera.browser' '/cache/Android/data/com.opera.browser'
checkMount '/sdcard/PlayerPro' '/cache/data/PlayerPro'
Hi inteks i own a xperia U. I want to move asphalt 7 gamedata to the data partition. I used this script:
rm -r /sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
busybox mkdir -p /sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
busybox mkdir -p /system/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
mount -o bind /data/Android/obb/com.gameloft.android.ANMP.GloftA7HM /sdcard/Android/obb/com
But its still in the sdcard partition after reboot. Something wrong i'm doing here. Please point it out so i can move the data.
Thanks !
Sent from my ST25i using Tapatalk 2
Rapier07 said:
Hi inteks i own a xperia U. I want to move asphalt 7 gamedata to the data partition. I used this script:
rm -r /sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
busybox mkdir -p /sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
busybox mkdir -p /system/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
mount -o bind /data/Android/obb/com.gameloft.android.ANMP.GloftA7HM /sdcard/Android/obb/com
But its still in the sdcard partition after reboot. Something wrong i'm doing here. Please point it out so i can move the data.
Thanks !
Sent from my ST25i using Tapatalk 2
Click to expand...
Click to collapse
busybox mkdir -p /system/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
mount -o bind /data/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf /sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
a few errors in script...
inteks said:
busybox mkdir -p /system/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
mount -o bind /data/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf /sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf
a few errors in script...
Click to expand...
Click to collapse
Oh.. What should i use in place of them?
Edit: i get it i guess. Will try again and report back.
Thanks for your help.
Sent from my ST25i using Tapatalk 2
No go
I've been trying this since morning. Tried one more method and it destroyed my gta3 data.
Could you please write the full script i need to use?
The gamedata location is
/sdcard/Android/obb/ com.gameloft.android.ANMP.GloftA7HM
Thanks.
Sent from my ST25i using Tapatalk 2
Rapier07 said:
No go
I've been trying this since morning. Tried one more method and it destroyed my gta3 data.
Could you please write the full script i need to use?
The gamedata location is
/sdcard/Android/obb/ com.gameloft.android.ANMP.GloftA7HM
Thanks.
Sent from my ST25i using Tapatalk 2
Click to expand...
Click to collapse
how do you start the script ? /etc/init.d or /sdcard/userinit.sh with setxperia ?
have you tryed my new script ?
save this to /sdcard/userinit.sh and use setxperia .... -->>
checkMount(){
if grep -qs $1 /proc/mounts; then
echo "$1 is allready mounted"
else
busybox rm -r $1
busybox mkdir -p $1
busybox mkdir -p $2
mount -o bind $2 $1
echo "$1 successfully mounted"
fi
}
checkMount '/sdcard/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf' '/data/Android/obb/com.gameloft.android.ANMP.GloftA7HM_row_wf'
Click to expand...
Click to collapse
but keep in mind after this you have to redownload gamedata ...
parameter of checkmount -> "checkmount orginalfolderpath newfolderpath"
Hi... I m kinda noob... So could u plz tell me to steps to follow to how to get this done.... Tnx
Sent from my ST25i using xda app-developers app

[Q]How to mount directories across SD cards

Okay, this 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:
Code:
/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
These 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!
I may be wrong, but I don't believe Android Vold can mount loopback (bind). You'll have to create a partition on the SD card instead, feeding it to Vold. Then try something similar to;
dev_mount /dev/block/mmcblk0p2 /mnt/sdcard/amazonmp3 /devices/platform/msm_sdcc.2/mmc_host/mmc1
Or if you forget about Vold, and use an ordinary mount;
# mount -o bind /sdcard-ext/amazonmp3 /sdcard/amazonmp3
In this case (bind loopback mount), you don't need it to be a partition.
Maybe the easies way is you just forget about the internal sdcard, replacing /mnt/cdcard with The real McCoy instead.
Cool. Thanks for the help. I see that this would have to be done using busybox, which is cool since I have that installed.
I tested what you stated and yup, that mounts them. So, I guess I'll fool around a little more with the scripts in /etc/init.d and see if I can't get it to work. I might have to do a sleep or something in the script to give the system time to mount the sdcards, but hopefully, this will work.
Thanks again for the tip!
UPDATE:
Well, here's my script but it doesn't seem to work. I have it first check to see if the number of lines returned from doing directory listing on the /sdcard and /sdcard-ext directories are 0. If so, it sleeps for 10 seconds and then tries it again, waiting for the sdcards to be mounted.
Once they are mounted, then I go and mount my directories. However, it doesn't seem to work. I have the script in the /etc/init.d directory and the permissions are set for execution (0777) like the other two scripts in there (98tweaks and S99SuperCharger).
If I go and run the script myself, it works and mounts the directories.
Here is the script. Any other ideas?
Code:
#!/system/xbin/sh
# Check if the SDCARDs are mounted yet.
result="`ls /sdcard/ | wc -l`"
while [ "$result" -eq 0 ]
do
sleep 10
result="`ls /sdcard/ | wc -l`"
done
result="`ls /sdcard-ext/ | wc -l`"
while [ "$result" -eq 0 ]
do
sleep 10
result="`ls /sdcard-ext/ | wc -l`"
done
# The cards are mounted. Now mount the directories
busybox mount --bind /sdcard-ext/DCIM /sdcard/DCIM
busybox mount --bind /sdcard-ext/amazonmp3 /sdcard/amazonmp3
busybox mount --bind /sdcard-ext/Pictures /sdcard/Pictures
busybox mount --bind /sdcard-ext/Android/data/com.iconology.comics.app /sdcard/Android/data/com.iconology.comics.app
Okay. Got it to work finally. I just decided to set it up using ScriptManager instead to run on boot.
Not sure why it wasn't working with the init.d process.
you rock!
iBolski said:
Cool. Thanks for the help. I see that this would have to be done using busybox, which is cool since I have that installed.
I tested what you stated and yup, that mounts them. So, I guess I'll fool around a little more with the scripts in /etc/init.d and see if I can't get it to work. I might have to do a sleep or something in the script to give the system time to mount the sdcards, but hopefully, this will work.
Thanks again for the tip!
UPDATE:
Well, here's my script but it doesn't seem to work. I have it first check to see if the number of lines returned from doing directory listing on the /sdcard and /sdcard-ext directories are 0. If so, it sleeps for 10 seconds and then tries it again, waiting for the sdcards to be mounted.
Once they are mounted, then I go and mount my directories. However, it doesn't seem to work. I have the script in the /etc/init.d directory and the permissions are set for execution (0777) like the other two scripts in there (98tweaks and S99SuperCharger).
If I go and run the script myself, it works and mounts the directories.
Here is the script. Any other ideas?
Code:
#!/system/xbin/sh
# Check if the SDCARDs are mounted yet.
result="`ls /sdcard/ | wc -l`"
while [ "$result" -eq 0 ]
do
sleep 10
result="`ls /sdcard/ | wc -l`"
done
result="`ls /sdcard-ext/ | wc -l`"
while [ "$result" -eq 0 ]
do
sleep 10
result="`ls /sdcard-ext/ | wc -l`"
done
# The cards are mounted. Now mount the directories
busybox mount --bind /sdcard-ext/DCIM /sdcard/DCIM
busybox mount --bind /sdcard-ext/amazonmp3 /sdcard/amazonmp3
busybox mount --bind /sdcard-ext/Pictures /sdcard/Pictures
busybox mount --bind /sdcard-ext/Android/data/com.iconology.comics.app /sdcard/Android/data/com.iconology.comics.app
Click to expand...
Click to collapse
Dude...a little renaming of dirs and i was running. thanx:good:
iBolski said:
Okay. Got it to work finally. I just decided to set it up using ScriptManager instead to run on boot.
Not sure why it wasn't working with the init.d process.
Click to expand...
Click to collapse
Works perfectly
Thanks for your work.
I have a question. Is it possible to create a folder in /mnt/sdcard (for example /mnt/sdcard/myfolder) with a script or automaticly after boot?
What i want is to mount the external SD to this folder (/mnt/sdcard/myfolder) but first you have to create the folder "mysdcard".
But i hope it works with a script only like:
Code:
#!/system/xbin/sh
# The cards are mounted. Now mount the directories
mkdir /mysdcard
busybox mount --bind /sdcard-ext /sdcard/mysdcard
sorry for my english
xoxys said:
Thanks for your work.
I have a question. Is it possible to create a folder in /mnt/sdcard (for example /mnt/sdcard/myfolder) with a script or automaticly after boot?
What i want is to mount the external SD to this folder (/mnt/sdcard/myfolder) but first you have to create the folder "mysdcard".
But i hope it works with a script only like:
Code:
#!/system/xbin/sh
# The cards are mounted. Now mount the directories
mkdir /mysdcard
busybox mount --bind /sdcard-ext /sdcard/mysdcard
sorry for my english
Click to expand...
Click to collapse
sorry my english bad...
if i don't have /etc/init.d directory... can i execute this command in another way?
thanks...
nb:
* modified with debuggerd is not work, my jelly-bean not execute debuggerd on boot
* add script install-recovery.sh on /system/etc is not work too....

[Q] Access android media from Ubuntu Touch

I'm running Utopic RTM on a Nexus 4 Dual Booted using multirom.
I want to access media files from android on ubuntu touch. The followung is my rc.local file.
Code:
mount -o remount,rw /
mount -t ext4 -o rw /dev/mmcblk0p23 /andata
mount -o bind /andata/media/0 /home/phablet/sdcard
chown phablet:phablet /home/phablet/sdcard
chmod 777 /home/phablet/sdcard
mount -o bind /andata/media/0/Spotify /home/phablet/Music
chown phablet:phablet /home/phablet/Music
chmod 777 /home/phablet/Music
mount -o bind /andata/media/0/Video /home/phablet/Videos
chown phablet:phablet /home/phablet/Videos
chmod 777 /home/phablet/Videos
exit 0
I can see the files perfectly on the file manager but they don't show up on the Music and Media Player apps.
Any solutions?
Have you tried mounting your Spotify folder to a subdirectory of the Music directory?
According to the following bug, that should work: https://bugs.launchpad.net/music-app/+bug/1320784
never thought of that. I'll give it try. maybe i should mention that copying the files to the music works just fine. just mounting doesn't show up on the library.
nikwen said:
Have you tried mounting your Spotify folder to a subdirectory of the Music directory?
According to the following bug, that should work: https://bugs.launchpad.net/music-app/+bug/1320784
Click to expand...
Click to collapse
Mounting to subdirectory didn't work.
Ok, would you mind filing a bug report here then? https://bugs.launchpad.net/music-app

[PIT] SGH-S959G: Merge /data and /storage/sdcard0 (/data/media mod)

HOW TO:
Merge "Internal Storage" (/storage/sdcard0) and "Data" (/data) partitions.
WHY:
1) Eliminate "not enough storage" limitation on installed apps. Install as many as you want.
2) Increase potential Internal Storage space (adding unused space from the /cache /preload /data and /emmc partitions together into one mega partition).
3) True full device encryption for /data and /storage/sdcard0 (if you desire).
OVERVIEW OF HOW IT WORKS:
1) Use Odin to flash a modified PIT file to repartition your device. /data is sized to 14+ GB, /cache, /preload, and /emmc are all downsized to 10MB each and are unused.
2) Use my script to modify your ROM to store your "Internal Storage" files on the /data/media/0 folder. This script will hijack your "su" and "sdcard" binaries to work properly.
3) Use my custom TWRP recovery for all of your recovery needs (supports encryption).
4) Encrypt your device if you like.
DIFFICULTY:
Medium
REQUIRED SKILLS:
1) Know how to use ADB
2) Know how to use Odin
3) Know how to fully backup your device and restore it after a factory reset.
SUPPORTED DEVICES:
SGH-S959G ONLY
"COULD BE" SUPPORTED DEVICES:
***DO NOT USE THIS METHOD FOR ANYTHING OTHER THAN SGH-S959G OR YOU WILL RISK HARD-BRICKING IT.
***IF YOU WANT TO TRY IT OUT THEN YOU MUST POST TO THIS FORUM FIRST AND WE WILL DISCUSS
***GETTING YOUR DEVICE SUPPORTED
***Possibly SGH-I777
***Possibly SGH-I9100
***Maybe Others
SUPPORTED ROMS:
CyanogenMOD 12+ (and probably derivative ROMs)
*Risk of soft brick if trying on another ROM (but no higher risk of hard brick).
RISKS: There is a very small risk of hard-brick when flashing a PIT file to your device. To minimize your risk:
1) Don't try to flash during a thunderstorm.
2) Don't try to flash to an unsupported device.
3) Don't try to flash if your USB cable / port / charging port is damaged/faulty. YOU MUST HAVE A RELIABLE USB PORT
4) Don't try to flash with your battery at 0%.
5) Don't try to flash with a computer that likes to crash a lot.
6) Don't unplug or restart your device or computer in the middle of a flash (it takes 10 seconds, be patient, geez).
STEPS TO INSTALL:
Step #1:
Make 2 backups of everything on your phone. All partitions, sdcard, micro-SD, etc...
MOVE THESE BACKUPS TO YOUR COMPUTER, THEY WILL BE ERASED FROM YOUR PHONE.
Make sure you know how to fully restore a completely wiped phone (without a preinstalled recovery) using the computer backups, starting only from the phone's BOOTLOADER/Download/Odin mode.
If you don't know how to do this, you must stop here.
PROCEEDING WITH THIS TUTORIAL WILL PERMANENTLY WIPE MOST PARTITIONS ON YOUR PHONE, THAT INCLUDES: /cache /modem /system /data /emmc /preload
Did you back up your /efs?
BACK UP YOUR /efs!!!
Step #2: Download all attached files.
Step #3: Verify that you have an uncorrupted version of both PIT files. To do this, use the md5 tool (attached) in the windows command line:
> md5 Original_SGH-S959G.pit
Output should read:
7237EC02379B497C6028236B5BBC0C91 Original_SGH-S959G.pit
> md5 MEGADATA_SGH-S959G.pit
Output should read:
9036368F41FAD9FAA266D08398EA2A33 MEGADATA_SGH-S959G.pit
If the MD5 sums don't match, STOP HERE.
DO NOT FLASH A .PIT FILE IF THE MD5 SUM IS WRONG.
Step #5: Install recovery ...
SGH-S959G_TWRP_v2.8.7.0_datamedia.zip
Step #6: Flash PIT
Did you do Step 3? Do it again, don't be lazy.
Open Odin (attached), click the PIT button. Select MEGADATA_SGH-S959G.pit
Re-Partition, Auto Reboot and F. Reset Time should be checked. The PIT filename should appear next to the PIT button.
NOTHING ELSE SHOULD BE CHECKED.
Boot your phone into bootloader/download mode and connect it. The first ID:COM field should turn yellow and have text that looks like 0:[COM5]. In the message field you will see something like <ID:0/005> Added!
Review the risks of what you're about to do above.
Hold your breath, press the start button.
Flashing takes about 10 seconds. Once it's done your phone will reboot. You can close Odin at this point.
Step #7: Format partitions.
Boot into recovery.
Format EMMC: adb shell make_ext4fs mmcblk0p11
Format PRELOAD: adb shell make_ext4fs mmcblk0p12
Wipe CACHE using recovery interface (from advanced wipe screen).
Format DATA using recovery interface (special button present on wipe screen) .
Wipe INTERNAL STORAGE using recovery interface (from advanced wipe screen).
Step #8: Restore partitions.
Reboot into recovery (you must do this again after you format, and the recovery must be datamedia version if you are installing, regular version if you are uninstalling - did you follow step #5?).
... restore your /modem /system /data and /emmc partitions. /cache and /preload should not be restored.
Step #9: Modify Android ...
(I tested on a fully booted android system, but probably works from recovery too.)
Run these commands (obviously correcting the "C:datamedia_installer" path).
*********************************
** If installing from recovery **
*********************************
** mount /data **
** mount /system **
*********************************
adb root
adb push "C:datamedia_installer" /data/local/datamedia_installer
adb shell chmod 700 /data/local/datamedia_installer
To Install: adb shell /data/local/datamedia_installer install
Note: If you ever flash a new ROM in the future it will likely disable this mod. You'll have to do the Step #9 command(s) again.
To Uninstall: adb shell /data/local/datamedia_installer uninstall
Reboot.
Step #10: Adjust /data/media permissions ...
adb root
adb shell chown -R media_rw /data/media/0
adb shell chgrp -R media_rw /data/media/0
adb shell find /data/media/0 -type d -exec chmod 775 {} +
adb shell find /data/media/0 -type f -exec chmod 664 {} +
adb shell chcon -R ubject_r:media_rw_data_file:s0 /data/media/0
Congratulations, if you made it this far you're golden.
STEPS TO UNINSTALL:
Step #1: Install recovery ...
SGH-S959G_TWRP_v2.8.7.0.zip
Step #2: MD5 Verify and then Flash PIT ... (see Step #6 above)
Original_SGH-S959G.pit
Step #3: Format Partitions ... (see Step #7 above)
Step #4: Restore partitions ... (see Step #8 above)
Make sure you are using regular version, not datamedia version.
**You can optionally skip the /emmc restore at this point, and instead finish Step #5 below, then restore to /storage/sdcard0 while Android is running (not in recovery). This should (theoretically) setup the right permissions so you can skip step #6 below.
Step #5: Modify Android ... (see Step #9 above)
Only difference is the first argument for datamedia_installer script (use "uninstall")
Step #6: Adjust /mnt/media_rw/sdcard0 permissions ...
Not sure exactly what the permissions need to be, never had to do this. Let me know if you are trying to do this and I can help you troubleshoot.
**See my note in uninstall Step #4 if you are having trouble here.
XDA:DevDB Information
[PIT] SGH-S959G: Merge /data and /storage/sdcard0 (/data/media mod), Tool/Utility for the AT&T Samsung Galaxy S II SGH-I777
Contributors
dimoochka, Lanchon (thanks for the idea!)
Version Information
Status: Stable
Created 2015-10-07
Last Updated 2015-10-07
great work!
for those wanting to peek at the script without downloading 17MB...
Code:
if [ $1 ] && [ $1 == "install" ]
then
if [ -e /system/bin/sdcard_bin ]
then
echo "Already installed."
else
mount -o remount,rw /system
cp /system/xbin/su /data/local/su_bin_backup
cp /system/bin/sdcard /data/local/sdcard_bin_backup
chmod 700 /data/local/su_bin_backup /data/local/sdcard_bin_backup
cp /system/bin/sh /system/bin/sdcard_sh
mv /system/bin/sdcard /system/bin/sdcard_bin
mv /system/xbin/su /system/xbin/su_bin
echo "#!/system/bin/sdcard_sh" > /system/bin/sdcard
echo "" >> /system/bin/sdcard
echo "while true; do" >> /system/bin/sdcard
echo " sleep 10000" >> /system/bin/sdcard
echo "done" >> /system/bin/sdcard
echo "if [ \$7 ] && [ \$7 == \"/storage/sdcard0\" ]" >> /system/bin/sdcard
echo "then" >> /system/bin/sdcard
echo "fi" >> /system/bin/sdcard
echo "#!/system/bin/sh" > /system/xbin/su
echo "" >> /system/xbin/su
echo "if [ \$1 ] && [ \$1 == \"--daemon\" ]" >> /system/xbin/su
echo "then" >> /system/xbin/su
echo " /system/xbin/sdcardd&" >> /system/xbin/su
echo "fi" >> /system/xbin/su
echo "/system/xbin/su_bin \"\[email protected]\"" >> /system/xbin/su
echo "#!/system/bin/sh" > /system/xbin/sdcardd
echo "" >> /system/xbin/sdcardd
echo "while [ \"\$mprop\" != running ]; do" >> /system/xbin/sdcardd
echo " sleep 1" >> /system/xbin/sdcardd
echo " mprop=\`getprop init.svc.fuse_sdcard0\`" >> /system/xbin/sdcardd
echo "done" >> /system/xbin/sdcardd
echo " setenforce 0" >> /system/xbin/sdcardd
echo " runcon u:r:init:s0 /system/bin/sh -c \"
setenforce 1;
/system/bin/sdcard_bin -u 1023 -g 1023 -d /data/media/0 /storage/sdcard0&
/system/bin/sdcard_bin -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1&
/system/bin/sdcard_bin -u 1023 -g 1023 -d /mnt/media_rw/usbdisk0 /storage/usbdisk0&
\"&
" >> /system/xbin/sdcardd
chmod 755 /system/xbin/su /system/xbin/sdcardd
chmod -R 755 /system/bin/sdcard /system/bin/sdcard_sh
chown -R root /system/bin/sdcard /system/bin/sdcard_sh
chgrp -R shell /system/bin/sdcard /system/bin/sdcard_sh
chcon u:object_r:su_exec:s0 /system/xbin/su
chcon u:object_r:su_exec:s0 /system/xbin/sdcardd
chcon u:object_r:sdcardd_exec:s0 /system/bin/sdcard
chcon u:object_r:sdcardd_exec:s0 /system/bin/sdcard_sh
mount -o remount,ro /system
echo "Successfully installed (you can ignore any device busy errors and should not see any other errors)."
fi
fi
if [ $1 ] && [ $1 == "uninstall" ]
then
if [ -e /system/bin/sdcard_bin ]
then
mount -o remount,rw /system
mv -f /system/bin/sdcard_bin /system/bin/sdcard
mv -f /system/xbin/su_bin /system/xbin/su
rm /system/bin/sdcard_sh
rm /system/xbin/sdcardd
mount -o remount,ro /system
echo "Successfully installed (you can ignore any device busy errors and should not see any other errors)."
else
echo "Not installed."
fi
fi
This looks interesting to me, I have the 4 GB pit mod on my S959G and I have been wondering if one could take the internal SD card space and put it to /data. You made my day with this but has anyone had luck in doing this mod and using xposed modules to make the external SD card the card apps, music, pictures, downloads, and etc folders as a fake internal SD card or is that what modding the android system does so that ROMs see the external SD card as the only expandable memory directory?
Sent from my CM 10 Toshiba Thrive using XDA Free mobile app
cidlover said:
This looks interesting to me, I have the 4 GB pit mod on my S959G and I have been wondering if one could take the internal SD card space and put it to /data. You made my day with this but has anyone had luck in doing this mod and using xposed modules to make the external SD card the card apps, music, pictures, downloads, and etc folders as a fake internal SD card or is that what modding the android system does so that ROMs see the external SD card as the only expandable memory directory?
Sent from my CM 10 Toshiba Thrive using XDA Free mobile app
Click to expand...
Click to collapse
In a nutshell, this is what my mod does:
/data points to mmcblk0p10 (I think off the top of my head)
/storage/sdcard0 points to /mnt/media_rw/sdcard0 which points to mmcblk0p11 (I think off the top of my head)
By installing my PIT, you severely shrink mmcblk0p11 and expand mmcblk0p10 to monster size.
My script then changes the location that /storage/sdcard0 points to (to /data/media/0 which is located on mmcblk0p10).
Android puts everything (pictures, downloads, etc.) by default onto /storage/sdcard0 -> so these files get redirected to the partition which has all the space (/data/media/0 or mmcblk0p10).
So, to answer your question, an Xposed mod to redirect all of that stuff to /storage/sdcard1 (external SD) instead may or may not work depending on the method it uses. If it tells the system that the default directory to use is /storage/sdcard1 via some environment variable or method then there should be no interaction (which is probably the way that the mod works; that's the simplest method). If it does some unmounting/mounting of directories then that may interfere with my script depending on the timing with which the Xposed mod activates.
If you decide to try to get Xposed to do this and it doesn't work - let me know what mod you're using. I can fix my script to accommodate it.
Alternatively, you don't even need Xposed. Instead you can just edit the script at this point (in notepad):
/system/bin/sdcard_bin -u 1023 -g 1023 -d /data/media/0 /storage/sdcard0&
/system/bin/sdcard_bin -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1&
First line: change /storage/sdcard0 to /storage/sdcard1
Second line: change storage/sdcard1 to /storage/sdcard0
*don't add/remove any whitespace or new lines (or really change anything other than the 0 and 1) or you may break the script
This will swap the folders so that /storage/sdcard0 points to external SD and /storage/sdcard1 points to /data/media/0.
Why do you want to do this anyway? 14+ gigs of /data not enough for your carefully curated porn collection?
dimoochka said:
In a nutshell, this is what my mod does:
/data points to mmcblk0p10 (I think off the top of my head)
/storage/sdcard0 points to /mnt/media_rw/sdcard0 which points to mmcblk0p11 (I think off the top of my head)
By installing my PIT, you severely shrink mmcblk0p11 and expand mmcblk0p10 to monster size.
My script then changes the location that /storage/sdcard0 points to (to /data/media/0 which is located on mmcblk0p10).
Android puts everything (pictures, downloads, etc.) by default onto /storage/sdcard0 -> so these files get redirected to the partition which has all the space (/data/media/0 or mmcblk0p10).
So, to answer your question, an Xposed mod to redirect all of that stuff to /storage/sdcard1 (external SD) instead may or may not work depending on the method it uses. If it tells the system that the default directory to use is /storage/sdcard1 via some environment variable or method then there should be no interaction (which is probably the way that the mod works; that's the simplest method). If it does some unmounting/mounting of directories then that may interfere with my script depending on the timing with which the Xposed mod activates.
If you decide to try to get Xposed to do this and it doesn't work - let me know what mod you're using. I can fix my script to accommodate it.
Alternatively, you don't even need Xposed. Instead you can just edit the script at this point (in notepad):
/system/bin/sdcard_bin -u 1023 -g 1023 -d /data/media/0 /storage/sdcard0&
/system/bin/sdcard_bin -u 1023 -g 1023 -d /mnt/media_rw/sdcard1 /storage/sdcard1&
First line: change /storage/sdcard0 to /storage/sdcard1
Second line: change storage/sdcard1 to /storage/sdcard0
*don't add/remove any whitespace or new lines (or really change anything other than the 0 and 1) or you may break the script
This will swap the folders so that /storage/sdcard0 points to external SD and /storage/sdcard1 points to /data/media/0.
Why do you want to do this anyway? 14+ gigs of /data not enough for your carefully curated porn collection?
Click to expand...
Click to collapse
Lol, no, I wanted to see if we turn, in theory, our Galaxy S2 phones into a phone with no Internal Memory and the only expandable memory is a external sd card to expand it, i just was thinking a few xposed modules can help after doing this mod.
cidlover said:
Lol, no, I wanted to see if we turn, in theory, our Galaxy S2 phones into a phone with no Internal Memory and the only expandable memory is a external sd card to expand it, i just was thinking a few xposed modules can help after doing this mod.
Click to expand...
Click to collapse
Just to clarify, the behavior of the device after this mod is identical. If installed properly, this mod does not create any new problems that need fixing. It still behaves exactly the same as if an internal storage partition exists.
dimoochka said:
Just to clarify, the behavior of the device after this mod is identical. If installed properly, this mod does not create any new problems that need fixing. It still behaves exactly the same as if an internal storage partition exists.
Click to expand...
Click to collapse
Sorry to bring this up again, but how is sd card data handled? Like .obb files in the Android folder on the internal SD card after this mod. And has anyone tried this mod yet?
cidlover said:
Sorry to bring this up again, but how is sd card data handled? Like .obb files in the Android folder on the internal SD card after this mod. And has anyone tried this mod yet?
Click to expand...
Click to collapse
Real simple. Instead of files being placed into /storage/sdcard0 they are redirected to /data/media/0. At the end of the day that is the primary difference.
The /data/media/obb folder remains empty (I have no idea what this is used for normally).
I've been using this mod for 2 months, it's worked great. I think me and you are probably the only two people interested in doing it :laugh:
dimoochka said:
The /data/media/obb folder remains empty (I have no idea what this is used for normally).
Click to expand...
Click to collapse
http://blog.notfaqs.com/2013/05/android-obb-files-location.html
http://developer.android.com/google/play/expansion-files.html
/system 1gb
I would like to get some help modifying the /system partition to be 1 gb is there any help i can get?

Categories

Resources