|
|
| Next: limited acces |
| Author |
Message |
drwho07

Joined: Nov 29, 2007 Posts: 1546
Location: Central FL, USA
|
Posted: Mon Sep 22, 2008 8:54 am Post subject: Defrag that Flash Drive? |
|
|
A few days ago I was updating one of my flash drives, that I carry with me on Service Calls, to hold all my Security Programs, Latest version of Firefox and all my utilities.
Well after adding and removing files for several months, my little PNY 'Attache' drive was getting badly fragmented. Being somewhat of a 'neat-freak' I wanted to FIX that.
The windows Defrag, my 'Visine' for Windows, does a pretty good job of "Getting The Red Out", but does little to "pack" the files to remove the big gaping holes in the data pattern.
I wanted to add Windows Dot Net Framework 3.5 (a 201.8mb file) but I didn't want it to be broken up when the Disk Operating System tried to fill the holes with the new file.
So what to do?
Voila! I decided to do the same thing I do with my Maxtor hard drive, to compact the files (remove all the spaces between files)
First I did a good cleanup on the little Flash Drive by removing all the old files that I no longer use. Then, booting into DOS with my Ghost 11.5 flash drive, I made a Ghost backup of my PNY Flash Drive (FD) to a large partition on one of my HD's.
I then Verified the image and then did a Restore of that image back to the PNY FD.
As I had anticipated, the PNY FD was now perfectly organized with NO spaces in the data pattern. Like this:
For those who don't, or won't, use Ghost or some comparable imaging software, there is another way to do this little job of reorganizing their Flash Drive(s).
Copy, or MOVE all the data from the Flash drive to a hard drive, then reformat, or just DELETE, the Flash Drive and copy all the data back to the flash drive. All files will be written in sequential order with NO spaces between them. Voila! Job done!
The advantage to me, of using Ghost, is that when I'm done, I have a compressed backup copy of my flash drive, on my HD, just in case I ever need it.
Well, that's it....for a cloudy Monday morning.
Y'all have a great day now, Y'hear?
The Doctor
Tags still don't work like they used to!! |
|
| Back to top |
|
 |
goretsky

Joined: Dec 07, 2002 Posts: 9041
Location: Southern California
|
Posted: Tue Sep 23, 2008 3:36 am Post subject: |
|
|
Hello,
Did you try timing the defragmentation versus copying the files off the USB FLASH drive, reformatting it, and copying them back? Also, any idea which of the two methods is going to perform the least amount of writes to the NAND FLASH module(s) inside? As I understand it, those have a finite number of write cycles and I am wondering which method would allow the use of the drive for the longest period.
Regards,
Aryeh Goretsky |
|
| Back to top |
|
 |
drwho07

Joined: Nov 29, 2007 Posts: 1546
Location: Central FL, USA
|
Posted: Tue Sep 23, 2008 8:55 am Post subject: [Login to view extended thread Info.] |
|
|
| goretsky wrote: |
Hello,
Did you try timing the defragmentation versus copying the files off the USB FLASH drive, reformatting it, and copying them back? Also, any idea which of the two methods is going to perform the least amount of writes to the NAND FLASH module(s) inside? As I understand it, those have a finite number of write cycles and I am wondering which method would allow the use of the drive for the longest period.
Regards,
Aryeh Goretsky |
All good questions, but it really doesn't matter!
But, if it really mattered to me, and of course it doesn't, I'd have to say the Ghost method would result in the least amount of stress on the drive.
It involves only one read and one write.
If that simple process breaks the little drive, I'll throw it out and never buy a Flash Drive from that company again.
I don't trust PNY ram and I would NEVER install any in my PC, but I bought the PNY Flash Drives, because they were the cheapest ones in the store at the time.
So far, they have served me well. I have three of them....a 2 gig, a 4 gig and an 8 gig. My other Flash Drives are either SanDisk or NoName.(from Staples)
I actually have many Flash drives ranging from 64 megs to 8 gigs.
There is nothing on any of them that's not also on one of my hard drives.
So if one goes south on me, it's NO BIGGIE!
Cheers Mates!
The Doctor |
|
| Back to top |
|
 |
goretsky

Joined: Dec 07, 2002 Posts: 9041
Location: Southern California
|
Posted: Wed Sep 24, 2008 1:24 am Post subject: [Login to view extended thread Info.] |
|
|
Hello,
I actually meant disk I/O operations at the level of writing data to the blocks of cells which form the individual sectors which make up the clusters, updating the actual file allocation table with the new cluster's location, writes to the directory entry table, and so forth. I would think disk imaging or a straight file copy would consume the least, too, but haven't researched a good test methodology for this.
Regards,
Aryeh Goretsky |
|
| Back to top |
|
 |
drwho07

Joined: Nov 29, 2007 Posts: 1546
Location: Central FL, USA
|
Posted: Wed Sep 24, 2008 9:30 am Post subject: [Login to view extended thread Info.] |
|
|
The last thing I want to be accused of here is being argumentative, but does all that technical stuff really matter?
I'm sure all that stuff was important to the engineers that developed the Flash Drive, but to the guy on the street, who just needs a place to store his stuff, it's really a NON-Issue.
I'd still have to say that a Ghost backup and restore would put the least amount of stress on a flash drive. Even the FAT is written only once during a Ghost Restore.
I didn't want to get too technical in my original post, but just to say, "here's how to fully defragment a Flash Drive".
I'm seriously doubting the number of people who will actually do it, but the information is now in the archives anyway, for those who may want to.
Or call it an attempt to breath a little life into this dying forum.
The Doctor  |
|
| Back to top |
|
 |
