[DEV]Link2SD working on X10i - XPERIA X10 Android Development

=================== GOOD NEWS ================
Thanks to GORO and Z we have a solution
tkymgr said:
Hi,
because link2sd rearranges install-recovery.sh
I made a patch for patch for using link2sd
for CM7-Z-MOD-002
for SE 2.3.3 sample
Z's work contributes to all.
Thanks for Z !!
Cheers,
tkymgr
Click to expand...
Click to collapse
Step by step guide
http://forum.xda-developers.com/showpost.php?p=16853029&postcount=39
thanks to waigsr
for those looking to see the technical aspects of it.
SE sample zip contains a vold replacement from cm7 which actually do the magic of making sure that first partition gets mounted.
Note : as Link2SD messes with install-recovery.sh its adviced that after flashing this zip port any specific tweak you have in install-recovery.sh over to install-recovery2.sh in the same folder.
and then run link2SD
Hope this helps.
-============== Keeping old study for later reference and memories only ==============
I have been messing around with Link2SD and its config here is a short writeup for those who want to help.
The basic problem
Link2SD looks for a partition no of /sdcard +1 partition
Android has a habbit of mounting the last partition as /sdcard
so link2sd is going to fail in all senses.
however if anything is mounting at /data/sdext2 Link2sd condsider it as a second partition
so we still have hope of using it however there are several limitations of it.
multiple ways in which link2sd could be used.
1) create 2 partitions on sdcard
a) ext2 partition as mmcblk0p1
b) vfat partition as mmcblk0p2
entry in install-recovery.sh
mount -t ext2 /dev/block/mmcblk0p1 /data/sdext2
Cons : xrecovery can't mount sdcard as its mmcblk0p1 that xrecovery mounts
2) create 2 vfat partitions
a) mmcblk0p1 mounting itself at /data/sdext2
b) mmcblk0p2 mounting itself as /sdcard
cons recovery related files will go in /data/sdext2
3) three partition layout
a) mmcblk0p1 -> reserverd for recovery related stuff
b) mmcblk0p2 -> link2sd
c) mmcblk0p3 -> SDCARD
or find an alternative to use mmcblk0p1 as /sdcard
or use a loop file as /data/sdext2
Do suggest what you all think and how should we proceed.

-=======reserved==========

and u sure this doesnt break recovery?
ok now that i read the post carefully i understand that it WILL BREAK recovery

DooMLoRD said:
and u sure this doesnt break recovery?
ok now that i read the post carefully i understand that it WILL BREAK recovery
Click to expand...
Click to collapse
cons highlighted to avoid confusion.
any idea how we can get this piece to work.

BTW why do we need it when we have app2sd ?
How's it better ?

anantshri said:
cons highlighted to avoid confusion.
any idea how we can get this piece to work.
Click to expand...
Click to collapse
keep only one FAT32 partition...
modify the recovery ramdisk to mount that partition to /sdcard

DooMLoRD said:
keep only one FAT32 partition...
modify the recovery ramdisk to mount that partition to /sdcard
Click to expand...
Click to collapse
that could be done
however there is one more issue which i found just now
SDCARD can't be mounted to PC till both partitions are umounted and that won't be done automatically so we need alternative for sdcard umounting also
something like a gscript code for umounting /data/sdext2 before attempting sdcard mount to pc

the new vold introduced in froyo causes this issue

Adolf1994 said:
the new vold introduced in froyo causes this issue
Click to expand...
Click to collapse
the default vold.fstab listing is
dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_sdcc.1/mmc_host/mmc0 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.4/mmc_host/mmc0 /devices/platform/msm_sdcc.4/mmc_host/mmc1
some stuff online suggests that i can specify a partition number manually.
however
Code:
dev_mount sdcard /mnt/sdcard [B]1[/B] /devices/platform/msm_sdcc.1/mmc_host/mmc0 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.4/mmc_host/mmc0 /devices/platform/msm_sdcc.4/mmc_host/mmc1
when i am trying this it barks out and not even mounts sdcard.

