The operating system plays a central role in managing how data is read from, written to, and presented from physical storage devices. This content covers storage media types, cluster-based data organization, file fragmentation, and OS-level data protection.
OS Storage Management
Storage on your computer is just made up of ones and zeros, and so any file is just a series of ones and zeros to represent different characters, graphics, programs, whatever the case may be. That's what goes onto the storage. However, that's not what we see in the operating system. Instead, the operating system represents it in little file icons and folder icons, and it displays it in some sort of organized folder fashion.
Here's some different media and devices that we can store data on. At the bottom here we have our magnetic storage, in the middle we have our solid state, and at the top we have our optical drive. Really, all of this provides this physical aspect to the computer so the computer can actually store data onto it, and then we have a protocol or interface to allow that communication to and from these devices. But the operating system needs to know how to input data through these protocols and interfaces onto these devices, and so that's really what the operating system does: it takes a big part in reading and writing data to these devices.
So now we have these physical devices, but your operating system really does a lot of coordination and figures out how to write data to these devices and also read data from these devices, and that's one of the jobs of an operating system.
Your storage drive is made up of clusters. Clusters are little sections of the disk, and there's a bunch of ones and zeros. There's different sizes, but one of the standard sizes is 4,096 bytes, and so each one of these clusters would be 4,096 bytes and it would be a series of ones and zeros. Now, sometimes a file will fit neatly inside of that. More often than not it doesn't, and it will take up many clusters to store a file.
Just to give you an idea how these files work, let's talk about fragmentation. Let's say I open up a file, I add some graphics to it, I save it, and it's a fairly large file. So what's going to happen is it's quite a bit larger than 4,096, and so it takes up a lot of clusters on the disk. Right here we have file one that's saved and it's taking up quite a few clusters. Now we create a new document, it's not quite as big, but we still save it and it's file two, and that's stored right here. If we go back and make a change to file one and add something, that's going to need more space, and there's no consecutive space now that's available for it. What's going to have to happen is it's going to store it in the next available slot, and so now file one gets stored here. As you can see, we have fragmentation: that file one is split amongst two areas here.
The operating system needs to know how to retrieve information from and put information into these different little containers that are on this device. But it can get a little confusing if we're just pulling data in and out of these little containers, and so we need some sort of representation of how to grab this information. So another thing that your operating system does is it provides navigation, so you can see the data that's actually stored in these devices.
In fact, if we want to break this down, your operating system does reads in from the system, it does writes to the system, it presents information that's on these devices, and then we also can use our operating system to prepare and manage these devices.
Another thing that your operating system is capable of doing is protecting the data on your device. That is, we don't want anybody just to be able to get onto our device and read all of our personal stuff, or be able to change the stuff that we have on it, and so there's this additional protection where it protects the data that's stored on these devices.
I'm on my demo laptop and I want to show you a visualization of these clusters. What I'm going to do is open up a program that's part of Sysinternals, and it's called DiskView64. So I'm going to open this up. It shows me the user account control, so yes, I'll accept that, and then I choose the drive down here of what I want to analyze. I'm just going to select the C drive, and then we'll make this a little bit bigger. As it goes, it's going to take a couple of minutes to do the full scan, so we'll wait till it does a full scan and then we'll talk about what's happening. But essentially all of what it's filling in right here, what we're seeing it filling in, is all of the clusters of this disk.
All right, now it's finished its scan; it took a couple of minutes to do. So what are we looking at? Down here at the bottom, this is showing you the full disk. This is the full disk, and the white space on here is an empty part of the disk. I can actually take a look at the legend to see what things mean. So the white is unused clusters, the blue is contiguous file clusters, the red means it's a fragmented file cluster, and the yellow just means it's highlighted.
So let's take a look at some of this. I'm going to zoom in a little bit. First of all, if I click down here I can select different parts of the disk, so I'm just going to start out right at the beginning here and we're going to zoom in so it'll get closer. All these dots, each one of those dots is a cluster. So you can see I can zoom really far in here. I'm not going to zoom quite that close in, but I can click on this and now it's showing you a file. That's a file right there. In fact I can see which file it is; it's this file right there, and then it shows you also the folder that it's in.
So I can click on another one, and that one is there's the file right there, and this is the folder, the directory, that it's in. So I can go through and scroll through, and you can see this one is a much bigger file taking up many clusters there. Let me click one of these red ones here. The red one meant that it's been fragmented, so I can actually open this up and see the different fragments. So this has been fragmented into three, well, it's 54 clusters but broken into three spots here. So there is that file right there.
I've got another file I'm going to show you, and I like this one just because it's broken into lots of clusters. So I'm going to paste it in here and do a show next, and there we have it. We can see that this particular one is broken into lots; there's 389 clusters and it's fragmented all over the drive here, so quite a bit.
So that is how these disk systems store their data in these clusters, and something's got to manage all of the retrieving of this data and sending the data to it, and so your operating system is in charge of all that.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →