[DEV] SCRIPT MOD inte2ext swap - Transformer TF300T Android Development

I am a fresh owner Tf300.
It annoyed me that he sees Tf300 internal memory as sdcard
and as an external Micro SD card.
I searched and znalałem Script of SG3.
Modified it - it works.
But there is a problem.
Micro SD card is mounted as sdcard
but the internal (the old SDcard) will not mount)
Maybe someone can help
Because he wants to improve both were mounted partitions correctly
script base from galaxys3 http://forum.xda-developers.com/showthread.php?t=1772234
KOD:
#!/system/bin/sh
# Wait for the system to mount the internal media and remout it as r/o
# this should prevent the system from writing to it until we make the
# switch, yet keeps the /data/media r/w, so at the end it won't be r/o
for i in $(seq 1 1 3000)
do
if ( grep -c "/storage/sdcard0" /proc/mounts ); then
mount -o remount,ro /storage/sdcard0
break;
fi
usleep 100000
done
# now wait for the external media and remount
for i in $(seq 1 1 3000)
do
if ( grep -c "/Removable/MicroSD" /proc/mounts ); then
# create new temporary mount point
mount -o remount,rw /
mkdir /storage/tmpmnt
mount -o remount,ro /
# do the rebinding using the temporary mount point
mount -o bind /data/media /storage/tmpmnt
mount -o bind /Removable/MicroSD /storage/sdcard0
mount -o bind /Removable/MicroSD /data/media
umount /Removable/MicroSD
mount -o bind /storage/tmpmnt /storage/MicroSD
umount /storage/tmpmnt
# make bind for ums mode
mkdir -p /storage/MicroSD/sdcard1
touch /storage/MicroSD/.nomedia
mount -o bind /storage/sdcard0 /storage/extSdCard/external_sd/sdcard1
# done
break;
fi
usleep 100000
done
exit

I´m no developer but that´s a start. Hope someone helps.

arcance said:
I am a fresh owner Tf300.
It annoyed me that he sees Tf300 internal memory as sdcard
and as an external Micro SD card.
I searched and znalałem Script of SG3.
Modified it - it works.
Click to expand...
Click to collapse
Trochę Polskiego się tu wkradło
Please change word "znalazłem" to "found"

