# Prevent Webos & Android /media/internal file delete upon reboot & WIFI Connect



## droidyman (Sep 23, 2011)

*Issue #1: File Delete from /media/internal (Webos), /sdcard (CM7 Android Build - Alpha)*

So here I am at work with my shinny new HP Touchpad running the CM7 Alpha build and I reboot into Webos to load up a nice SNES Rom and all of my ROMs are missing. To my disappointment (like others have posted here on RootzWiki) this is known to happen upon rebooting from Webos into Android. :_con:

Taking a closer look at the files in the CM-SYSTEM volume from Webos, you will find a couple of key files vold.fstab, mke2fs.conf and most importantly mountsd.

After looking at these files and with the help on Android Information.apk (you can Google for download links) for reviewing logs of the boot process, it seems like an easy way to resolve this behavior at least in the short term is to rename the fsck_msdos file in the bin directory.

I have tested this by dumping as many files as possible from Webos into the /media/internal directory booting into CM7 rebooting, powering off, editing a file from CM7 and rebooting back into Webos editing again and then finally rebooting into CM7.

I have also tried accessing the SDCARD from CM Recovery and from CM7 itself and all seems to be working.

Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
Please proceed at your own risk.
--

To get this done, I mounted the Touchpad in USB Mode FROM Webos. I then dumped from files right into the root of the disk drive letter exposed to windows when the Touchpad is in USB Mode.

I then used WebosQuickInstall to access the 'device command line' and mounted the cm-system lv and renamed the file that has caused such pain :erm:

cd /tmp
mkdir system
cd /tmp/system
mount -o loop /dev/store/cm-system /tmp/system
cd /tmp/system/bin
mv fsck_msdos fsck_msdos-old
cd /
umount /tmp/system
reboot
You should now be rebooted into CM7 and the file storing of data in Webos should be working for you. Please post your experiences.

In theory the installer media for CM7 for new installs could be updated with this as a short term fix as it simply impacts the SDCARD from being put through fsck and any files in the /media/internal to loose their assigned inodes. I have not tested this on a clean install.

*Issue #2: Wifi does not seem to connect or continues to scan during connect to PEAP AP's*

I actually have not had this issue at all yesterday but today it was unbearable. I did try to install every possible app from the market that was in the free category just because I could because the CM team gave me an early Christmas present.....Android on HP Touchpad.

However, the wifi would just continue to scan based on logs viewed in Android Information.

Taking a further look at the issue, I decided to open the wpa_supplicant.conf file and switch the ap_scan value to '0' instead of the CM7 default of '1'. This was just a trial but given the description of the value it appeared to be exactly what I needed.

Long story short this worked. I can now connect to my PEAP AP's without the connection dropping and watching the system state via ADB shows that the wifi state remains "alive" although the screen sensor has went to sleep.

_*Again proceed at your own risk.*_

cd /tmp
mkdir system
cd /tmp/system
mount -o loop /dev/store/cm-system /tmp/system
cd /tmp/system/etc/wifi
vi wpa_supplicant.conf
Look for the ap_scan value referenced above and change the setting to 0 from 1.
You may need to "forget" your saved wifi network and reconnect. I did have to do this step.
Happy to help. Let me know if this works for you.


----------



## neostryder (Aug 20, 2011)

Droidyman,

Do you suppose this would correct a TP that is already hosed or just prevent it from getting hosed in the first place? Are those of us who have already blown it SOL?

Thanks!

-neostryder


----------



## droidyman (Sep 23, 2011)

neostryder said:


> Droidyman,
> 
> Do you suppose this would correct a TP that is already hosed or just prevent it from getting hosed in the first place? Are those of us who have already blown it SOL?
> 
> ...


This is a good question. My guess is that for those of us who already have the CM7 build installed then we are out of luck. However, the build does say Alpha and to be honest it is the best thing out for the Touchpad including the original o/s. For multimedia files that were in /media/internal I dont forsee any way to get those back.

However, as some are still struggling with getting the build itself installed and while others are on their 2nd and 3rd attempts, this is likely to prevent anyone who has read this thread from loosing any data (hopefully).


----------



## neostryder (Aug 20, 2011)

droidyman said:


> This is a good question. My guess is that for those of us who already have the CM7 build installed then we are out of luck. However, the build does say Alpha and to be honest it is the best thing out for the Touchpad including the original o/s. For multimedia files that were in /media/internal I dont forsee any way to get those back.
> 
> However, as some are still struggling with getting the build itself installed and while others are on their 2nd and 3rd attempts, this is likely to prevent anyone who has read this thread from loosing any data (hopefully).


