Always out of space

Z

ZeroBarrier

Guest
It kind of is as simple as that, it's actually a known issue with this method (since it is unofficial and all), if the sd-ext partition doesn't unmount properly before a power cycle; then it does a partition check on sd-ext on next reboot. This delays the partition mounting and your phone proceeds in it's boot up sequence ignoring the data in /sd-ext/data/app/ (and /sd-ext/data/data/ if you have that bind option turned on). And since your phone thinks /data/app/ is actually in internal memory, then it doesn't bother reloading applications from there once booted up, so the only way around it is to reboot.
 
OP
S

Se7enLC

Active Member
Joined
Nov 16, 2009
Messages
1,262
Reaction score
0
It kind of is as simple as that, it's actually a known issue with this method (since it is unofficial and all), if the sd-ext partition doesn't unmount properly before a power cycle; then it does a partition check on sd-ext on next reboot. This delays the partition mounting and your phone proceeds in it's boot up sequence ignoring the data in /sd-ext/data/app/ (and /sd-ext/data/data/ if you have that bind option turned on). And since your phone thinks /data/app/ is actually in internal memory, then it doesn't bother reloading applications from there once booted up, so the only way around it is to reboot.

My point is that rebooting doesn't seem to fix anything - it keeps coming up with no applications until I restore to a backup, no matter how many times I reboot. Even if it does successfully mount the /sd-ext partition on boot (perhaps it is being mounted too late, but no amount of rebooting seems to make it mount again quick enough, if that is the case).

I'm going to investigate the issue further and see if there's a particular situation that triggers it. I believe that it's whenever I take the battery out. Even if I shut the phone off first, that first boot after a battery swap tends to make things blow up.
 
OP
S

Se7enLC

Active Member
Joined
Nov 16, 2009
Messages
1,262
Reaction score
0
It kind of is as simple as that, it's actually a known issue with this method (since it is unofficial and all), if the sd-ext partition doesn't unmount properly before a power cycle; then it does a partition check on sd-ext on next reboot. This delays the partition mounting and your phone proceeds in it's boot up sequence ignoring the data in /sd-ext/data/app/ (and /sd-ext/data/data/ if you have that bind option turned on). And since your phone thinks /data/app/ is actually in internal memory, then it doesn't bother reloading applications from there once booted up, so the only way around it is to reboot.

My point is that rebooting doesn't seem to fix anything - it keeps coming up with no applications until I restore to a backup, no matter how many times I reboot. Even if it does successfully mount the /sd-ext partition on boot (perhaps it is being mounted too late, but no amount of rebooting seems to make it mount again quick enough, if that is the case).

I'm going to investigate the issue further and see if there's a particular situation that triggers it. I believe that it's whenever I take the battery out. Even if I shut the phone off first, that first boot after a battery swap tends to make things blow up.

Looks like that triggers it pretty reliably. Once it fails to mount ONCE, it gives up on all the applications it thought were installed and doesn't look for them again, even if it mounts fine on future reboots. I think the "fix" is to make sure that it is not allowed to finish booting if it cannot mount /sd-ext - since if it DOES finish booting, it corrupts the installed packages database and can't be recovered without a restore.

I'm going to have to debug this using ADB - aLogcat doesn't give me a long enough scrollback. On a failed boot, There are so many "Application not found" messages that the actual sd-ext mounting error scrolls off the end and can't be found. I may try to modify the script to log to a file, but I don't believe that any files are writeable at the time the script is run (certainly not the SD card)
Manually deleting packages.xml from the "real" /data partition STARTED to address the problem. Other apps showed up, but most of them were force-closing left and right, probably due to other differences in the /data/system and other directories.
 
OP
S

Se7enLC

Active Member
Joined
Nov 16, 2009
Messages
1,262
Reaction score
0
Huzzah! I got it working reliably!

I used the method found in this posting on xda as inspiration. I added the cm.filesystem.ready property to the end of the 05mountsd script and modified init.rc to delay sysinit until that property was true. I pulled the battery to corrupt the sd-ext filesystem, but the bootup completed fsck before allowing sysinit, preventing the problems I mentioned earlier.

xda-developers - View Single Post - [Script][A2SD] Darktremor Apps2SD 2.7.5.2 (10/03/2010)

I may package up this modification into an easily-installable .zip file, or I may just see if it can get included in the next CM release.
 
Z

ZeroBarrier

Guest
Nice!

I'll probably need your help now to get this done, haha!
 

