Missing space with new Apps2SD method - G1 Android Development

I was trying to use the new Apps2SD method by Marcus and I seem to be running into a problem. When I try to remove the unionfs partition through either G-Parted or disk utility I cannot remove/format it.
As far as I'm aware unionfs is NOT supported in G-parted nor in Mac OS. I only have a 1GB FAT32 partition and the other 3GB seem to be lost. I searched the forums and Google but cannot find anything. Does anyone have any suggestions?

im not sure what are you trying to do, but you can repartition removing phone's sd card and plugin it into a computer. If you want to repartition / change partitions with you phone acting as sd card reader connected with usb, you will have to undo unionfs process before trying to repartition / make any changes to sdcard
that last can be acomplished removing /data/init.rc and /data/a2sd.sh and rebooting the phone.
if this doesnt help you, provide more info, like the output of "df" command.

What I'm trying to do is restart Marcus's unionfs Apps2SD by destroying the partitions so I can get a fresh start. I tried deleting the 2 files you told me about but that didn't work. Heres the output of df:
# busybox df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 49356 0 49356 0% /dev
tmpfs 4096 0 4096 0% /sqlite_stmt_journals
/dev/block/mtdblock3 92160 60244 31916 65% /system
/dev/block/loop0 492 492 0 100% /system/modules
/dev/block/loop1 3524 3524 0 100% /system/xbin
/dev/block/mtdblock5 91904 23756 68148 26% /data
/dev/block/mtdblock4 30720 1160 29560 4% /cache
/dev/block//vold/179:1
991664 0 991664 0% /sdcard
Thanks!

Related

[HELP] Force Closes

So all of my apps from the market aren't working. I have apps and cache to SD and the SD still seems to work (can still access pictures saved) so I'm not sure what's wrong.
Any app I try to open will force close immediately (or almost immediately). Stock apps still work though.
Not sure what went wrong, I didn't do anything new when this error occured.
Anyone have bright ideas on how to fix it?
I'm thinking the EXT2 partition might be corrupted, but if so, wouldn't more crashes happen with the browser and such, since I have cache to SD as well? I haven't had a chance to check yet on that though.
Extra info in case it helps:
$ busybox df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 48.4M 0 48.4M 0% /dev
tmpfs 4.0M 0 4.0M 0% /sqlite_stmt_journals
/dev/block/mtdblock3 67.5M 67.0M 516.0K 99% /system
/dev/block/loop0 1.5M 1.5M 0 100% /system/modules
/dev/block/loop1 3.1M 3.1M 0 100% /system/xbin
/dev/mmcblk0p2 220.3M 67.9M 141.0M 33% /system/sd
/dev/block/mtdblock5 74.8M 43.3M 31.5M 58% /data
/dev/block/mtdblock4 67.5M 2.2M 65.3M 3% /cache
/dev/block/mmcblk0p1 743.7M 419.2M 324.5M 56% /sdcard
I'll probably dig around for my Ubuntu live CD this weekend to check the partition. Hoping to find a solution before then.
Did you try to re-install the apps ? I fixed mine that way
Doing so works, but I have over 50 apps installed and would take a while, plus I would lose all of my settings and data. Is there any other method?
Thanks for the suggestion though. Hadn't thought of that one earlier.

[06/06/09] Haykuro 6.0r1 boot.img with atime+ext3 mod (and now hero)

