On Fri, 2003-07-18 at 12:34, Spencer Butler wrote:
> I have an HDD that is in need of a defrag.  I know the ext2 filesytem is
> not 'suppose' to need to be defragged, but mine does.  I think using
> bittorrent is a part of the cause.  Bittorrent downloads 'hunks' of the
> file at a time, and in no certain order.  I do not claim to know the
> exact reasoning behind my assumption (that bittorrent is the cause of my
> fragmentation) but I do think it is the source.
> 
> I would very much like to remedy the situation.  Mike Hicks suggested
> that simply coping the files back and forth my take care of it.  While
> that does sound like a plausable remedy, I don't really have the disk
> space to do that.

You can't even do it one file at a time?  If that's the case, I think
you'd better start digging for loose change in the couch to find money
for more storage ;-)

Some simple scripts could be written to do this.  Well, they can be very
simple if you don't care about permissions and such, but more complex
stuff can be somewhat difficult.

An easy (though probably slow) way to do this would be to run the two
commands

        find /path -type f -exec gzip -v --fast {} \;
        find /path -type f -exec gunzip -v {} \;

That might mess up permissions, but I'm not 100% sure.  Also, it would
be scary to do on files that end up bigger when compressed (MP3s, video
files, etc), as you might run out of disk space.

> I have read the man page for defrag and am wondering if this is safe to
> do?  I do not intend to use windows defrag to solve this problem (for
> more reasons than 'its windows'). 

I would be wary of using the defrag program.  I've never really heard of
anyone using it, and I don't know if it would work very well with the
various extensions that have been made to the ext2 filesystem over the
years.

> Has anyone had any experience siumular to these?  Any ideas on the
> safest way to solve this problem?

I've only looked into defragmenting my hard drive a few times since I
started using Linux.  The first time was when I was new to Linux and
didn't know that the filesystem was more intelligent about how files get
laid out.

The second time was fairly early in the period when I started
downloading music files.  I thought the fragmentation level seemed
high.  However, I was informed that a file was considered by fsck and
other tools to be 'fragmented' even if it just had two pieces.  With big
files like that, you're more likely to have a partition with an apparent
high fragmentation level, even if the files are mostly contiguous.

However, it's quite possible that you're running into real fragmentation
issues with BitTorrent.  I noticed the sparse file stuff happening when
I first used it a week or so ago (to download Mandrake 9.1).  Having a
file say it's 600 MB when it really isn't is very annoying (well, it was
annoying for me since I needed to clear up space for it -- I wasn't
warned that it was going to take up all the space on the disk..)

-- 
 _  _  _  _ _  ___    _ _  _  ___ _ _  __   I bought some powdered
/ \/ \(_)| ' // ._\  / - \(_)/ ./| ' /(__   water, but I don't know
\_||_/|_||_|_\\___/  \_-_/|_|\__\|_|_\ __)  what to add to it.
[ Mike Hicks | http://umn.edu/~hick0088/ | mailto:hick0088 at tc.umn.edu ]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://shadowknight.real-time.com/pipermail/tclug-list/attachments/20030718/71264a43/attachment.pgp