Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

disk fragmentation : defrag

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Discussion
View previous topic :: View next topic  
Author Message
jjmac
LXF regular


Joined: Fri Apr 08, 2005 2:32 am
Posts: 1996
Location: Sydney, Australia

PostPosted: Sat May 16, 2009 2:16 am    Post subject: disk fragmentation : defrag Reply with quote

Howdy all,


defrag disk defragmentation file-systems
========================================

Something i saw in a thread on an other site, discussing fragmentation issues in Linux.

And, as there seems to be a number of people who visit here and are also involved in site maintenance/administration -=- I thought it would be interesting, to read about their thoughts on this.


I'm hoping we can bypass the basics. Such as different file systems for different purposes and the general good design of Unix like/Linux file systemsin general ie; block groups.

(But if we must then i guess we must ...)

And focus more on the strategies people use to address this.

It would seem to me to only really be of concern to a system where the creation and removal of files involves writes of largely differing block numbers. Making it not always possible to find a continuous block sequence to fit. Along with a fairly good whack of file size increase due to editing activity. In which case a fragmentation situation would be unavoidable. If just left to itself, that is.

Either way it seems to me that blocks have just got to be moved about eventually, probably large numbers, if a system is prone to this type of thing. Which, tends to spell 'tar' to me.

So ...

# What kind of problems have you struck ?

# What solution(s) did you use to fix them --- defrag tools etc ?

# programs ?

# Which ones sux, which ones don't ?

# Did you ever leave it until it just got so bad ... ?


Smile


jm
_________________
http://counter.li.org
#313537

The FVWM wm -=- www.fvwm.org -=-

Somebody stole my air guitar, It happened just the other day,
But it's ok, 'cause i've got a spare ...
Back to top
View user's profile Send private message
Dutch_Master
LXF regular


Joined: Tue Mar 27, 2007 2:49 am
Posts: 2354

PostPosted: Sat May 16, 2009 2:36 am    Post subject: RE: disk fragmentation : defrag Reply with quote

I'm having a bit of an issue on understanding what you're after here?

1) Linux/Unix filesystems are far superior to anything from Redmond. So much so that fragmentation is rarely an issue, likewise defragging the system.
2) Based on 1) Linux/Unix users never have to defrag their systems, at least not on purpose.
3) I've never heard of a defrag-tool for anything other then DOS and NTFS based systems, I suppose because no-one needs them...

Mind that without understanding the basics, a sensible discussion could not happen... Wink
Back to top
View user's profile Send private message
nelz
Moderator


Joined: Mon Apr 04, 2005 12:52 pm
Posts: 8002
Location: Warrington, UK

PostPosted: Sat May 16, 2009 8:07 am    Post subject: RE: disk fragmentation : defrag Reply with quote

More recent filesystems, like ext4 and btrfs, leave empty blocks at the end of a file, so it can grow without fragmentation.
_________________
Unix is user-friendly. It's just very selective about who it's friends are.
Back to top
View user's profile Send private message
gerdesj



Joined: Tue Feb 12, 2008 8:38 pm
Posts: 41

PostPosted: Sun May 17, 2009 11:04 pm    Post subject: Re: RE: disk fragmentation : defrag Reply with quote

Dutch_Master wrote:
I'm having a bit of an issue on understanding what you're after here?

1) Linux/Unix filesystems are far superior to anything from Redmond. So much so that fragmentation is rarely an issue, likewise defragging the system.
2) Based on 1) Linux/Unix users never have to defrag their systems, at least not on purpose.
3) I've never heard of a defrag-tool for anything other then DOS and NTFS based systems, I suppose because no-one needs them...

Mind that without understanding the basics, a sensible discussion could not happen... Wink


Quite an "on message" answer, however you might to look here for a defragmenter:

http://vleu.net/shake/

I don't believe any FS can not suffer from fragmentation. I have no definate stats but anecdotally, my old laptop running a constantly updated Gentoo ~x86 system for four years benefited from Shake.

Obviously, anecdote !== data, but I think it is worth it occasionaly.

Cheers
Jon
Back to top
View user's profile Send private message Visit poster's website
Rhakios
Moderator


Joined: Thu Apr 07, 2005 12:18 am
Posts: 7473
Location: Midlands, UK

PostPosted: Sun May 17, 2009 11:26 pm    Post subject: RE: Re: RE: disk fragmentation : defrag Reply with quote

From time to time, file systems get checked at boot up. If you don't have one of those flashy framebuffer boot screens in the way, you can see a result flash up of % discontinuity of files. This usually tends to be pretty low on file systems that have at least 30% free space and aren't seeing too many re/writes, usually less that 10%.
Installing a new OS once a year seems to keep it low, only the home directory is ever around, unformatted, on any of my machines for much longer than that. Having said which, my home folder was only showing about 7% discontinuity last time I saw it checked, so I don't find it a huge problem.
The question is whether or not it's worth it for file systems that get fuller than 70%, or which stick around with lots of file turnover for a long time. As jj suggests, a tar backup, formatting the partition and then untarring the data back would be one way of solving the problem. Shake looks like an interesting little utility with some neat features.
Of course, what we really need is benchmarks. Wink
_________________
Bye, Rhakios
Back to top
View user's profile Send private message
gerdesj