Well, there was a lot of chatter today about the speed increases on cyanogen's JF-1.51 ROM today, attributed to some changes in the ramdisk (see below). Attached is a boot.img with the same modifications but for Haykuro's 6.0r1 build - go ahead and download it now or read on for more details. Note: you'll only notice a difference if you run your apps/cache from your SD card.
The Changes
The only change is to mount your SD card's ext2 partition with the 'noatime' option. This is exactly what cyanogen did in his JF build, as per his post here. I also added the 'nodiratime' option. This is merely a very minor change in the runme.sh script of the boot ramdisk. [See below for more info on the ext3 mod, added 05/27/09]
By default, ext2 maintains the last access time ('atime') of every file and directory in the filesystem. This means that every time you access (read or write to) a file, this time will be reset and you'll be writing to your SD card. Two problems: 1) SD cards are slow as it is; requiring a write every time you access a file is going slow your whole system down. 2) SD cards fail after enough writes to the same location, so you're reducing your card lifetime by not having these options.
ext3 'auto' mod
Cyanogen added this to his latest build, so again, merely making this available for Haykuro 6.0r1 users. He wrote a bit more detail here which is working reading too.
In short: No other ROMs or app2sd solutions handle a clean shutdown of the ext2 partition, and Android doesn't have fsck tools. The result is that shutting down or crashing can corrupt your ext2 partition and you can lose data. Meanwhile, ext3 is a journaling file system; it recovers gracefully from unclean shutdowns. It's also backwards compatible, you can still mount an ext3 as ext2, you just lose journaling capability.
The mod mounts the 2nd SD partition as type 'auto', which means it will read your existing partition as ext2 and in the future as ext3 if you upgrade. This is more for advanced users but I'll try post some simple instructions below. Make sure you download the boot-haykuro-6.0r1-atime-ext3.zip image.
What about hero? (added 06/06/09)
This is a modded kernel 2.6.29 with unionfs support from daproy. Besides the atime+ext3 stuff, by request I also added support to run /system/init.rc and /data/init.rc (needed by some scripts).
http://turtle.wastelands.net/dragon/...uto-initrc.zip
See also:
1) Daproy's release: http://forum.xda-developers.com/showthread.php?p=3905574#post3905574
2) Release in this thread: http://forum.xda-developers.com/showpost.php?p=3909682&postcount=10
Note: you also need to
1) adb remount
2) push wlan.ko /system/lib/modules
How to apply
Download and unzip the file to get your new boot.img
Option 1:
Code:
adb push boot.img /sdcard
adb shell
# cat /dev/zero > /dev/mtd/mtd2 write: No space left on device [this is ok, you can ignore]
# flash_image boot /sdcard/boot.img
(or mount your SD card, copy the image, and run the above commands in a terminal).
Option 2:
1. Boot into fastboot mode (boot with power+camera)
2. fastboot flash boot boot.img
How to check if it's working
Type 'mount' in an adb shell or your phone's terminal, and look for the 'noatime' and 'nodiratime' option on your ext2 mount point. (If you go ahead with the ext3 mod and upgrade, you'll see it will show up as ext3 in the mount list below).
Code:
$ adb shell
# mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
/dev/block/mtdblock3 /system yaffs2 rw 0 0
/dev/block/mtdblock5 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block/mmcblk0p2 /system/sd ext2 rw,[b]noatime,nodiratime[/b],errors=continue 0 0 <--
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1000,fmask=0711,dmask=0700,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8 0 0
If things go wrong
If for some reason you can't boot after trying this, you can restore your system simply by reapplying Haykuro's image (boot with power+home and alt-s). Alternatively, I'm attaching the original boot.img as well, which you could reflash with option 2 above.
How to upgrade your ext2 partition to an ext3
I found this really easy on Linux. People can write about alternative methods, but this worked great for me: (substitute /dev/sdb2 below as necessary)
1. Connect to USB and mount your SD card in Android
2. Unmount your ext2 partition from inside linux (e.g. sudo umount /dev/sdb2)
3. sudo tune2fs -j /dev/sdb2 (this adds a journal to the filesystem)
4. adb shell, reboot (or just reboot phone without tapping 'turn off USB storage')
Even though I found this really simple and didn't even bother to make a back up first, I'm really familiar with Linux and linux filesystems -- this should be considered advanced use, and I'm not responsible for you losing your entire ext3 partition.
Note - I agree with cyanogen; I don't think the journal writes is a big performance impact or will wear out your card. This is a relatively small amount of extra data on each write... very low performance/wear impact and for me very worth the benefits.
References
1. Original launch thread of cyanogen's JF 1.51 build
2. Boot Image how to referenced by cyanogen's post
I'm also attaching my compiled versions of mkbootfs and mkbootimg in case anyone wants to play around without downloading and compiling the 2.3 GB Android source.
Worked like a charm thanks man!
This worked perfectly for me! Great job on this; noticable speed improvements for me
Not a great improvement.. Apps are starting circa a second faster..
anyone try this or have a method for Haykuro's Hero build?
boot.img for JACHero r1.4
jroid said:
anyone try this or have a method for Haykuro's Hero build?
Click to expand...
Click to collapse
Which build? I think beta 4 is out yes? I haven't moved over to Hero yet because of the bluetooth issue. Nevertheless, I just made a boot.img for JACHero1.4 - it's untested, but can't imagine it giving any problems... you can always just reapply the update.zip if things go wrong (I still take no responsibility though ). It will probably work with the recent hero builds, let me know how it goes.
I was reffering to the official build he dropped w/ rosie.
thanx I'll give it a shot
confirmed. works on hero build.
very noticeable speed improvement. thanks
# cat /dev/zero > /dev/mtd/mtd2 write: No space left on device
cat /dev/zero > /dev/mtd/mtd2 write: No space left on device
write: No space left on device
# flash_image boot /sdcard/boot.img
flash_image boot /sdcard/boot.img
# mount
mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
/dev/block/mtdblock3 /system yaffs2 ro 0 0
/dev/block/mtdblock5 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block/mmcblk0p2 /system/sd ext2 rw,errors=continue 0 0
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=
1000,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,s
hortname=mixed,utf8 0 0
# reboot
reboot
C:\>adb shell
# mount
mount
rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
/dev/block/mtdblock3 /system yaffs2 ro 0 0
/dev/block/mtdblock5 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock4 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block/mmcblk0p2 /system/sd ext2 rw,noatime,nodiratime,errors=continue 0 0
/dev/block//vold/179:1 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=
1000,fmask=0000,dmask=0000,allow_utime=0022,codepage=cp437,iocharset=iso8859-1,s
hortname=mixed,utf8 0 0
#
Click to expand...
Click to collapse
confirmation #2 it works on hero w/ Rosie
From another thread:
http://forum.xda-developers.com/showpost.php?p=3905574&postcount=42
daproy said:
Ok I reverted the recent commits to the 2.6.29 tree and camera works fine again and I patched in UnionFS. Sorry for the mess guys. I guess it shows I should have tested it before uploading. I put the kernel zImage in there separate as well in case people wanted to make their own boot.img
http://drop.io/tgbvqky
Click to expand...
Click to collapse
For those that were asking, here are some mods to daproy's great work.
* Mounts the 2nd partition as type 'auto' - ext3 if u have it, else ext2.
* Mounts with noatime and nodiratime options
* Includes appropriate calls to /system/init.rc and /data/init.rc
http://turtle.wastelands.net/dragon/android/hero-boot-unionfs-2-atime-auto-initrc.zip
Kinslayer81 said:
From another thread:
http://forum.xda-developers.com/showpost.php?p=3905574&postcount=42
For those that were asking, here are some mods to daproy's great work.
* Mounts the 2nd partition as type 'auto' - ext3 if u have it, else ext2.
* Mounts with noatime and nodiratime options
* Includes appropriate calls to /system/init.rc and /data/init.rc
http://turtle.wastelands.net/dragon/android/hero-boot-unionfs-2-atime-auto-initrc.zip
Click to expand...
Click to collapse
Hey thanks for the new kernel package.
Simple question.
I had now problem fastbooting the boot.img or adb pushing the wlan.ko but what do I do with the kernel file? Anything, or is it just there in case I want to make changes to the boot or wlan.ko files?
Ext3 on flash media drastically reduces the lifetime because of the frequent writes to the journal, a simple search on google brings up tons of things against the idea, yaffs2 or jffs would be a better decision because it is optimized for flash media and has a journal, not everyone has a class 6 sdhc, and ext3 will cause curruption in any lower class sd, and it will reduce a class's lifetime as well, there is plenty of docs and specs on this, if u prefer speed over reliability/sd lifetime have fun
defconoi said:
Ext3 on flash media drastically reduces the lifetime because of the frequent writes to the journal, a simple search on google brings up tons of things against the idea, yaffs2 or jffs would be a better decision because it is optimized for flash media and has a journal, not everyone has a class 6 sdhc, and ext3 will cause curruption in any lower class sd, and it will reduce a class's lifetime as well, there is plenty of docs and specs on this, if u prefer speed over reliability/sd lifetime have fun
Click to expand...
Click to collapse
This has been discussed ad nauseam.
Even in average high use (compiling the linux kernel!), ext3/journalling with the noatime option results in LESS THAN A 4% INCREASE IN WRITES. Even an abnormal case ('make clean' on the linux kernel, i.e. deleting literally thousands of files) maxed out at a 40% increase, which for deletes really isn't such a big deal. http://thunk.org/tytso/blog/2009/03/01/ssds-journaling-and-noatimerelatime/
Yaffs2, etc, ARE WORSE FOR YOUR SD CARD, which implements it's own hardware anti wear levelling. If you have the hardware and software both swapping around locations, you're doing more work, making things slower, and shortening the life of your card. Flash file systems are contra indicated for SD and other such media.
And it's not about preferring speed over reliability. Ext3 will be slightly slower than ext2, but it's definitely more reliable, because when you shut down, your phone crashes or something else goes wrong, it can recover gracefully instead of YOUR EXT2 PARTITION BECOMING CORRUPT and you losing your data.
I hope this issue is closed now.
ccyrowski said:
Hey thanks for the new kernel package.
Simple question.
I had now problem fastbooting the boot.img or adb pushing the wlan.ko but what do I do with the kernel file? Anything, or is it just there in case I want to make changes to the boot or wlan.ko files?
Click to expand...
Click to collapse
Yea I did the steps with the boot.img and wlan.ko and it appears to be working (noatime and nodiratime are showing). But whats the deal with the kernal file?
sacredsoul said:
Yea I did the steps with the boot.img and wlan.ko and it appears to be working (noatime and nodiratime are showing). But whats the deal with the kernal file?
Click to expand...
Click to collapse
It was included by daproy for ROM developers. I just left it in there to provide the complete package. You can safely ignore it
Kinslayer81 said:
It was included by daproy for ROM developers. I just left it in there to provide the complete package. You can safely ignore it
Click to expand...
Click to collapse
Ah. Thanks man! Enjoying my speedy JACHero Optimized build with this boot.img.
i pushed the wlan and use fastboot to flash the boot.img but when i check with the "mount" command it shows :
i'm using Jac's ROM
/dev/block/mmcblk0p2 /systemsd ext2 rw,errors=continue 00
instead of this:
/dev/block/mmcblk0p2 /system/sd ext2 rw,noatime,nodiratime,errors=continue 0 0
I get a wifi unable to start.
ifconfig tiwlan0 in Terminal returns No such device. Any help guys? Yes I tried rebooting already.
EDIT: Posted this on JACHero thread too. Posting here to get more response...
adb remount
adb push wlan.ko /system/lib/modules
Click to expand...
Click to collapse
Microsoft Windows [Version 6.1.7100]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Shanker>cd C:\android-sdk-windows-1.5_r1\tools
C:\android-sdk-windows-1.5_r1\tools>adb remount
remount succeeded
C:\android-sdk-windows-1.5_r1\tools>adb push wlan.ko /system/lib/modules
1117 KB/s (676043 bytes in 0.591s)
C:\android-sdk-windows-1.5_r1\tools>
Click to expand...
Click to collapse
I rebooted and I still cant start wifi. Btw I am using the kinslayer81 boot.img for JACHero 1.4...
namsir said:
i pushed the wlan and use fastboot to flash the boot.img but when i check with the "mount" command it shows :
i'm using Jac's ROM
/dev/block/mmcblk0p2 /systemsd ext2 rw,errors=continue 00
instead of this:
/dev/block/mmcblk0p2 /system/sd ext2 rw,noatime,nodiratime,errors=continue 0 0
Click to expand...
Click to collapse
i got the samething.... when i check to see if its working with "mount"
it doesnt show the noatime, nodiratime :\
Kinslayer81 said:
From another thread:
http://forum.xda-developers.com/showpost.php?p=3905574&postcount=42
For those that were asking, here are some mods to daproy's great work.
* Mounts the 2nd partition as type 'auto' - ext3 if u have it, else ext2.
* Mounts with noatime and nodiratime options
* Includes appropriate calls to /system/init.rc and /data/init.rc
http://turtle.wastelands.net/dragon/android/hero-boot-unionfs-2-atime-auto-initrc.zip
Click to expand...
Click to collapse
can we do aufs/unionFS on Haykuro's original hero build? I've got the new boot.img and wlan.ko and ext3 FS, just wondering what I would need to do.

