From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 831DA138010 for ; Wed, 5 Sep 2012 19:04:15 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 336EFE07F9; Wed, 5 Sep 2012 19:03:54 +0000 (UTC) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com [209.85.217.181]) by pigeon.gentoo.org (Postfix) with ESMTP id 18A09E07A0 for ; Wed, 5 Sep 2012 19:01:54 +0000 (UTC) Received: by lbbgk1 with SMTP id gk1so606418lbb.40 for ; Wed, 05 Sep 2012 12:01:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type; bh=gDcEDUVKY0rVGuHcKz8N03zBpGjplsXu/PwUEqTJDgM=; b=hsVJnAypIbuWGMrz845GlXPzDB/+bfSw0eJdLrMhgWQjgZsGgFXk7VMWtYelDA5QKr dXwAAJeOiZQEt/m7idQGFLeShDnuwZ6UKY7IA6371GDB1VWJrtZ2l54MON0rZfJeFulE Mm0e9h5idSfJ4RwvRHIYFXv7xwbXnR7LxtkoMEfkrLKMT6nLBbtVIyc8DNR7Idpk/jFn /Es6NYzUUBBe6U68MSxzfHVE8tTGDQIpuKHoQ2mek9m9lpIGJVfHKACX7SMzMXqRibly 0orFNEWtNw6qUtZrBJT4ho1MphuWHTHcLTequbc5VzUMsEi71LI2J4MknuCC09eBa/AL ZQVg== Received: by 10.112.37.8 with SMTP id u8mr10995lbj.30.1346871714021; Wed, 05 Sep 2012 12:01:54 -0700 (PDT) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Sender: paul.hartman@gmail.com Received: by 10.112.29.132 with HTTP; Wed, 5 Sep 2012 12:01:32 -0700 (PDT) In-Reply-To: <504793C5.7060909@gmail.com> References: <20120904072003.GD3095@ca.inter.net> <201209051225.18653.peter@humphrey.ukfsn.org> <50473F39.5080603@gmail.com> <201209051358.43675.peter@humphrey.ukfsn.org> <504793C5.7060909@gmail.com> From: Paul Hartman Date: Wed, 5 Sep 2012 14:01:32 -0500 X-Google-Sender-Auth: FI_Hp_4Fp-Y4NENOcl1XxijYSPw Message-ID: Subject: Re: [gentoo-user] aligning SSD partitions To: gentoo-user@lists.gentoo.org Content-Type: text/plain; charset=ISO-8859-1 X-Archives-Salt: d0585d6a-6366-4dd5-928a-014e92172978 X-Archives-Hash: b82ba42c64d58ecc693d82a4db2d1578 On Wed, Sep 5, 2012 at 1:02 PM, Dale wrote: > Peter Humphrey wrote: >> On Wednesday 05 September 2012 13:02:01 Dale wrote: >> >>> I find that after a big update, like KDE, it helps to defrag /usr. >> Interesting. I've just run sudo e4defrag -c /usr and got a fragmentation >> of zero. That's after upgrading KDE last week. >> >> Then I ran it on all the nine ext4 partitions here and only two had >> nonzero fragmentations; one was 1 and the other 2. >> >> Looks like I can forget about it on this box. >> > > I have to say that here, it is not a whole lot of fragmentation but it > does seem a bit faster afterwards. I guess it depends on what is > fragmented and such. I sometimes wonder if it defrags itself. Even > when I watch the fsck when booting, all the ext4 partitions have a very > small percentage of fragmentation. My /boot which is ext2 is fragmented > as heck. lol I'm not worried about it tho. ;-) When I was using > reiserfs, it was always a good bit of fragmentation. > > Just thought it was worth a mention since this is the first time I saw a > Linux defrag tool. I think almost all linux defrag tools/techniques deal with file fragmentation only, that is to say one file with more than 1 extent, but don't deal with filesystem fragmentation (10000 small files scattered all over the drive, rather than written contiguously). So I'm not surprised that Peter did not see fragmentation after installing KDE. AFAIK almost all that modern defrag tools do is just copy the file, allocating the whole file at once in the copy process, and if that new copy has fewer extents than the old copy, it fills in the data, then removes the original file. The concept is not entirely dissimilar to the old "backup, format, restore" defrag process. Over the years I have used a poor-man's version of that concept to defrag files. Just move it to another drive (or -- even better -- a ramdrive/tmpfs), then move it back to disk (with a tool that performs preallocation). There is a userland defrag tool that does exactly this, on any filesystem. It is called "shake". Typically I only see fragmentation on large files that were copied from a slow source (over the network/internet), or bittorrent clients that do not preallocate space, etc. Any kind of streaming file that was written, huge multi-gigabyte video recording files, that kind of stuff. But the key to avoiding file fragmentation is preallocation...