1. Home
  2. Explore
  3. Computer Science
  4. File System Implementation

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

File System Implementation

Transcript

You can all just go away. I don't care. Ohh and that was perfect timing for the transcription to start, so the transcription recorded just started with me seeing you can all go away. I don't care. Perfect. Ohh dear right? For the benefit of the tape. That was talking about YouTube subscribers.

Ohh Collins unsubscribed. Now he's just gotten off. No, that's just. OK, so last week we started talking about file systems and this week I want to delve a wee bit further into that. And later on I want to talk about different types of media that fails, make the stored on. But before we do that, I want to have a rethink about how we might go about implementing some of these file systems.

OK so. We want to look at some of the ways that we can set up file systems both locally and remote, and think of it, some of the algorithms that we can use to set them up. And as before, these are all about tradeoffs. So as we've seen. All through this module, whether we're looking at memory or anything else, it's all about trade-offs. You choose one thing, you lose another.

So we were thinking of it failed systems. It helps to have some vocabulary to do that as ever, anything that's in blue, you absolutely definitely want to remember. For the assessments. Umm. So we have fails logical pieces of data and they're stored and failed systems and we need to have some interface to that and we saw that last week. Data will then be transferred from those files systems into memory where it can be worked on.

And it's likely that we're going to need some way of understanding what the fail is. So we need to fail control block it's names. Relatable state, that kind of stuff. And we also have to remember that we'll get different types of device and we've talked about device drivers before and accessing different types of hardware. The same thing's gonna have to happen with our fail system, so the operating system. Hides all of that. It doesn't care whether you're saving to hard disk, USB drive, whatever, because it just works with its device driver to give you the same style of interface.

O we end up having this kind of layered idea. In our file system, so the application program stays well away from the devices. It only knows about logical file system which then has to organize the files onto the file system which is created or in the storage device itself. That's it. Accessed via IO onto the device. So this whole year and the nice thing about having these kinds of layers of codes.

Is that we can change things. I'm not really too worried if. At. Come on. If at this point. It's a hard disk or USB cause that's taking care of it ion control. You set. This certainly doesn't care about it. And we can swap these things. We can have multiple. Fail systems, multiple devices, multiple everything, and the nice thing is at the top where we are, we just see one logical fail system.

We do this every day. We plug in USB drives. All of a sudden we get a device driver for USB that. Needs to have input output and needs to be added onto the file system and needs to be organized and needs to be shown as part of the logical file system. So in your File Explorer you see something like my USB drive. So the the operating system takes care of this. And takes care of it. In a way that makes it unnecessary. For us to think about it at all.

Whether we are talking about a physical hard disk which has in essence ion failings glued to a a desk. The desk and then rotates. Let's discontinue. It takes an end of all of you without a desktop system, goes feel that happening. Because the disk. Writes all the time.

And similarly, while the discretes. The retaliate? We'll move. In and out. And again, you can hear that. When a helpdesk is going. Probably isn't hard disk feel because they have physical issues that the redhead will hit the inside or the outside sometimes if you jolt them this week. But here well actually touch the disc cause of course it's not touching normally. Usually something called the Bernoulli effect. Make sure that the the redhead is just that we bit above the disk so you don't scratch it or.

And one of the things that will do is it will take that mutate and it will hold it over here. So that's the desk is moving. It won't touch it, but it's definitely not a good idea if you're a hard disk to start shaking your machine. Which is something that people often forget when they have a laptop. So we can have a physical hard disk and that's then set up. To allow us to access all the data on the disk and we were talking about a disk. Actually we usually talk about more than one, so that we just saw.

The top one there that actually there are multiple platters and multiple retains and you can see that when the label on the disc. How do we set those up when we'll just get one large piece of? Real estate to save our files, they always split it up so. The retail, so that's the yellow one. Whoops. We can split up the disks into tracks, so we'll get multiple tracks and a note. And for the rotational version for the red thing here we split it up into sectors.

And one track and one sector gives us a block so we can move to a specific block on the desk. Umm. One thing you'll notice here is. This. Physically much larger than. This.

But they'll be set up to store the same amount of data, other and under Windows anyway. Other operating systems do it differently, so they actually change. It might be how fast they rotate so that they rotate more slowly towards the inside of the disk. Or have some other fancy way of doing it? Mostly the people have relied not on these kind of fancy tricks, but on in essence, having smaller and smaller iron filings collude to the disk so you can get more data per inch.

Or by adding more cylinders or by squeezing the tracks together or making the blocks smaller. And that's just been the figuration of disks over time that allow you to have that. So as I said, you're operating system will have lots of. You still have to hard disk or any of the other devices that we have, we don't really care because operating system just presents all that in one consistent way. So that's the logical way that we think of a file system versus the physical way that it's actually stored. On. Devices, so we'll say open thread dot text.

But I'll device driver will be told to open drive one cylinder 72, track 2, sector 10 and put it into a specific memory location. So that's the link between the. Logical thread dot text and the physical where it's actually stored. And depending on the size it is, we might be able to get lots of it. So there's retrieve block 123. So we make this say yeah, go to this one. Get this block.

And pick it up so each block is numbered. But again, we've got the trade off, so we've got this big disc set up in blocks. Do we have large blocks with lots of data in them? In which case thread dot text, which is probably very small, will waste a lot of space in that block. Which suggests that we have smaller sized blocks instead, so that small files don't waste space. But the downside of that is.

Because we've covered some other things before. Don't say to that is. Thanks. Yeah. Again, sorry. Time it takes place. OK. Loading times. I'm not specifically loading times because you're always going on to the desk and you're always having to move around it.

What you will have to do though is keep track of each of the blocks. So if you have lots of blocks but smaller, you have to keep note of them all and have to remember where they all are, and at some point we're gonna have to do that. So we're gonna have to say Block 123 is Fred dot text. So the more blocks that we have, the more we have to keep up. A fail. Book one is this Block 2 is this block the is this Block 4 is. This Block 5 is this.

So it's about getting that. Balance rate once again. About whether we have lots and lots. Of smaller ones so that we don't we space or fewer larger blocks will at least keep track of what we waste more space and we'll look to that before. Well when did we look at that before in a similar way.

Remember, we're discussed memory and how large a chunk of memory we should have. And they had the same kind of discussion. About whether we had lots and lots of smaller ones, so it wasted space or fewer bigger ones, so that we had less to manage. It's the same argument here. Another one, and if we didn't, how would we know that? Get Block 123 gives us very dot text. We have to remember them somewhere.

No, the other thing we want to build mind is of course things like hard disks are slow, certainly compared to memory. So we might want buffers and caches. And we're gonna have to have somewhere that. Again, as I said, matches up the logical with the physical thread dot text with block 123, so I'm going to have to have some sort of. Organization module to do that for us. It's also going to include all the other stuff that we saw last week that fails have.

Name we lost modified. Retrieve status. All that kind of stuff. I needed anything else that any operating system wants to have. They will say there were 80 that having these labels is really good because it allows us to add in more stuff, as in why we need them. But the downside to having lots of layers is.

We thoughts. Going to slow things down. Every time you the application program has to ask the logical first file system which has to has which has to ask the failed organization module which has to ask the basic file system which has to go out to IO which has to go through the device driver which eventually gets the device. Each one of those requests slows things down. So.

The. Layering helps us to understand and it reduces complexity for ours, but it adds overhead. But it means that we can cope with all these different types of device. With different fail systems as well. OK, so how are we actually going to do this? What we're going to put in place to give is?

Perfect. We already said that. Devices have a boot control block, so we've already said that you can boot your hard disk from a device. So we start up the machine. It goes through the BIOS, looks for a device and says Ohh look because an operating system on my hard disk and it transfers to that book control block. We've also said that we might have multiple volumes. So what a volume that splits off a physical disk or a volume that spans more than one physical disk doesn't really matter how we're doing it, but we need to have details on that as well. We need to keep track of.

How the? The logical layout is going to be shown, so we need to keep track of not just fails but of but directories as well, and allows to have the Wiz all available and an and have access to them properly within our system. And. Depending on the type of file system, how a file control block can start to grow in size so as well as a basic information, you might want to start thinking about. Where it links to. So if you have something like an Oracle operating system. It won't just store information about the fail, it will store. Information about the indexes or about other linked.

Table fans. So you've got a whole load of stuff going on. All stored in the fail control block. Most studentmail control block. And that just depends on how you set that up. So you need all these things on disk. And of course we can't work with stuff on disk, so it has to be brought in to memory. So we're going to need some sort of fail structure in memory as well.

