symlink /data/data to /mnt/sdcard - Android Q&A, Help & Troubleshooting

Hi... I have a rooted Sony Xperia J. It has phone memory of 764 mb, Internal SD card of 2.01gb and an ext SD card of 32gb.
What I want to do is move my app data which I think is in /data/data to my internal SD card which I think is mounted at /mnt/sdcard? I am going to create a folder on my sdcard called data.
I need some advice though as to whether this is possible and safe to do?
is it as simple as doing;
mkdir /mnt/sdcard/data
cp -r /data/data /mnt/sdcard/data
ln -s /data/data /mnt/sdcard/data
Then rebooting ?

in fact, thinking this might be a better option? Please can someone confirm this wont brick my phone?
mkdir /mnt/sdcard/data
mkdir /mnt/sdcard/app
cp -r /data/data /mnt/sdcard/data
cp -r /data/app /mnt/sdcard/app
ln -s /data/data /mnt/sdcard/data
ln -s /data/app /mnt/sdcard/app
Then rebooting ?

Sorry, I am doing lots of reading on this, but still haven't seen if anyone has done exactly this before. Would like some confirmation. I think I got the linking the wrong way around, so I now think it should be like this;
mkdir /mnt/sdcard/data
mkdir /mnt/sdcard/app
cp -pr /data/data /mnt/sdcard
cp -pr /data/app /mnt/sdcard
rm -r /data/data
rm -r /data/app
ln -s /mnt/sdcard/data /data/data
ln -s /mnt/sdcard/app /data/app
Then rebooting ?

yeah, that doesnt workd... soft bricked

ninjaprawn said:
yeah, that doesnt workd... soft bricked
Click to expand...
Click to collapse
Just in case someone needs this.
This wont work as you guys described because you need to format your card to EXT2 or EXT4, android is linux and needs perms wich FAT32 dont have. Also you need to make init script to mount the sdcard at boot and not at startup.

magix01 said:
Just in case someone needs this.
This wont work as you guys described because you need to format your card to EXT2 or EXT4, android is linux and needs perms wich FAT32 dont have. Also you need to make init script to mount the sdcard at boot and not at startup.
Click to expand...
Click to collapse
But is there any app that makes it easy?
i've a tablet vega with honeice android.
my problem is /data dimension, too.
i'm using link2sd app but /data is full, evenly.
why?

Related

moving the Dalvik cache

can we move the dalvik cache to the sd card?
or move it to the cache folder?
Thanks
hackit said:
can we move the dalvik cache to the sd card?
or move it to the cache folder?
Thanks
Click to expand...
Click to collapse
sure. easiest and most common method is using a symlink. probably best to do this from recovery mode when the android system is not actively using the dalvik-cache.
either copy the existing dalvik-cache from /data/dalvik-cache to the destination where the symlink will be, i.e. /sdcard/dc or /cache/dc OR just wipe /data/dalvik-cache and symlink to the new directory.
ln syntax example:
ln -s file1 file2
Creates a symbolic link to file1 with the name of the file2.
ln -s /data/dalvik-cache /sdcard/dc
or
ln -s /data/dalvik-cache /cache/dc
hope that helps!
Thanks for the reply,
so when you say recovery do you mean from cwm?
i already created the ext partition with cwm.
joeykrim said:
sure. easiest and most common method is using a symlink. probably best to do this from recovery mode when the android system is not actively using the dalvik-cache.
either copy the existing dalvik-cache from /data/dalvik-cache to the destination where the symlink will be, i.e. /sdcard/dc or /cache/dc OR just wipe /data/dalvik-cache and symlink to the new directory.
ln syntax example:
ln -s file1 file2
Creates a symbolic link to file1 with the name of the file2.
ln -s /data/dalvik-cache /sdcard/dc
or
ln -s /data/dalvik-cache /cache/dc
hope that helps!
Click to expand...
Click to collapse

B&N repartition SD card Boot