Apps2SD / Data2SD correctly sd card prep for ICS 4.0.4? on Xperia mini Pro (SK17i)

Well ...
Shortly after some investigation i can share a couple informations with all interesting users who use a sony xperia mini pro (SK17i).
I tryed to create 2 partitions on my sd-card and get them working with my mobile phone. It seams that there is no automatic detection that mount any /sd-ext file system by it self. On my desktop box (laptop with ubuntu 12.04) is it no problem to mount the 2 partitions when the device is connected by usb but the mobile device only work by default with an fat32 file system. So we need some work manual configurations to get moving apps or data to an external /sd-ext file system.
With an older cwm version it was easy to let clockworkmod recovery create an /sd-card and /sd-ext file system on android GB. It run automatic and did everything fine. Now i tryed to do it in the offical ICS 4.0.4 ROM and CWM-5.0.2.7-nAa-r2 but no luck. The Option to create the 2 file systems automatic seams to be removed. The other options to format and mount an ext file system are not working or i was not able to understand how to use them correctly.
If you know how to use CWM-5.0.2.7-nAa-r2 and get fat32 and ext-fs configured correctly then please let me know.
Code:
127|[email protected]:/ $ whoami
whoami: unknown uid 2000
1|[email protected]:/ $ su
[email protected]:/ # whoami
whoami: unknown uid 0
1|[email protected]:/ # df
Filesystem Size Used Free Blksize
/dev 170.0M 64.0K 170.0M 4096
/mnt/asec 170.0M 0.0K 170.0M 4096
/mnt/obb 170.0M 0.0K 170.0M 4096
/system 400.0M 323.4M 76.6M 4096
/data 420.0M 126.4M 293.6M 4096
/cache 101.5M 1.1M 100.4M 4096
/data/idd 6.0M 840.0K 5.2M 4096
/mnt/sdcard 28.3G 9.3G 19.0G 32768
/mnt/secure/asec 28.3G 9.3G 19.0G 32768
[email protected]:/ #
When i let titanium backup move an app from internal memoy to sd card it show that on internal memory is more free space and when i unmount the sd card in my phone i cant start the app (android say app not found). So far so good and everything looks fine for me. But what i not understand is why the ext-fs partitions is empty when i mount it on my linux computer?
I thought that it maybe uses the ext-fs while it is not shown as mounted but that is not linux like^^
Code:
[email protected]:/ # cat /proc/filesystems
nodev sysfs
nodev rootfs
nodev bdev
nodev proc
nodev cgroup
nodev tmpfs
nodev debugfs
nodev sockfs
nodev pipefs
nodev anon_inodefs
nodev rpc_pipefs
nodev inotifyfs
nodev devpts
[B]ext3
ext2[/B]
nodev ramfs
vfat
nodev nfs
yaffs
yaffs2
It looks like we have to use ext2 or ext3 on sd-cards because ext4 is not supported by the 4.0.4 stock rom!?
By the way i use a xperia mini pro phone (SK17i) with android ics 4.0.4 - OS is rooted but i left the bootloader locked.
Very good post I shear this
@Daniel.Infante
I made some changes on my old post but i guess you will (maybe) think the same. Thanks for your feedback.
@all
Can someboy help to create a correct startup script that will mount a ext3 file system on a sd card correctly? I am not 100% sure with this and dont like to make my device unbootable with wrong system changes :fingers-crossed:

How can i erase block size?

Hi Guys,
I am facing a small problem that will not let me install any Android system on my device.
I have a BLU DASH 3.5 and the problem seems whenever I use the command "busybox df" ... it always returns me:
Code:
~ # busybox df
busybox df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 80612 48 80564 0% /dev
/dev/block/mtdblock1 225280 215936 9344 96% /system
/dev/block/mtdblock4 179200 1152 178048 1% /data
/dev/block/mmcblk0p1 3850240 118560 3731680 3% /sdcard
/dev/block/mtdblock2 61440 1180 60260 2% /cache
My folder /SYSTEM is always full.
I've tried deleting the folder using the "rm" command and it works, the command clears my folder / system, except that when I create the folder again using "mkdir" and remount the partition with the command: "mount -t yaffs2 /dev/block/mtdblock1 /system" the space occupied remains just seen... 96% used.
I tried to:
- delete /system folder
- delete /dev/block/mtdblock1 (also mtdblock2, mtdblock3, mtdblock4, mtdblock5 and mtdblock6) but when devices reboot, everything back as it was before.
- remount in other partition
I dont know what to do
is there any way to clean/wipe/recreate the /system partition?

[Q] Does absence of Init.d cause Boot-Loop for Link2SD?

What is Link2SD?
Link2SD is an app for Android 2.0+ users on their phone to move applications to the SD card by dual-partitioning the card. First partition gets mounted as external SD and remains available for general use, while the second partition (preferably formatted with an *NIX type file-system, e.g. ext2, ext3, ext4 etc.) holds executable(.apk), data, dalvik-cache(.dex) and library files(.so) for linked/moved application.
Link2SD mounts the second partition of your SD card as /data/sdext2 and makes OS mounts it at boot time. When you select an application and press "Create Link" button you can select which files of the application will be linked and moved to SD card. Apk, dex and lib files can be moved and you can select all three or any two of three or even only one of them. Depending on what you select, Link2SD moves apk file, dalvik-cache (.dex) file and lib files (.so) to SD card's second partition and creates symbolic links in original directories. Phone must be Rooted, of course.
How does mounting of second SD partition work?
After the partitioned SD card is put in the phone, Link2SD asks you to select the file-system of the second partition on SD, just chose the one you used. Once /system/etc/init.d/11link2sd script is created, you have to restart the phone.
What is init.d support and why is it needed?
init.d directory is the container of start-up scripts in a *NIX type system. These scripts are execute during system boot.
Link2SD relies on the execution of /system/etc/init.d/11link2sd script which, in turn, mounts the second partition of SD card as /data/sdext2.
What is the Boot-Loop problem?
The SD card storage is dual-partitioned and put in the phone. Then, Link2SD generates mount script for the second partition of SD card and phone needs to be re-started. Some phones, e.g. Sony Xperia-L runs into infinite boot-sequence a.k.a. boot-loop. In this state, phone boot sequence starts, manufacturer logo is displayed proceeds for a few seconds and restarts. Only solution is to long press the power button or taking out the battery to switch the phone off.
Interestingly, if the dual-partitioned SD card is taken out and the phone is booted without SD card inserted, it boots normally.
What did I do with my Xperia-L so that it started boot-looping?
Rooted Xperia using Rootkit method. It leaved /system/etc/install_recovery.sh and /system/etc/init.d/00stop_ric scripts on the phone's file-system. (Script code listed below). I am using the rooted phone for months without any trouble.
Using an un-partitioned 32GB microSD card, formatted with FAT32, in the phone.
Deciding to give a try to Link2SD, I dual-partitioned the SD using Minitool Partition Manager. First partition was formatted with FAT32 while the second one was formatted with ext4. Sizes of partitions were around ~25GB and ~4.5GB respectively.
Installed Link2SD on phone.
Switched the phone OFF.
Put the dual-partitioned SD back in the phone slot.
Switched the phone ON.
Opened Link2SD app.
Link2SD immediately recognized the second partiton, asking me for its file-system type.
Selected ext4 from the list.
Link2SD generated the mount script and prompted for restart.
Restarted the phone.
Boot-Loop!!!
Switched the phone OFF by taking out battery.
Took the dual-partitioned memory card out.
Switched the phone ON.
Phone starts normally!!!
How did I solve the problem?
I installed Init.d Toggler app as described here.
As described here, I experienced the problem of first partition not being mounted. The error was related to SD Card being empty or the file-system damaged.
I re-formatted the first partition of SD with NTFS.
Installed Paragon exFAT, NTFS & HFS+ app.
Now, the first partition got mounted.
What does Init.d Toggler do?
Appends the following command at the end of /system/etc/install_recovery.sh: /system/bin/sysinit
Creates /system/bin/sysinit script.
Creates /system/etc/init.d directory to put the start-up scripts in.
Does REALLY lack of init.d support cause boot-loop problem?
As the Init.d Toggler solution says,
One of the requirements to use the Link2SD is the support to init.d scripts. Most of the custom roms support this, but not the stock one, giving a boot loop.
Click to expand...
Click to collapse
I doubt that to be the "real" problem underlying the hood. Why?
How come lack of init.d support cause the mount script /system/etc/init.d/11link2sd malfunction? At most, what could have happened is, it would NOT mount the second partition, that's it. Right? But, isn't it surprising to crash or the like during boot?
As stated, even prior to installing Link2SD, there always existed /system/etc/init.d/00stop_ric, which contains almost similar set of commands as that of mount script /system/etc/init.d/11link2sd created by Link2SD. It used to work like a charm. I guess, because of init.d support not being there in stock ROM, the script had never been executed before I used Init.d Toggler.
Had the lack of init.d support been the reason of boot-loop, how did the phone manage itself to boot normally with the dual partitioned SD card taken out? Please note that, the mount script was still residing in init.d directory.
To be noted that, Xperia L (Stock ROM) boots fine with a dual-partitioned SD card put in, though it never mounts the second partition.
At this point, can anyone help me investigate the root-cause behind the boot-loop problem? Can anyone come up with any idea or satisfactory answer to the query? Does anyone have any idea on how to approach the issue at hand?
Please find the relevant scripts below.
00stop_ric
Code:
#!/system/bin/sh
/system/xbin/busybox pkill /sbin/ric
mount -o remount,rw /
rm /sbin/ric
mount -o remount,ro /
/system/xbin/busybox pkill /sbin/ric
11link2sd
Code:
#!/system/bin/sh
#added by link2sd
LOG=/data/link2sd-11link2sd.log
echo "$(date) mounting..." > $LOG
sleep 2
mount -t ext4 -o rw /dev/block/vold/179:34 /data/sdext2 1>>$LOG 2>>$LOG
mount -t ext4 -o rw /dev/block/mmcblk1p2 /data/sdext2 1>>$LOG 2>>$LOG
mount >> $LOG
echo "$(date) mount finished" >> $LOG
install-recovery
Code:
#!/system/bin/sh
# If you're implementing this in a custom kernel/firmware,
# I suggest you use a different script name, and add a service
# to launch it from init.rc
# Launches SuperSU in daemon mode only on Android 4.3+.
# Nothing will happen on 4.2.x or older, unless SELinux+Enforcing.
# If you want to force loading the daemon, use "--daemon" instead
/system/xbin/daemonsu --auto-daemon &
# Some apps like to run stuff from this script as well, that will
# obviously break root - in your code, just search this file
# for "install-recovery-2.sh", and if present, write there instead.
/system/bin/sysinit
sysinit
Code:
#!/system/bin/sh
export PATH=/sbin:/system/sbin:/system/bin:/system/xbin
/system/bin/logwrapper /system/xbin/run-parts /system/etc/init.d
link2sd-11link2sd
Code:
Wed Jul 23 16:23:57 IST 2014 mounting...
mount: Device or resource busy
mount: Device or resource busy
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/secure tmpfs rw,relatime,mode=700 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 rw,nosuid,nodev,relatime,noauto_da_alloc,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 rw,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 rw,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/ftmd /ftmd ext4 rw,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/LTALabel /lta-label ext4 rw,nosuid,nodev,relatime,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/ftma /ftma ext4 ro,relatime,nobarrier,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware vfat ro,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=cp437,iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0
/dev/block/mmcblk1p1 /storage/sdcard1 fuseblk rw,nosuid,nodev,relatime,user_id=0,group_id=0,default_permissions,allow_other,blksize=4096 0 0
/dev/block/vold/179:34 /data/sdext2 ext4 rw,relatime,data=ordered 0 0
/dev/block/vold/259:0 /storage/sdcard0 vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/259:0 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
tmpfs /storage/sdcard0/.android_secure tmpfs ro,relatime,size=0k,mode=000 0 0
/dev/block/dm-0 /mnt/asec/uk.co.aifactory.chessfree-2 ext4 ro,dirsync,nosuid,nodev,noatime 0 0
/dev/block/dm-1 /mnt/asec/com.wave18.adbwireless-1 ext4 ro,dirsync,nosuid,nodev,noatime 0 0
/dev/block/dm-2 /mnt/asec/com.rerware.android.MyBackupRoot-1 ext4 ro,dirsync,nosuid,nodev,noatime 0 0
/dev/block/dm-3 /mnt/asec/com.rootuninstaller.free-2 ext4 ro,dirsync,nosuid,nodev,noatime 0 0
Wed Jul 23 16:23:59 IST 2014 mount finished

Categories

Resources