Reply
Thread Tools
Posts: 7 | Thanked: 0 times | Joined on Dec 2005
#1
I remember in days of yore when I used MS-DOS, I would occasionally have to run the CHKDSK command to reclaim space on my fat-based hard disk. Since flash cards are formatted as vfat, which is more or less fat, is it still necessary to run CHKDSK or the equivalent. Or has the need for a CHKDSK command gone away?
 
Posts: 123 | Thanked: 6 times | Joined on Dec 2005 @ Los Angeles
#2
chkdsk was replaced by defrag in msdos in the last versions. The later windows only equivalent still exists in windows XP.

That said I don't see any real need for defraging the flash since you aren't booting off of it and deleting and writing 1000's of files to it constantly. FAT32 (the successor to msdos FAT16) is pretty resiliant to fragmentation. I would be more worried about bad sectors on the flash if the firmware doesn't do a good job of balanced wear writes on the flash.

EDIT: **Whoops! I got defrag mixed up with scandisk (my bad)

Last edited by Tweak; 2006-02-23 at 03:29.
 
Posts: 333 | Thanked: 7 times | Joined on Dec 2005
#3
There is a ram defrag for the 770...you can find it on the maemo wiki...I ran this thing on the 770. It says it did something...but I have yet to notice anything different after running it.
 
hczim's Avatar
Posts: 13 | Thanked: 0 times | Joined on Jan 2006
#4
I can hardly see any reason why you'd want to defragment your flash. Defragmenting a disk reduces the seek times involved. There isn't anything like a seek time for a flash - it simply doesn't matter in which order its blocks are read/written.
On the other side, the number of allowed writes to a flash memory cell is limited, and defragmenting concentrates your data at lower addresses. But I somehow doubt you'll ever reach a critical number of writes anyway so this probably won't matter much.
 
Posts: 19 | Thanked: 0 times | Joined on Nov 2005 @ UK
#5
Originally Posted by Tweak
chkdsk was replaced by defrag in msdos in the last versions.
Chkdsk and defrag do different things, both existed in later versions of MSDOS. Chkdsk finds and corrects errors on the disk, i.e. differences between files on the disk and the file allocation table. Defrag re-arranges files on disk to be contiguous for performance reasons.
__________________
Nokia 770 + Navigation Kit
 
Posts: 98 | Thanked: 3 times | Joined on Feb 2006
#6
the way that data is stored on flash memory is "fragmented" on purpose due to load leveling. you want to store all new data in the blocks that have been used the least so that the memory will wear evenly and the usable life of the card will be extended. However, do to the way flash memory work, it make no difference if the data blocks are physicaly contigous like it matter on a disk. file system blocks on memory cards are virutal blocks anyway and a certain file system block's mapping to a physical spot on the card can change after deleteing data and adding new data.

chkdsk, or scandisk in win9x/dos7, might still be needed, but in very rare cases. the way data is stored on card is not as susecptable to corruption as hard disks.
 
Posts: 7 | Thanked: 0 times | Joined on Dec 2005
#7
The problem that CHKDSK solved has nothing to do with fragmentation. To oversimplify a bit, a FAT-formatted disk contained

space in use + free space + unavailable space

The "unavailable space" was literally that: space that could not be used to store files (I am not referring to the space that is made unavailable as a result of formatting the disk). Unavailable space was the result of disk errors: FAT was not a bulletproof file system. Unavailable space tended to grow over time. In other words, the amount of available space (used + free space) tended to shrink over time. Running CHKDSK would locate the unavailable space and move it to free space, thus restoring the effective size of the disk back to its original size.

My question might be rephrased as "Does VFAT lose space like FAT as a result of errors, and, if so, what command do you use to get it back (other than reformatting the disk)?"
 
Posts: 98 | Thanked: 3 times | Joined on Feb 2006
#8
the last time I saw FAT mark things with bad sectors, and then actualy recover them and use them again, with with an MFM disk. this just doens't happen on moderm disks.
 
Posts: 7 | Thanked: 0 times | Joined on Dec 2005
#9
Wow, this is harder to explain than I thought. The problem that I am talking about does not have anything to do with bad sectors.

As I understand it, FAT stands for "File Allocation Table." Basically,
the FAT table describes where on the disk each file is stored. For example, if you wanted to find out where file "stuff.txt" was stored,
you would look up "stuff.txt" in the FAT table and the latter would tell you that the file was stored at locations x, y, z, ... on the disk.

However, the FAT file system was poorly designed. The information in the FAT table would get screwed up every so often as a result of various computational errors (I can't think of any example off the top of my head). The practical effect of a screwed up FAT table was to make a portion of the disk unavailable for use. There was not anything wrong with the disk, the problem was a screwed up FAT table.

What CHKDSK did was to unscrewup the FAT table. I remember a friend telling me, back in the days when a 30 Meg (not Gig) HD was considered humongous, that he ran CHKDSK and recovered 2 Megs of disk space. That would be 6.6% of a 30 Meg disk.

These days, I hardly ever use the FAT or VFAT file system except on my Nokia 770 when using a flash card. I am trying to find out if (V)FAT is still a screwed up file system that requires commands like CHKDSK.
 
aflegg's Avatar
Posts: 1,463 | Thanked: 81 times | Joined on Oct 2005 @ UK
#10
Interesting - I never knew that about FAT. I'd suggest here, though, isn't the best place to ask the question (Google is your friend).

If it is something which will affect the 770, though, let us know your findings ;-)

Cheers,

Andrew
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 00:22.