Joined: Tue Feb 12, 2008 8:38 pm
Posts: 41

PostPosted: Sun May 17, 2009 11:44 pm    Post subject: RE: Re: RE: disk fragmentation : defrag Reply with quote

A quick re read later of the top post.

I personally rarely bother worrying about fragmentation on my "work" systems. By the time fragmentation might be an issue, we probably would have talked the customer into new hardware! In a corporate environment typically h/w is written off over three years. Rarely does a machine last > 5 years before moving to new hardware.

When I am looking at an old crusty system, then to try and wring a bit more performance out, I'd start by analyzing the workload and killing off old stuff.

To be honest defrag has never featured high on my list of things to do. I have predominately used reiser3 for file systems and I don't think that fragmentation has been a real issue.

I have used Shake a few times but only on my personal systems. I certainly don't do the Vista thing of running it every time a new piece of software is installed 9)
Back to top
View user's profile Send private message Visit poster's website
jjmac
LXF regular


Joined: Fri Apr 08, 2005 2:32 am
Posts: 1996
Location: Sydney, Australia

PostPosted: Tue May 19, 2009 1:57 am    Post subject: RE: Re: RE: disk fragmentation : defrag Reply with quote

Howdy all,

And thanks for the feed back. I'd mention the actual site and thread but that tends to sit a bit uneasily with me. Though i suppose it shouldn't.


In any case, it was one of those recently installed Linux and is threatening to go back to windows over a defrag issue he/she was having.

They said their system was involved high volume usage involving large (30M) files.

It did seem somewhat strange to me. Especially as the 'maintainer' appeaed to have just done a default Linux install, and left it at that. And was claiming the file system was running with a 60% discontinuity. Specifics had to be probed out of him as well i might add Wink.

I could see their point, but it did seem to me that regardless of the whys and wheres --- the real problem they had was having a lack of stategy to deal with the situation. For if or when it should arise.


Dutch_Master wrote:
>>
I'm having a bit of an issue on understanding what you're after here?
2) Based on 1) Linux/Unix users never have to defrag their systems, at least not on purpose.
>>

Just some feed back from peoples experiences along these lines. As per the post.

On #1 --- the keyword being 'rarely' which is what this here is about.
On #2 --- to broad a statement and the point that the other thread poster was using as a 'it's not my fault' excuse Smile . 'Never' is really only a general purpose statement, and so can be a bit mis-leading.
On #3 --- Either have i. Except for Con Kolivas' defrag script. But it isn't the kind of thing a person couldn't put a script together themselves for, and then, of course add elaborations to over time. Such as cancelling inode flags, using a dedicated write-to and write-from partition etc.


Dutch_Master wrote:
>>
Mind that without understanding the basics, a sensible discussion could not happen...
>>

And get bogged down in too ... i was hoping to assume responces were already inclusive in that regard Smile. Which, not surprisingly, they are.



nelz wrote:
>>
More recent filesystems, like ext4 and btrfs, leave empty blocks at the end of a file, so it can grow without fragmentation.
>>

Yes, ext4 was mentioned. But not the added facility.
btrfs wasn't mentioned, and is a new one to me.



Rhakios wrote:
>>
From time to time, file systems get checked at boot up. If you don't have one of those flashy framebuffer boot screens in the way, you can see a result flash up of % discontinuity of files. This usually tends to be pretty low on file systems that have at least 30% free space and aren't seeing too many re/writes, usually less that 10%.
>>

I like watching it all scroll by too Smile. And the free space that the person had available was one thing that hadn't been mentioned ...


Just on the % discontinuous return that fsck comes up with. It just goes to show, that it is up to the person to be able to interpret what the tool is trying to tell them. That is, they need to be in control of their system, rather than the other way round.

Such as --- for say, a 4G partition, with a standard new ext2 file-system created on it with a 1% reserve ... the discontinuous percentage should be around 9.x%. Falling with further usage. That's purely due to the dispersal of meta-data writes at the beginning of the array of 'block-groups' which make up the file-system. And doesn't lend itself to any defrag issue at all.

I'll have to go and mention that on the other thread :evil' (grin).

Thanks again for all your feed back -=- of course -=-

Smile


jm
_________________
http://counter.li.org
#313537

The FVWM wm -=- www.fvwm.org -=-

Somebody stole my air guitar, It happened just the other day,
But it's ok, 'cause i've got a spare ...
Back to top
View user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast