Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
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.
I searched for defradmentation options on Linux, but only found one post on that topic and people said it's not necessary to defragment the disk on linux. So I was just wodering if that's really the case. How can Linux not need to be defragmented? And how can one defragment the HD on linux?
Thanks!
Great site this linuxquestiosn.org, I just found it yesterday!
Originally posted by merlin371 but why do you not need it?
You only defrag a filesystem when its fragmented, which in Linux you don't need to, cause it doesn't get fragmented. Its the way they designed the filesystem, which is superior to Windows type filesystems.
Try searching, there are better explanations out there already on this topic.
Roughly saying, it's because the file systems are a conjunct of blocks of the same size. Files are allocated into those blocks, but the files are not of the same size of the blocks. This will generate a lot of blocks with wasted/empty space.
Linux, in another hand, tries to preallocate data in blocks of 8 units (ext2 and 3, no idea about the other file systems for Linux...). If a file is not in use or deleted, it reallocate the block, so no space is wasted.
That's why in Windows (FAT16/32, I have no idea how NTFS works...) you lose a huge amount of space after a while with half-used blocks. This is bad for performance as well, since it takes longer time to the OS access these blocks. Running a defrag fix it though, it frees space, make the system faster and so on...
I've heard of some tools to defrag Linux partitions, never tried any of them either (looks tough to use, cannot be used under mounted partitions and so on). It's not a matter that you don't need to defrag a Linux partition, actually, you could do, but the waste of space in blocks is to small to worry about it...
Again, I have no idea how NTFS works, but I'd like to know
Last edited by Mega Man X; 12-27-2003 at 05:41 PM.
Actually there is a company that is making software to defrag Linux. They "claim" it does get defraged. I have never seen mine get over about 3 or 4% myself. I delete and copy crap all over the place. Usually because I screw something up.
If you really feel you need it I may can search and find the company name. I sent them a e-mail. Still think they are milking a dead cow myself.
My advice, unless you are running some big fancy server that you need every ounce of speed from, don't worry about it.
Someone please correct me if I'm wrong, but I believe Linux file systems actually do fragment....so they came out with journal file systems (ext3 and reiser).
I may be mistaken about this, but i assumed these were, in a sense, self-defragging file systems. Ext2 is not.
Linux file systems can be fragmented. It's normal. Because Linux is multi-threaded and multi-user OS. And fragmented file system is good for these OSes. To defragment Linux can decrase performance.
Sometimes you can see your HDD is spinning so much. In that time, Linux changes inodes for files and reallocate some files for increasing performance. But it is not defragmantion.
Linux is a good designed OS. So don't worry about it. Only use
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.