1 00:00:00,520 --> 00:00:03,840 Speaker 1: Welcome to Brainstuff from how stuff works dot com where 2 00:00:03,840 --> 00:00:14,840 Speaker 1: smart Happens. Hi, I'm Marshall Brain with today's question, how 3 00:00:14,880 --> 00:00:20,200 Speaker 1: does disk defrag work? The word disk defrag is typically 4 00:00:20,320 --> 00:00:23,880 Speaker 1: used to refer to the Microsoft Windows utility called the 5 00:00:23,960 --> 00:00:27,760 Speaker 1: disk defragment or. It's designed to solve a problem that 6 00:00:27,760 --> 00:00:31,280 Speaker 1: occurs because of the way hard disk store data. If 7 00:00:31,320 --> 00:00:34,680 Speaker 1: you've read the article how hard disks work, then you 8 00:00:34,800 --> 00:00:39,320 Speaker 1: know three key facts about hard disks. First, hard disk 9 00:00:39,400 --> 00:00:42,760 Speaker 1: store data in chunks called sectors. If you imagine the 10 00:00:42,800 --> 00:00:45,600 Speaker 1: surface of the disc divided into rings like the rings 11 00:00:45,600 --> 00:00:48,760 Speaker 1: of a tree, and then imagine dividing each ring into 12 00:00:48,800 --> 00:00:53,040 Speaker 1: pie slices, a sector is one pie slice on one ring. 13 00:00:53,600 --> 00:00:56,800 Speaker 1: Each sector holds a fixed amount of data, like five 14 00:00:57,160 --> 00:01:00,840 Speaker 1: and twelve bytes. The hard disk has a small arm 15 00:01:00,960 --> 00:01:03,360 Speaker 1: that can move from ring to ring on the surface 16 00:01:03,360 --> 00:01:06,559 Speaker 1: of the disk to reach a particular sector. The hard 17 00:01:06,640 --> 00:01:08,840 Speaker 1: disc moves the arm to the right ring, and then 18 00:01:08,840 --> 00:01:12,520 Speaker 1: it waits for the sector to spin into position. Third, 19 00:01:12,640 --> 00:01:15,959 Speaker 1: hard discs are slow in computer terms compared to the 20 00:01:16,000 --> 00:01:18,360 Speaker 1: speed of the processor in its memory. The time it 21 00:01:18,440 --> 00:01:20,680 Speaker 1: takes for the arm to move and for a sector 22 00:01:20,720 --> 00:01:24,160 Speaker 1: to spin into place is an eon. Because of fact 23 00:01:24,200 --> 00:01:27,760 Speaker 1: number three, you want to minimize ARM movement as much 24 00:01:27,800 --> 00:01:31,720 Speaker 1: as possible, and you want data stored in sequential segments 25 00:01:31,760 --> 00:01:34,600 Speaker 1: on the disc. So let's imagine that you install a 26 00:01:34,600 --> 00:01:38,000 Speaker 1: new application on an empty hard disk. Because the disk 27 00:01:38,160 --> 00:01:40,440 Speaker 1: is empty, the computer can store the files of the 28 00:01:40,440 --> 00:01:44,959 Speaker 1: application into sequential sectors on sequential rings. This is an 29 00:01:44,959 --> 00:01:48,120 Speaker 1: efficient way to place data on a hard disk. As 30 00:01:48,160 --> 00:01:51,880 Speaker 1: you use the disc. However, this efficient technique becomes harder 31 00:01:51,920 --> 00:01:54,800 Speaker 1: for a disk. What happens is that the disc fills 32 00:01:54,920 --> 00:01:58,760 Speaker 1: up and then you erase files to reclaim space. Those 33 00:01:58,760 --> 00:02:01,840 Speaker 1: files that you delete are scattered all over the surface 34 00:02:01,880 --> 00:02:04,680 Speaker 1: of the disk. When you load a new application or 35 00:02:04,720 --> 00:02:07,280 Speaker 1: a large file onto the disc, it ends up being 36 00:02:07,320 --> 00:02:12,320 Speaker 1: stored in hundreds or thousands of these scattered pockets of space. Now, 37 00:02:12,400 --> 00:02:15,600 Speaker 1: when the computer tries to load the scattered pieces the 38 00:02:15,680 --> 00:02:18,400 Speaker 1: discs ARM has to move all over the surface and 39 00:02:18,440 --> 00:02:22,560 Speaker 1: it takes forever. The idea behind the disc defragment or 40 00:02:22,639 --> 00:02:25,320 Speaker 1: is to move all the files around so that every 41 00:02:25,360 --> 00:02:29,120 Speaker 1: file is stored on sequential sectors on sequential rings on 42 00:02:29,200 --> 00:02:33,119 Speaker 1: the disc. In addition, a good disk defragment or may 43 00:02:33,200 --> 00:02:36,840 Speaker 1: also try to optimize things even more, for example, by 44 00:02:36,880 --> 00:02:40,520 Speaker 1: placing all applications close to the operating system on the 45 00:02:40,560 --> 00:02:44,880 Speaker 1: disc to minimize movement when an application loads. When done 46 00:02:44,960 --> 00:02:49,760 Speaker 1: well on older discs, defragmenting can significantly increase the speed 47 00:02:49,800 --> 00:02:52,880 Speaker 1: of file loading. On a new disc that's never filled 48 00:02:52,960 --> 00:02:56,240 Speaker 1: up or had any significant number of file deletions, it 49 00:02:56,280 --> 00:02:59,680 Speaker 1: will have almost no effect because everything is stored sequentially 50 00:02:59,720 --> 00:03:03,560 Speaker 1: all ready. As you might imagine, the process of individually 51 00:03:03,639 --> 00:03:06,799 Speaker 1: picking up and moving thousands of files on a relatively 52 00:03:06,800 --> 00:03:10,720 Speaker 1: slow hard disk is not a quick process. It normally 53 00:03:10,760 --> 00:03:15,240 Speaker 1: takes hours for the defragment or to run properly, ensure 54 00:03:15,320 --> 00:03:19,360 Speaker 1: that you have no other applications running, and then run 55 00:03:19,400 --> 00:03:22,920 Speaker 1: the defragment or sometime late in the evening before you 56 00:03:22,960 --> 00:03:25,000 Speaker 1: plan to go to sleep, or before you go out 57 00:03:25,040 --> 00:03:27,400 Speaker 1: to dinner or something, so it has a big chunk 58 00:03:27,440 --> 00:03:30,919 Speaker 1: of time to do its job. For more on this 59 00:03:31,120 --> 00:03:33,600 Speaker 1: and thousands of other topics, is it how staff works 60 00:03:33,639 --> 00:03:38,120 Speaker 1: dot com