With the sdcard parted in 3 partitions, I tried to make the third partition recognized by my pc, and I tried an application named multimount sd or something like that and it worked for me. You can found it in the market. With it, the pc can recognize the third partition not the first. Maybe that will help in your project.
Sent from my X10i

i meant the vold binary/system, not the fstab config

Adolf1994 said:
i meant the vold binary/system, not the fstab config
Click to expand...
Click to collapse
can you point me to the correct code for this.

fat32 is first partition
ext2 is second partition
vold.fstab
dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_sdcc.1/mmc_host/mmc0 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.4/mmc_host/mmc1
this will mount fat32 partition
dev_mount ext2 /mnt/sdcard 1 or 2 /devices/platform/msm_sdcc.1/mmc_host/mmc0 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.4/mmc_host/mmc1
should mount ext2 for link2sd

the vold from 2.1 works well as you can see and if you'd have googled it, then you'd know there is a revised version of vold in 2.2+

How about instead bind mounting a folder on /system as /data/sdext2 did this for ages on 2.1 to get more space for apps without probs. Obviously /system has to be mounted rw which isn't a prob for me and at least on stock there's loads of free space there which is a shame to waste.
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
mount -o bind /system/app2 /data/sdext2
Think the folders need to be created first.

patch for using link2sd
Hi,
because link2sd rearranges install-recovery.sh
I made a patch for patch for using link2sd
for CM7-Z-MOD-002
for SE 2.3.3 sample
Z's work contributes to all.
Thanks for Z !!
Cheers,
tkymgr

aZuZu said:
fat32 is first partition
ext2 is second partition
vold.fstab
dev_mount sdcard /mnt/sdcard auto /devices/platform/msm_sdcc.1/mmc_host/mmc0 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.4/mmc_host/mmc1
this will mount fat32 partition
dev_mount ext2 /mnt/sdcard 1 or 2 /devices/platform/msm_sdcc.1/mmc_host/mmc0 /devices/platform/goldfish_mmc.0 /devices/platform/msm_sdcc.4/mmc_host/mmc1
should mount ext2 for link2sd
Click to expand...
Click to collapse
I also assumed something like this however android seems to be needing a last partition as vfat and that vfat is mounted as sdcard or nothing is mounted.
shaunbu said:
How about instead bind mounting a folder on /system as /data/sdext2 did this for ages on 2.1 to get more space for apps without probs. Obviously /system has to be mounted rw which isn't a prob for me and at least on stock there's loads of free space there which is a shame to waste.
Code:
mount -o remount,rw -t yaffs2 /dev/block/mtdblock2 /system
mount -o bind /system/app2 /data/sdext2
Think the folders need to be created first.
Click to expand...
Click to collapse
for you i recommand checking http://forum.xda-developers.com/showthread.php?t=1206149 and also system being rw all the time is not at all a good idea.
tkymgr said:
Hi,
because link2sd rearranges install-recovery.sh
I made a patch for patch for using link2sd
for CM7-Z-MOD-002
for SE 2.3.3 sample
Z's work contributes to all.
Thanks for Z !!
Cheers,
tkymgr
Click to expand...
Click to collapse
Thanks buddy will check it as soon as possible ...rightnow my sdcard is not mounting nomatter what setting i do thinking of flashing CM7 and will see how it goes from there.
Note : just checked the zip i think SE stock needed a relacement at vold. will just flash the vold and see if it works.

tkymgr said:
Hi,
because link2sd rearranges install-recovery.sh
I made a patch for patch for using link2sd
for CM7-Z-MOD-002
for SE 2.3.3 sample
Z's work contributes to all.
Thanks for Z !!
Cheers,
tkymgr
Click to expand...
Click to collapse
Thanks buddy. I can confirm the SE 2.3.3 sample zip worked. I flashed the zip, turned off my x10, partitioned the sd on my pc using fat32 & ext32, powered on and DID NOT get previous error of sd not recognized on startup. It mounted fat32 partition and link2sd recognized ext2 partition right away. Selected ext type, rebooted again and I've moved apps that I wanted to the sd card. Rebooted a couple more times and apps are still linked and running fine. Time will tell if any apps will have issues or any tweaks on this rom will be affected. Using WBs v3.9 custom GB and I'll report again later.
Again thank you to everyone's efforts and for not giving up on this old feature.
Edit: Forgot to mention I can still enter xrecovery manually and using the xperia reboot app.