So once we. Hey. Create once we have our file system, we have to bring that in to our. Memory. Things like. We have devices are mounted, you know sea is our hard disk. If is over. Network fail system. You as our USB drive. However you're operating system works that you need a mount point. And they need to know what type of system it is and what kind of information it's going to be stored. And the fall formal.

And then it's going to have to allow certain operations and we spoke about them last week, open close that canister. So you start to end up with something like this. Where ever. Logical user thinks well, I've got a failed name. So somewhere in memory we have a directory structure stored. Let's say it's. Oh, there wasn't a particular.

Directory. And then that directory as a fail. So let's go into our secondary storage desk, get the file control block within that directory. And then bring it back into memory. How do we do that? We need to read it from a particular place, get it in and store it in memory so that we can use it. Remember, nothing can happen until we get stuff into memory.

And how does it even know where to get the stuff from? Because we've already mounted it, we've already said we have a fail system on our hard disk. We have a fail system on our USB. The question becomes whether we set those up at the beginning, so whether we mount the disks when we start up, which is common for our internal devices, or whether we mount them in an ad hoc basis. Putting a USB stick and DVD. I don't know.

An external USB hard drive. It really doesn't matter. But we need to have some way of putting those on as and when they are required, not just at the beginning. And sometimes you'll have noticed when you install things. No operating system gets upset. The windows for example, will quite commonly when you put in a USB drive, will complain and say can I check this file system quite often? What's happened actually is that you've used the USB and another machine quite often with a different operating system, and that stores different data on the drive.

I will operating system gets upset and confused and says what's going on here and wants to go and check it. And you can test that because the next time it tells you can I check the disk, tell it you won't have a look, and you probably find that files are actually they are quite happily. Sometimes, though, it it's completely blocked and you can't do anything with it. Either because you're operating system doesn't understand the file system. So you've plugged a. USB into a Mac and formatted it for a Mac, and then you try and plug it into a Windows machine.

And the Windows machine simply doesn't understand the failed system. Or because you've got a physical issue with all that metadata that you're storing on the desk, all of your directory structures and file control blocks and stuff. If something happens to those on the desk you struggled to see the rest of the files on the disk, and if. Because you've got no way of accessing them, you have no way of knowing where things are.

And you start to end up with things like this bad sectors or. Alright, problems detected. Ohh I'd your happens to be and I'm sure at least some of you have seen at least some of these error messages. OK. We're happy with that so far. So.

How we're going to set up these structures? How, for example, are we going to actually implement a directory structure? Well, we can just have a list. For adult text is in Flintstones directory. Will my dot text doesn't Flintstones directory? Wilma dot text doesn't rubble directory. And never tell him we want something. We just go through and figure out. And where as just being through last 12 with a a linear list it takes ages to go through. Yeah, James had a.

An era of this tape yesterday. So we can start to use other types of organizational system and if you know what a linked list or a B tree is. Great. If you don't, don't worry about them. It's just a fast way of accessing data. Those of you doing things like algorithms and structures will absolutely understand what these are. But you can just trust me that the speed things up. Peace for bakery in this case.

Those other ways of approaching it as well, we can use something called a hash table and. A hash is basically a fancy mathematical function. So you can take a piece of data, apply a hash function, and what it does is it gives you. A unique number and only the data that you feed it will create that unique number.

So you feed on Fred dot text and it gives you a unique number which you can then very quickly get to because if you have already have the hash number that you unique. Means you can. Get to that very quickly if you know already. Know that you have to go to #816 and you don't have to search through one through 815 like a linear tree. It's much quicker. Don't side with a harsh is.

It's very complicated, so complicated mathematical function, so it takes time and also creating the function in the 1st place is really hard particularly. To do what I'm just saying to do. And not you want a unique number and you can't always get a unique number, so you get a collision. So you have to put that into your structure as well and think what happens if I feed in the same thing when I get two things out.

We also have to think of it where we put stuff on our desk. And a game we've talked about this before when we talk about contiguous allocation before anyone remember. It's the same arguments and the same approaches that we took to memory where we said. Could we load a file into memory? Does it all have to be contiguous? Does all have to follow one after the other in memory and we'll get the same type of arguments for implementing our failed systems? Do we see that all our files have to stay in one huge block on the disk?

Or are we happy that they are split? If we have contiguous allocation, it stays simple. We just say go there and read 10 blocks. That's our whole file and we're done. But in the same ways with dead, with mammary we can start getting holes on in the desk. We can start struggling to find free space even if we've got lots of space, it might be split up into smaller things. We may end up with editing a fail, making it bigger, and then finding out they can't see if it back into the same place, so we'll have to take a whole file and put it somewhere else on the disk so it starts to get tricky. The fragmentation builds in and you start to have them to defragment disks to allow you to. I didn't speak them up.

