Jump to content


Photo

USING LINK2SD TO USE INTERNAL SD AS EXTSD.

- - - - -

  • Please log in to reply
44 replies to this topic

#1
elperroderoke

elperroderoke

    Regular

  • Members
  • PipPip
  • 113 posts
  • Devices:Defy+; U8650; U8815
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, 06 August 2012 - 06:42 PM.

  • 2

#2
Hogweed

Hogweed

    Diehard

  • Members
  • PipPipPipPip
  • 392 posts
  • Devices:Huawei Ascend G300
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, 03 August 2012 - 02:51 PM.

  • 0

#3
elperroderoke

elperroderoke

    Regular

  • Members
  • PipPip
  • 113 posts
  • Devices:Defy+; U8650; U8815
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

#4
Cyda

Cyda

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,448 posts
  • Gender:Male
  • Location:Wales
  • Devices:Nexus 4 & 7 running PAC
As TeamWin recovery allows you to choose which partitions to backup & restore does it work with this method?

  • 0

#5
Hogweed

Hogweed

    Diehard

  • Members
  • PipPipPipPip
  • 392 posts
  • Devices:Huawei Ascend G300
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, 03 August 2012 - 03:40 PM.

  • 0

#6
elperroderoke

elperroderoke

    Regular

  • Members
  • PipPip
  • 113 posts
  • Devices:Defy+; U8650; U8815

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, 03 August 2012 - 03:59 PM.

  • 0

#7
p4l1n0

p4l1n0

    Newbie

  • Members
  • Pip
  • 2 posts
  • Devices:G300
Hi elperroderoke, could you please check EXT4 part again? I think you forget actually change blk1p2 for blk0p19 ....

if not sorry for alert

  • 0

#8
elperroderoke

elperroderoke

    Regular

  • Members
  • PipPip
  • 113 posts
  • Devices:Defy+; U8650; U8815

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

#9
elperroderoke

elperroderoke

    Regular

  • Members
  • PipPip
  • 113 posts
  • Devices:Defy+; U8650; U8815

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

#10
Hogweed

Hogweed

    Diehard

  • Members
  • PipPipPipPip
  • 392 posts
  • Devices:Huawei Ascend G300

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, 03 August 2012 - 04:31 PM.

  • 0

#11
elperroderoke

elperroderoke

    Regular

  • Members
  • PipPip
  • 113 posts
  • Devices:Defy+; U8650; U8815
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

#12
Hogweed

Hogweed

    Diehard

  • Members
  • PipPipPipPip
  • 392 posts
  • Devices:Huawei Ascend G300
Yes no init.d in pure unmodified stock. I am running Paul's Modaco Gr2 which includes init.d support.

Edited by Hogweed, 03 August 2012 - 04:55 PM.

  • 0

#13
elperroderoke

elperroderoke

    Regular

  • Members
  • PipPip
  • 113 posts
  • Devices:Defy+; U8650; U8815

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

#14
Cyda

Cyda

    Hardcore

  • Members
  • PipPipPipPipPipPip
  • 1,448 posts
  • Gender:Male
  • Location:Wales
  • Devices:Nexus 4 & 7 running PAC

Could you please give me some link about this recovery.
Regards.

http://www.modaco.com/topic/353879-team-win-recovery-for-huawei-u8815ascend-g-300/#entry1946935

  • 0

#15
wso277

wso277

    Enthusiast

  • Members
  • PipPipPip
  • 156 posts
  • Devices:Ideos x3, ascend g300

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, 03 August 2012 - 05:50 PM.

  • 0

#16
Hogweed

Hogweed

    Diehard

  • Members
  • PipPipPipPip
  • 392 posts
  • Devices:Huawei Ascend G300
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

#17
wso277

wso277

    Enthusiast

  • Members
  • PipPipPip
  • 156 posts
  • Devices:Ideos x3, ascend g300

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

#18
Hogweed

Hogweed

    Diehard

  • Members
  • PipPipPipPip
  • 392 posts
  • Devices:Huawei Ascend G300
Hopefully :-)

  • 0

#19
wso277

wso277

    Enthusiast

  • Members
  • PipPipPip
  • 156 posts
  • Devices:Ideos x3, ascend g300
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

#20
Hogweed

Hogweed

    Diehard

  • Members
  • PipPipPipPip
  • 392 posts
  • Devices:Huawei Ascend G300

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, 03 August 2012 - 06:33 PM.

  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users