SD Card Defragging!

awsumnes1

New member
I was going to title this "Read this thread if you like HUGE . . ." but was a little worried egarc and dropshort would break a finger hitting the mouse button . . . I hope some of you are reading anyway. This is quite important!

Well, I got home today, JUMPED OFF the little school bus, unfastened the old crash helmet, and set to work with the priorities: hug my girl, feed the dog, and . . . oh yes . . . figure out why Kinoma Movie clips (or any other players' clips you have on your card) are ALWAYS fragmented, almost right from the start. Now I know you're saying "I don't defrag my SD Card, I'm bad enough with the PC," but you must remember I'm English and well, not quite "right."

I use Norton Utilities "Speed Disk," which isn't the greatest for C Drive on the computer (often makes a bigger mess than you had to start with, and does NOT defrag directories on a FAT32 drive). However, it is GREAT for the SD Cards for the Palm (or anything else). Kinoma, I noticed, was always fragmented and the 10-12 clips I keep had up to 12 fragments.

The long and short of it is, place them AT THE END of the SD Card. Don't place them "after" everything else -- place them LAST ON THE VERY END. You'll not only notice THEY don't fragment, they also don't cause fragmentation of other smaller files.

I use CardBackup from jkware, in two sets of backup files called "CdBU1 and CdBU2." #1 backs up at 5AM, #2 at 5PM. I don't want these scattered all over the place either, and as they are contantly appended and grow in size as more goes on the T3 to be backed up, they are likely candidates for fragmentation too as they eventually have to "curl around" directories which cannot be moved.

Place THOSE FILES at END OF files. Not last on disk with Kinoma -- following the other contiguous files. You'll need to open the folder, then HIGHLIGHT ALL of the files within, and wait about 4-5 seconds for them to "list" on the Norton display. Do it for all sets (most of you will have only one).

Oila. No fragmentation. Zero. Nada. That is especially important since restoring doesn't need any additional glitches as it is!

Thought I'd pass it along. SD Cards are GREAT for "linear memory;" i.e., they put data in a nice contiguous "lump." However, deleting and adding files, editing files, adding and removing, etc soon rearranges that data - so much so that sometimes you need to take a "photo" on the hard drive (copy them all to the PC), format the card, and copy them back. This should alleviate that need.
 
The "knee-jerk" reaction is leaner, cleaner, more responsive, less chance of wasted space, less chance of lost "bytes" that cause something not to open. This happened to me with a TealInfo Folio.

The HONEST answer in practical terms is probably "not much." I'm just picky. With Kinoma loaded at the END of a 245MB card, and activating the app, the response time to load the clips is the same as when it was "closer to the top" of the disk -- so access time is not affected much that I've seen.

Most people save, erase, reload data on SD Cards and never even think about it -- and that indeed might be best since SD Cards are fast, but volatile memory media. I just think when something you check on Norton Speed Disk "claims" to have fragments, you have to wonder why, and I set about fixing it.

Another solution for people with REALLY HEAVY useage would be take a "snapshot" onto the PC with a card reader, burn that to CD for safety, format the disk and SLOWLY reload the files back on (I don't think it hurts to load 1-2MB at a time, although I'm sure you could "slam" the whole folder(s) and just wait - that's where I see a HUGE difference in the Panasonic cards).

It's certainly defragged then - because formatting erased all the current and long erased "directories." That's where you hit snags - those directories, like on a FAT32 Hard Drive, can't be moved under normal defrag. So programs placed AROUND them are obviously "split" and fragmented. Formatting and reloading once every 6 months would not only force ou to back up in case the card went bad; it would also "lay a clean slate" on the SD. These SD Cards are wonderfully "linear" in how they accept data in a contiguous order - doesn't get better than that. However, when you decide you don't need that map of Mobile, Alabama any longer, you create a hole which may or not be filled back in. Any file manager like Filez or TealMover will indicate you've freed up almost exactly that amount of space to the BYTE, but "filling it in exactly" is unlikely so gaps are created.

I've defragged hopefully for the last time til end of year, at which time OS6 may be replacing the T3, and I'll reformate the card for THAT UNIT and load everything back on from the PC. I just thought it strange that Kinoma fragments more than any other file and by placing them at the end they're "out of the way but accessible" and the other files are more neatly compacted.
 
The reason people defragment disks is exactly as specified, to put things in contiguous order to make load times shorter from a disk drive. With a spinning disk, you have a rotation/latency time which occurs - which means, if things are not contiguous, you need to wait until the disk turns (rotation) to reach the next section. You also have to wait for the disk "head" to be positioned to the right cylinder and track (latency). This is a short time on the new 7200 rpm disks, but it still takes time.

Earlier disks, which had a slower rotation, and a slower seek time (time to position the head to the cylinder/track), gained greatly by defragging the disk.

Now, lets look at an SD card. No rotation, no placement of a physical "head" to the cylinder and track - no delay based on mechanical movement. Nanosecond positioning to the "address" on the card.

I've been using the same SD card for over a year and haven't noticed more than 1 nanosecond difference from deleting and adding files. The time it takes to save / format / reload an SD card would take 100s of years to make up from just using the card.

Defragment programs don't know the difference between an SD card and a normal "mechanical" disk, and so report that you can see "great" savings in access time, which is totally false when it comes to "non-mechanical" disks such as Compact Flash, SD, MM or memory stick devices.

The main element in their speed is the flash read/write process implemented by the manufacturer, and the "speed" of the card itself. Some (more expensive cards) have a faster read/write time since the electronics have a much faster electronic cycle.

This is the same as speed ratings on a PC. The difference between a 233mHz processor and a 2.4Ghz processor is the difference in read/write to the PC memory and how fast it can access an instruction.

For me, defragmenting an SD, MM, CF, Memory stick is just a waste of time. Minutes (hours?) versus nanoseconds.

fnagle
 
Sure, it's a non moving medium, and thanks for pointing that out fnagle - I hadn't thought of that - I was just looking at "results."

2.4GHz is which? The PC, right? 233Mhz-400Mhz would be the . . . Palm. That woudl be slower, then. I would contend that access time would be helped out by continuity, but that's me.

I wouldn't think it was worth defragging a 32MB card -- but a 256 or 512 or 1+GB? I'll take the roughly 20 seconds it takes to defrag if only for the fragmented file safety issues and knowing it's defragged. It's not something to be done daily or even monthly - but 20 seconds once or twice a year? Why not save similar 5-6 MB files from being all over the place when you can organize them in one place on the disk?

I haven't lost a file or been unable to read a file since defragging, starting a few months back with a 64MB card!!

I just wish there was a way to defrag ONCE, but get all the DIRECTORIES placed together - that would probably put fnagle and I in the same boat - as long as there aren't MAJOR changes to what's on there, information would not then be "arranged" around those directories - little gaps here and there would indeed be irrelevant.
 
No, the 233Mhz referred to the speed of earlier PC's versus todays PC. SD, MM, CF, Memory sticks all have their own "write" speed based on internal circuitry. At 233Mhz - 400Mhz on a Palm type device, the access to the card is nothing compared to how fast the card itself can write the data. Finding the location on the card is still in the nanosecond range, writing depends on the card electronics. The reason a Panasonic (compare this to the 2.4G( may be faster than a SanDisk or Lexar (compare these to the 233Mhz).

As for allocating directories - unless disk operating systems have changed from the original DOS - (File structures under XP have changed to allow for larger volumes) - when a disk (card) is formatted, space is reserved for directories on the disk. This is the reason when you format a card you see a portion is already "used". This is the space reserved for all the files you may place on the disk in the future. In addition, disks / "cards" have space reserved for "bad tracks". This means that the disk has actually more space than specified and if during a format operation it discovers a bad "track" it sets a pointer to the "reserved" space and assigns that new area as the "original" track for the disk. If a disk is truely "bad", you then encounter the problem of not having enough "good reserved space", and you'll see total reduced space on the drive because of tracks being "marked" bad/unusable.

I think that you'll find that all the directories are "together" on the disk, and each directory entry "points" to where the file is located. This was done to allow all systems to know where to look for the directory, instead of having to search the entire disk, then locate the file it points to. Once again, because you don't have a mechanical positioning of the "head", you're talking nanoseconds.

Once the disk finds the start of a file, it reads the first track, and this track contains a pointer to the next track and so on. When talking about a physical (mechanical) disk, if the next track is not contiguous, the disk has to reposition the head to the appropriate cylinder and/or wait for the track to revolve under the head, before it can read the next track. Most operating systems provide a memory "buffer" to speed up this process and will read more than the requested track into memory. Once in memory, if the next read is for sequential data, then there isn't a need to read more. If the next read is for non-sequential data then the process of read and buffer starts over again. With a card, the process is the same, but you have eliminated the read (fast), position the head (slow), read (fast) with read (fast), position the head (fast), read (fast) sequence.

It amazes me, that after 20+ years of working with computers, I'm still "waiting" for the computer to complete a task. I was glad to move from a 300 baud modem to a 1200 baud modem, and today I'm dissatisfied with 128kb internet access! available in my home here in Peru.

The same applies to the computers we use. The first "mainframe" filled a room and my Palm T|3 is faster, has more memory, can do more and fits in my "palm" :-).

Frank
 
I was actually joking about the 233MHz thing . . .

Yes, they never seem fast enough.

This is a wonderful battling of posts - I told you I wasn't "right!"

I'm probably the only guy on the planet that worries about defragging an SD Card and I appreciate very much the lengths to which you "non-combatively" refuted some of my theories.

Man, I love this forum. Take care buddy. "I promise I won't defrag today, and it's been two weeks since my last defragging . . . ."

Hee hee!!
 
In keeping with the non-combative post on SD cards -

Each card has a certified number of write cycles before the card "wears out". Normally, one wouldn't expect to reach this limit in one's lifetime, since the number of "cycles" is quite high. Each time you "defragment" the card, you use up additional write cycles by rewriting all the data to the card. So technically, your using up your write cycles (hurting your card) faster than just reading the data already in place :-).

You may have to buy another card in your next lifetime :-).

(Sorry, I just couldn't resist - but as it was once said - "the devil made me do it")

Frank

P.S. I promise - no more posts on defragging... My lips are sealed and I won't tell anyone else that your defragging.
 
Does anyone have a 2gb SD card running okay on a Tungsten T3. Need that Fat32 driver, (I guess).

I'm going to connect my T3 with Card Export to make my 1gb aDATA SD card a virtual drive.

Then, for the heck of it, I will use O&O defrag do a defrag on the card and see what happens.

I also have been using my 1gb aDATA card for about a year and never defraged it. I have loaded and unloaded a lot of filles (mostly .ogg audio files).
 
Back
Top