forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Reclaim the lost space on memory stick

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
bulb



Joined: 19 Jan 2006
Posts: 50

PostPosted: Thu Jan 26, 2006 5:52 pm    Post subject: Reclaim the lost space on memory stick Reply with quote

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
View user's profile Send private message
nullp01nter



Joined: 04 Jan 2006
Posts: 26
Location: Saxony/Germany

PostPosted: Thu Jan 26, 2006 6:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
bulb



Joined: 19 Jan 2006
Posts: 50

PostPosted: Fri Jan 27, 2006 3:55 am    Post subject: Reply with quote

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
View user's profile Send private message
nullp01nter



Joined: 04 Jan 2006
Posts: 26
Location: Saxony/Germany

PostPosted: Fri Jan 27, 2006 7:18 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group