Chapter 12 3 Mass Storage Systems Chapter 12 3 Mass Storage Systems Chapter 12 1 Overview of Mass Storage Structure Chapter 12 2 Disk Attachment Disk Scheduling Chapter 12 3 Disk Management Swap Space Management RAID Structure Chapter 12 4 Stable Storage Implementation Tertiary Storage Devices Operating System Issues Performance Issues Operating System Concepts 2 38 Silberschatz Galvin and Gagne 2005 Disk Management Operating System Concepts 3 38 Silberschatz Galvin and Gagne 2005 Disk Management We will discuss three very important topics Disk Formatting Boot Blocks and Bad Blocks Operating System Concepts 4 38 Silberschatz Galvin and Gagne 2005 Disk Management Preliminary Comments Before a disk is first put into use it must be formatted But the disk can and does typically support a variety of often diverse uses from Operating system needs and User needs and Certain specialized needs for sometimes special applications So the disk must can be formatted in a number of ways and is Further when disks are manufactured and sent out for use they often have bad spots bad sectors This is the norm Thus any kind of formatting must account for bad spots on the disk and map logical blocks into physical sectors So there s a lot of important information in this section Operating System Concepts 5 38 Silberschatz Galvin and Gagne 2005 Disk Management Disk Formatting Initially a disk is divided into sectors that the disk controller can from and write to read Recall the disk controller is itself a small very specialized processor and executes a restricted instruction set The instruction set deals primarily with instructions dealing with I O and instructions dealing with device operations themselves Instructions include requests such as input and output open close read write etc and additional instructions needed to control and manage the disk operations is device ready timing much more As stated in previous lectures instructions to the disk controller and other low level privileged instructions take the form of commands and instructions depends on the computing system Commands handled interpretively Instructions generally assembler level are a bit different Operating System Concepts 6 38 Silberschatz Galvin and Gagne 2005 Disk Management Disk Sectors Formatting the disk into sectors is referred to as low level formatting Typical sector size is 512 bytes others are available such as 256 bytes 1024 bytes IK and others 512 is the norm Each sector itself contains a specific data structure consisting of a header body of the sector and a trailer Headers and Trailers are used for control information needed by the disk controller These typically include Sector number can check against the request for I O Usually found in header Error Correction Codes ECC Usually found in trailer Data area itself generally 512 bytes Operating System Concepts 7 38 Silberschatz Galvin and Gagne 2005 Disk Management Disk Sectors The error correcting code not exactly the same as those used in main memory but the thinking and specific bits are very similar is generated when data is written to the data portion There are a variety of formulas used in generating ECCs When a read takes place the hardware calculates the code based on the number and position of specific bitsand compares it to the code stored in the sector If different the sector is somehow corrupted Because the ECC is error correcting the bit hopefully one may be both identified detected and corrected This is called a soft error and this phenomenon is passed on to system administrators and tech reps for maintenance concerns We talk a lot about ECC parity redundancy and more when we discuss RAID ahead Operating System Concepts 8 38 Silberschatz Galvin and Gagne 2005 Disk Management Low Level Formatting Usually the disk is low level formatted as part of production Part of this formatting includes a process to designate a number of bytes of the data portion of a sector Header and trailer sizes are generally fixed because they are hardware processed As stated the disk may be divided into specific portions of the disk called partitions which may be used for specific needs Because of the physical characteristics of disk access partitions are normally allocated in cylinders Each partition is essentially a separate logical disk Three typical partitions are Partition for the operating system s executable code Partitions for user files Often partition s of raw disk Operating System Concepts 9 38 Silberschatz Galvin and Gagne 2005 Disk Management Low Level Formatting Given that three or more partitions are established these partitions need to be made ready After partitioning step 2 is logical formatting creation of a file system Here the OS needs to establish several data structures for control and management These partitions are initialized and include structures such as empty directories and other structures like memory maps to be used to manage free and allocated regions necessary during normal operations In truth there is much more than just these Operating System Concepts 10 38 Silberschatz Galvin and Gagne 2005 Really much more is done depending on the OS Are we using virtual memory Many more support structures are needed paging Segmentation Memory maps Setting up queues to support multi tasking operations Other skeletal data structures to be used during operations Perhaps we want to be able to dual boot this computing system Another side note Interestingly actual disk I O is done in blocks but file system I O is done in clusters simply larger hunks of blocks This is done to facilitate sequential I O exploiting the theory of locality Recall Operating System Concepts 11 38 Silberschatz Galvin and Gagne 2005 Disk Management Low Level FormattingRaw Disk The notion of raw disk is an important one This partition normally not very large has no associated file system included in its initialization It is simply a raw area of sequential blocks Actually processing in raw disk can speed up many operations but special processing is required and is the responsibility of such clients Very specific locations in the partition can be exactly specified and hence the need to use a file system directory etc is bypassed In fact using a file system would be a major hindrance and would likely slow things down considerably Raw disk is simply available to some special clients with some special applications to use as they wish These clients for example data base engines are on their own and do
View Full Document