
Operating SystemsChapter 8Mass Storage1
Operating Systems 1 Chapter 8 Mass Storage

Topics inPart3(StorageManagementKV,DistributedFSUserSpaceProcessesGraph System...File systemImplementationOperatingSystemKernelFileSystemOperationsFAT32,EXT2/3SSSSaidSuitsDevices25669512G8
Topics in Part 3 (Storage Management) 2 File System Operations Operating System Kernel User Space Devices Processes File system Implementation FAT32, EXT2/3 KV, Distributed FS, Graph System

Storage Hierarchyregisterscachemainmemorysolid-state diskharddiskopticaldiskmagnetictapes3
Storage Hierarchy 3

Topics(MassStorage)Disk StructureDisk SchedulingSSDStructureSSDSMSal1298258851268SSDFeatures/IssuesRAIDErasure Coding
Topics (Mass Storage) 4 SSD Structure SSD Features/Issues Disk Structure Disk Scheduling RAID Erasure Coding

Topics- Disk structureDisk schedulingSolid-state drives (SSDs)RAID & Erasure coding5
5 Topics - Disk structure - Disk scheduling - Solid-state drives (SSDs) - RAID & Erasure coding

HardDiskStructure-Physical viewPhysicaladdress(cylinder,track,sector)Track:The surface of a platteris dividedinto tracksSector:Trackisdividedintosectors(512Bdata+ECC)tracktspindleCylinder:Setof tracks that are at one arm positionarmassemblysectorsAccess:Seek+Rotateread-writeSeektime:cylinder c-headmove disk arm to desired cylinderplatterRotational latency:armspinat5400/7200/10K/15KRPMrotation
Hard Disk Structure – Physical view Physical address (cylinder, track, sector) Track: The surface of a platter is divided into tracks Sector: Track is divided into sectors (512B data + ECC) Cylinder: Set of tracks that are at one arm position Access: Seek + Rotate Seek time: move disk arm to desired cylinder Rotational latency: spin at 5400/7200/10K/15K RPM

Hard Disk Structure-Physical viewConstant linervelocity (CLV)> Uniformdensityofbitspertrackoutertrackholdmore sectorstracktspindleVariablerotationspeed tokeepthesame rate of datamovingarmCD-ROM/DVD-ROMsectorsConstant angularvelocity(CAv)Constantrotationspeedread-writecylinder c-Higher density of bits in inner tracksheadHard disksplatterarmrotation
Hard Disk Structure – Physical view Constant liner velocity (CLV) Uniform density of bits per track, outer track hold more sectors Variable rotation speed to keep the same rate of data moving CD-ROM/DVD-ROM Constant angular velocity (CAV) Constant rotation speed Higher density of bits in inner tracks Hard disks

Hard DiskStructure-Logical viewHow to use?Large1-Darraysoflogicalblocks(usually512bytes)AddressmappingLogical block number-> (cylinder#, track #, sector#)Disk management is required>Diskformatting>Disks are prone tofailures:defective sectors arecommon(badblocks)Needtohandledefectivesectors:badblockmanagement
Hard Disk Structure – Logical view How to use? Large 1-D arrays of logical blocks (usually 512 bytes) Address mapping Logical block number -> (cylinder #, track #, sector #) Disk management is required Disk formatting Disks are prone to failures: defective sectors are common (bad blocks) Need to handle defective sectors: bad block management

DiskManagementDiskFormattingStep 1:Low-level formatting/physical formattingDivide intosectors so diskcontroller can read/writeFills the disk with a special data structure for each sector (data area(512B)headerandtrailer (sectornumber&EcC))The controller automatically does the EcC processing whenever a sectorisread/writtenDone at factory, used for testing and initializing (e.g., the mapping). It is alsopossibleto set thesector size (256B,512B, 1K,4K)
Disk Management Disk Formatting Step 1: Low-level formatting/physical formatting Divide into sectors so disk controller can read/write Fills the disk with a special data structure for each sector (data area(512B), header and trailer (sector number & ECC)) • The controller automatically does the ECC processing whenever a sector is read/written Done at factory, used for testing and initializing (e.g., the mapping). It is also possible to set the sector size (256B, 512B, 1K, 4K)

DiskManagementDiskFormattingStep 2: How to use disks to hold files after shipment?Choice1:FilesystemPartition into one or more groups of cylinders (each as a separate disk)Logical formatting: creating a Fs by storing the initial FS data structures1/o optimization: Disk 1/o (via blocks)& file system 1/o (via clusters), why?Moresequentialaccess,fewerrandomaccessChoice2:RawdiskUse disk partition as a large sequentialarray of logical blocks, without FSRaw//O:bypass all FS services (buffer cache,prefetching...),be able tocontrolexactdisklocation
Disk Management Disk Formatting Step 2: How to use disks to hold files after shipment? Choice 1: File system Partition into one or more groups of cylinders (each as a separate disk) Logical formatting: creating a FS by storing the initial FS data structures I/O optimization: Disk I/O (via blocks) & file system I/O (via clusters), why? • More sequential access, fewer random access Choice 2: Raw disk Use disk partition as a large sequential array of logical blocks, without FS Raw I/O: bypass all FS services (buffer cache, prefetching.), be able to control exact disk location