Alternative to app2sd >>>> link2sd

goodoane

Senior Member
Nov 25, 2010
269
90
@bakpinar
Instead of moving all applications to SD card with app2sd, I want to move only selected applications.
Because I don't want to move my launcher, soft keyboard and dialer application to SD and make them unavaliable on boot if my SD card has problem or not inserted.
In order to resolve this I developed an application called Link2SD.

Original link:[App] Link2SD - xda-developers

Is not working now on our device but is just a matter of time.
L.E.
Now is nativelly working with the internal memory(sdcard)

I use this to make it to work on external memory(sdcard2).
1.universal root 2.62 beta 5 no supereruser installed from the apk
2.superuser from market
3.busybox from market I prefer 1.8 git version
4.root explorer
5.put 2 script(using root explorer) on /system/etc/ folder (inst-sd.sh and install-recovery.sh)
6.change permission to this file using root explorer
7.creat a new folder (with root explorer) in /data/"sdext2"
8.install link2sd
9.reboot my device and the fun begin
Files that you need for this:
http://rapidshare.com/files/445330883/For_S7.zip

Remember this it was tested on v104 best buy on an external card.

A small tutorial for how to here:http://www.androidtablets.net/forum...4-alternative-app2sd-link2sd-3.html#post46002
 
Last edited:
That looks pretty cool thanks for sharing

Sent from my incredible using Android Tablet Forum
 
The only way to make this working was to manualy make scripts for mounting the ext2 partition and to manualy create sdext2 folder in /data/sdext2.
1st script install-recovery.sh
#!/system/bin/sh
/system/etc/init-sd2.sh&

2nd script init-sd.sh
!/system/bin/sh
MYLOG=/data/install-recovery.log
echo "$(date) Starting install-recovery.sh" > $MYLOG
echo "$(date) Waiting SD to become ready..." >> $MYLOG
sleep 10
mount -t ext2 /dev/block//vold/179:2 /data/sdext2 1>>$MYLOG 2>>$MYLOG
mount >> $MYLOG
echo "$(date) Finishing install-recovery.sh" >> $MYLOG
 
Looks like a good option. How can I move to this with many existing apps in a2sd? Which apps can you move? Does it do apps and data? What about cache?

Sent from my Ideos S7
 
You can move only the downloaded application(no sytem). It dosn't move data or dalvik-cache.

Sent from my Ideos S7 using Tapatalk
 
I think this would be a much safer and better solution than the current apps2sd that we are using. I am pretty sure I could script an install-recovery.sh to do the setup automatically. In the apps2sd thread, I have verified that we can use /cache for the dalvik-cache. I don't think there is any real need to move data or private directories, so I think this would be a superior solution and give the option of moving the apps that you want to. It would be best to start with an empty device. I will be doing some testing of this.
 
Been testing this out. It seems to work well and should generally be more stable.

Some Observations:
1) transition from apps2sd is hard, best to start again from a fresh rom and reinstall your apps from backup
2) setup is a lot simpler, create directory, install the app and then reboot and manually move apps to sdcard
3) Not all apps can be moved. Not really a problem, it is mainly system ones that dont work
4) it broke my market when I installed, but easy enough to fix, reinstall and reboot
5) you have to link your apps, then reboot before it takes effect
6) gives the option of keeping widgets and sensitive apps on the internal memory, improved stability
7) Titanium does not report apps2sd correctly, so you have no idea how much space is being used.

Overall I like it. I am sticking with this for now and will keep doing more testing. I am using it this mod with the /cache mod to give me about 100M of free memory, with all my required apps installed. Not bad really. :)
 
Another problem is when you upgrade an app, it someones breaks it. App also needs to be relinked.

Cache mod is now described in apps2sd. The is an original post here somewhere. It comes from xda forum.

Sent from my S7
 
Here is my setup for this.

I have these files in /system/etc/

install-recovery.sh
#!/system/bin/sh
#
/system/etc/init-sd2.sh&
/system/etc/init-camera.sh&
/system/etc/init-cache.sh&