It works for me after I modified it and install the latest busybox v1.21.0. ( I'm using Energy ROM 4.1.1 btw). Let me know if this works for you.
Here's the script ( I also attach the flashable zip) :
#!/system/bin/sh
# Wait for the system to mount the internal media and remout it as r/o
# this should prevent the system from writing to it until we make the
# switch, yet keeps the /data/media r/w, so at the end it won't be r/o
for i in $(seq 1 1 3000)
do
if ( grep -c "/storage/sdcard0" /proc/mounts ); then
mount -o remount,ro /storage/sdcard0
break;
fi
usleep 100000
done
# now wait for the external media and remount
for i in $(seq 1 1 3000)
do
if ( grep -c "/Removable/MicroSD" /proc/mounts ); then
# create new temporary mount point
mount -o remount,rw /
mkdir /storage/tmpmnt
mount -o remount,ro /
# do the rebinding using the temporary mount point
mount -o bind /data/media /storage/tmpmnt
mount -o bind /Removable/MicroSD /storage/sdcard0
mount -o bind /Removable/MicroSD /data/media
umount /Removable/MicroSD
mount -o bind /storage/tmpmnt /Removable/MicroSD
umount /storage/tmpmnt
# make bind for ums mode
mkdir -p /Removable/MicroSD/EXTERNAL_SD
touch /Removable/MicroSD/ EXTERNAL_SD/.nomedia
mount -o bind /storage/sdcard0 /Removable/MicroSD/EXTERNAL_SD
# done
break;
fi
usleep 100000
done
exit

Odp: [DEV] SCRIPT MOD inte2ext swap
Ok trying thanx for help
Sent from my HTC Desire Z using xda app-developers app

One question. Will this script solve the I/O problem, as now the tablet will use my class10 sdcard as internal, or didn't I understand it well?

why not just edit the vold file
Sent From My Unlocked & Rooted 4.2.2 Android Powered []D [] []V[] []D TF300T

Works
I think good solution for people ho heve only 16gb internal and sdmicro 64gb or biger
Edit vold ithink no god solution and not be save
Regards
Sent from my ASUS Transformer Pad TF300T using xda app-developers app

arcance said:
Works
I think good solution for people ho heve only 16gb internal and sdmicro 64gb or biger
Edit vold ithink no god solution and not be save
Regards
Sent from my ASUS Transformer Pad TF300T using xda app-developers app
Click to expand...
Click to collapse
you can edit the vold file and accomplish the same results. you need to use a root explorer.I have done it on every device I own at one point.yes it saves.

Hi
Trying use modification
When try flesh i see error can't find tmpmnt
I don't have idea
Use 4.2 xcromi 4.7.0
And need more space for instal soft my tf300 have 16gb only.
Or sugestion how modyfication vold.
Reagarts
Sent from my ASUS Transformer Pad TF300T using xda app-developers app

Related

ext4 module 2.6.29 (enclair 2.1) without reflash (raw lag fix)

I compiled ext4 module to work with enclair 2.1 kernel 2.6.29, tested with XXJF5 stock firmware. Need root access, tune2fs and mke2fs static binary (e2fsprog-bin.tgz.zip)
mkdir -p /system/lib/modules/2.6.29/
#copy module.tar.gz in /system/lib/modules/2.6.29/
cd /system/lib/modules/2.6.29/
tar zxvf module.tar.gz
insmod /system/lib/modules/2.6.29/kernel/fs/jbd2/jbd2.ko
insmod /system/lib/modules/2.6.29/kernel/lib/crc16.ko
insmod /system/lib/modules/2.6.29/kernel/fs/ext4/ext4.ko
if=/dev/zero of=/sdcard/sd/filesystem.ext4 bs=1048576 count=2048
losetup /dev/block/loop1 /sdcard/sd/filesystem.ext4
mke2fs -t ex4 /dev/block/loop1
tune2fs -c 0 -i 0 -m 0 /dev/block/loop1
mkdir /sdcard/sddata
mount -t ext4 /dev/block/loop1 /sdcard/sddata
cp -rp /data/data /sdcard/sddata
cp -rp /data/system /sdcard/sddata
cp -rp /data/dalvik-cache /sdcard/sddata
cp -rp /data/app /sdcard/sddata
cp -rp /data/app-private /sdcard/sddata
mount -t ext4 -o bind /sdcard/sddata/data /data/data
mount -t ext4 -o bind /sdcard/sddata/system /data/system
mount -t ext4 -o bind /sdcard/sddata/dalvik-cache /data/dalvik-cache
mount -t ext4 -o bind /sdcard/sddata/app /data/app
mount -t ext4 -o bind /sdcard/sddata/app-private /data/app-private
run your quadrant test, i got 1793. enjoy.
ps: if you want make it permanent look at RyanZA playlogos1 trick. Also make sure your ext4 filesystem is available at boot time instead /sdcard/sddata
Note:
- due its nature ext4 keep data in RAM much more than ext3 before writing on disk, therefore if a powerloss happens before data got written this may results in lost of data. (see delayed allocation). On the other hand a temporary file wont be written to disk, but kept on RAM avoiding read/write cycles. Inode reservation can increase performance as well.
- barrier can be disabled but this may result in a corrupt journal
explain please
you may want to use ext4 without reflash, and at the same time keep your /data untouchable, just in case you need a recovery backup. eg: if /sdcard got corrupt, system will mount your original /data. (desynced)
I had to disable vold, and mv /etc/vold.conf /etc/vold.old, otherwise it coundnt find /sdcard/filesystem.ext4 so I mount it just before everything.
userinit.sh
--
/system/bin/mount -t vfat -o errors=remount-ro /dev/block/mmcblk1p1 /sdcard
insmod /system/lib/modules/2.6.29/kernel/fs/jbd2/jbd2.ko
insmod /system/lib/modules/2.6.29/kernel/lib/crc16.ko
insmod /system/lib/modules/2.6.29/kernel/fs/ext4/ext4.ko
/data/local/bin/losetup /dev/block/loop1 /sdcard/filesystem.ext4
/system/xbin/e2fsck -p /dev/block/loop1
/system/bin/mount -t ext4 /dev/block/loop1 /sdcard/sddata
/system/bin/mount -t ext4 -o bind /sdcard/sddata/data /data/data
/system/bin/mount -t ext4 -o bind /sdcard/sddata/system /data/system
/system/bin/mount -t ext4 -o bind /sdcard/sddata/dalvik-cache /data/dalvik-cache
/system/bin/mount -t ext4 -o bind /sdcard/sddata/app /data/app
/system/bin/mount -t ext4 -o bind /sdcard/sddata/app-private /data/app-private
--
mv /system/bin/playlogos1 /system/bin/playlogosnow
Do not forget to create /system/bin/playlogos1 as follow:
#!/system/bin/sh
sh /system/bin/userinit.sh
/system/bin/playlogosnow
I got 1858
this is just proof do not use on your device if you dont know what you doing. Since vold does not mount partition some application may not recognize /sdcard mounted that way.
id like to find a way to start vold before playlogos1 and resolve this issue, buts vold seems check argv[0] before start.
e2fsprogs recompiled as well ? In other words, will the e2fsprogs from cynogen work on ext4? These do use libs, btw.
I might build support for this into CFLagFix if I can freely use the files
yeah static bin.
husq510 said:
yeah static bin.
Click to expand...
Click to collapse
Just want to ask if it's ok to implament this in my lagfix zips
Ofc ill credit you
sure you can.
Thanks for the statically linked e2fsck
Nvm got it working on captivate also

[FIX] ext4 for JPM/JP6

Hi,
in case that anybody of you was using Mimocan fix (ext4 on the external SD), here I have attached libs for enabling ext4 on JP6/JPM (without modifying kernel).
I'm personally using ext4 partition on external SD, and loopback file on this partition formatted in ext2.
That way I'm getting 2000 in Quadrant, and the phone is working fast.
Here is my userinit:
Code:
insmod /data/local/fs_jpm/slow-work.ko
insmod /data/local/fs_jpm/jbd2.ko
insmod /data/local/fs_jpm/fscache.ko
insmod /data/local/fs_jpm/mbcache.ko
insmod /data/local/fs_jpm/ext4.ko
busybox mount -t ext4 -o noatime,nodiratime,errors=continue /dev/block/mmcblk1p2 /data/sdcard_ex2_mnt
busybox mknod /dev/loop0 b 7 0
busybox losetup /dev/loop0 /data/sdcard_ex2_mnt/linux.ex2
mount -t ext2 -o noatime,nodiratime,errors=continue /dev/loop0 /data/ext2data
busybox mount -o bind /data/ext2data/data /data/data;
busybox mount -o bind /data/ext2data/app /data/app;
busybox mount -o bind /data/ext2data/dalvik-cache /data/dalvik-cache;
P.S. Thanks for darkbyt3, for making slow_work module!
P.S. 2. Also in the archive is NILFS2 support for those who like experiments , and CIFS by darkbyt3.
thanks for the info.
linux noob question, but where does the userinit file live?
im used to editing scripts in /system/init.d but that was on a custom rom.
/system/bin/userinit.sh
kanemari said:
thanks for the info.
linux noob question, but where does the userinit file live?
im used to editing scripts in /system/init.d but that was on a custom rom.
Click to expand...
Click to collapse
Sorry for being even more of a noob, but can you tell me how to apply the mimocan fix for JPM/JP6 step by step please, I would love to be able to use it.
I have tried all the lag fixes and nothing comes close to what I had with the mimocan fix, even though you get better scores none of them were as smooth as mimocan fix.
Thanks a lot really appreciate the help.
milan2008 said:
Sorry for being even more of a noob, but can you tell me how to apply the mimocan fix for JPM/JP6 step by step please, I would love to be able to use it.
I have tried all the lag fixes and nothing comes close to what I had with the mimocan fix, even though you get better scores none of them were as smooth as mimocan fix.
Thanks a lot really appreciate the help.
Click to expand...
Click to collapse
Like u did i tried many lagfix, feel less lag with voodoo or mimocan compare others, but least lag with combo of voodoo or mimocan with minfree (autokiller preset aggressive). Give it a try...
Hi, sorry for the questions:
How i can do this fix?
Thanks
vitalij said:
Hi,
in case that anybody of you was using Mimocan fix (ext4 on the external SD), here I have attached libs for enabling ext4 on JP6/JPM (without modifying kernel).
I'm personally using ext4 partition on external SD, and loopback file on this partition formatted in ext2.
That way I'm getting 2000 in Quadrant, and the phone is working fast.
Here is my userinit:
Code:
insmod /data/local/fs_jpm/slow-work.ko
insmod /data/local/fs_jpm/jbd2.ko
insmod /data/local/fs_jpm/fscache.ko
insmod /data/local/fs_jpm/mbcache.ko
insmod /data/local/fs_jpm/ext4.ko
busybox mount -t ext4 -o noatime,nodiratime,errors=continue /dev/block/mmcblk1p2 /data/sdcard_ex2_mnt
busybox mknod /dev/loop0 b 7 0
busybox losetup /dev/loop0 /data/sdcard_ex2_mnt/linux.ex2
mount -t ext2 -o noatime,nodiratime,errors=continue /dev/loop0 /data/ext2data
busybox mount -o bind /data/ext2data/data /data/data;
busybox mount -o bind /data/ext2data/app /data/app;
busybox mount -o bind /data/ext2data/dalvik-cache /data/dalvik-cache;
P.S. Thanks for darkbyt3, for making slow_work module!
P.S. 2. Also in the archive is NILFS2 support for those who like experiments , and CIFS by darkbyt3.
Click to expand...
Click to collapse
Isn't there aversion without debug information? 3mb for a kernel module is huge
sztupy said:
Isn't there aversion without debug information? 3mb for a kernel module is huge
Click to expand...
Click to collapse
Maybe, the size is irrelevant for this kind of using these modules - anyway I copy them to /data where I have plenty of space.
Ext4 is working fine, however if used separately without loop device it doesn't produce speed increase, differently from eclair builds.
Sent from my GT-I9000 using XDA App
tanoxxx said:
Hi, sorry for the questions:
How i can do this fix?
Thanks
Click to expand...
Click to collapse
I did it manually, and it have lots of steps. Probably if you were not using mimocan's fix - this lagfix is not for you. You need to repartition sd card, format it, create loop device, and then manually copy data there.
milan2008 said:
Sorry for being even more of a noob, but can you tell me how to apply the mimocan fix for JPM/JP6 step by step please, I would love to be able to use it.
I have tried all the lag fixes and nothing comes close to what I had with the mimocan fix, even though you get better scores none of them were as smooth as mimocan fix.
Thanks a lot really appreciate the help.
Click to expand...
Click to collapse
Well It may contain errors, but I am doing like this:
1) Create second primary partition on the external SD card and make it EXT4 (easiest to do it in external card reader, using PARAGON or GPARTED). And format it of cause. Choose size, for example 1Gb
Remember that first primary partition must remain FAT32
2) Put the card back to phone.
3) You need root and terminal (adb or any terminal on phone)
4) copy modules from my first post to /data/local/fs_jpm/
5) run following commands:
Code:
insmod /data/local/fs_jpm/slow-work.ko
insmod /data/local/fs_jpm/jbd2.ko
insmod /data/local/fs_jpm/fscache.ko
insmod /data/local/fs_jpm/mbcache.ko
insmod /data/local/fs_jpm/ext4.ko
mkdir /data/sdcard_ex2_mnt
busybox mount -t ext4 -o noatime,nodiratime,errors=continue /dev/block/mmcblk1p2 /data/sdcard_ex2_mnt
busybox dd if=/dev/zero of=/data/sdcard_ex2_mnt/linux.ex2 bs=1024 count=800000
Change 800000 to any size of loopback file you want (here it is 800Mb)
Code:
busybox mknod /dev/loop0 b 7 0
busybox losetup /dev/loop0 /data/sdcard_ex2_mnt/linux.ex2
busybox mkfs.ext2 /dev/loop0
mkdir /data/ext2data/
mount -t ext2 -o noatime,nodiratime,errors=continue /dev/loop0 /data/ext2data
cp -rp /data/data /data/ext2data/
cp -rp /data/app /data/ext2data/
cp -rp /data/dalvik-cache /data/ext2data/
mv /system/bin/playlogos1 /system/bin/playlogosnow
copy files from attached system_bin.zip archive, to /system/bin.
Code:
busybox chmod +x /system/bin/userinit
busybox chmod +x /system/bin/playlogos1
then just reboot.
After reboot you can check that correct mounts are used with
Code:
mount
command.
wolfiett said:
/system/bin/userinit.sh
Click to expand...
Click to collapse
i put a script there but it doesnt work... and the script runs fine if i run it from the terminal prompt.
how can i check what the issue is?
vitalij said:
Well It may contain errors, but I am doing like this:
1) Create second primary partition on the external SD card and make it EXT4 (easiest to do it in external card reader, using PARAGON or GPARTED). And format it of cause. Choose size, for example 1Gb
Remember that first primary partition must remain FAT32
2) Put the card back to phone.
3) You need root and terminal (adb or any terminal on phone)
4) copy modules from my first post to /data/local/fs_jpm/
5) run following commands:
Code:
insmod /data/local/fs_jpm/slow-work.ko
insmod /data/local/fs_jpm/jbd2.ko
insmod /data/local/fs_jpm/fscache.ko
insmod /data/local/fs_jpm/mbcache.ko
insmod /data/local/fs_jpm/ext4.ko
mkdir /data/sdcard_ex2_mnt
busybox mount -t ext4 -o noatime,nodiratime,errors=continue /dev/block/mmcblk1p2 /data/sdcard_ex2_mnt
busybox dd if=/dev/zero of=/data/sdcard_ex2_mnt/linux.ex2 bs=1024 count=800000
Change 800000 to any size of loopback file you want (here it is 800Mb)
Code:
busybox mknod /dev/loop0 b 7 0
busybox losetup /dev/loop0 /data/sdcard_ex2_mnt/linux.ex2
busybox mkfs.ext2 /dev/loop0
mkdir /data/ext2data/
mount -t ext2 -o noatime,nodiratime,errors=continue /dev/loop0 /data/ext2data
cp -rp /data/data /data/ext2data/
cp -rp /data/app /data/ext2data/
cp -rp /data/dalvik-cache /data/ext2data/
mv /system/bin/playlogos1 /system/bin/playlogosnow
copy files from attached system_bin.zip archive, to /system/bin.
Code:
busybox chmod +x /system/bin/userinit
busybox chmod +x /system/bin/playlogos1
then just reboot.
After reboot you can check that correct mounts are used with
Code:
mount
command.
Click to expand...
Click to collapse
Thanks a lot, I am going to try it now.
Update: it keeps failing, I am getting `Failed (Operations not permitted)`. I don't know if anyone can help.
I tried it with Tayutama's latest rom.
milan2008 said:
Thanks a lot, I am going to try it now.
Update: it keeps failing, I am getting `Failed (Operations not permitted)`. I don't know if anyone can help.
I tried it with Tayutama's latest rom.
Click to expand...
Click to collapse
At which point are you getting the error? Maybe you /system partition is read-only? try
Code:
su
busybox mount -o remount,rw /system
Or you do not have a root
wolfiett said:
/system/bin/userinit.sh
Click to expand...
Click to collapse
Actually it should be
Code:
/system/bin/userinit

