Gentoo Archives: gentoo-user

From: Paul Hartman <paul.hartman+gentoo@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Fragmentation of my drives. Curious mostly
Date: Wed, 03 Dec 2008 17:52:52
Message-Id: 58965d8a0812030952u2770e084y85fcf0abc5dcc1e2@mail.gmail.com
In Reply to: Re: [gentoo-user] Fragmentation of my drives. Curious mostly by Joshua Murphy
1 On Fri, Nov 28, 2008 at 10:09 AM, Joshua Murphy <poisonbl@×××××.com> wrote:
2 > On Fri, Nov 28, 2008 at 6:46 AM, Alan McKinnon <alan.mckinnon@×××××.com> wrote:
3 >> On Friday 28 November 2008 13:14:42 Dale wrote:
4 >>> If this is a little high, what would be the best way to defrag it?
5 >>
6 >> By not defragging it.
7 >>
8 >> It's not Windows. Windows boxes needs defragging not because fragmentation is
9 >> a huge problem in itself, but because windows filesystems are a steaming mess
10 >> of cr@p that do little right and most things wrong. Defrag treats the
11 >> symptom, not the cause :-)
12 >>
13 >> Reiser tends to self-balance itself out. What is especially noteworthy is that
14 >> none of the general purpose Linux filesystems provide a defrag utility.
15 >> Theodore 'Tso and Hans Reiser are both exceptional programmers, if there was
16 >> a need for such a tool they would assuredly have written one. They did not,
17 >> so there probably isn't.
18 >>
19 >> Any Linux defrag tool you encounter will have been written by a third party
20 >> separate from the developers. It will move blocks around and update
21 >> superblocks, the drive will have to be unmounted for that to work and a
22 >> slight misunderstanding of how to do it will ruin data.
23 >>
24 >> Are you willing to take the very real risk of data corruption?
25 >>
26 >>> Is
27 >>> there a best way? I do have a second hard drive that I back up too.
28 >>> Both Drives are 80Gbs and I do have a set of DVD back ups as well. I
29 >>> can update those pretty quick.
30 >>
31 >>
32 >>
33 >> --
34 >> alan dot mckinnon at gmail dot com
35 >>
36 >>
37 >
38 > While not trying to incite flames here... xfs isn't general purpose?
39 > xfs_fsr defrags xfs partitions while they're mounted and is designed
40 > to be used from cron (it's in xfsdump, not xfsprogs). File
41 > fragmentation, while a fact of life on any filesystem that sees any
42 > real use, does slow access times, as the drive head has to jump from
43 > one place to another, so a lot of fragmentation is a bad thing... but
44 > as you say, we're not dealing with FAT based FS's here, so severe
45 > fragmentation only shows itself on very full filesystems. I very
46 > rarely see over 80% usage of my filesystems and have never
47 > consistently checked fragmentation levels, though, so I can't say
48 > whether xfs's being the exception on having a tool for the job means
49 > it particularly needed one...
50
51 I believe JFS has a filesystem defrag tool as well, but I don't think
52 it has a file defrag tool.
53
54 My favorite way to defrag individual files is to mv to /dev/shm, sync,
55 mv back to hard drive.
56
57 I've found fragmention to be noticable (as far as slowing disk read
58 speeds) on large files that were downloaded over the internet. Large
59 ISO images, TV shows etc that are hundreds of megabytes downloaded
60 over a long period of time (especially if multiple downloads are
61 streaming at once). On my old "slow" computer (P4 2.8ghz) the file
62 fragmentation on ext3 would get so bad that I could not burn DVD
63 backups of the files at full speed without first defragmenting them.