[f200] Folders Get Emptied!


Redsandro

Still Fresh
Joined
Aug 1, 2008
Messages
98
Location
127.0.0.1
Website
www.rednet.nl
Ok this is my final post tonight, I don't mean to look like I'm spamming or something.. I am very serious.

I played around with a lot of games, videofiles and music now. Trying to install more, I discovered the strangest behavior. Simply put, whenever I copy these apps in these folders, they get automatically removed on reboot!

CODE
/game/zDoom/
/game/Transport Tycoon Deluxe/
/gmenu2x/


Now when there's a dir with no runnable files, all the firmware browser sees is [..] (back one dir).
But when I enter these folders, not even [..] is shown. Now I can live without those games... but everybody wants gmenu2x!

-edit-

Got another two
CODE
/game/space_varments/
/game/Wolfenstein 3D/

and I didn't even enter that folder on the gp2x, but it's empy each time I booted.
I noticed this because I created a folderstructure on my drive and I synchronise it.
 
Last edited by a moderator:
Sounds like the sd card isn't getting unmounted, so the cached data isn't written to the card.

One fix would be to be an SD card reader.
 
Hmm..

I have this card-reader for sd-cards usb stick thingie that I used because I got it for free with the sd-card. Your idea made me think about trying 'safely remove hardware' before pulling out the sd. I thought this necessity was removed in XP. But this is not the cause either.

It appears when I remove the stick and insert it again, the same folders are emptied again! So this is NOT the gp2x's fault.

Would this brand new sd card be broken already? I tried and inserted it in my digital camera. Took a picture, put it back in the usb stick and read out the picture just fine.

But when I write 'awassdhfsfgasfgsfg' to a random textfile, re-insert the stick and open the file again, it sais 'ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ'.

I'm pretty confused. I also have an internal card reader but somehow it reads nothing. (not even my oldschool 32M cards which I know are working).

-edit-

I tried copying the files directly on the sd inside the gp2x using the cable. The exact same problem. Oh dear..
 
Redsandro said:
I thought this necessity was removed in XP. But this is not the cause either.
If you have "Optimize for quick removal" enabled on your removeable device it should be OK to unplug. I always use "Safely remove" icon because I have had corrupted USB sticks anyway. Don't trust Windows to get it right.

Redsandro said:
It appears when I remove the stick and insert it again, the same folders are emptied again! So this is NOT the gp2x's fault.
Try running "chkdsk /f" on that drive to ensure the FAT32 filesystem is intact.
When in doubt, re-format if you already have your data in a backup.
 
Last edited by a moderator:
bman said:
If you have "Optimize for quick removal" enabled on your removeable device it should be OK to unplug. I always use "Safely remove" icon because I have had corrupted USB sticks anyway. Don't trust Windows to get it right.

I have that enabled. I guess I won't trust Windows.

bman said:
Try running "chkdsk /f" on that drive to ensure the FAT32 filesystem is intact.
When in doubt, re-format if you already have your data in a backup.
There were no errors, but I reformatted anyway. A few times just because formatting is the only thing that's fast. For now, everything seems to works fine.

Thanks for helping.



-edit-

Oh no it's back!

I tried GMenu2x - autodetect programs and all was fine. It stored files and they are still there after reboot.
However, any file I change (i.e. move to another section) gets corrupted. It works until I restart GMenu2x and the edited links are gone. Examination shows the corrupted file data is changed to "ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ"(...)

Sigh..

GMenu2x sais on the 'taskbar': 1868/3887 MB on a 8GB SD card. Is this a bug, or does this mean my card isn't properly detected?
(Windows corrupts files, too, but it sais the size correctly.)

Would formatting the card ext2 help? I think this is not fs related but not sure anymore..



-edit-

All files I copy are ÿÿÿÿÿÿÿ(...) now. (I tried creating links for GMenu2X manually.)
Here's an interesting "chkdsk /f" output:

CODE
D:\Documents and Settings\God>chkdsk /f f:
The type of the file system is FAT32.
Volume RED_GP2X8GB created 8/8/2008 3:52 PM
Volume Serial Number is 54E6-B764
Windows is verifying files and folders...
Removing nonvalid long folder entry from \gmenu2x\sections\found gpe...