[Q] Need help to execute script to switch internal memory with 64GB card for Note 2

Hi,
I have a Samsung Galaxy Note 2 (SGH-T889). I found a script online which had instruction to execute with script manager (SManager). The file is called app2sdNote2.bin. When I run SManager and located the script, I select Su and Boot. When I select Run, SManager just hangs forever until I kill the process. The grant message never appears. I would like to run the script to use my 64 GB memory card as the default storage. Any help is greatly appreciated.
#!/system/bin/sh
#extsd2internalsd is a modification that allows to switch internal sd to external sd and viceversa. With this you can use default internal sd only for app storage #and the external sd to store all apps resource and all others stuff. The resut is a very big increase of installable apps on gs3
#All credits to Mattiadj of xda forum for the idea and script and to mike1986 for the cmw zip.
#xda thread url at
#Script Modified for U.S. Galaxy S3/Note 2 by Zedomax at GalaxyS3Root.com and GalaxyNote2Root.com to be compatible when sdcard is not inserted.
busybox mount -o remount,rw /
busybox mount -t vfat -o umask=0000 /dev/block/vold/179:17 /mnt/sdcard
busybox mount -t exfat -o umask=0000 /dev/block/vold/179:17 /mnt/sdcard
if busybox mount | busybox grep vold/179:17; then
busybox mount -o bind /data/media /mnt/extSdCard
fi
comicrage said:
Hi,
I have a Samsung Galaxy Note 2 (SGH-T889). I found a script online which had instruction to execute with script manager (SManager). The file is called app2sdNote2.bin. When I run SManager and located the script, I select Su and Boot. When I select Run, SManager just hangs forever until I kill the process. The grant message never appears. I would like to run the script to use my 64 GB memory card as the default storage. Any help is greatly appreciated.
#!/system/bin/sh
#extsd2internalsd is a modification that allows to switch internal sd to external sd and viceversa. With this you can use default internal sd only for app storage #and the external sd to store all apps resource and all others stuff. The resut is a very big increase of installable apps on gs3
#All credits to Mattiadj of xda forum for the idea and script and to mike1986 for the cmw zip.
#xda thread url at
#Script Modified for U.S. Galaxy S3/Note 2 by Zedomax at GalaxyS3Root.com and GalaxyNote2Root.com to be compatible when sdcard is not inserted.
busybox mount -o remount,rw /
busybox mount -t vfat -o umask=0000 /dev/block/vold/179:17 /mnt/sdcard
busybox mount -t exfat -o umask=0000 /dev/block/vold/179:17 /mnt/sdcard
if busybox mount | busybox grep vold/179:17; then
busybox mount -o bind /data/media /mnt/extSdCard
fi
Click to expand...
Click to collapse
Wrong device thread.
comicrage said:
Hi,
I have a Samsung Galaxy Note 2 (SGH-T889). I found a script online which had instruction to execute with script manager (SManager). The file is called app2sdNote2.bin. When I run SManager and located the script, I select Su and Boot. When I select Run, SManager just hangs forever until I kill the process. The grant message never appears. I would like to run the script to use my 64 GB memory card as the default storage. Any help is greatly appreciated.
#!/system/bin/sh
#extsd2internalsd is a modification that allows to switch internal sd to external sd and viceversa. With this you can use default internal sd only for app storage #and the external sd to store all apps resource and all others stuff. The resut is a very big increase of installable apps on gs3
#All credits to Mattiadj of xda forum for the idea and script and to mike1986 for the cmw zip.
#xda thread url at
#Script Modified for U.S. Galaxy S3/Note 2 by Zedomax at GalaxyS3Root.com and GalaxyNote2Root.com to be compatible when sdcard is not inserted.
busybox mount -o remount,rw /
busybox mount -t vfat -o umask=0000 /dev/block/vold/179:17 /mnt/sdcard
busybox mount -t exfat -o umask=0000 /dev/block/vold/179:17 /mnt/sdcard
if busybox mount | busybox grep vold/179:17; then
busybox mount -o bind /data/media /mnt/extSdCard
fi
Click to expand...
Click to collapse
Script doesn't work on s4. Tried all the known scripts and so far none work.
Sent from my SGH-M919 using Tapatalk 2

