SlideShare a Scribd company logo
1 of 20
MASS STORAGE STRUCTURE
Disk drive structure
 Data stored on surfaces
 Up to two surfaces per
platter
 One or more platters per disk
 Data in concentric tracks
 Tracks broken into sectors
 256B-1KB per sector
 Cylinder: corresponding
tracks on all surfaces
 Data read and written by
heads
 Actuator moves heads
 Heads move in unison
Chapter 5 2
CS 1550, cs.pitt.edu
(originaly modified by
Ethan L. Miller and
sector
cylinder
platter
spindle
track
head
actuator
surfaces
Disk drive specifics
IBM 360KB floppy WD 18GB HD
Cylinders 40 10601
Tracks per cylinder 2 12
Sectors per track 9 281 (average)
Sectors per disk 720 35742000
Bytes per sector 512 512
Capacity 360 KB 18.3 GB
Seek time (minimum) 6 ms 0.8 ms
Seek time (average) 77 ms 6.9 ms
Rotation time 200 ms 8.33 ms
Spinup time 250 ms 20 sec
Sector transfer time 22 ms 17 msec
Chapter 5 3
CS 1550, cs.pitt.edu
(originaly modified by
Ethan L. Miller and
Disk “zones”
 Outside tracks are longer
than inside tracks
 Two options
 Bits are “bigger”
 More bits (transfer faster)
 Modern hard drives use
second option
 More data on outer tracks
 Disk divided into “zones”
 Constant sectors per track in
each zone
 8–20 (or more) zones on a
disk
Chapter 5 4
CS 1550, cs.pitt.edu
(originaly modified by
Ethan L. Miller and
Disk “addressing”
 Millions of sectors on the disk must be labeled
 Two possibilities
 Cylinder/track/sector
 Sequential numbering
 Modern drives use sequential numbers
 Disks map sequential numbers into specific location
 Mapping may be modified by the disk
 Remap bad sectors
 Optimize performance
 Hide the exact geometry, making life simpler for the OS
CS 1550, cs.pitt.edu
(originaly modified by Ethan
L. Miller and Scott A. Brandt)
Chapter 5
5
Building a better “disk”
 Problem: CPU performance has been increasing
exponentially, but disk performance hasn’t
 Disks are limited by mechanics
 Problem: disks aren’t all that reliable
 Solution: distribute data across disks, and use
some of the space to improve reliability
 Data transferred in parallel
 Data stored across drives (striping)
 Parity on an “extra” drive for reliability
CS 1550, cs.pitt.edu
(originaly modified by Ethan
L. Miller and Scott A. Brandt)
Chapter 5
6
CD-ROM recording
 CD-ROM has data in a
spiral
 Hard drives have concentric
circles of data
 One continuous track:
just like vinyl records!
 Pits & lands “simulated”
with heat-sensitive
material on CD-Rs and
CD-RWs
Chapter 5 7
CS 1550, cs.pitt.edu
(originaly modified by
Ethan L. Miller and
Structure of a disk sector
 Preamble contains information about the sector
 Sector number & location information
 Data is usually 256, 512, or 1024 bytes
 ECC (Error Correcting Code) is used to detect & correct
minor errors in the data
Chapter 5 8
CS 1550, cs.pitt.edu
(originaly modified by
Ethan L. Miller and
Preamble Data ECC
What’s in a disk request?
 Time required to read or write a disk block determined
by 3 factors
 Seek time
 Rotational delay
 Average delay = 1/2 rotation time
 Example: rotate in 10ms, average rotation delay = 5ms
 Actual transfer time
 Transfer time = time to rotate over sector
 Example: rotate in 10ms, 200 sectors/track => 10/200 ms =
0.05ms transfer time per sector
 Seek time dominates, with rotation time close
 Error checking is done by controllers
CS 1550, cs.pitt.edu
(originaly modified by Ethan
L. Miller and Scott A. Brandt)
Chapter 5
9
Disk request scheduling
 Goal: use disk hardware efficiently
 Bandwidth as high as possible
 Disk transferring as often as possible (and not seeking)
 We want to
 Minimize disk seek time (moving from track to track)
 Minimize rotational latency (waiting for disk to rotate the desired sector
under the read/write head)
 Calculate disk bandwidth by
 Total bytes transferred / time to service request
 Seek time & rotational latency are overhead (no data is transferred), and
reduce disk bandwidth
 Minimize seek time & rotational latency by
 Using algorithms to find a good sequence for servicing requests
 Placing blocks of a given file “near” each other
CS 1550, cs.pitt.edu
(originaly modified by Ethan
L. Miller and Scott A. Brandt)
Chapter 5
10
Disk scheduling algorithms
 Schedule disk requests to minimize disk seek time
 Seek time increases as distance increases (though not linearly)
 Minimize seek distance -> minimize seek time
 Disk seek algorithm examples assume a request queue & head
position (disk has 200 cylinders)
 Queue = 100, 175, 51, 133, 8, 140, 73, 77
 Head position = 63
Chapter 5 11
CS 1550, cs.pitt.edu
(originaly modified by
Ethan L. Miller and
100 17551 1338
140
73
77
read/write head position
disk requests
(cylinder in which block resides)
Outside edge Inside edge
First-Come-First Served (FCFS)
 Requests serviced in the order in which they arrived
 Easy to implement!
 May involve lots of unnecessary seek distance
 Seek order = 100, 175, 51, 133, 8, 140, 73, 77
 Seek distance = (100-63) + (175-100) + (175-51) + (133-51) +
(133-8) + (140-8) + (140-73) + (77-73) = 646 cylinders
Chapter 5 12
CS 1550, cs.pitt.edu
(originaly modified by
Ethan L. Miller and
100
175
51
133
8
140
73
77
read/write head start
Shortest Seek Time First (SSTF)
 Service the request with the shortest seek time from the current head
position
 Form of SJF scheduling
 May starve some requests
 Seek order = 73, 77, 51, 8, 100, 133, 140, 175
 Seek distance = 10 + 4 + 26 + 43 + 92 + 33 + 7 + 35 = 250 cylinders
Chapter 5 13
CS 1550, cs.pitt.edu
(originaly modified by
Ethan L. Miller and
100
175
51
133
8
140
73
77
read/write head start
SCAN (elevator algorithm)
 Disk arm starts at one end of the disk and moves towards the other
end, servicing requests as it goes
 Reverses direction when it gets to end of the disk
 Also known as elevator algorithm
 Seek order = 51, 8, 0 , 73, 77, 100, 133, 140, 175
 Seek distance = 12 + 43 + 8 + 73 + 4 + 23 + 33 + 7 + 35 = 238 cyls
Chapter 5 14
CS 1550, cs.pitt.edu
(originaly modified by
Ethan L. Miller and
100
175
51
133
8
140
73
77
read/write head start
C-SCAN
 Identical to SCAN, except head returns to cylinder 0 when it reaches
the end of the disk
 Treats cylinder list as a circular list that wraps around the disk
 Waiting time is more uniform for cylinders near the edge of the disk
 Seek order = 73, 77, 100, 133, 140, 175, 199, 0, 8, 51
 Distance = 10 + 4 + 23 + 33 + 7 + 35 + 24 + 199 + 8 + 43 = 386 cyls
Chapter 5 15
CS 1550, cs.pitt.edu
(originaly modified by
Ethan L. Miller and
100
175
51
133
8
140
73
77
read/write head start
C-LOOK
 Identical to C-SCAN, except head only travels as far as the last
request in each direction
 Saves seek time from last sector to end of disk
 Seek order = 73, 77, 100, 133, 140, 175, 8, 51
 Distance = 10 + 4 + 23 + 33 + 7 + 35 + 167 + 43 = 322 cylinders
Chapter 5 16
CS 1550, cs.pitt.edu
(originaly modified by
Ethan L. Miller and
100
175
51
133
8
140
73
77
read/write head start
Selection of a disk scheduling
algorithm
 SSTF is easy to implement and works OK if there aren’t
too many disk requests in the queue
 SCAN-type algorithms perform better for systems under
heavy load
 More fair than SSTF
 Use LOOK rather than SCAN algorithms to save time
 Long seeks aren’t too expensive, so choose C-LOOK over
LOOK to make response time more even
 Disk request scheduling interacts with algorithms for
allocating blocks to files
 Make scheduling algorithm modular: allow it to be changed
without changing the file system
 Use SSTF for lightly loaded systems
 Use C-LOOK for heavily loaded systems
CS 1550, cs.pitt.edu
(originaly modified by Ethan
L. Miller and Scott A. Brandt)
Chapter 5
17
Disk Management
 Low-level formatting, or physical formatting — Dividing a disk
into sectors that the disk controller can read and write
 To use a disk to hold files, the operating system still needs to
record its own data structures on the disk
 Partition the disk into one or more groups of cylinders
 Logical formatting or “making a file system”
 To increase efficiency most file systems group blocks into clusters
 Disk I/O done in blocks
 File I/O done in clusters
 Boot block initializes system
 The bootstrap is stored in ROM
 Bootstrap loader program
 Methods such as sector sparing used to handle bad blocks
Swap-Space Management
 Swap-space — Virtual memory uses disk space as an
extension of main memory.
 Swap-space can be carved out of the normal file system,or,
more commonly, it can be in a separate disk partition.
 Swap-space management
 4.3BSD allocates swap space when process starts; holds
text segment (the program) and data segment.
 Kernel uses swap maps to track swap-space use.
 Solaris 2 allocates swap space only when a page is forced
out of physical memory, not when the virtual memory page
is first created.
Swapping on Linux
 Linux uses 4K page slots
 Swap can be in dedicated swap partition or swap file on FS
 Numbers above indicate ref count; e.g., 3 means 3 processes
sharing

More Related Content

What's hot (19)

Sheik Mohamed Shadik - BSc - Project Details
Sheik Mohamed Shadik - BSc - Project DetailsSheik Mohamed Shadik - BSc - Project Details
Sheik Mohamed Shadik - BSc - Project Details
 
Mass storage device
Mass storage deviceMass storage device
Mass storage device
 
Disk structure
Disk structureDisk structure
Disk structure
 
operating system
operating systemoperating system
operating system
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
Kavi
KaviKavi
Kavi
 
Kavi
KaviKavi
Kavi
 
Operating Systems
Operating SystemsOperating Systems
Operating Systems
 
Thiru
ThiruThiru
Thiru
 
I/O System and Csae Study
I/O System and Csae StudyI/O System and Csae Study
I/O System and Csae Study
 
Palpandi
PalpandiPalpandi
Palpandi
 
Os
OsOs
Os
 
Mass Storage Devices
Mass Storage DevicesMass Storage Devices
Mass Storage Devices
 
Mass Storage Structure
Mass Storage StructureMass Storage Structure
Mass Storage Structure
 
Swap-space Management
Swap-space ManagementSwap-space Management
Swap-space Management
 
ch11
ch11ch11
ch11
 
storage and file structure
storage and file structurestorage and file structure
storage and file structure
 
db
dbdb
db
 
Disk Management
Disk ManagementDisk Management
Disk Management
 

Similar to Mass storage structure

Similar to Mass storage structure (20)

Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
7 disk managment
7 disk managment7 disk managment
7 disk managment
 
Secondary storage structure-Operating System Concepts
Secondary storage structure-Operating System ConceptsSecondary storage structure-Operating System Concepts
Secondary storage structure-Operating System Concepts
 
Disk scheduling
Disk schedulingDisk scheduling
Disk scheduling
 
CH10.pdf
CH10.pdfCH10.pdf
CH10.pdf
 
Ch12
Ch12Ch12
Ch12
 
9_Storage_Devices.pptx
9_Storage_Devices.pptx9_Storage_Devices.pptx
9_Storage_Devices.pptx
 
Cs8493 unit 4
Cs8493 unit 4Cs8493 unit 4
Cs8493 unit 4
 
Ch14 OS
Ch14 OSCh14 OS
Ch14 OS
 
OS_Ch14
OS_Ch14OS_Ch14
OS_Ch14
 
Disk Scheduling
Disk SchedulingDisk Scheduling
Disk Scheduling
 
9_Storage_Devices.pptx
9_Storage_Devices.pptx9_Storage_Devices.pptx
9_Storage_Devices.pptx
 
Viknesh
VikneshViknesh
Viknesh
 
Mass storage structure
Mass storage structureMass storage structure
Mass storage structure
 
ch12-gh1.pptx
ch12-gh1.pptxch12-gh1.pptx
ch12-gh1.pptx
 
381 ccs chapter8_updated(1)
381 ccs chapter8_updated(1)381 ccs chapter8_updated(1)
381 ccs chapter8_updated(1)
 
CS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage ManagementCS 542 Putting it all together -- Storage Management
CS 542 Putting it all together -- Storage Management
 
Hard disk
Hard diskHard disk
Hard disk
 
I/O structure slide by Rajalakshmi SKC
I/O structure slide by Rajalakshmi SKCI/O structure slide by Rajalakshmi SKC
I/O structure slide by Rajalakshmi SKC
 
Secondarystoragedevices1 130119040144-phpapp02
Secondarystoragedevices1 130119040144-phpapp02Secondarystoragedevices1 130119040144-phpapp02
Secondarystoragedevices1 130119040144-phpapp02
 

Recently uploaded

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsSandeep D Chaudhary
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxmarlenawright1
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSAnaAcapella
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 

Recently uploaded (20)

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
OSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & SystemsOSCM Unit 2_Operations Processes & Systems
OSCM Unit 2_Operations Processes & Systems
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 

Mass storage structure

  • 2. Disk drive structure  Data stored on surfaces  Up to two surfaces per platter  One or more platters per disk  Data in concentric tracks  Tracks broken into sectors  256B-1KB per sector  Cylinder: corresponding tracks on all surfaces  Data read and written by heads  Actuator moves heads  Heads move in unison Chapter 5 2 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and sector cylinder platter spindle track head actuator surfaces
  • 3. Disk drive specifics IBM 360KB floppy WD 18GB HD Cylinders 40 10601 Tracks per cylinder 2 12 Sectors per track 9 281 (average) Sectors per disk 720 35742000 Bytes per sector 512 512 Capacity 360 KB 18.3 GB Seek time (minimum) 6 ms 0.8 ms Seek time (average) 77 ms 6.9 ms Rotation time 200 ms 8.33 ms Spinup time 250 ms 20 sec Sector transfer time 22 ms 17 msec Chapter 5 3 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and
  • 4. Disk “zones”  Outside tracks are longer than inside tracks  Two options  Bits are “bigger”  More bits (transfer faster)  Modern hard drives use second option  More data on outer tracks  Disk divided into “zones”  Constant sectors per track in each zone  8–20 (or more) zones on a disk Chapter 5 4 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and
  • 5. Disk “addressing”  Millions of sectors on the disk must be labeled  Two possibilities  Cylinder/track/sector  Sequential numbering  Modern drives use sequential numbers  Disks map sequential numbers into specific location  Mapping may be modified by the disk  Remap bad sectors  Optimize performance  Hide the exact geometry, making life simpler for the OS CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt) Chapter 5 5
  • 6. Building a better “disk”  Problem: CPU performance has been increasing exponentially, but disk performance hasn’t  Disks are limited by mechanics  Problem: disks aren’t all that reliable  Solution: distribute data across disks, and use some of the space to improve reliability  Data transferred in parallel  Data stored across drives (striping)  Parity on an “extra” drive for reliability CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt) Chapter 5 6
  • 7. CD-ROM recording  CD-ROM has data in a spiral  Hard drives have concentric circles of data  One continuous track: just like vinyl records!  Pits & lands “simulated” with heat-sensitive material on CD-Rs and CD-RWs Chapter 5 7 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and
  • 8. Structure of a disk sector  Preamble contains information about the sector  Sector number & location information  Data is usually 256, 512, or 1024 bytes  ECC (Error Correcting Code) is used to detect & correct minor errors in the data Chapter 5 8 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Preamble Data ECC
  • 9. What’s in a disk request?  Time required to read or write a disk block determined by 3 factors  Seek time  Rotational delay  Average delay = 1/2 rotation time  Example: rotate in 10ms, average rotation delay = 5ms  Actual transfer time  Transfer time = time to rotate over sector  Example: rotate in 10ms, 200 sectors/track => 10/200 ms = 0.05ms transfer time per sector  Seek time dominates, with rotation time close  Error checking is done by controllers CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt) Chapter 5 9
  • 10. Disk request scheduling  Goal: use disk hardware efficiently  Bandwidth as high as possible  Disk transferring as often as possible (and not seeking)  We want to  Minimize disk seek time (moving from track to track)  Minimize rotational latency (waiting for disk to rotate the desired sector under the read/write head)  Calculate disk bandwidth by  Total bytes transferred / time to service request  Seek time & rotational latency are overhead (no data is transferred), and reduce disk bandwidth  Minimize seek time & rotational latency by  Using algorithms to find a good sequence for servicing requests  Placing blocks of a given file “near” each other CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt) Chapter 5 10
  • 11. Disk scheduling algorithms  Schedule disk requests to minimize disk seek time  Seek time increases as distance increases (though not linearly)  Minimize seek distance -> minimize seek time  Disk seek algorithm examples assume a request queue & head position (disk has 200 cylinders)  Queue = 100, 175, 51, 133, 8, 140, 73, 77  Head position = 63 Chapter 5 11 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and 100 17551 1338 140 73 77 read/write head position disk requests (cylinder in which block resides) Outside edge Inside edge
  • 12. First-Come-First Served (FCFS)  Requests serviced in the order in which they arrived  Easy to implement!  May involve lots of unnecessary seek distance  Seek order = 100, 175, 51, 133, 8, 140, 73, 77  Seek distance = (100-63) + (175-100) + (175-51) + (133-51) + (133-8) + (140-8) + (140-73) + (77-73) = 646 cylinders Chapter 5 12 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and 100 175 51 133 8 140 73 77 read/write head start
  • 13. Shortest Seek Time First (SSTF)  Service the request with the shortest seek time from the current head position  Form of SJF scheduling  May starve some requests  Seek order = 73, 77, 51, 8, 100, 133, 140, 175  Seek distance = 10 + 4 + 26 + 43 + 92 + 33 + 7 + 35 = 250 cylinders Chapter 5 13 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and 100 175 51 133 8 140 73 77 read/write head start
  • 14. SCAN (elevator algorithm)  Disk arm starts at one end of the disk and moves towards the other end, servicing requests as it goes  Reverses direction when it gets to end of the disk  Also known as elevator algorithm  Seek order = 51, 8, 0 , 73, 77, 100, 133, 140, 175  Seek distance = 12 + 43 + 8 + 73 + 4 + 23 + 33 + 7 + 35 = 238 cyls Chapter 5 14 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and 100 175 51 133 8 140 73 77 read/write head start
  • 15. C-SCAN  Identical to SCAN, except head returns to cylinder 0 when it reaches the end of the disk  Treats cylinder list as a circular list that wraps around the disk  Waiting time is more uniform for cylinders near the edge of the disk  Seek order = 73, 77, 100, 133, 140, 175, 199, 0, 8, 51  Distance = 10 + 4 + 23 + 33 + 7 + 35 + 24 + 199 + 8 + 43 = 386 cyls Chapter 5 15 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and 100 175 51 133 8 140 73 77 read/write head start
  • 16. C-LOOK  Identical to C-SCAN, except head only travels as far as the last request in each direction  Saves seek time from last sector to end of disk  Seek order = 73, 77, 100, 133, 140, 175, 8, 51  Distance = 10 + 4 + 23 + 33 + 7 + 35 + 167 + 43 = 322 cylinders Chapter 5 16 CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and 100 175 51 133 8 140 73 77 read/write head start
  • 17. Selection of a disk scheduling algorithm  SSTF is easy to implement and works OK if there aren’t too many disk requests in the queue  SCAN-type algorithms perform better for systems under heavy load  More fair than SSTF  Use LOOK rather than SCAN algorithms to save time  Long seeks aren’t too expensive, so choose C-LOOK over LOOK to make response time more even  Disk request scheduling interacts with algorithms for allocating blocks to files  Make scheduling algorithm modular: allow it to be changed without changing the file system  Use SSTF for lightly loaded systems  Use C-LOOK for heavily loaded systems CS 1550, cs.pitt.edu (originaly modified by Ethan L. Miller and Scott A. Brandt) Chapter 5 17
  • 18. Disk Management  Low-level formatting, or physical formatting — Dividing a disk into sectors that the disk controller can read and write  To use a disk to hold files, the operating system still needs to record its own data structures on the disk  Partition the disk into one or more groups of cylinders  Logical formatting or “making a file system”  To increase efficiency most file systems group blocks into clusters  Disk I/O done in blocks  File I/O done in clusters  Boot block initializes system  The bootstrap is stored in ROM  Bootstrap loader program  Methods such as sector sparing used to handle bad blocks
  • 19. Swap-Space Management  Swap-space — Virtual memory uses disk space as an extension of main memory.  Swap-space can be carved out of the normal file system,or, more commonly, it can be in a separate disk partition.  Swap-space management  4.3BSD allocates swap space when process starts; holds text segment (the program) and data segment.  Kernel uses swap maps to track swap-space use.  Solaris 2 allocates swap space only when a page is forced out of physical memory, not when the virtual memory page is first created.
  • 20. Swapping on Linux  Linux uses 4K page slots  Swap can be in dedicated swap partition or swap file on FS  Numbers above indicate ref count; e.g., 3 means 3 processes sharing