zlim

Joined: Mar 11, 2005 Posts: 2636
|
Posted: Wed Sep 24, 2008 5:17 pm Post subject: [Login to view extended thread Info.] |
|
|
Actually, if you do some research - it is not recommended to defrag flash drives.
I have a flash drive aka ssd (solid state drive) as the main hard drive in my eeepc so I know it is not correct to defrag it as you would on any hard drive that has a read and write head because seek time doesn't change no matter where the files are placed. It is a different mechanism. |
|
| Back to top |
|
 |
goretsky

Joined: Dec 07, 2002 Posts: 9041
Location: Southern California
|
Posted: Wed Sep 24, 2008 7:53 pm Post subject: [Login to view extended thread Info.] |
|
|
Hello,
Since NAND flash devices eventually fail after a finite number of write operations, I thought it might be interesting in figuring out how to maintain a USB flash drive for as long as possible. While they may be a mature (semi-mature) technology today, I have some four-year-old USB flash drives that have failed (constant errors or no longer readable at all).
I suspect there are some people who use their USB flash drives to store personal files and do not back them up or store duplicate copies elsewhere, and I suspect that when their device fails, it is going to be an interesting data recovery scenario.
Like ZLim, I have read that seek time on solid-state disks is essentially 0 milliseconds access time on them runs in the microsecond range, and that the way that bytes are sequentially stored on them differs then from rotating media like floppy diskettes and hard disk drives, which makes for some different layout scenarios for what is considered a contiguous file. I would think, though, that that would be handled by the microcontroller on board and not be affected very much by fragmentation or from defragmenting, which is what makes your initial report of slow access so interesting. Up to about 8GB or so, the FAT file system is more efficient than NTFS, so perhaps there is something internal to Microsoft Windows that was causing the performance degradation that lead you to defragment the USB flash drive. Out of curiosity, did you every try accessing it from a Mac or a PC running a non-Windows operating such as Linux or BSD? If so, did it still behave poorly?
As for the forum dying, well, I've seen a few breaths of life in the past week. Maybe you have, too. : )
Regards,
Aryeh Goretsky |
|
| Back to top |
|
 |
drwho07

Joined: Nov 29, 2007 Posts: 1546
Location: Central FL, USA
|
Posted: Wed Sep 24, 2008 8:40 pm Post subject: [Login to view extended thread Info.] |
|
|
Ha Ha,,,,,re-read my post. I said nothing about loss of performance or any such.
All I said was that after many additions and deletions, my poor little Flash Drive was horribly fragmented, and I just wanted it to be NEAT like my hard drive.
I have absolutely NO need to plug it into any other computer.
It's now 100% NOT Fragmented and it makes me real happy.
It was always a matter of personal preference and never one of performance.
When any file is broken up into pieces and scattered around, the chance of data loss increases with every fragmentation.
I've minimized my chances of data loss by eliminating all fragmentation.
Job done! Nuff said!
Thank you all for your participation.
The Doctor  |
|
| Back to top |
|
 |
goretsky

Joined: Dec 07, 2002 Posts: 9041
Location: Southern California
|
Posted: Thu Sep 25, 2008 1:04 am Post subject: [Login to view extended thread Info.] |
|
|
Hello,
I had assumed--rather incorrectly, it seems--that you had defragmented the USB flash drive because you were experiencing a slowdown with its performance. The is the reason one would normally defragment a disk volume.
As I understand it, when a NAND flash memory cel loses the ability to flip its bit (hold a charge), the problem usually spreads to the cels adjacent to it along one axis (they are laid out in a grid-like fashion). That would mean that the bits stored next to it would be likely to fail as well, no?
I wonder if in the case of a solid state disk, where seek time and transfer speeds are essentially a non-issue, fragmentation might actually be a good thing since it would limit a bit-level error from becoming a byte-level error, and so forth.
Of course, the wear leveling algorithms used by some (all recent?) USB flash drives are supposed to ensure data gets written in blocks across the memory chips so that no one block gets an inordinate amount of writes, but I don't know of any practical (non-destructive) way to validate this.
Regards,
Aryeh Goretsky |
|
| Back to top |
|
 |
drwho07

Joined: Nov 29, 2007 Posts: 1546
Location: Central FL, USA
|
Posted: Thu Sep 25, 2008 11:17 am Post subject: [Login to view extended thread Info.] |
|
|
Forty some odd years ago, I might have cared about all the technical stuff, but at 65 I really don't give a hoot!
It's like the automatic transmission in my car......I don't care nor do I want to know what's in there or how it gets me to where I need to be. I just care that it DOES!
And when I doesn't I'll call AAA to take it to the garage for repair.
I found that when I passed 60 my interests changed considerably.
I no longer care how things work....I just care that they DO!
I no longer care about the bits & bytes, rows & columns in a Flash Drive. To me it's a black box, that either works or doesn't.
When it doesn't, I'll throw it away. I have plenty more.
When I go on a call, I take not one flash drive with me...... I take three,
all programmed with the same software.
As a backup, I have the same info on both a CD and DVD. I'm covered!
As I said previously, I doubt that anyone reading this forum will ever DEFRAG their Flash Drive, but if they do want to, like I did, now they will know how.
Cheers Maties!
The Doctor  |
|
| Back to top |
|
 |
|
|
|
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
|
| |
|
|