[GUIDE] Make Link2SD use a disk image instead of a second ext2 partition

Was using Link2SD to move apps to the second partition of a micro SD card for the usual reasons... Then did -something- that broke the micro SD card slot. Now what to do?
Possible solutions:
Is it possible to repartition the internal NAND? -- Wouldn't that involve unpacking and repacking the kernel image? Better not... Although it was an inexpensive tablet, it would be an expensive brick.
Is it possible to bind-mount a directory on the "internal SD" for use with Link2SD? -- Would that even work with vfat? (Permissions and stuff...)
What about replacing the ext2 SD-card partition with a disk image
Materials:
Android tablet. (Broken SD card slot optional.)
Root with busybox installed.
Link2SD installed and configured -- This has to be done prior to breaking the SD card slot. Link2SD's startup scripts are needed, which it may not create without a "properly" formatted and installed SD card.
Computer with Linux installed OR a Linux Live DVD -- To create the disk image and transfer the contents from the physical SD card to the image file. I used Ubuntu.
USB transfer cable (optional) -- To transfer the disk image from the computer to the tablet. Also to execute terminal commands on the tablet. Possible to do over a network, but the cable can be faster and more convenient.
Do not try this unless you are fully prepared to brick your device.​
Method:
Create the disk image on the computer:
Code:
qemu-img create -f raw link2sd-disk.img 3G
Format the disk image to ext2:
Code:
mkfs.ext2 link2sd-disk.img
Mount the disk image to a newly created directory:
Code:
mkdir /tmp/link2sd-disk
sudo mount -o loop link2sd-disk.img /tmp/link2sd-disk
Mount the original SD card with the second ext2 partition.
Copy the contents of the sd card to the disk image. Use rsync to keep file permissions and other metadata. The trailing "/" on the directory names is important.
Code:
sudo -s
rsync --archive --hard-links /media/path-to-sd-card/ /tmp/link2sd-disk/
Unmount the sd card and disk image.
Code:
sudo umount /tmp/link2sd-disk
Transfer the disk image to your tablet.
Code:
adb push link2sd-disk.img /mnt/sdcard/link2sd-disk.img
Edit /system/bin/debuggerd on the tablet:
Code:
adb pull /system/bin/debuggerd
Edit debuggerd with your favorite text editor. Pay careful attention to the actual identity of the internal sd card as used on your tablet (/dev/block/mtdblock9). Notice that "busybox mount" is used. The normal mount command does not support the necessary options.
Code:
#!/system/bin/sh
#added by link2sd
LOG=/data/link2sd-debuggerd.log
ls -la /dev/block/ 1>>$LOG 2>>$LOG
echo 1>>$LOG 2>>$LOG
echo "$(date) mounting..." > $LOG
busybox mount -t vfat -o rw,relatime,uid=1000,gid=1015,fmask=0002,dmask=0002,shortname=mixed,errors=remount-ro /dev/block/mtdblock9 /mnt/sdcard 1>>$LOG 2>>$LOG
busybox mount -t ext2 -o loop,rw /mnt/sdcard/link2sd.img /data/sdext2 1>>$LOG 2>>$LOG
echo 1>>$LOG 2>>$LOG
mount >> $LOG
echo 1>>$LOG 2>>$LOG
echo debuggerd.bin launched >> $LOG
exec /system/bin/debuggerd.bin
Backup the original file and transfer the new file and set permissions.
Code:
adb shell mv /system/bin/debuggerd /system/bin/debuggerd.001
adb push debuggerd /system/bin/debuggerd
adb shell chmod 755 /system/bin/debuggerd
All done. Reboot. :fingers-crossed:
Hope the above is useful or enlightening. Let me know if I need to explain anything in greater detail.
I've tested this on HTC One X and it does not work. After mounting sdcard and my image using these commands:
Code:
busybox mount -t vfat -o rw,relatime,uid=1000,gid=1015,fmask=0002,dmask=0002,shortname=mixed,errors=remount-ro dev/block/vold/179:14 /mnt/sdcard 1>>$LOG 2>>$LOG
busybox mount -t ext2 -o loop,rw /mnt/sdcard/link2sd.img /data/sdext2 1>>$LOG 2>>$LOG
I have access to the image file from /data/sdext2 but my sdcard is not visible in the system (but it is mounted in the /mnt/sdcard). Does anyone know how to mount .img during boot? Binding to debuggerd seems to be not the best option. :S
EDIT BELOW:
I've found a solution to this issue:
1. create 03mountsd file
2. put it in the /etc/init.d/ directory (for example, using adb)
3. reboot
03mountsd contents:
Code:
#!/system/bin/sh
#added by link2sd
LOG=/data/mountsd.log
COUNTER=60
ls -la /dev/block/ 1>>$LOG 2>>$LOG
echo 1>>$LOG 2>>$LOG
echo "$(date) mounting..." > $LOG
while [[ $COUNTER -gt 0 && ! -f /storage/sdcard0/app.img ]]; do
COUNTER=$(($COUNTER-1))
sleep 1
done
echo "=> COUNTER = $COUNTER" > $LOG
# busybox mount -t vfat -o rw,relatime,uid=1000,gid=1015,fmask=0002,dmask=0002,shortname=mixed,errors=remount-ro /dev/block/vold/179:14 /mnt/.sd 1>>$LOG 2>>$LOG
busybox mount -t ext4 -o loop,rw /storage/sdcard0/app.img /data/sdext2 1>>$LOG 2>>$LOG
echo 1>>$LOG 2>>$LOG
mount >> $LOG
echo 1>>$LOG 2>>$LOG
EDIT: still not working: applications moved using link2sd and this method are not visible for android. :/