init-sd2.sh
#!/system/bin/sh
MYLOG=/data/init-sd2.log
echo "$(date) Starting init-sd2.sh" > $MYLOG
echo "$(date) Waiting SD to become ready..." >> $MYLOG
sleep 10
mount -t ext2 /dev/block/vold/179:2 /data/sdext2 1>>$MYLOG 2>>$MYLOG
mount >> $MYLOG
echo "$(date) Finishing init-sd2.sh" >> $MYLOG


init-cache.sh
#!/system/bin/sh
#
MYLOG=/data/init-cache.log
echo "$(date) Starting init-cache.sh" > $MYLOG
if [ ! -d /cache/dalvik-cache ]
then
echo "$(date) ( !-d /cache/dalvik-cache)" >> $MYLOG
mkdir /cache/dalvik-cache >> $MYLOG
chown 1000:1000 /cache/dalvik-cache >> $MYLOG
chmod 775 /cache/dalvik-cache >> $MYLOG
fi

if [ -L /data/dalvik-cache ]
then
echo "$(date) (-L /cache/dalvik-cache)" >> $MYLOG
rm -f /data/dalvik-cache >> $MYLOG
mkdir /data/dalvik-cache >> $MYLOG
chown 1000:1000 /data/dalvik-cache >> $MYLOG
chmod 775 /data/dalvik-cache >> $MYLOG
elif [ ! -d /data/dalvik-cache ]
then
echo "$(date) (elsif ! -d /data/dalvik-cache)" >> $MYLOG
mkdir /data/dalvik-cache >> $MYLOG
chown 1000:1000 /data/dalvik-cache >> $MYLOG
chmod 775 /data/dalvik-cache >> $MYLOG
elif [ -d /data/dalvik-cache ]
then
for filename in /data/dalvik-cache/*
do
if [ -L $filename ]
then
rm -f $filename >> $MYLOG
fi
done
mv /data/dalvik-cache/* /cache/dalvik-cache/ >> $MYLOG
fi
echo "$(date) Mounting Cache" >> $MYLOG
mount -o bind /cache/dalvik-cache/ /data/dalvik-cache/ 1>>$MYLOG 2>>$MYLOG
mount >> $MYLOG
echo "$(date) Finishing init-cache.sh" >> $MYLOG


My mounts now look like this

# mount
mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
/dev/block/mtdblock1 /system yaffs2 ro 0 0
/dev/block/mtdblock6 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock5 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock5 /data/dalvik-cache yaffs2 rw,nosuid,nodev 0 0
/dev/block/vold/179:2 /data/sdext2 ext2 rw,errors=continue 0 0
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=
1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,s
hortname=mixed,utf8,flush 0 0

Space looks like this
# busybox df -h
busybox df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 207.6M 16.0K 207.5M 0% /dev
tmpfs 4.0M 0 4.0M 0% /sqlite_stmt_journals
/dev/block/mtdblock1 160.0M 128.2M 31.8M 80% /system
/dev/block/mtdblock6 175.0M 141.9M 33.1M 81% /data
/dev/block/mtdblock5 94.8M 66.7M 28.1M 70% /cache
/dev/block/mtdblock5 94.8M 66.7M 28.1M 70% /data/dalvik-cache
/dev/block/vold/179:2
1.4G 432.4M 968.1M 31% /data/sdext2
/dev/block//vold/179:1
13.4G 6.9G 6.5G 52% /sdcard
#
 
The link appears to have a problem any chance of posting it or can I get it through XDA?
Edit. Looked at XDA and it's on the Market
 
Last edited:
Is there an easier way to implement this?

I don't feel like I am confident enough to be able to try and run scripts to get this time. I'm very noobish to all of this.

At the moment I really want to use my external card more for video and file viewing (PDFs, etc) but I seem unable to do so. Was hoping this could fix that issue or maybe I am having a different one.
 
No mod needed to do that. S7 will read video and docs straight from sd. That works out of the box.

Sent from my S7
 
Here is my setup for this.

I have these files in /system/etc/

install-recovery.sh
#!/system/bin/sh
#
/system/etc/init-sd2.sh&
/system/etc/init-camera.sh&
/system/etc/init-cache.sh&

init-sd2.sh
#!/system/bin/sh
MYLOG=/data/init-sd2.log
echo "$(date) Starting init-sd2.sh" > $MYLOG
echo "$(date) Waiting SD to become ready..." >> $MYLOG
sleep 10
mount -t ext2 /dev/block/vold/179:2 /data/sdext2 1>>$MYLOG 2>>$MYLOG
mount >> $MYLOG
echo "$(date) Finishing init-sd2.sh" >> $MYLOG


init-cache.sh
#!/system/bin/sh
#
MYLOG=/data/init-cache.log
echo "$(date) Starting init-cache.sh" > $MYLOG
if [ ! -d /cache/dalvik-cache ]
then
echo "$(date) ( !-d /cache/dalvik-cache)" >> $MYLOG
mkdir /cache/dalvik-cache >> $MYLOG
chown 1000:1000 /cache/dalvik-cache >> $MYLOG
chmod 775 /cache/dalvik-cache >> $MYLOG
fi

if [ -L /data/dalvik-cache ]
then
echo "$(date) (-L /cache/dalvik-cache)" >> $MYLOG
rm -f /data/dalvik-cache >> $MYLOG
mkdir /data/dalvik-cache >> $MYLOG
chown 1000:1000 /data/dalvik-cache >> $MYLOG
chmod 775 /data/dalvik-cache >> $MYLOG
elif [ ! -d /data/dalvik-cache ]
then
echo "$(date) (elsif ! -d /data/dalvik-cache)" >> $MYLOG
mkdir /data/dalvik-cache >> $MYLOG
chown 1000:1000 /data/dalvik-cache >> $MYLOG
chmod 775 /data/dalvik-cache >> $MYLOG
elif [ -d /data/dalvik-cache ]
then
for filename in /data/dalvik-cache/*
do
if [ -L $filename ]
then
rm -f $filename >> $MYLOG
fi
done
mv /data/dalvik-cache/* /cache/dalvik-cache/ >> $MYLOG
fi
echo "$(date) Mounting Cache" >> $MYLOG
mount -o bind /cache/dalvik-cache/ /data/dalvik-cache/ 1>>$MYLOG 2>>$MYLOG
mount >> $MYLOG
echo "$(date) Finishing init-cache.sh" >> $MYLOG


My mounts now look like this

# mount
mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
/dev/block/mtdblock1 /system yaffs2 ro 0 0
/dev/block/mtdblock6 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock5 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock5 /data/dalvik-cache yaffs2 rw,nosuid,nodev 0 0
/dev/block/vold/179:2 /data/sdext2 ext2 rw,errors=continue 0 0
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=
1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,s
hortname=mixed,utf8,flush 0 0

Space looks like this
# busybox df -h
busybox df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 207.6M 16.0K 207.5M 0% /dev
tmpfs 4.0M 0 4.0M 0% /sqlite_stmt_journals
/dev/block/mtdblock1 160.0M 128.2M 31.8M 80% /system
/dev/block/mtdblock6 175.0M 141.9M 33.1M 81% /data
/dev/block/mtdblock5 94.8M 66.7M 28.1M 70% /cache
/dev/block/mtdblock5 94.8M 66.7M 28.1M 70% /data/dalvik-cache
/dev/block/vold/179:2
1.4G 432.4M 968.1M 31% /data/sdext2
/dev/block//vold/179:1
13.4G 6.9G 6.5G 52% /sdcard
#

Hello,

I am the developer of Link2SD.
Currently I'm working on to make Link2SD usable on more devices.

I received some emails which state that Link2SD does not work on Huawei ascend. While investigating the problem I saw your post.

#!/system/bin/sh
MYLOG=/data/init-sd2.log
echo "$(date) Starting init-sd2.sh" > $MYLOG
echo "$(date) Waiting SD to become ready..." >> $MYLOG
sleep 10
mount -t ext2 /dev/block/vold/179:2 /data/sdext2 1>>$MYLOG 2>>$MYLOG
mount >> $MYLOG
echo "$(date) Finishing init-sd2.sh" >> $MYLOG
This is exactly what Link2SD does for making Android mount ext2 partition at boot time. The only difference is Link2SD puts these lines in /system/etc/install-recovery.sh directly
but you put these in a different script and call it from install-recovery.sh in the background.
That is the reason of the problem? Did you try with install-recovery.sh script? (without second script)

Thanks
 
Back
Top