But as I see it is really really simple. Ohh, we do let's say have a fail safe where it starts. See how long it is and then we can very quickly pick up our fails on the disk. But what we start ending up with what we end up with is things like this. Falls in our. File system.

If we have a failed that's 6-7 blocks long. We can't account store. Because we've got 4 here, we'll get 6 here. We'll get 2 here. We'll get 3 here, so we'll get plenty of space, but we don't have 6 contiguous blocks. So it's nice and simple but. There are problems with it. So maybe we want to. Move to something like this where we have an extent based system. So you start off with your file. Now when it gets bigger you allocate some more.

So you say, OK, I'm going to have a fail. I reckon it's going to be 10 blocks on my desk. Here's 10 block, and you work on it for a while and you fail gets bigger. So you say. OK, give me another five blocks. I never came. You fail. Gets bigger. You extend it out. That gives you some of the advantages of contiguous in that at least they extents or altogether. So you can say, OK, it's starts here and it's 10 blocks long. Go get me all of that.

But you start to create some more complexity because you have to point to the new part of the fail. Because I fail now consists of one or more extents. So the obvious. Next step from that extent as well, we're already doing that and we really have to point from one part to the next part to the next part to the next part. Why not just link them in the 1st place? So rather than saying ohh reserve me 10 just say no, start off give me one.

And then we need another one point to the next one and then the next block and then the next block, and doesn't matter where in the disk we are, we start off with one. We point to the next one. And every time we keep pointing to the next one until we. Are at the end. And we have something called a nil pointer or a null pointer. Or not pointing anything at the end.

So we only take the space that we need. And. You can get solitaire. Still did. Nice to know I'm talking about failed system and you're talking sort. You can also get it on. On Android now brought the whole Windows XP games onto Android. Installed them now. They can get them in a window, stories, you know, however. They all systems with a link method. There's no space lost. You're not worried about. Suddenly finding this piece of this space exists. We can use it, although that does suggest perhaps to remember where that free space is, we have to know which of those blocks are empty. And that's the white ones in this case around the Gray ones.

It may take time. For instead of just saying. Go to position 14 and read 4 three blocks. It has to say go to zero and then go to 23 and then go to three and then go to 24. And if you're a member, how hard disk is. Well, we're real estate for this. Have you processed them as? Who here? And then go here. And then go here. And then go here. And each time we do that, the disk caster, Italy and the head has to go in and out and that takes time.

We also the issue of what happens if one of the blocks in that fail gets corrupted. What if you're halfway through the fail? And your pointer to the next. Block becomes corrupted all of a sudden. Your file stops halfway through and you don't know where there is the stuff is. So just one block can kill the whole fail. I have about then rather than storing the link within the block itself, we have a table somewhere. And the table says OK Fred dot text has got.

1816 and four. So that fail has been allocated 1816 and four. And we keep that fail allocation table somewhere that says OK, let's fail has got these things. Now the nice thing about having a fail allocation table is it works in the same way, so each time you add something on it gets added on to your fellow location table and you know where the next block is.

But it's one space, so rather than being all over the desk and stored per block, you can store it in a nice big table. Which also means that you can bring it into memory. Which helps speed up getting to where things are. Of course, it also means that you've got one point of failure and the number of times. And the early days when the fail allocation table died and then you couldn't get access to the disk. There are too many to count. So you may want to keep a backup of the failover occasion table somewhere else on the disk and you remember what I said about physically damaging discs.

So. You may have a strategy where you keep one copy of the file allocation table on the outside edge and one copy in the inside. Just sort of physically far apart in case of any physical damage, so there's all sorts of things like that where you can set them up, but when you come down to it, you have a linked list. You point to the next one and then the next one and then the next one. Just like that.

Until finally you've read and all the. OK. It's orange venture. You've read an old felt. Sorry I'm laughing because you guys are still talking about solitaire and how it's on Windows 11, and that's the best thing about Windows 11. I'm. So here we have it. On the desk we we follow each block one after the other. Here we have it in a file allocation table.

