Skip to content
Skip to main content

About this free course

Download this course

Share this free course

Introducing computing and IT
Introducing computing and IT

Start this free course now. Just create an account and sign in. Enrol and complete the course for a free statement of participation or digital badge if available.

5.5 Fragmentation

“I have noticed that a hard disk drive gets slower the fuller it gets. Why is that?” asked Rupert.

“If your operating system tries to save a file that cannot be stored in a single cluster, the file system breaks up the file into cluster-sized chunks and tries to save them in contiguous clusters.”

“What does ‘contiguous’ mean?” Rupert interrupted.

“It just means clusters that are next to each other on the disk. However, if contiguous clusters are not available, the file is fragmented, which means that the remaining clusters are written elsewhere on the same disk. That is called fragmentation, and it can slow down system performance because the file system must direct the heads to several different areas of the disk to find all the data in the file you want to read. The extra time for the heads to travel to a number of locations causes a delay before the entire file is retrieved.

“If you want to, you can change the cluster size of your hard disk drive when you format it. But you have to bear in mind that, although a larger cluster size reduces the potential for fragmentation, and reduces the amount of disk space needed to store information about the used and unused areas on the disk, a larger cluster size will also increase the likelihood of unused slack space.”

Activity 14 (self-assessment) Slack space

  • a.Given that a cluster size on a particular disk is 2 KB (kilobytes), what is the physical size of a file with a logical size of 69 KB? What is the slack space in this case?

To use this interactive functionality a free OU account is required. Sign in or register.
Interactive feature not available in single page view (see it in standard view).
  • b.Given that a cluster size on a particular disk is 4 KB, what is the physical size of a file with a logical size of 69 KB? What is the slack space in this case?

To use this interactive functionality a free OU account is required. Sign in or register.
Interactive feature not available in single page view (see it in standard view).
  • c.What percentage increase in slack space does doubling the cluster size cause in this case?

To use this interactive functionality a free OU account is required. Sign in or register.
Interactive feature not available in single page view (see it in standard view).

Answer

  • a.To find the physical size, first calculate the number of clusters the file will require, which is given by 69 / 2 = 34.5. So the file will need 35 whole clusters. The physical size of the file is 35 × 2 KB = 70 KB. Hence the slack space in this case is 70 KB – 69 KB = 1 KB.
  • b.To find the physical size, first calculate the number of clusters the file will require, which is given by 69 / 4 = 17.25. So the file will need 18 whole clusters. The physical size of the file is 18 × 4 KB = 72 KB. Hence the slack space in this case is 72 KB – 69 KB = 3KB.
  • c.The percentage increase in slack space is given by (3–1)/1 x 100%=200%

“I have heard of something called ‘defragging’,” said Rupert. “Is that related to what you are talking about?”

“Yes,” said Gloria, “when you defragment (or defrag) a hard disk, you are using a software utility that moves the chunks of files to try to arrange them in contiguous clusters.” (Figure 20)

Described image
Figure 20 (a) A fragmented file occupying six clusters and (b) the same file after defragmentation

“Windows 10 should automatically schedule a defragging utility for you – once a week, by default,” said Gloria.

“How about on a Mac?” asked Rupert.

“There is no defragging program built into the operating system because OS X defrags files itself using Hotfile Adaptive Clustering (HFAC). It works by identifying the read-only files and files that are accessed frequently, and then allocating them to a space on the outer track of the disk called the ‘hot zone’, which has faster access. In general, then, it is not necessary to defragment a Mac, although it may become necessary to buy and use a utility if the system slows down when working with large files such as multimedia files, video editing tools, and so on, which require frequent read and write operations of large files.”

Activity 15 (self-assessment) Speed of a hard disk drive

Give two factors that determine the speed at which a file can be accessed from a particular hard disk drive.

To use this interactive functionality a free OU account is required. Sign in or register.
Interactive feature not available in single page view (see it in standard view).

Answer

  1. The speed of access depends on where the file is stored on the disk. Clusters on the outer tracks of the disk are accessed more quickly than clusters on the inner tracks of the disk.
  2. If a file is highly fragmented, it will take longer to access than a file that is stored in contiguous clusters.