LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Defragment FAT32 from Linux (https://www.linuxquestions.org/questions/linux-newbie-8/defragment-fat32-from-linux-481814/)

kniwor 09-09-2006 03:36 AM

Defragment FAT32 from Linux
 
k, so i got dual boot on some machines, and the main partition for keeping DATA is FAT32, which is badly fragmented almost always, since machines are usually in Linux and hardly are booted into windows, it is hard to run a defragmentation software from there, i need a linux solution that can do the job, and it would be good if it runs automatically....

stress_junkie 09-09-2006 07:13 AM

Disk defragmentation has always been ignored in the Unix world. I don't believe that there is a disk defragmenter that runs in Linux. The only thing that you can do, as far as I know, is to back up the partition, reformat the partition, and then restore from backup.

kniwor 09-10-2006 10:10 PM

any windows code that has been tested to work fine under wine

lleb 09-10-2006 11:38 PM

no clue but for a few bucks i would sugest Diskeeper as the best windows 3rd party app for defrags.

lleb 09-10-2006 11:38 PM

http://www.diskeeper.com/defrag.asp

enjoy

Dummy-in-Linux 09-11-2006 02:04 AM

Linux file systems resist disc fragmentation. A typical Linux disc partition would typically be between 2% and 5% fragmented and rarely exceed 20% fragmentation.

For this reason the Ex2defrag program is rarely used, especially as the partition has to be unmounted, and therefore becomes unusable during processing.

Many systems administrators would regard as unacceptable having to put a partition out of service for the duration of a defragmentation.

There is also an argument that defragmenting files actually degrades performance and disc space availability by undoing the benefits of the sparse file storage that is employed by Linux

gnuzilla 02-17-2012 01:20 PM

Fat32 Defrag
 
I know this is years late, but a search brought me to this post.

@Dummy-in-Linux: Did you actually read the original question? ".., the main partition for keeping DATA is FAT32, ..."
It's almost like people just see the words 'Linux' and 'Defrag', and immediately go on the "Linux filesystems don't need to defrag rant".
Seriously if you search this question, expect that unrelated rant somewhere on every post.

If anyone has a an alternative solution, I would really appreciate any help.

NOTE: 'alternative solution' means not one of these crappy workarounds.
1. Boot any other OS, looking for something native GNU/Linux.
2. Manually. or automatically, recreating the filesystem.
3. O&O Defrag Linux BETA, Will not defrag FAT16/FAT32 or NTFS

jefro 02-17-2012 03:11 PM

At one time the official way to defrag windows was to backup it and restore it. That still hold true if you have no other way. You tar it off and tar it back.

qrange 08-14-2012 03:37 AM

yeah, right we all know backup+restore would 'defragment' it. but thats not a real solution. because good defragmenter will place often used files near disk edge, leave small gaps, etc. and it should be faster. also doesn't need so much extra space.

problem is, even Windows software doesn't have good FAT32 defragment as they all rely on builtin API which cannot move FAT32 directories :(

There is "Partition Logic" bootable .iso that supposedly can defragment FAT32, dunno if its reliable.

David the H. 08-14-2012 08:02 AM

You can try this filesystem-agnostic defragging script. It appears to simply reorder the files in largest-to-smallest order.

http://ck.kolivas.org/apps/defrag/

I've never tried it myself, so I can't vouch for it. From a quick glance at the code though there are a couple of lines that tell me it's currently not safe to use if any filenames contain embedded newlines, at the least.


All times are GMT -5. The time now is 08:13 PM.