3

Is it worth it? there is e2defrag. How long will it takes for 120GB? 8h will be enough?

I would like to improve read/write on the hard disc. hard disc seems to be new(9 months old). its in my work machine, i'm java programmer.

6

What are your read/write rates? How much of an increase are you looking to gain? You probably won't get that much of an increase out of defragmenting.

The time needed for defragmenting your data will very much depend on the rate of fragmentation, amount of files and read/write speeds of your disk and other speed-factors of your hardware. 8h should be enough, but I can only guess.

Fragmentation is always an issue, but ext2/3/4 reserve some space to make sure they are able to write data in one go instead of always having to scatter it around. You can check how much space is reserved with tune2fs -l /dev/<your device> | grep -i reserve. Reducing the reserved amount will likely increase fragmentation over time, while increasing the reserved amount will likely not help to decrease fragmentation further.

If you need to increase your read/write, maybe operating over a ramdrive will help for scenarios where you don't have too much data but a lot of small files. Also you may want to check SSDs out to increase your r/w.

Also refer to this answer for information on fragmentation.

  • 1
    Changing the reserved space ( it is reserved for root so the system can still boot and write log files and such, not for fragmentation reasons ) will not itself have any affect on fragmentation. Actually filling the disk to capacity will. – psusi Dec 24 '11 at 20:10
4

Defragmentation of ext2/3/4 filesystems is unnecessary (if you always have a little free space). They don't get badly fragmented, under normal use.

0

I'm assuming that you aren't actually using ext2, but rather ext3 or ext4. Both are quite good at avoiding fragmentation, especially ext4. As a result, you almost certainly will not notice any difference after running e2defrag. As for how long it will take; that depends entirely on how much data it has to move. The first time you run it can take some time, but subsequent runs should be very fast. It is quite possibly one of the fastest defrag algorithms there is, though an unsafe one; if it is interrupted in the middle, you can kiss your filesystem goodby.

  • I don't understand. why i'm not using ext2? are you a hacker? please don't hack into mycomputer – UAdapter Dec 26 '11 at 20:38
  • @UAdapter, huh? Because nobody has used ext2 for the better part of a decade. – psusi Dec 27 '11 at 1:58
  • are you sir calling me a liar? I use ext2 on my work machine. I'm trying to get that changed, but there is no reason for it. see here - askubuntu.com/questions/90175/… – UAdapter Dec 27 '11 at 10:17
  • @UAdapter, no, that is just very unusual so I assumed you were mistaken. It is an easy mistake to make, and in fact, isn't entirely inaccurate to say you are using ext2 when you are in fact using ext3 or 4 because they are largely backward compatible minor extensions to ext2. – psusi Dec 27 '11 at 14:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.