D:\Documents and Settings\God>chkdsk /f f:
The type of the file system is FAT32.
Volume RED_GP2X8GB created 8/8/2008 3:52 PM
Volume Serial Number is 54E6-B764
Windows is verifying files and folders...
Removing nonvalid long folder entry from \gmenu2x\sections\found gpe...


Note that it gets fixed every time, and I cannot delete the folder in explorer because windows claims the folder is not empty, even though it is and I think it wasn't even there before I ran chkdsk.. because I just deleted it.

Out of frustration, I'm going to format the SD card to ext2. To rule out Windows flockups.




-final edit-

I read here that although ext2 is supported, it's a bad idea and comes with a hassle to activate it. So I crawl back to FAT32.
In another topic about failing SD cards, someone wrote this hint:
imhotep said:
You may as well try 'zero-filling' the card with HDD Low Level Format Tool. It fixed one of my 4GB SD's a few months ago. It takes about 15 minutes and then you need to pull card out of PC reader, reinsert it, then format.

So I dd'ed zero's on the card using Linux:
CODE
sander@MC-RED:/dev$ sudo dd if=/dev/zero of=/dev/sdb
dd: writing to `/dev/sdb': No space left on device
16382977+0 records in
16382976+0 records out
8388083712 bytes (8.4 GB) copied, 3610.97 s, 2.3 MB/s
Took approximately exactly an hour..

On the other hand, this topic has some useful info too:
juanvvc said:
You can format your SD cards in EXT2 and the Gp2x will support them. Just modify /etc/fstab in your Gp2x to mount EXT2 as the default filesystem for SDs. You can even write a simple script to mount the SD as EXT2 and if it fails, try FAT32.
icon_question.gif
But how do I edit the fstab? It's quite easy using the F100, but how do I do it on F200?

icon_question.gif
Is there an option to mount with a speed limit? Maybe 1Mbps tops will keep this SD on track.

Anyway in the mean time, I used gPartEd to create FAT32 again on the card. This time in linux. Having the card in the GP2X to transfer everything back. 2,5MBps is a slow pony, so I'll get back with good or bad news later.

-update-

Questions still stand. But I am dubbing this 'broken SD card' because errors are inconsistent.
 
Last edited by a moderator:
I unfortunately don't have a fix for your problem, but I did experience much the same issues with my A-Data 8GB SDHC card. I was never certain if it was triggered by a certain amount of data being put on the card or what, but at some point when adding files I would always start getting errors such as you are seeing. Long symbols as filenames, etc...

I gave up pretty quickly trying to track it down and went with an ugly method to make it work. Basically I went with the ext2 method, unfortunately the information in the thread you quoted isn't entirely accurate. It turns out the first partition has to be FAT because of the way the automount stuff works in the GPH firmware...if this is incorrect someone tell me how to make it work, because I'd love to know.

So I have a small FAT partition along with a large ext2 partition that is in fstab and gets mounted in the /root/start.sh script. The next problem is that the built in menu and gmenu2x can't see the partition. Nothing can be done about the built in menu, but I managed to work around the problem in gmenu2x by symlinking my mounted partition to /mnt/ext, which is unused on the f200. Then I can select programs from gmenu2x from there...

So a big kludge to get it all working. I do get card issues sometimes still that are fixed by running fsck on the partition, so it could be that there is something wrong with it still...

If you don't have serial access to you're f200, the only way you'll get this working is to write some scripts to copy the needed files onto a card and then after editing them on your pc, copy them back.
 
Interesting information.. Did the ext2 work or is it 'a nicer way of being broken'?
Because I had similar issues copying files just in windows, unmount/mount the card and reread in windows showed no files. So if windows alone screws this up, I'm thinking of a broken SD card.

However, come to think of it, it only broke after using it in my F200 once. Can be coincidence, but I don't know..

I am about to send my card back to the shop to get a new one. Do you think GP2X is the cause of a faulty card, in stead of the card itself?
 
Yes, I would say it "fixed it". I don't get any weird filename problems or the card acting read only anymore. Like I said, I have had to run fsck on it a couple of times, but now that I think of it, that might be from never umounting the card before turning off the unit...

It is a bit of trouble to deal with though in some cases...I might clean it off and try fat32 again for "fun".

I can't speak to if its likely the gp2x causing problem or not. I didn't mess with it long enough to really get a good feel for it... I can't see how the gp2x could do anything that a format of the card couldn't fix though...

****EDIT****
Well, after an initial failure, so far so good. Only put <2G of data on yet though... The initial failure was created the fat32 partition as "fat32 (LBA)", type 'c' with linux fdisk. I immediately got trash file name, etc when I tried to transfer files after formatting. So I repartitioned using just fat32, type 'b' with linux fdisk. I will continue to dump files on there and see if it screws up again as more data is added....

****EDIT 2****
4 GB now and still looking good. I'm hopeful.
 
Thanks for trying.

I am very confused as to why this behavior would occur. If bits are broken, one would expect them to be broken in both FAT32 and EXT2.

Here's my 8Gig SD formatted as FAT32 with 8 gigs of video on there, compared with the sources:

SD8G.png


The thing that troubles me is that 'rotten' clusters are exactly in the last half, leaving the first 4Gig good.

I'm gonna try two partitions now, one 4G EXT2. If I get similar results, I know for a fact it's a faulty SD card and I'll return it.
 
sounds like you got a faked card there, those are quite common, especially at ebay.
so the card you have is probably actually a 4gb one but was relabeled as 8.

you could try a "dd if=/dev/sdb of=testfile.img bs=1M skip=4000" and check if its all 0 or FF, if it is then its probably fake.
 
Thanks for that advice! You were right!

I was trying to find this out in a very obnoxious way using two 4G partitions. But you are right. Now I understand why all the ÿÿÿÿÿ in my files. ÿ has an ascii value of 0xFF.

It wouldn't fit in my hex-editor so I dropped a smaller file. I leart that everything is 0xFF avove 4010 blocks? (strange number?)CODE
dd if=/dev/sdb of=testfile.img bs=1M skip=4009 count=1 # This gives real data
dd if=/dev/sdb of=testfile.img bs=1M skip=4010 count=1 # .. and up - this gives 0xFF all the way


But how is this possible? How come it does report 4 extra fake GigaBytes? Is it possible to hack SD into saying it has 8 gigabytes or something? Can I undo the hack so it simply won't store more than 4 GB?
 
Redsandro said:
It wouldn't fit in my hex-editor so I dropped a smaller file. I leart that everything is 0xFF avove 4010 blocks? (strange number?)
SD cards have a reserved section of the card, which you can only access by a challenge/response mechanism. It's there to store top secret information like DRM certificates/etc. It can't be accessed by normal software.

Redsandro said:
But how is this possible? How come it does report 4 extra fake GigaBytes? Is it possible to hack SD into saying it has 8 gigabytes or something? Can I undo the hack so it simply won't store more than 4 GB?
SD cards have a CID (Card Information/Identification) area. Here is where it states the capacity of the card (in bytes for SD card, in blocks for SDHC cards). It's a write once sector. Sadly, there's nothing you can do apart from create a partition on your card of 4GB and using that. Will work under Linux, but I don't think Windows will handle it.
 
Last edited by a moderator:
I get it. Some nasty trick. I fell for it but found out sooner than later.
I sent my card back. When I get a refund, I'll probably pay twice as much to buy a SD card just here in the city. That's how I know it's a good one. Thanks for clarification.

Squidge said:
SD cards have a reserved section of the card, which you can only access by a challenge/response mechanism. It's there to store top secret information like DRM certificates/etc. It can't be accessed by normal software.
dd is pretty standard/normal software, right? :) But is it really purposely hidden for certificates and the likes, or is it 10 MB of relocatable bits in case some accessable bits on the SD card start failing? I know hard drives have that. Don't know how many though.
 
Last edited by a moderator:
Back
Top