furbearingmammal

Super Moderator
Joined
Jun 16, 2010
Messages
11,081
Reaction score
363
Location
Anywhere you're not
Website
swdouglas.blogspot.com
Current Phone Model
32GB Moto X Developers Edition
Twitter
furryvarmint
Huzzah! I got it working reliably!

I used the method found in this posting on xda as inspiration. I added the cm.filesystem.ready property to the end of the 05mountsd script and modified init.rc to delay sysinit until that property was true. I pulled the battery to corrupt the sd-ext filesystem, but the bootup completed fsck before allowing sysinit, preventing the problems I mentioned earlier.

xda-developers - View Single Post - [Script][A2SD] Darktremor Apps2SD 2.7.5.2 (10/03/2010)

I may package up this modification into an easily-installable .zip file, or I may just see if it can get included in the next CM release.
Let Cyanogen know, offer it to the TeamDouche repository, and maybe drop Koush a line. He seems much more interested in the X/2 nowadays, but that's where the new development is heading anyway since the Droid is EOL now.
 

marty4short

Member
Joined
Nov 11, 2009
Messages
234
Reaction score
0
Location
Latrobe,PA
Huzzah! I got it working reliably!

I used the method found in this posting on xda as inspiration. I added the cm.filesystem.ready property to the end of the 05mountsd script and modified init.rc to delay sysinit until that property was true. I pulled the battery to corrupt the sd-ext filesystem, but the bootup completed fsck before allowing sysinit, preventing the problems I mentioned earlier.

xda-developers - View Single Post - [Script][A2SD] Darktremor Apps2SD 2.7.5.2 (10/03/2010)

I may package up this modification into an easily-installable .zip file, or I may just see if it can get included in the next CM release.

I would like to try your method if you don't mind posting the zip
 
OP
S

Se7enLC

Active Member
Joined
Nov 16, 2009
Messages
1,262
Reaction score
0
I would like to try your method if you don't mind posting the zip

While looking through Firerat's script, I discovered that that he put a lot of work into making sure there isn't any data loss or other problems with the conversion from internal data to /sd-ext, so I've decided not to mess with it :)

Here's what you can do to try it out:

1). Backup your SD card
2). Format and re-partition your SD card (you can use ROM Manager to do this automatically)
3). Reload stuff onto your SD card
4). Make a nandroid backup!
5). Install a kernel that can mount the second partition on the SD card as ext3. I know Slayher works, and P3Droid works if you make sure that the ext3 module loads. The default CM kernel does NOT work
6). Delete /etc/init.d/05mountsd
7). Run Firerat's script. It should install a new copy of 05mountsd and mount your SD card. If it doesn't mount your SD card, you'll want to just stop here and try other things like mounting it manually until you have a system that can mount it on boot.
8). Once Firerat's script runs and moves your apps to the SD card, you should be able to reboot and it will still work. At this point, make a nandroid backup!

IF you run into the problems I did (where a battery pull makes your /sd-ext partition not boot and all your apps appear to be missing) let me know! For all I know at this point, I'm the only one with this problem, and if that's the case, the extra steps I had to take aren't worth it.
 

marty4short

Member
Joined
Nov 11, 2009
Messages
234
Reaction score
0
Location
Latrobe,PA
Ive tried using the script twice every time I move my data/data folder everything seems to quit working and all my apps force close. It won't let me move anything back either. I don't know if re-partitioning my sd card would help at ll.
 
OP
S

Se7enLC

Active Member
Joined
Nov 16, 2009
Messages
1,262
Reaction score
0
Ive tried using the script twice every time I move my data/data folder everything seems to quit working and all my apps force close. It won't let me move anything back either. I don't know if re-partitioning my sd card would help at ll.

What do you mean by re-partitioning? You already have it partitioned into at least 2 partitions (first as primary fat32, second as ext3), right?

Does it properly mount /sd-ext on boot? Make sure that is working before proceeding
 

marty4short

Member
Joined
Nov 11, 2009
Messages
234
Reaction score
0
Location
Latrobe,PA
Yes it is partitioned but does not seem to mount I am using slaythers kernel what steps should I try to get it to mount properly?
I was using this command mount -o rw /dev/block/mmcblk0p2 /sd-ext and it keeps saying it failed device or resource is busy.
 
Last edited:
OP
S

Se7enLC

Active Member
Joined
Nov 16, 2009
Messages
1,262
Reaction score
0
Yes it is partitioned but does not seem to mount I am using slaythers kernel what steps should I try to get it to mount properly?

If you're already running slayhers kernel, what error do you get when you run Firerat's script?

If you type "df", does it list /sd-ext as mounted?

Do you see a device for /dev/block/mmcblk0p2?

When you reboot, does /sd-ext come back up and mount automatically (check with df)?
 

marty4short

Member
Joined
Nov 11, 2009
Messages
234
Reaction score
0
Location
Latrobe,PA
i haven't gotten any errors running the script everything seems to go fine after reboot everything seems to force close. I reboot again and I loose all my apps I havent run the script again on this nandroid im showing you

# "df"
"df"
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 115632 0 115632 0% /dev
tmpfs 115632 0 115632 0% /mnt/asec
/dev/block/mtdblock4 143744 137032 6712 95% /system
/dev/block/mtdblock6 268032 154588 113444 58% /data
/dev/block/mtdblock5 94848 51684 43164 54% /cache
/dev/block/mtdblock0 1536 1176 360 77% /config
/dev/block/mmcblk0p2 468104 3 443127 0% /sd-ext
/dev/block/vold/179:1
15086312 9909712 5176600 66% /mnt/sdcard
/dev/block/vold/179:1
15086312 9909712 5176600 66% /mnt/secure/asec
/dev/block/dm-0 4164 2248 1916 54% /mnt/asec/com.metago.ast
ro-1
/dev/block/dm-1 2088 48 2040 2% /mnt/asec/com.mylittlebi
gapps.android.albumartgrabber-1
/dev/block/dm-2 2088 460 1628 22% /mnt/asec/com.google.zxi
ng.client.android-1
/dev/block/dm-3 11424 9764 1660 85% /mnt/asec/com.halfbrick.
fruitninja-1
/dev/block/dm-4 2088 300 1788 14% /mnt/asec/com.betterandr
oid.bettercut-1
/dev/block/dm-5 2088 140 1948 7% /mnt/asec/siir.es.adbWir
eless-1
/dev/block/dm-6 7276 5528 1748 76% /mnt/asec/com.google.ear
th-1
/dev/block/dm-7 3124 1504 1620 48% /mnt/asec/com.google.and
roid.stardroid-1
/dev/block/dm-8 5200 3896 1304 75% /mnt/asec/alterforce.eng
ine-1
/dev/block/dm-9 2088 264 1824 13% /mnt/asec/com.gmail.naga
matu.drocap2-1
/dev/block/dm-10 13500 11724 1776 87% /mnt/asec/com.rovio.angr
ybirds_lite-2
/dev/block/dm-11 4164 2104 2060 51% /mnt/asec/com.batterypow
eredgames.antigen-1
#
 
OP
S

Se7enLC

Active Member
Joined
Nov 16, 2009
Messages
1,262
Reaction score
0
i haven't gotten any errors running the script everything seems to go fine after reboot everything seems to force close. I reboot again and I loose all my apps I havent run the script again on this nandroid im showing you

# "df"
"df"
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 115632 0 115632 0% /dev
tmpfs 115632 0 115632 0% /mnt/asec
/dev/block/mtdblock4 143744 137032 6712 95% /system
/dev/block/mtdblock6 268032 154588 113444 58% /data
/dev/block/mtdblock5 94848 51684 43164 54% /cache
/dev/block/mtdblock0 1536 1176 360 77% /config
/dev/block/mmcblk0p2 468104 3 443127 0% /sd-ext

Ok, that looks like it's mounting /sd-ext fine, and the errors sound a lot like the errors I was seeing. I didn't get force-closes, but all the apps were missing.

I'm attaching my fix to this post for you to try, if you want.

1). Run firerat's script to install all your apps to /sd-ext
2). Reboot into recovery and apply this update file (works in CWM, no idea about other recoveries)
NOTE: Don't try to boot normally until you install this update, and don't run Firerat's script AFTER the update.
3). Then cross your fingers and hope that your droid will boot up and have all your apps still.

What this update will do is modify your ramdisk and install a copy of 05mountsd that I modified, overwriting the one that firerat installs. The ramdisk modification causes it to wait for a property cm.filesystem.ready to be 1 before it will start sysinit. The modification to 05mountsd waits for /sd-ext to mount, and when it is successfull it sets cm.filesystem.ready to be 1.

Let me know if this works for you. Make sure you have a backup just in case you get stuck unable to boot up!
 
Top