ext4 SD mount data not persistent across reboot - Android Q&A, Help & Troubleshooting

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.

Related

[DEV]Link2SD working on X10i

=================== 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

Change streak's innersd to 3 partitions,without disassembling phone,keep old data

Remember to fully backup your system first
do 1 -4 after streakmod 0.3.2.8
do 5 with newest mke2fs、e2fsck、busybox (or from the Attach Files )
1.mount data、sdcard
mkdir /datas
mount -t ext3 /dev/block/innersd0p6 /datas
mount -t vfat /dev/block/mmcblk1p1 /sdcard
2.backup
mkdir /sdcard/LOST.DIR/
tar -cpf /sdcard/LOST.DIR/data.tar /datas
3.del old partition ,add new partitions
umount /cache
umount /datas
fdisk /dev/block/innersd0
d
6
n
l
+1G
n
l
t
7
b
w
4.format new partitions
mke2fs -F -j -b4096 -m0 /dev/block/innersd0p6
e2fsck -yf /dev/block/innersd0p6
busybox mkfs.vfat /dev/block/innersd0p7
5.restore
mount -t ext3 /dev/block/innersd0p6 /datas
rm -r datas
tar -xpf /sdcard/LOST.DIR/data.tar
6.use new added partition
mkdir /sdcard/usbdisk
mount -t vfat /dev/block/innersd0p7 /sdcard/usbdisk
Remember to fully backup your system first
video
http://player.youku.com/player.php/sid/XMzQ4NjY2Mzg0/v.swf
the Attach Files can change partitions automaticly
View attachment 2to3.zip could add new partition
View attachment 3to2.zip could change it back to 2 partitions
View attachment 3to3.zip is used to change the partition size
(change “+1G” in part.sh of the zip packages )
View attachment AutoMount.zip could mount the new partition after boot
in DSC 0.71, it will be mounted to /mnt/usbdisk ,the real u-disk will be mounted to /sdcard/usbdisk
in other systems,it will be mounted to /sdcard/usbdisk ,then you cann't umount your sdcard before umount /sdcard/usbdisk
After added new partition , you must not do Factory Restart or fastboot userdata.img , otherwise it will change the partitions back
so when you have flashed a new ROM or if you want to do factory restart ,you may need to fastboot my View attachment userdata.zip the other way is to do "wipe data /factory reset" and "selective restore View attachment firstboot.zip" by StreakMod 0.3.2.8
full restore by SreakMod is safe,it won't change partitions
Remember to fully backup your system first
What is the advantage of this? Also, there appears to be some formatting problem with your post, with some lines of single letters. Makes it really confusing looking.
lordmorphous said:
What is the advantage of this? Also, there appears to be some formatting problem with your post, with some lines of single letters. Makes it really confusing looking.
Click to expand...
Click to collapse
Those are likely the commands to use fdisk itself. It's basically "what to press" so you could literally do it blind.
The innerSD is sometimes large enough to forgo using the outerSD completely, esp if you have a larger innerSD.
Given it's age, the S5 has an absolutely huge /data partition, it's nearly 2gb when comparable devices are 1gb tops (such as the venue)
Have you considered making your new partition and naming it /sdcard instead?
The correct way on HC and newer is to make /data/media a symlink to /sdcard and use MTP to mount it. The actual sdcard becomes /sdcard2
The S5 kernels do not support mtp so you cant do this.
But what if you took that new partition you made? innersd0p7 becomes /sdcard and the actual sdcard becomes /sdcard2. Then you could also use your partition for apps that refuse to work without an sdcard present (like titanium backup) Still you wouldnt be able to mount it.
The GNote does /sdcard/sdcard2 or something as a hack to support both without MTP, but it's hack and ultimately different from the standardized sdcard/sdcard2 in newer android.
ALso if you're repartitioning the innerSD, not only is a backup a good idea, but it's recommeneded to have access to the card itself. If for some reason the repartition goes wrong you might end up not being able to boot. Reformatting the sdcard externally will fix it.
OK, at first glance this line
fdisk /dev/block/innersd0
d
6
n
l
looked like it should have been fdisk /dev/block/innersd0p6
Like I said, first glance. Guess that is what I get for replying to posts this late at night....time for bed.

[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!

[Q] Link2SD:2nd partition shown but still not working

I tried to install Link2SD in Micromax A58 as the internal storage is very low and need to install some more apps. Already rooted and installed Link2SD to use the ext4 2nd partition of my 8 GB SD card. After trying with all possible ways, couldn't get it worked. All the time it was showing error--
"Mount Script can not be created. Mount: No such file or directory"
Previously even the 2nd partition was not shown as mounted in the storage info of Link2SD but after modifying the install-recovery.sh in /etc path, the storage info now atleast showing the 2nd partition as mounted. My install-recovery.sh looks like below--
#!/system/bin/sh
/system/xbin/daemonsu --auto-daemon &
/system/etc/install-recovery-2.sh
mount -t ext4 -o rw /dev/block/mmcblk0p2 /data/sdext2
mount -t ext4 -o rw /dev/block/vold/179:2 /data/sdext2
Now, the problems are as below--
1) Installed multiple applications but none of them are actually linked to SDcard. The Link2SD shows them as 'On SD Card' and just after installing 9-10 small applications, the internal memory is now full. If I go to 'Create Link', it is giving error '/data/sdext2 mount not found'.
2) When try to recreate mount script and choosing 'ext4' as parameter, it still throws error
"Mount Script can not be created. Mount: No such file or directory"
It seems that even though the storage info shows the 2nd partition as mounted, but system couldn't identify it somehow. So, Link2Sd is not working at all.
Please help and advice further. Thanks a lot.

[Q] Mount second SD Card partition on boot

Hello, all.
I have a Moto E with a 32GB External Memory card.
I've formatted the card to have a 12G FAT32 partition for the phone to use as intended, and the other 20GB I've formatted into a EXT4 filesystem that I plan to use for various stuff.
I can mount and write to the partition without any problem:
Code:
mount -t ext4 -o rw /dev/block/mmcblk1p2 /sdcard/sdext4/
The issue lies in that I have no idea where I should place this so that it automatically does it on boot (I cannot find any init.d directory, for example).
Could someone let me know what scripts are read at boot and where the best location for putting said command would be?
----
EDIT: Come to think of it, I'll need it for the following command so I can rsync as well without a hassle:
Code:
ln -s /data/data/eu.kowalczuk.rsync4android/files/rsync rsync

Categories

Resources