Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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....
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.
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
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
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.