This is straight from the mSD card that they have been using at every B&N. So you can just do it yourself at your convenience.
Gives you 8GB of external storage and the rest is for Barnes and Noble content.
Thanks. But how should we use it? Copy to SD and reboot? Use Win32DiskImager write the image to a SD?
Sent from a Galaxy far, far away
Does it install version 1.42?
otisw said:
Does it install version 1.42?
Click to expand...
Click to collapse
I had 1.4.0 before, and still had it after.
Sent from a Galaxy far, far away
Did root remain intact?
Anxiyz said:
Did root remain intact?
Click to expand...
Click to collapse
No, it completely erases everything.
Sent from a Galaxy far, far away
Damn, I could have used that last week before I took my NT in and had them do it for me. Oh well. Thanks for posting it though.
.CRS. said:
Here is how I got it to work.
IT ERASES EVERYTHING SO BACKUP BEFORE YOU DO THIS
1. Put flashing_boot.img on the root of your sd card
2. Turn off Nook
3. Hold the power button and the N button until the black N flashes on and off
4. Push the power button to turn the nook back on
5. It will show a factory reset menu, just push the N button to continue
View attachment 955245
Sent from a Galaxy far, far away
Click to expand...
Click to collapse
Just a note. You must have stock recovery for this to work not CMW or other.
Failed Several Times
I tried this several times but my media storage was still 1GB. Do I need to write the attached image or just copy it straight forward. When just copying, I can't pursue with the factory reset.
Same thing here, tried several times and still getting 1GB
Ditto. I was able to perform a factory reset, but I still have just 1GB of user storage after the update.
I suspect the problem may have something to do with the NOOK Tablet not recognizing the microSD card. I've noticed when using ClockworkMod that sometimes I have to remove it and re-insert it before it's recognized -- but there's no way to tell whether the stock recovery is seeing the card or not.
I tried removing/re-inserting it a few times during one of the three attempts to use this img, but that didn't seem to help.
That's the issue I had, not recognizing the card itself. I even copied the file unto a different card altogether and same thing. Still working on it, not ready to give up on it just yet.
No luck here and I'm sure it's not my cards. The couple cards I've tried all work with CWM. I've tried 2 different 1GB cards, a 256MB card, a 4GB card and an 8GB card.... I don't feel like clearing out my 32GB card. I've tried both FAT and FAT32. Does this need a different format, such as ext2? I've also tried using Win32DiskImager to actually "write" the image to the card... This I only tried on the 256MB.
jmeyerhead, any chance of getting a MD5 checksum? I have f94cd4df7351f81a2623f15e1853e205 .
CRS... Did you do anything that the rest of us haven't listed? Did you download from a different location?
EDIT: I'm also running the stock recovery. I run CWM off SD when I need it.
To use this you will need a 50MB FAT32 LBA Bootable partition with MLO, u-boot.bin from b&n update 1.4.2 and flashing_boot.img from the first post.
I extracted the kernel and ramdisk and they have a couple of shell scripts to do all the work.
However the scripts refer to a second ext3 partition on the sdcard which will allow you to reinstall the tablet from scratch as they do in the factory
I was able to pull the executables genpart make_ext4fs mkdosfs simg2img busybox etc and push them to my nook running with clockwork mod. Then inside a adb shell I was able to restore my tablet completely the only files I needed were the rombackup.zip from the original so that I retained my serial etc
Here is a approximate record of the steps I did inside the adb shell
Code:
#!/bin/sh
export emmc_total_sectors=31129600
export disk_total_sectors=31117905
export disk_media_sectors=25165823
./genptable ptable.new
# Enable performance mode
echo 4 > "/sys/devices/platform/mmci-omap-hs.1/mmc_host/mmc0/mmc0:0001/power_class"
./busybox dd if=/dev/zero of=/dev/block/mmcblk0 bs=4096 count=256 conv=notrunc,fsync
./busybox if=ptable of=/dev/block/mmcblk0
./busybox dd if=MLO of=/dev/block/mmcblk0p1
./busybox dd if=u-boot.bin of=/dev/block/mmcblk0p2
./busybox dd if=recovery.img of=/dev/block/mmcblk0p3
./busybox dd if=boot.img of=/dev/block/mmcblk0p4
./mkdosfs -F32 -n rom /dev/block/mmcblk0p5
./mkdosfs -F32 -n bootdata /dev/block/mmcblk0p6
./mkdosfs -F32 -n MyNook /dev/block/mmcblk0p10
./make_ext4fs -L factory /dev/block/mmcblk0p7
./make_ext4fs -L system /dev/block/mmcblk0p8
./make_ext4fs -L cache /dev/block/mmcblk0p9
./make_ext4fs -L userdata /dev/block/mmcblk0p11
./busybox mkdir -p /mnt/factory
./busybox mkdir -p /mnt/rom
./busybox mkdir -p /mnt/bootdata
./busybox mount -t ext4 /dev/block/mmcblk0p7 /mnt/factory
./busybox mount -t vfat /dev/block/mmcblk0p5 /mnt/rom
./busybox mount -t vfat /dev/block/mmcblk0p6 /mnt/bootdata
cd /mnt
/tmp/byhand/busybox unzip /tmp/byhand/rombackup.zip
cd /tmp/byhand
./busybox dd if=/dev/zero of=/mnt/bootdata/BCB bs=1088 count=1
./busybox dd if=/dev/zero of=/mnt/bootdata/BootCnt bs=4 count=1
./busybox umount /mnt/rom
./busybox umount /mnt/bootdata
./busybox cp factory.zip /mnt/factory/
./busybox cp rombackup.zip /mnt/factory/
cd /mnt/factory
/tmp/byhand/busybox unzip factory.zip romrestore.zip
cd /tmp/byhand
./busybox umount /mnt/factory
I did fiddle with the partition sizes a bit since I wanted 12.6GB so the exports at the beginning are different from what is in the flashing_boot.img
BIG FAT WARNING - I did this and it works form me don't try it unless you feel confident to recover from a clockworkmod booting off a sdcard
Well, mine is bricked. I can boot CWM SD though so I'm sure all is not lost. I'll have to experiment with it later. Just so everyone else knows I made formatted the disk as stated, copied the stated files. When I booted I immediately got a "software update" screen (I don't think I even held the n button down). Then once done it said to remove the card and restart.... never restarted (screen didn't light up, no 'n' screen, nada. I popped in my CWM SD and it did boot. Tried restoring a backup but that won't boot either. Should have stuck to the manual method or just gone in... I was hoping for something in the middle as far as complexity.
UPDATE: Ok, well I've gone in with Parted and let it correct the found errors (the expected ones reported in the manual formatting thread). Looking at the output from parted the repartitioning worked but something got screwed up. I've tried another restore after letting Parter do its thing but no joy. Is there anything else I should try while I'm in CWM and have ADB up? Any ideas?
Oh, and mine is a 16GB NT.... not 8GB and not Nook Color. I'm trying to download Adam's total wipe Ubuntu image but the host has exceeded its daily limit and the torrent is near dead.... So I'll just hurry up and wait while continuing to try different fixes via CWM.
EDIT: Read on. I did actually get my NT partitioned but ran into some issues with the file system I didn't expect. Thanks to meghd00t everything is now working perfectly... Read on.
if you have a copy of acclaim_update.zip for 1.4.0 or the b&n updates for 1.4.1.or 1.4.2 rename the file to acclaim_update.zip put it on the root of a FAT32 formated sd card and boot the nook by inserting the usb cable
if the steps from my previous post have worked all you need is a partition table MLO u-boot.bin boot.img recovery.img and rombackup.zip
when the tablet boots just like it looks for flashing_boot.img it also looks for the acclaim_update.zip if it is present and the MLO u-boot boot and recovery are OK it will completely reflash the OS to stock - However to retain serial number and B&N website access preserve the rombackup.zip from the factory partition
Did your thread get cut off?
Well, obviously I don't know how to set this up properly. I assume that it had actually booted off the internal system and not the SD I *thought* I set up. Is there a tutorial on building a SD properly for this or should I just go ahead and go with AdamOutler's Ubuntu card? Do I need to take a special precautions in either case to preserve the serial number?
Thanks for all the help!
Actually I had the exact same experience as you, so when the partition table was fixed I did not bother to create the contents of the 2nd ext3 partition, Instead I just copied the necessary files in adb and used dd to install MLO, u-boot, boot & recovery format all the Fat32 & ext4 partitions and copied factory.zip rombackup.zip to the factory partition and allowed the factory reset to happen.
from a quick look at the script the 2nd ext3 partition should atleast have these files
Code:
mkdir /images_to_flash
mount /dev/mmcblk1p2 /images_to_flash
if [ -f /images_to_flash/preflash.img ]; then
test -r /images_to_flash/noshutdown && cp /images_to_flash/noshutdown /
test -r /images_to_flash/version.ppm.gz && fbsplash -s /images_to_flash/version.ppm.gz
dd if=/images_to_flash/preflash.img of=/dev/mmcblk0 bs=4M conv=notrunc,fsync
simg2img /images_to_flash/factory.img /dev/mmcblk0p7
umount /images_to_flash
elif [ ! -f /images_to_flash/factory.img ]; then
if [ -f /images_to_flash/bootcnt ]; then
dd if=/images_to_flash/MLO of=/dev/mmcblk0p1
dd if=/images_to_flash/u-boot.bin of=/dev/mmcblk0p2
dd if=/images_to_flash/recovery.img of=/dev/mmcblk0p3
test -r /images_to_flash/boot.img && dd if=/images_to_flash/boot.img of=/dev/mmcblk0p4
if [ -f /images_to_flash/factory.zip ]; then
cp /images_to_flash/factory.zip /mnt/factory/factory.zip
dd if=/images_to_flash/MLO of=/dev/mmcblk0p1 bs=4096 conv=notrunc,fsync
dd if=/images_to_flash/u-boot.bin of=/dev/mmcblk0p2 bs=4096 conv=notrunc,fsync
dd if=/images_to_flash/recovery.img of=/dev/mmcblk0p3 bs=4096 conv=notrunc,fsync
dd if=/images_to_flash/boot.img of=/dev/mmcblk0p4 bs=4096 conv=notrunc,fsync
test -r /images_to_flash/factory.img && simg2img /images_to_flash/factory.img /dev/mmcblk0p7
if [ ! -f /images_to_flash/factory.img ]; then
test -r /images_to_flash/system.img && simg2img /images_to_flash/system.img /dev/mmcblk0p8
if [ -f "/images_to_flash/factory.img" ]; then
if [ -f /images_to_flash/factory.zip ]; then
cp /images_to_flash/factory.zip /mnt/factory/factory.zip
if [ -f "/images_to_flash/factory.img" ]; then
umount /images_to_flash
I guess these could be made by
1. preflash.img - ignore we dont want a factory install
2. bootcnt - dd if=/dev/zero of=bootcnt bs=4 count=1
3. MLO - unzip from factory.zip and rename
4. u-boot.bin - unzip from factory.zip
5. boot.img - unzip from factory.zip
6. recovery.img - unzip from factory.zip
7. factory.zip - rename the acclaim_update.zip for 1.4.0 or rename one of the b&n updates for 1.4.1 or 1.4.2
8. factory.img - this i think is a blank ext4 fs on a sparse disk, however if it does not exist the script will format the partition
9. system.img - not required
Why dont you go ahead and create a 2nd ext3 partition on the sdcard and create these files I am sure you will be able to unbrick and retain the rombackup and all the serials etc
just FYI I am attaching the shell script inside the flashing_boot.img that is doing all the work

[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] System.img Editing Dev Help

Hi all,
im working on making a ROM for the Asus Transformer and im struggling a bit. im totall new to Linux, using mint and just getting used to it.
Basically im just trying to take a stock ROM and add root but adding superuser.apk and SU binary but im running into problems.
Asus Roms are a bit unusual, packed into blob files, ive unpacked that no problem, the system image is called blob.APP but its just the same as system.img just the name as i understand it.
ok so what ive done:
Code:
mkdir system
sudo mount -t ext4 -o loop blob.APP system/
so this mounts the ext4 fs as a loop device and allows me to copy the contents out
Code:
sudo cp -ar system new_system
then ive copied superuser.apk to /app and SU binary to /dev with drop and drag.
then make the filesystem image
Code:
sudo ./make_ext4fs -l 512m -a system blob.APP new_system/system
then just pack it up and flash it, flashing works fine, no errors but when i go to reboot it warns that theres no OS so somethings not worked. ive tried everything i can find googeling!
i just started learning linux on weds so go easy on me
any advice or help would be really great. thanks!
mkdir system here you will mount the old system
mkdir system_new here you will mount the new system
we now create the actual image
dd if=/dev/zero of=system_new.img bs=4k count=60000
bs=4k is the block size
count=60000 the number of blocks of 4kb size
so is something like 60000*4= 240000 which is actually 240 Mb
so it depends to you how big you want the image.
now we format the system.img in ext4
mkfs.ext4 system_new.img
Proceed anyway? (y,n) y
now we override the filesystem check
tune2fs -c0 -i0 system_new.img
Now we mount the the 2 directories that we created in the first step
mount -o loop system_new.img system_new/
mount -o loop system_new.img system/
Now we copy the contet of the old image to the new one with all the perimissions
cp -v -r -p system/* system_new/
We sinc the files
sync
We unmount the partitions
umount system_new/
umount system/
And voila, the system.img in ext4 is created.
Tips: you will need superuser acces.
if you will copy new files besides the ones from the old system you will have to set by hand all the permissions.
If you are using ubuntu just type
sudo su
and you will be root and no more sudo at each command.
Thank u so much for your guide this is exactly what I'm looking for so massive thanks!
So to add root I.can drop and drag superuser.apk and the binary into the new image?
Also do I need to worry about the android mountpoint?
Sent from my HTC Sensation Z710e using xda premium
yes you can do that, as long as you set the permissions right. (you can google for them)
and from what i remeber you will have to set also the ownership of the su, and superusers files
you need to do tests first, and then try
the mountpoint should be ok as it is now.
globula_neagra said:
mkdir system here you will mount the old system
mkdir system_new here you will mount the new system
we now create the actual image
dd if=/dev/zero of=system_new.img bs=4k count=60000
bs=4k is the block size
count=60000 the number of blocks of 4kb size
so is something like 60000*4= 240000 which is actually 240 Mb
so it depends to you how big you want the image.
now we format the system.img in ext4
mkfs.ext4 system_new.img
Proceed anyway? (y,n) y
now we override the filesystem check
tune2fs -c0 -i0 system_new.img
Now we mount the the 2 directories that we created in the first step
mount -o loop system_new.img system_new/
mount -o loop system_new.img system/
Now we copy the contet of the old image to the new one with all the perimissions
cp -v -r -p system/* system_new/
We sinc the files
sync
We unmount the partitions
umount system_new/
umount system/
And voila, the system.img in ext4 is created.
Tips: you will need superuser acces.
if you will copy new files besides the ones from the old system you will have to set by hand all the permissions.
If you are using ubuntu just type
sudo su
and you will be root and no more sudo at each command.
Click to expand...
Click to collapse
U said, we have to set permissions by ourselves. So what are the permissions that needs to be set when I add a new folder with an APK in it?
Sudo chmod 777 filepath/filename.apk
Sudo chmod a-rwx filepatch/filename.apk.
This is what I remember from top of my head. Google it a bit if it does not work from the first try as I have not used this like in 5 years.
If you allready have root you can you a file manager and just copy the file/folder where you want and set the permissions via thw file manager or using terminal commanda or via adb.
From what remember you can t make a folder in the apk folder as you won t be able to run the apk.

How to create symlink for /sdcard1 from /ext_card?

That's "root directory" /sdcard1 and "root directory" /ext_card (just wanna avoid confusion), not /storage/sdcard1, which i do have, some apps I restored via Titanium on RR LP from stock KK depend on /sdcard1, to rebuild all databases from those apps from scratch is out of the question when there are symlinks, just need to learn how to make them work without causing a mess.
Posts I've found from the subject are old (pre-Lollipop), I would have guessed they are still good but somewhere it said it depends on the rom....
Symlink solution (easier, no delay waiting for block device), place the following in /etc/init.d/99sdcard1
Code:
#!/system/bin/sh
ln -s /storage/extSdCard /storage/sdcard1
ln -s /storage/extSdCard /mnt/sdcard1
ln -s /storage/sdcard0 /mnt/sdcard0
Don't know if this will work for me.. because symlink needs to be /sdcard1 at root
I'm not interested in creating mount points, just a symlink should do it, thanks in advance for any help.
I used the following in terminal emulator and it worked once:
Code:
ln -s /storage/sdcard1 /sdcard1
Then I created a file in /etc/init.d/99sdcard1 with that same line
Code:
#!/system/bin/sh
ln -s /storage/sdcard1 /sdcard1
Doesn't create the symlink, and when trying the command in term emu it says ln: sdcard1: Read-only file system

Categories

Resources