[PRJ] apps2sd discussion

Ok i have just finished redoing the A2SD process , all working again yay !

after the reboot in adb , s7 rebooted fine. I unplugged usb then hit the power button and pressed shutdown....turned back on and she booted fine :cool:

front cam mod on boot is still holding up nicely with the added script

so fingers crossed will try a few more reboots and hold off on installing too many things right now.
 
@pvella couldn't do this today as i redid my s7, but here is my mount and busybox command you asked for in the camera swap thread :

Fresh after redoing the A2SD mod

C:\Program Files\Android\android-sdk-windows\platform-tools>adb shell
$ su
su
# 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/mtdblock5 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block//vold/179:1 /sdcard2 vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid
=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,
shortname=mixed,utf8,flush 0 0
/dev/block//vold/179:17 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid
=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,
shortname=mixed,utf8,flush 0 0
/dev/block/vold/179:18 /system/sd ext2 rw,errors=continue 0 0
/dev/block/vold/179:18 /data/app ext2 rw,errors=continue 0 0
/dev/block/vold/179:18 /data/data ext2 rw,errors=continue 0 0
/dev/block/vold/179:18 /data/dalvik-cache ext2 rw,errors=continue 0 0
# busybox df -h
busybox df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 207.6M 16.0K 207.6M 0% /dev
tmpfs 4.0M 0 4.0M 0% /sqlite_stmt_journals
/dev/block/mtdblock1 160.0M 118.5M 41.5M 74% /system
/dev/block/mtdblock5 175.0M 6.7M 168.3M 4% /data
/dev/block/mtdblock4 96.0M 3.2M 92.8M 3% /cache
/dev/block//vold/179:1
14.8G 6.1G 8.7G 41% /sdcard2
/dev/block//vold/179:17
6.1G 3.0M 6.1G 0% /sdcard
/dev/block/vold/179:18
1.4G 55.7M 1.3G 4% /system/sd
/dev/block/vold/179:18
1.4G 55.7M 1.3G 4% /data/app
/dev/block/vold/179:18
1.4G 55.7M 1.3G 4% /data/data
/dev/block/vold/179:18
1.4G 55.7M 1.3G 4% /data/dalvik-cache
#
 
This dalvik2cache might be nice too: Dalvik-cache in /cache [Archive] - xda-developers

/cache is 90MB

This should work, we can even script it to auto create on install-recovery. What happens if the cache fills? Mine is about 60m already. I think this will either work really well or brick the device. Anyone tried it? No need to automount, since cache is an existing mount. Symbollic link should work. I still need a2sd since I need about 400m just for apps.

Happy to test this in the next few days.

Sent from my Ideos S7
 
If we issue the mount command we should see something like:

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 rw 0 0
/dev/block/mtdblock6 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock5 /cache yaffs2 rw,nosuid,nodev 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,shortname=mixed,utf8,flush 0 0
/dev/block/vold/179:2 /system/sd ext2 rw 0 0
/dev/block/vold/179:2 /data/app ext2 rw 0 0
/dev/block/vold/179:2 /data/app-private ext2 rw 0 0
/dev/block/vold/179:2 /data/dalvik-cache ext2 rw 0 0
/dev/block/vold/179:2 /data/data ext2 rw 0 0


Now we need to automate the mounting of these partitions during boot.

For this to occur we need two scripts to be placed in /system/etc/

The first script is called install-recovery.sh as the tablet looks for this script at boot time, we use this to call another script called init-sd.sh to mount the second partition on the sdcard, and then bind mount the directories in the data partition.

the first script contains the following

#!/system/bin/sh
/system/etc/init-sd.sh&


The second script contains:

#!/system/bin/shsleep 10
mount -t ext2 /dev/block/vold/179:2
mount -o bind /system/sd/app /data/app
mount -o bind /system/sd/app-private /data/app-private
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache
mount -o bind /system/sd/data /data/data

so using a good text editor, such as notepad ++, we need to make these two scripts and then get them on to the tablet.

We could either mount the sdcard on your windows machine, or use Droid explorer, or adb push to put these on to the sdcard

Once they are on the sd card, we need to move them to the correct place and also as we've been editing these files on a windows machine, make sure that the line breaks are good and correct.

To do this we need to issue the following commands:

cd /sdcard
dos2unix install-recovery.sh
dos2unix init-sd.sh

Now we copy both of these files to the /system/etc/ folder

cp install-recovery.sh /system/etc
cp init-sd.sh /system/etc

Next we need to make sure both these files are able to be run at boot, by issuing the following command:

chmod 755 /system/etc/install-recovery.sh
and
chmod 755 /system/etc/init-sd.sh

Now we reboot the tablet, and hopefully everything has worked, we can do this quickly via the adb
shell with the reboot command

reboot

If all has worked correctly, everything will be up and running.

so using a good text editor, such as note pad ++, we need to make these two scripts and then get them on to the tablet.

We could either mount the sdcard on your windows machine, or use Droid explorer, or adb push to put these on to the sdcard

Once they are on the sd card, we need to move them to the correct place and also as we've been editing these files on a windows machine, make sure that the line breaks are good and correct.

To do this we need to issue the following commands:

cd /sdcard
dos2unix install-recovery.sh
dos2unix init-sd.sh

Now we copy both of these files to the /system/etc/ folder

cp install-recovery.sh /system/etc
cp init-sd.sh /system/etc

Next we need to make sure both these files are able to be run at boot, by issuing the following command:

chmod 755 /system/etc/install-recovery.sh
and
chmod 755 /system/etc/init-sd.sh

Now we reboot the tablet, and hopefully everything has worked, we can do this quickly via the adb shell with the reboot command

reboot

If all has worked correctly, everything will be up and running.

The output to my mount command is;

# 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/mtdblock5 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev 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
/dev/block/vold/179:2 /system/sd ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/app ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/app-private ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/dalvik-cache ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/data ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/app ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/app-private ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/dalvik-cache ext2 rw,errors=continue 0 0
#

Any ideas as to why the /dev/block/void/179:2 outputs all have errors=continue, is there a problem or should I just ignore it and proceed with the auto mount scripts?

Thanks
 
The errors=continue, just tells the file sytem what to do in an error condition. I think this might be a better setting than without errors=continue.
 
Thanks ver much for the quick reply, One other that I just noted between the guide's output and mine;

/dev/block/vold/179:2 /system/sd ext2 rw 0 0
/dev/block/vold/179:2 /data/app ext2 rw 0 0
/dev/block/vold/179:2 /data/app-private ext2 rw 0 0
/dev/block/vold/179:2 /data/dalvik-cache ext2 rw 0 0
/dev/block/vold/179:2 /data/data ext2 rw 0 0

and

/dev/block/vold/179:2 /system/sd ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/app ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/app-private ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/dalvik-cache ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/data ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/app ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/app-private ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/dalvik-cache ext2 rw,errors=continue 0 0

There seems to be a double up of entries, /data/app, /data/app-private, /data/dalvik-cache but not /data/data

Should I redo the whole process to try and remove the double entries?

Regards
 
You should not have the double entries. Retry it.

Sent from my Ideos S7
 
You should not have the double entries. Retry it.

Sent from my Ideos S7

Thanks, when all the way through to the point that the mount gave single entries of the mount ... /dev/block/void179:2(still comes up with the error=continue).
installed the 2 scripts(install-recovery & init-sd) in /system/etc/.

cat init-sd.sh
#!/system/bin/shsleep 10
mount -t ext2 /dev/block//vold/179:2
mount -o bind /system/sd/app /data/app
mount -o bind /system/sd/app-private /data/app-private
mount -o bind /system/sd/dalvik-cache /data/dalvik-cache
mount -o bind /system/sd/data /data/data
$ cat install-recovery.sh
cat install-recovery.sh
#!/system/bin/sh
/system/etc/init-sd.sh&
$

after reboot mount no longer gives an indication that the ext2 partition is mounted.

It would appear now that I have lost Market, Busybox installer & Titanium Backup and before the app2sd change I had 156M free space now 142M(settings/sd card and tablet storage).

Apart from the above seems to boot OK.

Any ideas on what may have gone wrong(ext2 partition 1.5GB, FAT32 partition 13.8GB)
 
I am guessing that this is a problem with the files created on windows. Read the notes I wrote about using notepad ++

Sent from my Ideos S7
 
Just an update about what I currently have loaded and tested on my S7. I currently have the latest Singapore ROM (S7V100R001C62B013).

I am loading the following scripts into /system/etc

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


init-sd.sh
#!/system/bin/sh
#
MYLOG=/data/init-sd.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 /system/sd 1>>$MYLOG 2>>$MYLOG
mount -o bind /system/sd/app /data/app 1>>$MYLOG 2>>$MYLOG
#mount -o bind /system/sd/data /data/data 1>>$MYLOG 2>>$MYLOG
#mount -o bind /system/sd/dalvik-cache /data/dalvik-cache 1>>$MYLOG 2>>$MYLOG
mount >> $MYLOG
echo "$(date) Finishing init-sd.sh" >> $MYLOG


init-camera.sh

#!/system/bin/sh
#
MYLOG=/data/init-camera.log
echo "$(date) Starting init-camera.sh" > $MYLOG
rm /dev/msm_camera/*
cd /dev/msm_camera
busybox mknod frame0 c 245 5
busybox mknod frame1 c 245 2
busybox mknod config0 c 245 4
busybox mknod config1 c 245 1
busybox mknod control0 c 245 3
busybox mknod control1 c 245 0
chown system.system *
chmod 660 *
echo "$(date) Finishing init-camera.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
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
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
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


mount now looks like this
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: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
/dev/block/vold/179:2 /system/sd ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/app ext2 rw,errors=continue 0 0


Space looks like this
# busybox df -h
busybox df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 207.6M 12.0K 207.5M 0% /dev
tmpfs 4.0M 0 4.0M 0% /sqlite_stmt_journals
/dev/block/mtdblock1 160.0M 141.3M 18.7M 88% /system
/dev/block/mtdblock6 175.0M 55.8M 119.2M 32% /data
/dev/block/mtdblock5 94.8M 48.4M 46.3M 51% /cache
/dev/block/mtdblock5 94.8M 48.4M 46.3M 51% /data/dalvik-cache
/dev/block//vold/179:1
13.4G 6.8G 6.6G 51% /sdcard
/dev/block/vold/179:2
1.4G 339.2M 1.0G 24% /system/sd
/dev/block/vold/179:2
1.4G 339.2M 1.0G 24% /data/app


I now have a lot of space, cache is now on a NAND mount point and stable, and I have not had to move /data/app-private, or /data/data at all.
 
Just an update about what I currently have loaded and tested on my S7. I currently have the latest Singapore ROM (S7V100R001C62B013).

I am loading the following scripts into /system/etc

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

init-sd.sh
#!/system/bin/sh
#
MYLOG=/data/init-sd.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 /system/sd 1>>$MYLOG 2>>$MYLOG
mount -o bind /system/sd/app /data/app 1>>$MYLOG 2>>$MYLOG
#mount -o bind /system/sd/data /data/data 1>>$MYLOG 2>>$MYLOG
#mount -o bind /system/sd/dalvik-cache /data/dalvik-cache 1>>$MYLOG 2>>$MYLOG
mount >> $MYLOG
echo "$(date) Finishing init-sd.sh" >> $MYLOG

init-camera.sh
#!/system/bin/sh
#
MYLOG=/data/init-camera.log
echo "$(date) Starting init-camera.sh" > $MYLOG
rm /dev/msm_camera/*
cd /dev/msm_camera
busybox mknod frame0 c 245 5
busybox mknod frame1 c 245 2
busybox mknod config0 c 245 4
busybox mknod config1 c 245 1
busybox mknod control0 c 245 3
busybox mknod control1 c 245 0
chown system.system *
chmod 660 *
echo "$(date) Finishing init-camera.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
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
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
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

mount now looks like this
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: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
/dev/block/vold/179:2 /system/sd ext2 rw,errors=continue 0 0
/dev/block/vold/179:2 /data/app ext2 rw,errors=continue 0 0

Space looks like this
# busybox df -h
busybox df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 207.6M 12.0K 207.5M 0% /dev
tmpfs 4.0M 0 4.0M 0% /sqlite_stmt_journals
/dev/block/mtdblock1 160.0M 141.3M 18.7M 88% /system
/dev/block/mtdblock6 175.0M 55.8M 119.2M 32% /data
/dev/block/mtdblock5 94.8M 48.4M 46.3M 51% /cache
/dev/block/mtdblock5 94.8M 48.4M 46.3M 51% /data/dalvik-cache
/dev/block//vold/179:1
13.4G 6.8G 6.6G 51% /sdcard
/dev/block/vold/179:2
1.4G 339.2M 1.0G 24% /system/sd
/dev/block/vold/179:2
1.4G 339.2M 1.0G 24% /data/app

I now have a lot of space, cache is now on a NAND mount point and stable, and I have not had to move /data/app-private, or /data/data at all.

In an earlier guide the init-sd.sh has the following;
mount -t ext2 /dev/block/vold/179:2
in this one;
mount -t ext2 /dev/block/vold/179:2 /system/sd

I'm assuming that it's the later maybe because of the target directory but don't know enough to be sure.

There was an earlier post regarding /block//vold as apposed to /block/vold was this confirmed and if so should I change the earlier commands also to reflect the //?
 
// has worked for some people. I did not need to do that. Not surr where that other command came from. You need both arguments for the mount to work.

Sent from my S7
 
Thanks, I think the problem with my implementation of the guide is that somehow(let's assume human error) the ownership and group of both init-sd.sh & install-recovery.sh has become owner - system and group - sdcard_rw whilst all the others in /system/etc are root & root respectively.

I'm not well versed in chown or whether a system file can be changed. If it can would it be a matter of chown root:root xx-xx.sh?
 
Back
Top