Persistent storage just like memory, only different Just like diamonds last forever (?) memory is volatile very dense Persistent Storage 10 TBytes of storage fit here ...but much cheaper 10 TByte NAS drive is $ 300 on Amazon way cheaper than How persistent storage A new abstraction affects File System design Goal Physical Characteristics Design Implication File System High performance An OS abstraction that provides persistent, named data Named data Controlled Sharing Reliability
How persistent storage How persistent storage affects File System design affects File System design Goal Physical Characteristics Design Implication Goal Physical Characteristics Design Implication Organize storage so that data can be High High accessed in large sequential units Large cost to initiate I/O Large cost to initiate I/O performance performance Use caching to avoid accessing persistent storage Named data Named data Controlled Controlled Sharing Sharing Reliability Reliability How persistent storage How persistent storage affects File System design affects File System design Goal Physical Characteristics Design Implication Goal Physical Characteristics Design Implication Organize storage so that data can be Organize storage so that data can be High High accessed in large sequential units accessed in large sequential units Large cost to initiate I/O Large cost to initiate I/O performance performance Use caching to avoid accessing persistent Use caching to avoid accessing persistent storage storage Large capacity Large capacity Support files and directories with Named data Named data Survives crashes Survives crashes meaningful names Shared across programs Shared across programs Controlled Controlled Sharing Sharing Reliability Reliability
How persistent storage How persistent storage affects File System design affects File System design Goal Physical Characteristics Design Implication Goal Physical Characteristics Design Implication Organize storage so that data can be Organize storage so that data can be High High accessed in large sequential units accessed in large sequential units Large cost to initiate I/O Large cost to initiate I/O performance performance Use caching to avoid accessing persistent Use caching to avoid accessing persistent storage storage Large capacity Large capacity Support files and directories with Support files and directories with Named data Named data Survives crashes Survives crashes meaningful names meaningful names Shared across programs Shared across programs Controlled Controlled Device may store data from Device may store data from Include with files metadata for access control Sharing many users Sharing many users Reliability Reliability How persistent storage How persistent storage affects File System design affects File System design Goal Physical Characteristics Design Implication Goal Physical Characteristics Design Implication Organize storage so that data can be Organize storage so that data can be High High accessed in large sequential units accessed in large sequential units Large cost to initiate I/O Large cost to initiate I/O performance performance Use caching to avoid accessing persistent Use caching to avoid accessing persistent storage storage Large capacity Large capacity Support files and directories with Support files and directories with Named data Named data Survives crashes Survives crashes meaningful names meaningful names Shared across programs Shared across programs Controlled Controlled Device may store data from Device may store data from Include with files metadata for access control Include with files metadata for access control Sharing many users Sharing many users Use transactions to atomically update multiple blocks of Crash can occur during updates Crash can occur during updates persistent storage Reliability Reliability Storage devices can fail Storage devices can fail Use redundancy to detect and correct failures Flash memory wears out Flash memory wears out Migrate data to even the wear
Understanding how File Storage Devices Systems work matters Example: Word processor with auto-save feature We focus on two types of persistent storage magnetic disks If file is large and application is naive in using the servers, workstations, laptops file system flash memory poor performance smart phones, tablets, cameras, laptops may have to overwrite entire file to insert a few bytes! Other exist(ed) clever doc format may transform updates in appends corrupt file tapes crash while overwriting may leave file in inconsistent state lost file drums Say we write update to a new file; delete original file; copy new file to old file location…untimely crash could leave us clay tablets with no file! Storage Devices Magnetic disk Magnetic Disks Store data magnetically on thin metallic film Rarely becomes corrupted bonded to rotating disk of glass, ceramic, or Large capacity at low cost aluminum Block level random access Slow performance for random access Better performance for sequential access Flash Memory Rarely becomes corrupted Capacity at intermediate cost (8x disk) Block level random access Good performance for reads; worse for random reads
Disk Drive Schematic Disk Drive Schematic Typically 512 bytes Typically 512 bytes reads by sensing a magnetic field spare sectors added for fault tolerance spare sectors added for fault tolerance writes by creating one floats on air cushion created by data on a track data on a track Track Block/Sector Track Block/Sector spinning disk can be read can be read without moving without moving s–1 s–1 0 0 arm arm 1 1 Head track skewing track skewing 2 2 staggers logical staggers logical address 0 on address 0 on . . . . Cylinder . . adjacent one to adjacent one to account for time account for time � 17 � 18 Arm to move head to move head assembly Surface Platter Spindle set of tracks on different surfaces with same track index thin cylinder that holds magnetic material 2018: 4200-15000 RPM each platter has two surfaces Disk Read/Write Disk Read/Write Present disk with a sector address Present disk with a sector address Old: CHS = (cylinder, head, sector) Old: CHS = (cylinder, head, sector) New abstraction: Logical Block Address (LBA) New abstraction: Logical Block Address (LBA) linear addressing 0...N-1 linear addressing 0...N-1 Heads move to appropriate track Heads move to appropriate track seek seek (and though shalt approximately find) settle settle (fine adustments) Disk access time: Disk access time: Appropriate head is enabled Appropriate head is enabled Wait for sector to appear under head Wait for sector to appear under head seek time + rotational latency rotational latency Read/Write sector Read/Write sector transfer time transfer time
Disk Read/Write Disk Read/Write Present disk with a sector address Present disk with a sector address Old: CHS = (cylinder, head, sector) Old: CHS = (cylinder, head, sector) New abstraction: Logical Block Address (LBA) New abstraction: Logical Block Address (LBA) linear addressing 0...N-1 linear addressing 0...N-1 Heads move to appropriate track Heads move to appropriate track seek (and though shalt approximately find) seek (and though shalt approximately find) settle (fine adustments) settle (fine adustments) Disk access time: Disk access time: Appropriate head is enabled Appropriate head is enabled Wait for sector to appear under head Wait for sector to appear under head seek time + seek time + rotational latency rotational latency rotation time + rotation time + Read/Write sector Read/Write sector transfer time transfer time transfer time A closer look: A closer look: seek time rotation time Today most disk rotate at 4200 to 15,000 RPM Minimum: time to go from one track to the next 15ms to 4ms per rotation 0.3-1.5 ms good estimate for rotational latency is half that Maximum: time to go from innermost to outermost track amount more than 10ms; up to over 20ms Head starts reading as soon as it settles on a Average: average across seeks between each possible track pair of tracks track buffering to avoid “shoulda coulda” if any of approximately time to seek 1/3 of the way across disk the sectors flying under the head turn out to be needed Head switch time: time to move from track on one i surface to the same track on a different surface range similar to minimum seek time
Recommend
More recommend