• Announcements

    • Reminder - MoDaCo position on illegal content   07/30/15

      ILLEGAL CONTENT I'd like to just reaffirm MoDaCo's position regarding piracy and illegal content in the light of some recent questions / postings. Posts will be censored by myself or my moderation team if the contain or link to: Illegal / pirated / cracked software or sites that host such softwareNintendo emulators / ROMs or sites hosting them (in light of Nintendo's legal stance)CUSTOM ROMS You may discuss and post links to custom device ROMs on MoDaCo, provided the following rules are adhered to: ROMs must not contain any illegal 3rd party software (this includes trial versions included without permission)ROMs must give full credit to the original authorISSUES If you have any issues with this policy, please contact PaulOBrien directly via PM.
    • Reminder: Selling items on the forum directly is not allowed   07/30/15

      Please note that selling items on the forum directly is not allowed by the forum rules. There is a forum for eBay auctions whereby you can list the items on eBay and link to them there. This is the ONLY forum for this type of activity. You may also advertise links to the eBay forum in your signature. Please note that selling directly in contravention of these rules will result in a warning / suspension / ban.

USING LINK2SD TO USE INTERNAL SD AS EXTSD.

45 posts in this topic

Posted (edited) · Report post

USING LINK2SD TO USE INTERNAL SD AS EXTSD.

I'm not a developer (THANKS TO BACKSIDE http://www.modaco.co...le-s2e-in-g300/ that gave me the clue) so I need some help to improve some things and test in other ROM's.

This was tested in GB stock ROM and ICS Stock too, so please test it in other ROM's to know if it works or it has to be done in other way (I think Link2 SD script is placed in init.d folder in ROM's that supports it).

This is just a simple guide to use the 2Gigas internal memory as EXT-SD so we can use the Link2sd program to move apps, davilk cache and libs to this space than normally is not used when we have the external SD card. This is similar to S2ext, but I like more the options that Link2sd gives us and the fact that it works on every ROM directly and works with FAT32.

First of all we need an SD, and we have to create 2 primary partition, the both of them must be FAT32. You can use Minitool Partition Wizard to make this, or Gpated in Linux

Now we will put this partitioned SD card in the phone and install Link2sd apk. Once we run Link2sd, the program will ask us to select the filesystem of the second partition on SD, just chose the one you used. Once the script is created by the program we will restart the phone.

Now using RootExplorer we will edit the file /system/etc/install-recovery.sh.

#!/system/bin/sh

#added by link2sd

LOG=/data/link2sd-install-recovery.log

echo "$(date) mounting..." > $LOG

mount -t vfat -o rw /dev/block/vold/179:34 /data/sdext2 1>>$LOG 2>>$LOG

mount -t vfat -o rw /dev/block/mmcblk1p2 /data/sdext2 1>>$LOG 2>>$LOG

mount >> $LOG

echo "$(date) mount finished" >> $LOG

And we will edit in this way (notice /dev/block/mmcblk1p2 is now /dev/block/mmcblk0p19)

#!/system/bin/sh

#added by link2sd

LOG=/data/link2sd-install-recovery.log

echo "$(date) mounting..." > $LOG

mount -t vfat -o rw /dev/block/mmcblk0p19 /data/sdext2 1>>$LOG 2>>$LOG

mount >> $LOG

echo "$(date) mount finished" >> $LOG

Now we will turn off the phone and we will change the partitioned SD card by one is not (our usual SD card) and restart the phone and is done. Open Link2SD and you will see that now you have a 2Gigas 2º partition that is mounted in /data/sdext2. Now use Link2SD normally to move all the data you want to this new partition.

Is not really needed to make the external SD to create the Link2sd script, you can paste the modificated install-recovery.sh file directly in /system/etc, and fix permissions and change woners (RWE-R E-R E, Owner ROOT and Group ROOT). Then you have to create manually the /data/sdext2 directory and restart the phone. The just run Link2SD.

I thouhg it would be a problem when you plug the phone to the PC and turn on USB Storage, because once the internal memory was mounted the linked apps will stop running, but is not.. Link2SD an the system still can access the files through /data/sdext2 at the same time that PC (Stock File Manager or the other file manger using /HWUserData folder can't do it). I linked Android Weather app and put its widget on the desktop, and even the internal memory was mounted, it still worked.

CWM Recovey an TW recovery (if selected), will include the internal memory (/datadata) in their backups and restores, so you don´t have to install or restore the linked apps manually.

Tested on GB (B892), ICS (B927) and INFUSION B927*

*Thanks to wso277.

Please let me now if this works in other ROMs.

Regards.

Edited by elperroderoke
2

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

There is actually no need to repartition the internal SD to use it with link2sd., See http://www.modaco.co...ncrease-memory/

(towards the end). CWM will backup and recover the unchanged partiition. You should be careful about mounting the drive on a PC though and what apps you have on the SD.

Edited by Hogweed
0

Share this post


Link to post
Share on other sites

Posted · Report post

I'm not telling to repartition the internal SD. You can chose if you want Fat32 or Ext4.

Fat32 has the problem that the internal Sd will be mounted and app linked will be stoped, but the Cwm backup will included and restore this partition.

Ext4 won't be mounted but Cwm won't backup or restore because it will try to mount it as Fat.

Regards.

0

Share this post


Link to post
Share on other sites

Posted · Report post

As TeamWin recovery allows you to choose which partitions to backup & restore does it work with this method?

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Ah, I see. I thought you re-partitioned the internal card but, looking again, what you did was repartition the external card to get the scripts then edited it. I just created one script to perform the bind and didn't run link2sd on a real external card first so it never created its own.

Edited by Hogweed
0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Ah, I see. I thought you re-partitioned the internal card but, looking again, what you did was repartition the external card to get the scripts then edited it. I just created one script to perform the bind and didn't run link2sd on a real external card first so it never created its own.

I don't know if is needed or not that link2sd creates de script, maybe once you have link2sd installed, put the edited script in the right place, so maybe is not needed using the partitioned external sd to create it and then edit.

I will try.

Regards.

Edited by elperroderoke
0

Share this post


Link to post
Share on other sites

Posted · Report post

Hi elperroderoke, could you please check EXT4 part again? I think you forget actually change blk1p2 for blk0p19 ....

if not sorry for alert

0

Share this post


Link to post
Share on other sites

Posted · Report post

I don't know if is needed or not that link2sd creates de script, maybe once you have link2sd installed, put the edited script in the right place, so maybe is not needed using the partitioned external sd to create it and then edit.

I will try.

Regards.

It did not work. The script must be created by Link2sd, not just paste.

Regards.

0

Share this post


Link to post
Share on other sites

Posted · Report post

Hi elperroderoke, could you please check EXT4 part again? I think you forget actually change blk1p2 for blk0p19 ....

if not sorry for alert

You were right, thank you.

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

It did not work. The script must be created by Link2sd, not just paste.

Regards.

All i did was mkdir the sdext2 in /data (it hadn't previously been created as I had never used link2sd in normal mode) and added /etc/init.d/11link2sd containing

#!/system/bin/sh

/system/xbin/busybox mount -o bind /HWUserData /data/sdext2

=========

And it worked. I have about 50 apps on it now.

Edited by Hogweed
0

Share this post


Link to post
Share on other sites

Posted · Report post

Thank you. Now it worket. All I had to do was create the /data/sdext2 folder manually, and Link2sd worked. So no needed to use the external Sd to "trick". Just put the edited install-recovery.sh in /system/etc.

I don't know, but I read init.d is not supported in stock Rom, at least directly.

Regards.

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Yes no init.d in pure unmodified stock. I am running Paul's Modaco Gr2 which includes init.d support.

Edited by Hogweed
0

Share this post


Link to post
Share on other sites

Posted · Report post

As TeamWin recovery allows you to choose which partitions to backup & restore does it work with this method?

Could you please give me some link about this recovery.

Regards.

0

Share this post


Link to post
Share on other sites

Posted · Report post

Could you please give me some link about this recovery.

Regards.

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

All i did was mkdir the sdext2 in /data (it hadn't previously been created as I had never used link2sd in normal mode) and added /etc/init.d/11link2sd containing

#!/system/bin/sh

/system/xbin/busybox mount -o bind /HWUserData /data/sdext2

=========

And it worked. I have about 50 apps on it now.

I'm goinf to try this, but when i tried it before (using the other thread) it gave me an error trying to mount. I didnt include the part about busybox.

EDIT: When i run the script with smanager i get a mounting error no such file or directory. I already created sdext2 in data. Using infusion rom.

Edited by wso277
0

Share this post


Link to post
Share on other sites

Posted · Report post

The internal partitioning is different on ICS as I understand it. I'm happy with GB right now so I can't check what the internal drive is mounted as in ICS if it is not /HWUserData

0

Share this post


Link to post
Share on other sites

Posted · Report post

The internal partitioning is different on ICS as I understand it. I'm happy with GB right now so I can't check what the internal drive is mounted as in ICS if it is not /HWUserData

So if i find where the internal card is mounted e just need to change the first directory?

0

Share this post


Link to post
Share on other sites

Posted · Report post

Hopefully :-)

0

Share this post


Link to post
Share on other sites

Posted · Report post

Just found the directory: /mnt/sdcard2

It seems to be working but whenever i link an app that app stops working. Gets back to normal if i remove the link.

0

Share this post


Link to post
Share on other sites

Posted (edited) · Report post

Just found the directory: /mnt/sdcard2

It seems to be working but whenever i link an app that app stops working. Gets back to normal if i remove the link.

You need the script to run at boot - Did you put the script in etc/init.d then reboot? If so then maybe another ICS difference

Edited by Hogweed
0

Share this post


Link to post
Share on other sites

Posted · Report post

You need the script to run at boot - Did you put the script in etc/init.d then reboot? If so then maybe another ICS difference

Yes, i set it to run at boot and gave it root permissions. Link2sd shows the mounted card with 2gb and creates the link, but the app i link gives an error at start.

0

Share this post


Link to post
Share on other sites

Posted · Report post

The reason I specifically say init.d is that I first used ROM Toolbox option to run script at boot. After boot everything was mounted correctly but the apps didn't work. Once I put the script in init.d it worked. ROM Toolbox script manager ran it too late in the boot sequence. You mentioned smanager earlier which is why I am checking.

0

Share this post


Link to post
Share on other sites

Posted · Report post

I have it in init.d but i set it to run at boot inside smanager. If delete de run at boot in smanager will it run anyway?

0

Share this post


Link to post
Share on other sites

Posted · Report post

Infusion has native init.d support so yes it should. Must have execute permission set of course.

0

Share this post


Link to post
Share on other sites

Posted · Report post

Uninstalled smanager and gave it permission to to execute but now the internal card doesn get mounted.

thanks for your help

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

MoDaCo is part of the MoDaCo.network, © Paul O'Brien 2002-2015. MoDaCo uses IntelliTxt technology.