I have no qualms about the fact that this is Alpha software. I signed up for it. I'm just trying to help with the problem solving. I wonder if my problem is different from the one that you are describing. Mine did destroy data on the media partition, but it is also trashing apps that I move to the faux SD card with App 2 SD. Everything goes fine for awhile, then boom. Some of the transfers fail and suddenly I'm left with a message saying that the SD card was removed. I've gone through the whole wipe and restore (both webOS and CM7) process twice and it happened both times. Do you think that this workaround that you propose, if applied this next time prior to reloading CM7, might prevent the issue? Do you know of any tools that can reset the original partitions for webOS, essentially taking the whole Doctor thing one step further? I might want to check with the webOSInternals guys on that one. If I make any headway, I will post it here and on the issue tracker. Thanks for digging into this!


----------



## droidyman (Sep 23, 2011)

neostryder said:


> I have no qualms about the fact that this is Alpha software. I signed up for it. I'm just trying to help with the problem solving. I wonder if my problem is different from the one that you are describing. Mine did destroy data on the media partition, but it is also trashing apps that I move to the faux SD card with App 2 SD. Everything goes fine for awhile, then boom. Some of the transfers fail and suddenly I'm left with a message saying that the SD card was removed. I've gone through the whole wipe and restore (both webOS and CM7) process twice and it happened both times. Do you think that this workaround that you propose, if applied this next time prior to reloading CM7, might prevent the issue? Do you know of any tools that can reset the original partitions for webOS, essentially taking the whole Doctor thing one step further? I might want to check with the webOSInternals guys on that one. If I make any headway, I will post it here and on the issue tracker. Thanks for digging into this!


I installed using this procedure as well as the possible fix I posted for wifi and it worked on a friends 32gb Touchpad. Whereas I was able to retain all of the content in /media/internal by removing the fsck_msdos file from the CM7 system...withbugs named zip file.

For starting from scratch it looks like you will need to boot into Webos and remove the 3 CM logical volumes and then use os doctor to revert to the factory settings based on comments in this post: http://rootzwiki.com/showthread.php?7943-Completely-remove-Android-Install.


----------



## green (Sep 2, 2011)

Note that the file delete "Fix" just papers over the issue.

The real issue is two fold:
there is either a vfat corruption in media when written to from WEBOS which is bad and not running fsck won't make it much better I guess,
or the dosfsck we ship is broken, which needs to be figured out and fixed then, I guess.


----------



## green (Sep 2, 2011)

Another note - I verified that the problem does lie in some strange cm7-supplied fsck behavior, so renaming the fsck seems to be a good workaround.


----------



## abstrakmind (Aug 26, 2011)

Hi.. I too also have the same problem with losing data from the /media/internal folder in WebOS. It's not too bad since I have backup of those files. However when I am looking at the amount of free space left on the Touchpad, it seems as if those data were not wiped out, just missing some where. Instead of starting out with 32GB of capacity, I now have only 24GB. Is this a normal thing?


----------



## neostryder (Aug 20, 2011)

I did a clean wipe of my TP, Android partitions, webOS full wipe, 3.0.2 doctor, and all, and reinstalled after renaming fsck_msdos to fsck_msdos_old in the /system/bin directory of update-cm-7.1.0-tenderloin-a1-fullofbugs.zip. After getting everything set up again, I began downloading all of the apps from my Google and Amazon accounts. After downloading roughly 100 apps, I started getting erratic behavior and sure enough, the SD card partition was blown to bits and couldn't be recognized in Android. Does removing fsck_msdos really fix the problem? It didn't seem to for me.

-neostryder


----------



## droidyman (Sep 23, 2011)

neostryder said:


> I did a clean wipe of my TP, Android partitions, webOS full wipe, 3.0.2 doctor, and all, and reinstalled after renaming fsck_msdos to fsck_msdos_old in the /system/bin directory of update-cm-7.1.0-tenderloin-a1-fullofbugs.zip. After getting everything set up again, I began downloading all of the apps from my Google and Amazon accounts. After downloading roughly 100 apps, I started getting erratic behavior and sure enough, the SD card partition was blown to bits and couldn't be recognized in Android. Does removing fsck_msdos really fix the problem? It didn't seem to for me.
> 
> -neostryder