tkymgr said:
Hi,
because link2sd rearranges install-recovery.sh
I made a patch for patch for using link2sd
for CM7-Z-MOD-002
for SE 2.3.3 sample
Z's work contributes to all.
Thanks for Z !!
Cheers,
tkymgr
Click to expand...
Click to collapse
confirmed working
Post updated with details......

Please, note, that everything you had previously added to install-recovery.sh, is now renamed into install-recovery.sh.ori. So, if you want it back, working, you need to rename/copy to install-recovery2.sh

Related

[Q] /emmc/ wont mount in CWM after encryption

CM10 recent install from CM9, which was Encrypted for work email.
Read that you can just format the partition and it will install new roms fine.
Within CM10 I can see /ExtSDCard/ and but /SDCard/ aka /emmc/ in CWM wont mount.
Going further down into CWM, emmc wont mount so it looks like it has installed the rom fine as it boots without a physical SD Card inserted? When trying to mount /emmc/ the log shows the following error "Failed to mount /dev/block.mmcblk0p11" which I assume is related.
I would like to mount and format the previously encrypted internal storage, so It could be used as /sdcard/ in CM10 so apps like Camera would work.
Thanks
Edit: Fixed English
Edit: Ok so I have worked out its /dev/block/mmcblk0p11 - cant format it ext4 then mount it using "mount -t ext4 /dev/block/mmcblk0p11 /emmc" but all the 'scheduled' tasks still think its vfat, so as a work around ill just format it as vfat.
This should be easy.... right?
busybox mkfs.vfat /dev/block/mmcblk0p11
Error:
mkfs.vfat: lseek: Value too large for defined data type
Ugh. Help me format this as vfat please
Fixed!:
Had to push a new version of busybox, which allowed vfat over 1gb.
Thanks me!

Native ext4 external sdcard mounting?

Hi,
I decided to my hole external card as ext4 format, without journal.
I see that the phone mounts it through fuse, and not directly like internal ext4 partitions.
Does anybody know why? And eventually how to mount it more cleanly...
Tks.
I think it depends on your kernel and modules available...
Sent from my GT-I9300 using Tapatalk 4
/proc/filesystems shows that ext4 is supported. As in fstab sdcard mount mode is set to auto, it should choose fuse only if necessary.
And by definition ext4 is present in all jelly bean kernels as it's default internal file system format.
Self answer...
http://source.android.com/devices/tech/storage/
It seems that android uses fuse for external (= secondary) storage regardless the filesystem. If I understood correctly.
I tried to change auto to ext4 in fstab but no effect, during boot it was restored to auto.
Edit: manually unmount /storage/sdcard1 and /mnt/fuse/sdcard1 then mounting vold block with ext4 argument works flawlessly.
Should write a little script in init.d to do that...
Better, to avoid manipulation as I flash nearly every day, script manager with:
#!/system/bin/sh
su
umount /storage/sdcard1
umount /mnt/fuse/sdcard1
mount -rw -t ext4 -o noatime,nosuid,nodev /dev/block/vold/179:17 /storage/sdcard1
I do all my remounts via script manager so it survives rom upgrades but sometimes also, init.d happens to soon and mounting doesn't work well. I remount my sd card with a 90 second delay using script manager
Before you ask, im not mounting it to change file system. Im changing permissions
One thing I'll point out though. Although will survive upgrade of rom usually, but if you change to different rom, vold may change from 179:17... 179 always same. Not :17 though
Sent from my GT-I9300 using Tapatalk 4
---------- Post added at 07:04 PM ---------- Previous post was at 06:58 PM ----------
Re the vold changing issue, I get around it like this....
#!/system/bin/sh
VOLD="$(mount | grep -E -o -m 1 ".{0,0}179:.{0,2}")"
su
umount /storage/sdcard1
umount /mnt/fuse/sdcard1
mount -rw -t ext4 -o noatime,nosuid,nodev /dev/block/vold/$VOLD /storage/sdcard1
Sent from my GT-I9300 using Tapatalk 4
Guys, how do you get around the problem that although ext4 external sdcard mounts fine and is usable through file managers, some programs just won't see it at all because it is no longer recognised as an external filesystem?
Have a try with programs like DiskUsage, Sygic GPS, Beyondpod Podcast manager and many more - they become unusable if the cars is not fat32 due to this reason, and it is true for either if it is mounter through fuse, or directly as ext4.

