Unix Tip: Fragmentation and Unix file systems

1 comment | 3I like it!
September 28, 2004, 08:45 PM —  ITworld.com — 

Send in your Unix questions today!


See additional Unix tips and tricks


People who have had bad experiences on Windows disks that performed poorly after they had become very fragmented often wonder if they need to apply some kind of periodic analysis and defragmentation on their Unix systems as they transition into a Unix admin or user role. For the most part, the answer is no. Most Unix file systems don't become fragmented the way FAT and NTFS file systems do. But, rather than give a quick yes/no answer, let's take a look at what fragmentation, and why Unix file systems are not as prone to fragmentation as their Windows cousins and what you need to do when a Unix file system is fragmented.

What Causes Fragmentation?

Fragmentation comes about when a system cannot or will not allocate enough contiguous disk space to store an entire file in a single location on a disk. Instead, the file ends up being broken into a number of pieces that are written to various locations on the disk and the file system must then maintain some kind of file system structure that keeps track of where all the related file pieces are stored.

When a file is written to disk, it isn't always possible to write it to the disk in consecutive blocks. The disk may be too full to provide a single location that is large enough to accommodate the file. It takes longer to read a file when it is not stored in consecutive blocks since the disk's read-write head has to move more to gather the individual pieces of the file. While fragmentation is a performance issue, it is less of a problem on a system with an affective buffer cache with read-ahead. On such file systems, the file system may be fetching portions of a file while the user or the application is still occupied with the first few blocks.

Fragmentation on Windows

To see fragmentation on a Windows 2000 system, open Programs -> Accessories -> System Tools -> Disk Defragmenter. Then, click on the Analyze button. This will bring up a graphical display in which the disk areas containing fragmented files are shown in red and, optionally (i.e., if you click on View Report) a list of fragmented files, their sizes and number of fragments. Depending on the degree of fragmentation, the tool will recommend that you defragment the disk. You can then click on Defragment to assemble the files in a non-fragmented fashion. This operation may take quite a while to run, but may make a noticeable difference in your disk's performance.

Fragmentation is more of a problem on FAT file systems than NTFS, largely because the FAT32 file system predates many of the innovations in file system design that have made them work more efficiently.

Sign up for ITworld's Daily newsletter
Follow ITworld on Twitter @IT_world

I like it!
Comments

Article provides a great overview

You article is a very good starting point for someone who wants to learn about this topic.

The availability of ext4 and online disk fragmentaiton tools should alleviate this problem on open source UNIX implementations. Read my survey at

http://sharevm.wordpress.com/2008/12/16/435/

The Veritas file system support online defragmentation on all platforms on whic it runs. ufs on Solaris also support online defragmentation.

| reply
peer-to-peer

jfruh
Apple syncing patent can't come soon enough

pasmith
New Twitter features borrow from 3rd party clients

Esther Schindler
Open Source Changes the Software Acquisition Process

mikelgan
How to set up continuous podcast play on the new iTunes

David Strom
Five important Windows 7 mobility features

sjvn
Guard your Wi-Fi for your own sake                        

Sandra Henry-Stocker
Grepping on Whole Words

 

Sidekick: The Good News & the Bad News
Either way you look at it Microsoft Data Center management did not follow standards or best practices in this failure. In which case it makes me wonder more about the outsourcing of corporate data much less personal data.
- mburton325

Join the conversation here

The Daily Tip

The Daily TipQuick, practical advice for IT pros. Made fresh daily.

Hot tips:

Want to cash in on your IT savvy? Send your tip to tips@itworld.com. If we post it, we'll send you a $25 Amazon e-gift card.

Newsletters

Subscribe to ITWORLD TODAY and receive the latest IT news and analysis.

I would like to receive offers via email from ITworld partners.
By clicking submit you agree to the terms and conditions outlined in ITworld's privacy policy.
Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

Marketplace