I have tested this dozens of times. I did a clean install with the CM7 provided fsck_msdos and prior to booting into CM7 for the first time renamed the fsck_msdos from Webos and have been rebooting time and time again with tons of files in the /media/internal directory.


----------



## chiaroscuro (Jun 16, 2011)

Your wifi fix works great... usually..whenever I restart (usually from a freeze/SOD) I needed to struggle to do the forget network and re enter password sequence to connect to my wifi - your fix has worked brilliantly and now on a number of reboots etc it still connects to wifi easily.... please highlight this fix for the lost wifi..great job.. I could handle the SOD..but the wifi was driving me nuts each time..and yes I am at min 384 MHz but that still doesn't prevent SOD for me...

Update: Spoke too soon....same issues with wifi after another reboot...darn it...


----------



## mesh (Oct 14, 2011)

Is the wifi fix only for PEAP setups or has anyone tried it on regulal PSK setups?


----------



## droidyman (Sep 23, 2011)

mesh said:


> Is the wifi fix only for PEAP setups or has anyone tried it on regulal PSK setups?


I initially tried this on WPA-PSK then WPA2 and it is still working for me, connecting to the AP on boot.


----------



## mesh (Oct 14, 2011)

Thanks I will give it a shot!


----------



## neostryder (Aug 20, 2011)

droidyman said:


> I have tested this dozens of times. I did a clean install with the CM7 provided fsck_msdos and prior to booting into CM7 for the first time renamed the fsck_msdos from Webos and have been rebooting time and time again with tons of files in the /media/internal directory.


Okay, trying this now. So you start with a fresh webOS install, no Android residue, then install CM7. Before it gets a chance to boot in Android, use moboot to boot webOS. Do your trick, then at last boot into Android and go nuts with the SDCARD partition and there will be no more corruption?

I appreciate your help on this!

-neostryder


----------



## droidyman (Sep 23, 2011)

neostryder said:


> Okay, trying this now. So you start with a fresh webOS install, no Android residue, then install CM7. Before it gets a chance to boot in Android, use moboot to boot webOS. Do your trick, then at last boot into Android and go nuts with the SDCARD partition and there will be no more corruption?
> 
> I appreciate your help on this!
> 
> -neostryder


Yes, that is correct. Install CM7 as posted, prior to booting CM7 for the first time boot WebOS perform the update and then boot CM7 as needed.


----------



## neostryder (Aug 20, 2011)

droidyman said:


> Yes, that is correct. Install CM7 as posted, prior to booting CM7 for the first time boot WebOS perform the update and then boot CM7 as needed.


Okay, I can definitively say that this doesn't solve the version of the problem that I am experiencing. I did all the steps, and when I got back to the point of moving my apps to the SD Card, it blew up in my face again, but only after moving around 20 of the biggest apps. I'm starting to think that what I am experiencing is a separate issue.

-neostryder


----------



## neostryder (Aug 20, 2011)

Okay, here's what I just posted to issue #69:

Okay, I tried the following and I am still experiencing the issue that I have had in the past:

Clean wipe of TP
- Remove Android partitions
- webOS full wipe
- 3.0.2 doctor
Reinstall CM7
Reboot into webOS before CM7 starts for the first time
Perform droidyman's steps to rename fsck_msdos to fsck_msdos-old (http://rootzwiki.com/showthread.php...rnal-file-delete-upon-reboot-amp-WIFI-Connect)
- cd /tmp
- mkdir system
- cd /tmp/system
- mount -o loop /dev/store/cm-system /tmp/system
- cd /tmp/system/bin
- mv fsck_msdos fsck_msdos-old
- cd /
- umount /tmp/system
- reboot
Perform wizard in CM7 for initial setup
Download ALL of the apps from my Google and Amazon accounts (~150 apps)
Start moving apps to SD Card

Here is when it craps out. After having moved twenty or so apps, it blew up on me again, meaning that I got the error again. I have attached a pic of what the icon looks like. The message says:

Removed SD card
SD card removed. Insert a new one.

I restarted numerous times, and it does not work after that. Oddly, though, /mnt/sdcard/ is available in the File Manager app, but .android_secure is empty and the download folder is missing...other stuff is probably missing, too. Now, if I try to move something to the SD Card, I get an error stating: "Failed to move application. There is not enough storage left." I'm starting to believe that the issue I am experiencing may not be the same as everyone else's after all. And I forgot to get a dmesg. Any suggestions?

Thanks!

-neostryder
View attachment 4585


----------