ext4 SD mount data not persistent across reboot

Hi,
Got this Desire Bravo with low internal memory so thought I should mount the app and data dirs to a ext4 partition on my SD card instead so I can install a lot of apps.
Followed this howto:
newton dot cx/~peter/2012/12/how-to-increase-app-space-with-a-partitioned-sd-card-on-an-htc-nexus-one-running-android-2-3-6-on-linux/
I found that my ext4 partition is mounted at boot time.
mount command gives the below:
/dev/block/mmcblk0p2 /mnt/sd-ext ext4 rw,nosuid,nodev,noatime,barrier=1,data=ordered 0 0
I can copy the data to the ext4 partition without any problem using "cp -rlp /data/app /mnt/sd-ext/data" and "cp -rlp /data/data /mnt/sd-ext/data" .
I can see the data when doing a "ls /mnt/sd-ext/" - looks ok.
But after reboot the data is just gone - just dont get it. Grateful for any help for troubleshooting this.
Running ROM CM10.1_VJ_4.2.2_V6.3_May24 .
Thanks...
EDIT: installed S2E app (Simple2Ext) instead, which didnt work well, so tried Mount2SD instead and appears to be working OK.

How to mount ext4 formatted MicroSD card on Android 6.0?

Hi
my phone is lg k10 android 6.0 and rooted
for me only mounted fat32
when I formatted ext4 microsdcard and insert on phone show message "can't use sd card. tap to set up for use"
when click this message my microsdcard formatted fat32.
How to mount ext4 formatted MicroSD card on Android 6.0?
Thanks
So you need ext4 for symlinking purposes eh?
Anyway , if your device supports ext4 , depends on vendor , you can try to mount it manually
Root is required.
In adb ,
Code:
-adb shell
-su
-df
- cat /proc/partitions
when you know the partition for your external sd ,
Code:
mount -o bind "path to partition" /storage/sdcard1
If this works , you want to add this as a script to run at boot or create a init.d script by your own and give it 0755 permission.
Cheers
-Edit
If it didnt work , try this , it may be a little complicated
https://forum.xda-developers.com/showthread.php?t=2424900
akash14darshan said:
So you need ext4 for symlinking purposes eh?
Anyway , if your device supports ext4 , depends on vendor , you can try to mount it manually
Root is required.
In adb ,
Code:
-adb shell
-su
-df
- cat /proc/partitions
when you know the partition for your external sd ,
Code:
mount -o bind "path to partition" /storage/sdcard1
If this works , you want to add this as a script to run at boot or create a init.d script by your own and give it 0755 permission.
Cheers
-Edit
If it didnt work , try this , it may be a little complicated
https://forum.xda-developers.com/showthread.php?t=2424900
Click to expand...
Click to collapse
I want use exfat because for big files size 4g
but not mount exfat
I want use format exfat Instead fat32
can I or must use custom rom?
123xdagsm said:
I want use exfat because for big files size 4g
but not mount exfat
I want use format exfat Instead fat32
can I or must use custom rom?
Click to expand...
Click to collapse
I need you to be particular with your wordings ..
Do you need ext4 sdcard to be mounted or exfat?
PS:
For File Size larger than 4gb , you can try NTFS , It is supported natively by my device.
Try formatting sdcard as NTFS and then insert into device.
If it shows any problem or doesnt mount , try this
Code:
-su
-ntfs-3g /dev/block/mmcblk1p1 /mnt/sdcard/external_sd
-vold
If this works , try making an init.d script with the above code , to mount sdcard everytime at boot
Cheers
akash14darshan said:
I need you to be particular with your wordings ..
Do you need ext4 sdcard to be mounted or exfat?
PS:
For File Size larger than 4gb , you can try NTFS , It is supported natively by my device.
Try formatting sdcard as NTFS and then insert into device.
If it shows any problem or doesnt mount , try this
Code:
-su
-ntfs-3g /dev/block/mmcblk1p1 /mnt/sdcard/external_sd
-vold
If this works , try making an init.d script with the above code , to mount sdcard everytime at boot
Cheers
Click to expand...
Click to collapse
It does not matter, I just want to support big size file 4g
I format ntfs but not work and type commands show error "
sush: ntfs-3g: not found"
I format ext4 too and test. command
# mount -o bind /dev/block/mmcblk1p1 /storage/sdcard1
and make director /storage/sdcard1 but show error"
mount: Not a directory"
123xdagsm said:
It does not matter, I just want to support big size file 4g
I format ntfs but not work and type commands show error "
sush: ntfs-3g: not found"
I format ext4 too and test. command
# mount -o bind /dev/block/mmcblk1p1 /storage/sdcard1
and make director /storage/sdcard1 but show error"
mount: Not a directory"
Click to expand...
Click to collapse
try this
Code:
-su
-cd /storage/
-mkdir sdcard1
-cd /
-mount -o bind /dev/block/mmcblk1p1 /storage/sdcard1
akash14darshan said:
try this
Code:
-su
-cd /storage/
-mkdir sdcard1
-cd /
-mount -o bind /dev/block/mmcblk1p1 /storage/sdcard1
Click to expand...
Click to collapse
not work show message again
"mount: Not a directory"
I use terminal for commands
I guess due to marshmallow's strict policies , you are not being able to mount NTFS,
I will suggest you to format card as ext4 using EaseUS Partition Manager and then insert sdcard in your device.
Ext4 is natively supported by linux and I dont think it should cause you problems.
Cheers , Pressing that Thanks button wont harm you
I don't know lg k10 android 6.0 not support formats exfat,ntfs,ext4 for micro sdcard.
Does anyone else have a comment to fix the problem?
akash14darshan said:
I guess due to marshmallow's strict policies , you are not being able to mount NTFS,
I will suggest you to format card as ext4 using EaseUS Partition Manager and then insert sdcard in your device.
Ext4 is natively supported by linux and I dont think it should cause you problems.
Cheers , Pressing that Thanks button wont harm you
Click to expand...
Click to collapse
Gonna try this.
akash14darshan said:
So you need ext4 for symlinking purposes eh?
Anyway , if your device supports ext4 , depends on vendor , you can try to mount it manually
Root is required.
In adb ,
Code:
-adb shell
-su
-df
- cat /proc/partitions
when you know the partition for your external sd ,
Code:
mount -o bind "path to partition" /storage/sdcard1
If this works , you want to add this as a script to run at boot or create a init.d script by your own and give it 0755 permission.
Cheers
-Edit
If it didnt work , try this , it may be a little complicated
https://forum.xda-developers.com/showthread.php?t=2424900
Click to expand...
Click to collapse
Would you tell me how to access the adb?
Cheers

Mount ext4 formatted external SDcard

Hi guys,
My Huawei MediaPad T2 7.0 Pro (PLE-701L) only allows FAT format for external SDcard. I looked at its kernel, and in fstab.qcom, I found this:
Code:
/devices/soc.0/7864900.sdhci/mmc_host /storage/sdcard1 vfat nosuid,nodev wait,voldmanaged=sdcard1:auto,noemulatedsd
and in /system/etc/vold.fstab,
Code:
dev_mount sdcard /storage/sdcard1 auto /devices/msm_sdcc.2/mmc_host
I changed vfat to ext4 in in fstab.qcom of kernel, and repacked boot.img to boot on the fly in bootloader. It booted but did not recognize ext4 formatted external SDcard just as usual.
Do I have any points that I missed? Hope someone will give me some insights... Thanks in advance.
Q

Categories

Resources