| View previous topic :: View next topic |
| Author |
Message |
bulb
Joined: 19 Jan 2006 Posts: 50
|
Posted: Thu Jan 26, 2006 5:52 pm Post subject: Reclaim the lost space on memory stick |
|
|
Hi,
I have written a large file on memory stick without checking for free space on it. The file was larger than available space, so subsequent sceIoWrite() calls failed. I have quit the application and removed the file that showed size 0. After checking the size of memory stick, it was full! I can't reclaim the lost space. I now have 0.8 Gb memory stick, instead of 1 Gb. :)
I know I could format the stick (I don't have important data on it anyway), but I would really like to solve this programatically. Do you know how to find used blocks that aren't really used?
Anyway, I think there is a potential to make a memory stick optimize/defrag tool. |
|
| Back to top |
|
 |
nullp01nter

Joined: 04 Jan 2006 Posts: 26 Location: Saxony/Germany
|
Posted: Thu Jan 26, 2006 6:03 pm Post subject: |
|
|
| As I think it is a FAT32 filesystem (correct me if I'm wrong), you have to access the stick on a sector basis. Then you'll have to search for lost clusters (look here: http://staff.washington.edu/dittrich/misc/fatgen103.pdf for a description of FAT32). Alternatively you can try to fix it via USB (use a filesystem repair utility, probably a chkdsk would be enough). |
|
| Back to top |
|
 |
bulb
Joined: 19 Jan 2006 Posts: 50
|
Posted: Fri Jan 27, 2006 3:55 am Post subject: |
|
|
null,
You were right - chkdsk did the trick.
The posted document look cool. I have one question though, do you know how to physically (not logically) read the memory stick (via PSP, not Windows or any other system)?
Thanx |
|
| Back to top |
|
 |
nullp01nter

Joined: 04 Jan 2006 Posts: 26 Location: Saxony/Germany
|
Posted: Fri Jan 27, 2006 7:18 am Post subject: |
|
|
| Quote: | | The posted document look cool. I have one question though, do you know how to physically (not logically) read the memory stick (via PSP, not Windows or any other system)? |
Well, ..., no. I searched the SDK for some candidates to do that kind of "direct access", but as I understood, e. g. the fread() and fwrite() functions are more or less directly processed by the PSP firmware. So when I tried to trace the function call from fread() backwards, I was stopped at the doors of the firmware :)
At the time when I suggested to directly play with the FAT32 I had no clue that there's no (or hard to find?) functions which do the job. Or can someone of the SDK developer give a hint?
Thoralt |
|
| Back to top |
|
 |
|