[Q] Internal/External Memory Swap

So, I have a Sprint Galaxy S3 Running Cyanogenmod 10.2.1, and I'd like to trick it into thinking my 64GB SdCard is the Internal Memory.
So far, by using Script Manager, and this Code:
busybox mount -o remount,rw /
busybox mount -t vfat -o umask=0000 /dev/block/vold/179:33 /mnt/shell/emulated/0
busybox mount -t exfat -o umask=0000 /dev/block/vold/179:33 /mnt/shell/emulated/0
if busybox mount | busybox grep vold/179:33; then
busybox mount -o bind /data/media /mnt/sdcard1
fi
I put it here: /system/etc/init.d
And tested it here: /data/
Running this makes all my apps stop working, and after a minute can no longer access the settings even.
When I plug it into a computer however, it is reading my Internal storage as the 64GB Card.
Any help is Appreciated!
This is some code I found and edited, so I'm not entirely sure of the Mechanics behind it.
Here are the Credits:
#!/system/bin/sh
#extsd2internalsd is a modification that allows to switch internal sd to external sd and viceversa.
#With this you can use default internal sd only for app storage
#and the external sd to store all apps resource and all others stuff. The resut is a very big increase of installable apps on gs3
#All credits to Mattiadj of xda forum for the idea and script and to mike1986 for the cmw zip.
#xda thread url at
#Script Modified for U.S. Galaxy S3s by Zedomax at GalaxyS3Root.com to be compatible when sdcard is not inserted.

Categories

Resources