So we can see here we've got a table where the disk blocks are numbered. And you said earlier how what what difference does it make how big the blocks are? What makes our difference and how big this table is? So instead of having the pointer stored within the block, so you start at 9:00 and 9:00 says. What is 16 and 16 says go to one and one says go to 10. And 10 says go to 2525 says minus one, which means no more.

Instead of having that you have a similar thing but in one table. So we fail. Starts at two 17217, goes to 618618, goes to 39 and 9 has a -, 1 to stop, and there's two. So Synchron idea but. You get. The issue with block size. Make it too small. And you have lots and lots of blocks and a huge thing allocation table.

Make the blocks too large and you have a smaller location table. And. You waste lots of space. And you may have seen things like fat 32 and fat 64, and that's where you have a 32 bit number for the number of boxes or 64 bit number for the number of blocks to give you a larger amount to go to. Because think of what happened when you went from a.

100 gig disk to one terabyte disk number of blocks multiplied by 10. So the number of blocks that you had to keep track of multiplied by 10. So you either. Had 10 times as many blocks. Or. Each block was ten times the size. So this is a nice simple we are doing it. It's actually used on pretty much every USB drive that you'll find because it's nice and simple and it's good for smaller file systems. But as they start to get bigger. All of these things come into play about size of block and how many. OK, entries you have.

So you might want to do. An indexed allocation, so instead of having them linked. Each one instead has an index block, so you see this file starts at 19. And when you go to 19 it says OK, what you're gonna need is 916 one 2025. So each starting block points to all the blocks and it's going you need. Again, sleep slowing down here because all you've got is the first one. And to get the rest of them, you have to read the first one and then queue goes up to go and get them from the disk.

So it's you'll need the index table, one for each. They fail. But it's random. And then your link from one to another. Once you're in there and there's nothing to say that you can't have. Double indexes. So here we've got a certain number of. And this index links. What if we have more than the 12345678 links that you've got there?

Well, there's the last one can have an its own index block which has the next eight which has the next 8. So you get. Two level. Indexes. So you can have an outer index which goes to a. Index table which then likes to the file itself so it starts getting more and more complicated. Until we end up with things like this like Unix U FS Universal file system.

And you see that it's made some choices. It's chosen to have a 4K block. For each block it is 4K in size. And the address is 42 bags, so that immediately gives you. A limit? On the size of this device. Two to the 32 * 4 K is the largest amount of data that you can store using US, and I'll let you work that out yourself.

It also uses a combination, so there are direct blocks where you just go straight to the data. It has single indirect, so the first block takes you to the next blocks. And then you get double indirect. One block takes you to the next index, takes your finally to the data and you would set these up based on the need. You always on Unix is a.

An executable fail gives you a list of files on your current directory. He was quite a lot. You probably want to get that quickly. So you have it directly linked. My back up from 2016. Dot G zip. Probably hasn't used that often. I'm happy with triple indirect. And the file system can actually start to tune that itself. So things that it's using more often, it can move about within its indices.

If you choose the operating, if you choose to do that in the operating system. So all of these things of choices that you make. Not always unique choices, and you might find, for example, that your main desk uses a different file system from your USB drive, and it will certainly use a different file system. Or if you happen to have a DVD player. Yeah, DVD drive attached so you can have multiple fail systems all in the one device for different reasons.

Why would you bother having lots of indices if you're doing a DVD? The DVD starts at the beginning you go through. And if you need to pass forward. You jump up four blocks at a time instead of 1. And if you want to go to a different chapter or wait until you go to block 1000. But it's very simple. Start at the beginning and go through. In essence, because it's a DVD you're watching a video and open. So you'll have different file systems based on different use cases. Quite often all linked to the same operating system, depending on what it is you need to do, whether it's about performance or whether it's about whatever.

And in fact, having the more complicated file system for a DVD would actually cut the performance. Can you imagine the DVD if it went to the outside and then had to zoom in and then moved on and it was all over the place? And you imagine the DVD having to do all that reading? It's just we've been on since. So we choose what we're doing depending on the type of workload that we have. And we can start to work those out. Because start to work out how long it takes is. And the one truism as if it go to an external.

Device it will be slower than. Getting to memory and we can stop putting these and you know those four I7. Running at 3.4 gigahertz and we can see how many CPU instructions we lose just in getting some IO. Those numbers will always change depending on your CPU and your ID and all that kind of stuff. But. One desk I all with 613 million instructions. 321 disk IO. It's the same as doing 630 million instructions and CPU.

I think the. Don't go there. Speak for themselves. I mentioned earlier that when we have a file system, we're gonna have some species in that first split it up into blocks. We're gonna have blocks aren't used, and we need to know where they are. So one of the ways we can do that is just have a bit map. So in essence, 1 bit for every block. If it's unused, it's zero. If it's used, it's a one. Or vice versa? Yeah, actually doesn't matter. Here, if it's a one that's free, and if it's a zero, it's used. Who kills? As long as everyone?

Chooses. Which we are owned a switch. So we can start to go through it out. Pet MOP and find 3 space. Of course, we're going to need space for a bitmap as well, and we can work out how much space we are going to need. Here we've got one. And it's a seems that Unix one it's a 4K block size which is 2 to the 12. You remember that from computing systems last year.

We've got a one terabyte disk that's two to the 40. So the number of blocks that we need to use the whole disk is 2 to the 40 / 2 to the 12. And that just gives us a number of blocks. Through that we get 2 to 28 which is 256 mega. Thanks. Quite well.

Well, what? Just remember which blocks being used on disk and which hasn't. You've got a four gig of memory in your machine. And you're using 116th of it for a one terabyte disk just to remember which bits are used and which aren't. That seems like quite a lot to me. So maybe we. We use the same sort of thing that we did for the finals, but instead of linking. Each fail and having the block pointing to the next one. Maybe we have a linked list for the unused ones.

So we just store the frost unused one which points to the next unused one, which points to the next unused 1. And if we need a block. We should go to this free list. We take the first one on the list. We take a note of what that's pointing to in that then becomes our. Next Frost free block. That's much, much quicker. So all we would do if we have this kind of free space thing, so you'll get a free space. And your greatest free. So we just say it starts at 2, two points to three, three points to four, and so on and so on. If we need a block, we say, OK, we are taking block too, you know, it's block too because that's our head that's no longer free.

So we take this three that it's pointing to and make that the header. So it's dead dead quick. Yellow is not that easy to see, is it just me or is it not that easy to see? You can make out we got thicker. Nothing would be easier. No, I've only get color options I don't have.

But. Thickness. Right. You get the idea. And again, as we've done before, we can start to finesse that rather than get the next block where he get the next. X number of blocks to group them up because quite often one more than one.

And. And we can also start taking note of how many we have. So all of these. Things are can be finessed till there was to get more to what we need for our own scenario. So we can get to the point where we have something called a space map. And that's used. ZFS is used on massive IBM mainframes which have therapy upon TB of data storage. So of course they're failed. System will be different to my machine here with a 256 gig SSD.

Of course it is. Because they've got an awful lot more data to store. So they can split them up into. Meters, lab units and manage multiple ones of those, and it doesn't really matter what that is. The point is we have to take different approaches for different things. All to ensure that we get the best performance that we can for our workload, which is why you see quite a lot of differences depending what it is you're doing on your machine.

So if for example, you've got a Windows machine, it's set up for a general purpose workloads. Combination of big and small fails different types of applications that are running. So when you get to the age of that massive files for video. A rendering. You'll start to see the fail system struggle will be but cause it's not used to having to cope with four or eight GB files.

Which is why sometimes or in high end workstations you may actually have two physical devices, one for your operating system and applications, one for data, and you have to use a different file system for that data just to cope with these sorts of things. And of course I was with most of the stuff we can put all those things into place. We can start putting buffers in. If we think we're going to use stuff again like that LS command, we'll keep it in memory, make some space available for things that we've got and are likely to use again. If I type LS at the command line, I'm probably going to do it again. To get a you know do LS and then I'll do LS star dot text or whatever it happens to be. So keep that in memory and our buffer.

Maybe sometimes we can think ahead. If I'm getting block one. Odds are I'm gonna get blocked too as well. So while I'm getting block one, why not get blocked 2? And have it ready. And if we don't need it? Well, OK, never mind. If we do need it all of a sudden, it's already there to go. So we can read ahead. So we can start to use a lot of techniques to allow us to get. Uh. Better efficiency and bedroom performance.

Any questions? Nope. No, I'm happy. OK, so as I said, we're going to do 2. Today. That was. Implementing file systems and I want to do a short one on my storage structures.

So we will do that, but I think you need a break because some of you want to go and play solitaire if nothing else. So I'll give you 10 minutes to go and play some solitaire, and I'll see you back here in whoops. In 10.

When it's solitaire. Yeah. So that's what you're all running away to do anyway. OK, Andrew thought of anything they want to ask before we. Yeah. Move on to our next part. The difference between volumes and partitions. So.

Partition is a physical split. So you can take a desk and split it into multiple partitions so you can take a disk and have CDD. Mm-hmm. Volume is a logical split, so your E drive could be a data volume, but you could then add another disk, another physical disk and extend the edrive to have more data. Yeah. So it spans multiple or multiple disks. Take mirrored me, nor a volume is up. Our code. Yeah. A logical way of thinking about it opticians a physical way of working and and it's not physically, but you know what I OK.

mean. It's set up as a a different device in and how you Aye. would see it. Thanks. That's all I had to ask. Anyone else? OK and. I want to have a look at some my storage systems in a stress some because clearly there's too many for us to go over in detail. So I just want to look at some as usual of the the choices that we make when we set these things up and how the.

Are you mate? Go about setting them up and using. So as before, we look at some of the ways that. Alright, we can touch it and look at the trade-offs that we make because of course once again it's going to be about trade-offs. So. We just spoke there about a hard disk. Magnetic disk. As I say, it's a boot gluing iron filings to. Ohh, a plotter and if you did the if you did the experiment in primary school where you get horseshoe magnet 9. Totally unique porting this part.

Are you recording this time? Are you going to record this part? So again, sorry. Hey, I left there called thing going, he says hopefully. What did you? Sorry, no worries. Suddenly, suddenly worrying. Yeah, it's still, it's still recording. Yeah, yeah, yeah. You know, just have to Fast forward through the 10 minute break as usual. And. Yeah. So. So I've completely forgotten what I'm saying and. The iron shavings experiment in school. Oh, yeah. Yeah. So you you played with it? Maybe played with it in school. And if you had one end of the magnet and feelings would go one way. And if you're dollar in the would go differently. And that's based Ali magnetic discuss, you magnetize it and if the .1 way it's a one is the point in another way it's a 0 and that's. In essence, all we are doing that.

The magic becomes because I am failings are very small when the discs are rotating very quickly. Umm. But there's still a limit, so we have to think about how fast we can get data off the drive onto the computer, and that's the transfer rate we have to think about that head that's moving about in the disk that's rotating. So the time for the disk rotate and the head to go to the right place, that's the positioning time. And we can split that up into the seek time, which is the head and the rotational latency, which is a desk.

And as I said earlier, sometimes the head hits the disk. That's not a good thing. Normally it doesn't. The Bernoulli effect keeps it away. We've also got disks that aren't attached all the time that we can attach and remove, and we've got different ways of attaching things. And you can see some of them on the screen there. And because we have all these different types of device attached in different ways, we need something in between them. That's the disk controller. So the computer talks to the disk controller and the disk controller then sorts out how it gets things.

So we end up with a hard disk. As you've just seen, that looks something like this. With multiple platters, multiple read write heads, these are all rotating and this is moving in and out so that we can get access to all the data. All the species on the desk. As ever. Technology moves on this slide is nearly ten years old now.

I think you would struggle to find a 30 GB magnetic disc these days, although you would have no problems getting four or eight terabyte disks now. One of the things you want to look out for is how you go about. Getting your fastest access so. You want to look at the transfer rate, how fast the buses you want to look at the seek time, and the rotational latency. So if you get a desk that spends more quickly, clearly it doesn't take as long to get under the head.

So the latency. Goes down as a revolutions per minute goes up and you can start to work out. Using all of these things, how long it will take to get a particular piece of data? And you've got an example in the screen now. Don't take too much notice of the of the calculations other than to say that's how you calculate them and that's how you plug them into any device that you have, whether the the ones on the slides are accurate. For now, it's up from the beat, but either way we can calculate our overall access latency.

So it's the seek time. Which you remember was. Moving the desk government and out plus. The retention of latency, how long it takes a disk. The top. So you get access latency on average access time depending on how fast the head can move in and out, and hit faster disk or takes. So we can start to get an idea of an average time taken to go to a particular part on the disk and then we have to add on the IO type how long we actually it actually takes to get the data off the disk and into memory. And you can start to Add all that up.

So here it's like 4K block 7200 RPM disk 5 millisecond seek time, one Gigabit per second transfer rate. .1 millisecond controller overhead add them all together and you can see that. Is that I will type for this particular desk for this particular controller for this particular Rev per minute you get the idea. So you can calculate and for all the disks and people do.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent