Storage
-
Upload
amir-payberah -
Category
Software
-
view
35 -
download
0
Transcript of Storage
![Page 1: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/1.jpg)
Storage
Amir H. [email protected]
Amirkabir University of Technology(Tehran Polytechnic)
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 1 / 64
![Page 2: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/2.jpg)
Motivation
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 2 / 64
![Page 3: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/3.jpg)
Secondary Storage
I Main memory is usually too small.
I Computer systems must provide secondary storage to back up mainmemory.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 3 / 64
![Page 4: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/4.jpg)
File Systems and Secondary Storage
I The file system can be viewed logically as three parts:
• The file systems at the lowest level: the structure of secondarystorage.
• The user and programmer interface to the file system.
• The internal data structures and algorithms used by the OS toimplement this interface.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 4 / 64
![Page 5: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/5.jpg)
File Systems and Secondary Storage
I The file system can be viewed logically as three parts:
• The file systems at the lowest level: the structure of secondarystorage.
• The user and programmer interface to the file system.
• The internal data structures and algorithms used by the OS toimplement this interface.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 4 / 64
![Page 6: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/6.jpg)
File Systems and Secondary Storage
I The file system can be viewed logically as three parts:
• The file systems at the lowest level: the structure of secondarystorage.
• The user and programmer interface to the file system.
• The internal data structures and algorithms used by the OS toimplement this interface.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 4 / 64
![Page 7: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/7.jpg)
File Systems and Secondary Storage
I The file system can be viewed logically as three parts:
• The file systems at the lowest level: the structure of secondarystorage.
• The user and programmer interface to the file system.
• The internal data structures and algorithms used by the OS toimplement this interface.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 4 / 64
![Page 8: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/8.jpg)
Overview ofMass-Storage Structure
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 5 / 64
![Page 9: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/9.jpg)
Mass Storage Structure (1/3)
I Magnetic disks: bulk of secondary storage
I Disk platter is a flat circular shape,covered with a magnetic material.
I Heads are attached to a disk arm.
I The surface of a platter is logicallydivided into circular tracks, whichare subdivided into sectors.
I The set of tracks that are at onearm position makes up a cylinder.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 6 / 64
![Page 10: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/10.jpg)
Mass Storage Structure (1/3)
I Magnetic disks: bulk of secondary storage
I Disk platter is a flat circular shape,covered with a magnetic material.
I Heads are attached to a disk arm.
I The surface of a platter is logicallydivided into circular tracks, whichare subdivided into sectors.
I The set of tracks that are at onearm position makes up a cylinder.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 6 / 64
![Page 11: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/11.jpg)
Mass Storage Structure (1/3)
I Magnetic disks: bulk of secondary storage
I Disk platter is a flat circular shape,covered with a magnetic material.
I Heads are attached to a disk arm.
I The surface of a platter is logicallydivided into circular tracks, whichare subdivided into sectors.
I The set of tracks that are at onearm position makes up a cylinder.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 6 / 64
![Page 12: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/12.jpg)
Mass Storage Structure (1/3)
I Magnetic disks: bulk of secondary storage
I Disk platter is a flat circular shape,covered with a magnetic material.
I Heads are attached to a disk arm.
I The surface of a platter is logicallydivided into circular tracks, whichare subdivided into sectors.
I The set of tracks that are at onearm position makes up a cylinder.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 6 / 64
![Page 13: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/13.jpg)
Mass Storage Structure (1/3)
I Magnetic disks: bulk of secondary storage
I Disk platter is a flat circular shape,covered with a magnetic material.
I Heads are attached to a disk arm.
I The surface of a platter is logicallydivided into circular tracks, whichare subdivided into sectors.
I The set of tracks that are at onearm position makes up a cylinder.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 6 / 64
![Page 14: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/14.jpg)
Mass Storage Structure (2/3)
I Drives rotate at 60 to 250 times per second.
I Transfer rate: the rate at which data flow between drive and com-puter.
I Positioning time (random-access time): the time to move disk armto desired cylinder (seek time) and time for desired sector to rotateunder the disk head (rotational latency).
I Head crash results from disk head making contact with the disksurface.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 7 / 64
![Page 15: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/15.jpg)
Mass Storage Structure (2/3)
I Drives rotate at 60 to 250 times per second.
I Transfer rate: the rate at which data flow between drive and com-puter.
I Positioning time (random-access time): the time to move disk armto desired cylinder (seek time) and time for desired sector to rotateunder the disk head (rotational latency).
I Head crash results from disk head making contact with the disksurface.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 7 / 64
![Page 16: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/16.jpg)
Mass Storage Structure (2/3)
I Drives rotate at 60 to 250 times per second.
I Transfer rate: the rate at which data flow between drive and com-puter.
I Positioning time (random-access time): the time to move disk armto desired cylinder (seek time) and time for desired sector to rotateunder the disk head (rotational latency).
I Head crash results from disk head making contact with the disksurface.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 7 / 64
![Page 17: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/17.jpg)
Mass Storage Structure (2/3)
I Drives rotate at 60 to 250 times per second.
I Transfer rate: the rate at which data flow between drive and com-puter.
I Positioning time (random-access time): the time to move disk armto desired cylinder (seek time) and time for desired sector to rotateunder the disk head (rotational latency).
I Head crash results from disk head making contact with the disksurface.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 7 / 64
![Page 18: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/18.jpg)
Mass Storage Structure (3/3)
I Disks can be removable.
I Drive attached to computer via I/O bus.• ATA, SATA, USB, Fibre Channel, SCSI, SAS, Firewire
I The host controller is the controller at the computer end of the bus.
I A disk controller is built into each disk drive.
I Host controller in computer uses bus to talk to disk controller builtinto drive or storage array.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 8 / 64
![Page 19: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/19.jpg)
Mass Storage Structure (3/3)
I Disks can be removable.
I Drive attached to computer via I/O bus.• ATA, SATA, USB, Fibre Channel, SCSI, SAS, Firewire
I The host controller is the controller at the computer end of the bus.
I A disk controller is built into each disk drive.
I Host controller in computer uses bus to talk to disk controller builtinto drive or storage array.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 8 / 64
![Page 20: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/20.jpg)
Mass Storage Structure (3/3)
I Disks can be removable.
I Drive attached to computer via I/O bus.• ATA, SATA, USB, Fibre Channel, SCSI, SAS, Firewire
I The host controller is the controller at the computer end of the bus.
I A disk controller is built into each disk drive.
I Host controller in computer uses bus to talk to disk controller builtinto drive or storage array.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 8 / 64
![Page 21: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/21.jpg)
Mass Storage Structure (3/3)
I Disks can be removable.
I Drive attached to computer via I/O bus.• ATA, SATA, USB, Fibre Channel, SCSI, SAS, Firewire
I The host controller is the controller at the computer end of the bus.
I A disk controller is built into each disk drive.
I Host controller in computer uses bus to talk to disk controller builtinto drive or storage array.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 8 / 64
![Page 22: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/22.jpg)
Hard Disks
I Platters range from 0.85” to 14” (historically).
I Commonly 3.5”, 2.5”, and 1.8”.
I Range from 30GB to 3TB per drive.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 9 / 64
![Page 23: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/23.jpg)
The First Commercial Disk Drive
I IBM, 1956
I 350 disk storage system
I 5M
I Access time ≤ 1 second
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 10 / 64
![Page 24: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/24.jpg)
Solid-State Disks (SSDs)
I Non-volatile memory used like a hard drive.
I More expensive per MB.
I Maybe have shorter life span.
I Less capacity, but much faster.
I No moving parts, so no seek time or rotational latency.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 11 / 64
![Page 25: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/25.jpg)
Magnetic Tape
I Early secondary-storage medium.
I Relatively permanent and holds large quantities of data.
I Access time slow.
I Random access ∼ 1000 times slower than disk.
I Mainly used for backup, storage of infrequently-used data.
I Once data under head, transfer rates comparable to disk.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 12 / 64
![Page 26: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/26.jpg)
Disk Structure
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 13 / 64
![Page 27: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/27.jpg)
Disk Structure (1/2)
I Disk drives are addressed as large 1-dimensional arrays of logicalblocks.
I The logical block is the smallest unit of transfer.
I Low-level formatting creates logical blocks on physical media.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 14 / 64
![Page 28: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/28.jpg)
Disk Structure (1/2)
I Disk drives are addressed as large 1-dimensional arrays of logicalblocks.
I The logical block is the smallest unit of transfer.
I Low-level formatting creates logical blocks on physical media.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 14 / 64
![Page 29: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/29.jpg)
Disk Structure (1/2)
I Disk drives are addressed as large 1-dimensional arrays of logicalblocks.
I The logical block is the smallest unit of transfer.
I Low-level formatting creates logical blocks on physical media.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 14 / 64
![Page 30: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/30.jpg)
Disk Structure (2/2)
I The array of logical blocks is mapped into the sectors of the disksequentially.
• Sector 0 is the first sector of the first track on the outermostcylinder.
• Mapping proceeds in order through that track, then the rest of thetracks in that cylinder, and then through the rest of the cylindersfrom outermost to innermost.
I Logical to physical address should be easy.• Except for bad sectors.• Non-constant num. of sectors per track via constant angular
velocity.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 15 / 64
![Page 31: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/31.jpg)
Disk Structure (2/2)
I The array of logical blocks is mapped into the sectors of the disksequentially.
• Sector 0 is the first sector of the first track on the outermostcylinder.
• Mapping proceeds in order through that track, then the rest of thetracks in that cylinder, and then through the rest of the cylindersfrom outermost to innermost.
I Logical to physical address should be easy.• Except for bad sectors.• Non-constant num. of sectors per track via constant angular
velocity.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 15 / 64
![Page 32: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/32.jpg)
Disk Structure (2/2)
I The array of logical blocks is mapped into the sectors of the disksequentially.
• Sector 0 is the first sector of the first track on the outermostcylinder.
• Mapping proceeds in order through that track, then the rest of thetracks in that cylinder, and then through the rest of the cylindersfrom outermost to innermost.
I Logical to physical address should be easy.• Except for bad sectors.• Non-constant num. of sectors per track via constant angular
velocity.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 15 / 64
![Page 33: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/33.jpg)
Disk Structure (2/2)
I The array of logical blocks is mapped into the sectors of the disksequentially.
• Sector 0 is the first sector of the first track on the outermostcylinder.
• Mapping proceeds in order through that track, then the rest of thetracks in that cylinder, and then through the rest of the cylindersfrom outermost to innermost.
I Logical to physical address should be easy.• Except for bad sectors.• Non-constant num. of sectors per track via constant angular
velocity.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 15 / 64
![Page 34: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/34.jpg)
Disk Attachment
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 16 / 64
![Page 35: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/35.jpg)
Disk Attachment
I Host-attached storage
I Network-attached storage (NAS)
I Storage-area network (SAN)
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 17 / 64
![Page 36: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/36.jpg)
Host-Attached Storage
I Host-attached storage accessed throughI/O ports talking to I/Obuses.
I The typical desktop PC uses an I/O bus architecture, called IDE orATA.
• Maximum of two drives per I/O bus.• A newer, similar protocol that has simplified cabling is SATA.
I SCSI is a bus, up to 16 devices on one cable.
I Fiber Channel (FC) is high-speed serial architecture.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 18 / 64
![Page 37: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/37.jpg)
Host-Attached Storage
I Host-attached storage accessed throughI/O ports talking to I/Obuses.
I The typical desktop PC uses an I/O bus architecture, called IDE orATA.
• Maximum of two drives per I/O bus.• A newer, similar protocol that has simplified cabling is SATA.
I SCSI is a bus, up to 16 devices on one cable.
I Fiber Channel (FC) is high-speed serial architecture.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 18 / 64
![Page 38: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/38.jpg)
Host-Attached Storage
I Host-attached storage accessed throughI/O ports talking to I/Obuses.
I The typical desktop PC uses an I/O bus architecture, called IDE orATA.
• Maximum of two drives per I/O bus.• A newer, similar protocol that has simplified cabling is SATA.
I SCSI is a bus, up to 16 devices on one cable.
I Fiber Channel (FC) is high-speed serial architecture.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 18 / 64
![Page 39: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/39.jpg)
Network-Attached Storage
I Network-attached storage (NAS) is storage made available over anetwork rather than over a local connection.
I Remotely attaching to file systems.
I NFS and CIFS are common protocols.
I Implemented via remote procedure calls (RPCs) between host andstorage over typically TCP or UDP on IP network.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 19 / 64
![Page 40: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/40.jpg)
Storage-Area Network
I Storage-area network (SAN) is common in large storage environ-ments.
I Multiple hosts attached to multiple storage arrays.
I Storage arrays and Hosts are connected to one or more Fibre Channelswitches.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 20 / 64
![Page 41: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/41.jpg)
Disk Scheduling
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 21 / 64
![Page 42: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/42.jpg)
Disk Scheduling (1/2)
I Having a fast access time and disk bandwidth.
I Minimize seek time.
I Seek time ≈ seek distance
I Disk bandwidth is the total number of bytes transferred, divided bythe total time between the first request for service and the comple-tion of the last transfer.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 22 / 64
![Page 43: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/43.jpg)
Disk Scheduling (2/2)
I There are many sources of disk I/O request, e.g., OS, system pro-cesses, users processes
I OS maintains queue of requests, per disk or device.
I Idle disk can immediately work on I/O request, busy disk meanswork must queue.
I Note that drive controllers have small buffers and can manage aqueue of I/O requests.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 23 / 64
![Page 44: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/44.jpg)
Disk Scheduling (2/2)
I There are many sources of disk I/O request, e.g., OS, system pro-cesses, users processes
I OS maintains queue of requests, per disk or device.
I Idle disk can immediately work on I/O request, busy disk meanswork must queue.
I Note that drive controllers have small buffers and can manage aqueue of I/O requests.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 23 / 64
![Page 45: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/45.jpg)
Disk Scheduling (2/2)
I There are many sources of disk I/O request, e.g., OS, system pro-cesses, users processes
I OS maintains queue of requests, per disk or device.
I Idle disk can immediately work on I/O request, busy disk meanswork must queue.
I Note that drive controllers have small buffers and can manage aqueue of I/O requests.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 23 / 64
![Page 46: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/46.jpg)
Disk Scheduling (2/2)
I There are many sources of disk I/O request, e.g., OS, system pro-cesses, users processes
I OS maintains queue of requests, per disk or device.
I Idle disk can immediately work on I/O request, busy disk meanswork must queue.
I Note that drive controllers have small buffers and can manage aqueue of I/O requests.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 23 / 64
![Page 47: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/47.jpg)
Disk Scheduling Algorithms
I First Come First Serve (FCFS)
I Shortest Seek Time First (SSTF)
I SCAN
I C-SCAN
I C-Look
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 24 / 64
![Page 48: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/48.jpg)
FCFS
I Request queue (0-199): 98, 183, 37, 122, 14, 124, 65, 67
I Head pointer 53
I Total head movement: 640 cylinders
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 25 / 64
![Page 49: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/49.jpg)
FCFS
I Request queue (0-199): 98, 183, 37, 122, 14, 124, 65, 67
I Head pointer 53
I Total head movement: 640 cylinders
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 25 / 64
![Page 50: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/50.jpg)
SSTF
I Selects the request with the minimum seek time from the currenthead position.
I SSTF scheduling is a form of SJF scheduling; may cause starvationof some requests.
I Total head movement: 236 cylinders.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 26 / 64
![Page 51: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/51.jpg)
SSTF
I Selects the request with the minimum seek time from the currenthead position.
I SSTF scheduling is a form of SJF scheduling; may cause starvationof some requests.
I Total head movement: 236 cylinders.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 26 / 64
![Page 52: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/52.jpg)
SSTF
I Selects the request with the minimum seek time from the currenthead position.
I SSTF scheduling is a form of SJF scheduling; may cause starvationof some requests.
I Total head movement: 236 cylinders.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 26 / 64
![Page 53: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/53.jpg)
SSTF
I Selects the request with the minimum seek time from the currenthead position.
I SSTF scheduling is a form of SJF scheduling; may cause starvationof some requests.
I Total head movement: 236 cylinders.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 26 / 64
![Page 54: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/54.jpg)
SCAN
I Starts from one end of the disk, and moves toward the other end.• Servicing requests until it gets to the other end of the disk.• At the end of the dist, the head movement is reversed and servicing
continues.
I SCAN algorithm sometimes is called the elevator algorithm.
I Total head movement: 236 cylinders
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 27 / 64
![Page 55: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/55.jpg)
SCAN
I Starts from one end of the disk, and moves toward the other end.• Servicing requests until it gets to the other end of the disk.• At the end of the dist, the head movement is reversed and servicing
continues.
I SCAN algorithm sometimes is called the elevator algorithm.
I Total head movement: 236 cylinders
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 27 / 64
![Page 56: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/56.jpg)
SCAN
I Starts from one end of the disk, and moves toward the other end.• Servicing requests until it gets to the other end of the disk.• At the end of the dist, the head movement is reversed and servicing
continues.
I SCAN algorithm sometimes is called the elevator algorithm.
I Total head movement: 236 cylinders
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 27 / 64
![Page 57: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/57.jpg)
C-SCAN
I Provides a more uniform wait time than SCAN.
I When it reaches the end, it immediately returns to the beginning ofthe disk without servicing any requests on the return trip.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 28 / 64
![Page 58: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/58.jpg)
Look
I LOOK is a version of SCAN, C-LOOK is a version of C-SCAN.
I Arm only goes as far as the last request in each direction, thenreverses direction immediately, without first going all the way to theend of the disk.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 29 / 64
![Page 59: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/59.jpg)
Selecting a Disk-Scheduling Algorithm
I SSTF is common and has a natural appeal: good performance
I SCAN and C-SCAN perform better for systems that place a heavyload on the disk: less starvation
I Performance depends on the number and types of requests.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 30 / 64
![Page 60: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/60.jpg)
Selecting a Disk-Scheduling Algorithm
I SSTF is common and has a natural appeal: good performance
I SCAN and C-SCAN perform better for systems that place a heavyload on the disk: less starvation
I Performance depends on the number and types of requests.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 30 / 64
![Page 61: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/61.jpg)
Disk Management
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 31 / 64
![Page 62: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/62.jpg)
Disk Management
I Disk formatting
I Boot block
I Bad blocks
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 32 / 64
![Page 63: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/63.jpg)
Disk Formatting (1/2)
I Low-level formatting, or physical formatting: dividing a disk intosectors that the disk controller can read and write.
I Each sector can hold header information, data, and error correctioncode (ECC).
I Usually 512 bytes of data but can be selectable.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 33 / 64
![Page 64: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/64.jpg)
Disk Formatting (2/2)
I To use a disk to hold files, the OS needs to record its own datastructures on the disk.
I Partition the disk into one or more groups of cylinders, each treatedas a logical disk.
I Logical formatting or making a file system.
I Raw disk• Use a disk partition as a large sequential array of logical blocks,
without any file-system data structures.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 34 / 64
![Page 65: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/65.jpg)
Disk Formatting (2/2)
I To use a disk to hold files, the OS needs to record its own datastructures on the disk.
I Partition the disk into one or more groups of cylinders, each treatedas a logical disk.
I Logical formatting or making a file system.
I Raw disk• Use a disk partition as a large sequential array of logical blocks,
without any file-system data structures.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 34 / 64
![Page 66: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/66.jpg)
Disk Formatting (2/2)
I To use a disk to hold files, the OS needs to record its own datastructures on the disk.
I Partition the disk into one or more groups of cylinders, each treatedas a logical disk.
I Logical formatting or making a file system.
I Raw disk• Use a disk partition as a large sequential array of logical blocks,
without any file-system data structures.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 34 / 64
![Page 67: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/67.jpg)
Disk Formatting (2/2)
I To use a disk to hold files, the OS needs to record its own datastructures on the disk.
I Partition the disk into one or more groups of cylinders, each treatedas a logical disk.
I Logical formatting or making a file system.
I Raw disk• Use a disk partition as a large sequential array of logical blocks,
without any file-system data structures.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 34 / 64
![Page 68: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/68.jpg)
Boot Block
I The bootstrap program: initializes a computer when it is poweredup and starts the OS.
• E.g., CPU registers, device controllers, the contents of main memory
I Stored in read-only memory (ROM)
I A tiny bootstrap loader program in the boot ROM: brings in a fullbootstrap program from disk.
I The full bootstrap program is stored in the boot blocks at a fixedlocation on the disk.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 35 / 64
![Page 69: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/69.jpg)
Boot Block
I The bootstrap program: initializes a computer when it is poweredup and starts the OS.
• E.g., CPU registers, device controllers, the contents of main memory
I Stored in read-only memory (ROM)
I A tiny bootstrap loader program in the boot ROM: brings in a fullbootstrap program from disk.
I The full bootstrap program is stored in the boot blocks at a fixedlocation on the disk.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 35 / 64
![Page 70: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/70.jpg)
Boot Block
I The bootstrap program: initializes a computer when it is poweredup and starts the OS.
• E.g., CPU registers, device controllers, the contents of main memory
I Stored in read-only memory (ROM)
I A tiny bootstrap loader program in the boot ROM: brings in a fullbootstrap program from disk.
I The full bootstrap program is stored in the boot blocks at a fixedlocation on the disk.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 35 / 64
![Page 71: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/71.jpg)
Boot Block
I The bootstrap program: initializes a computer when it is poweredup and starts the OS.
• E.g., CPU registers, device controllers, the contents of main memory
I Stored in read-only memory (ROM)
I A tiny bootstrap loader program in the boot ROM: brings in a fullbootstrap program from disk.
I The full bootstrap program is stored in the boot blocks at a fixedlocation on the disk.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 35 / 64
![Page 72: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/72.jpg)
Bad Blocks
I The controller maintains a list of bad blocks on the disk.
I The list is initialized during the low-level formatting at the factoryand is updated over the life of the disk.
I Sector sparing or forwarding: replacing each bad sector logically withone of the spare sectors.
• E.g., read logical block 87.• The controller find block 87 is bad based on its ECC, and reports it
to the OS.• After rebooting, the controller replaces the bad sector with a spare.• Whenever the system requests logical block 87, the request is
translated into the replacement sector’s address by the controller.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 36 / 64
![Page 73: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/73.jpg)
Bad Blocks
I The controller maintains a list of bad blocks on the disk.
I The list is initialized during the low-level formatting at the factoryand is updated over the life of the disk.
I Sector sparing or forwarding: replacing each bad sector logically withone of the spare sectors.
• E.g., read logical block 87.• The controller find block 87 is bad based on its ECC, and reports it
to the OS.• After rebooting, the controller replaces the bad sector with a spare.• Whenever the system requests logical block 87, the request is
translated into the replacement sector’s address by the controller.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 36 / 64
![Page 74: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/74.jpg)
Bad Blocks
I The controller maintains a list of bad blocks on the disk.
I The list is initialized during the low-level formatting at the factoryand is updated over the life of the disk.
I Sector sparing or forwarding: replacing each bad sector logically withone of the spare sectors.
• E.g., read logical block 87.
• The controller find block 87 is bad based on its ECC, and reports itto the OS.
• After rebooting, the controller replaces the bad sector with a spare.• Whenever the system requests logical block 87, the request is
translated into the replacement sector’s address by the controller.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 36 / 64
![Page 75: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/75.jpg)
Bad Blocks
I The controller maintains a list of bad blocks on the disk.
I The list is initialized during the low-level formatting at the factoryand is updated over the life of the disk.
I Sector sparing or forwarding: replacing each bad sector logically withone of the spare sectors.
• E.g., read logical block 87.• The controller find block 87 is bad based on its ECC, and reports it
to the OS.
• After rebooting, the controller replaces the bad sector with a spare.• Whenever the system requests logical block 87, the request is
translated into the replacement sector’s address by the controller.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 36 / 64
![Page 76: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/76.jpg)
Bad Blocks
I The controller maintains a list of bad blocks on the disk.
I The list is initialized during the low-level formatting at the factoryand is updated over the life of the disk.
I Sector sparing or forwarding: replacing each bad sector logically withone of the spare sectors.
• E.g., read logical block 87.• The controller find block 87 is bad based on its ECC, and reports it
to the OS.• After rebooting, the controller replaces the bad sector with a spare.
• Whenever the system requests logical block 87, the request istranslated into the replacement sector’s address by the controller.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 36 / 64
![Page 77: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/77.jpg)
Bad Blocks
I The controller maintains a list of bad blocks on the disk.
I The list is initialized during the low-level formatting at the factoryand is updated over the life of the disk.
I Sector sparing or forwarding: replacing each bad sector logically withone of the spare sectors.
• E.g., read logical block 87.• The controller find block 87 is bad based on its ECC, and reports it
to the OS.• After rebooting, the controller replaces the bad sector with a spare.• Whenever the system requests logical block 87, the request is
translated into the replacement sector’s address by the controller.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 36 / 64
![Page 78: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/78.jpg)
Swap-Space Management
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 37 / 64
![Page 79: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/79.jpg)
Swap-Space Management
I Swap-space: virtual memory uses disk space as an extension of mainmemory.
I Less common now due to memory capacity increases.
I It is safer to over-estimate than to under-estimate the amount ofswap space
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 38 / 64
![Page 80: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/80.jpg)
Swap-Space Management
I Swap-space: virtual memory uses disk space as an extension of mainmemory.
I Less common now due to memory capacity increases.
I It is safer to over-estimate than to under-estimate the amount ofswap space
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 38 / 64
![Page 81: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/81.jpg)
Swap-Space Management
I Swap-space: virtual memory uses disk space as an extension of mainmemory.
I Less common now due to memory capacity increases.
I It is safer to over-estimate than to under-estimate the amount ofswap space
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 38 / 64
![Page 82: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/82.jpg)
Swap-Space Location
I A swap space can reside in one of two places.
I It can be carved out of the normal file system.
• A large file within the file system.• Normal file-system routines can be used to create it, name it, and
allocate its space.• Inefficient
I It can be in a separate disk partition.
• A separate raw partition.• Optimized for speed rather than for storage efficiency.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 39 / 64
![Page 83: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/83.jpg)
Swap-Space Location
I A swap space can reside in one of two places.
I It can be carved out of the normal file system.
• A large file within the file system.• Normal file-system routines can be used to create it, name it, and
allocate its space.• Inefficient
I It can be in a separate disk partition.
• A separate raw partition.• Optimized for speed rather than for storage efficiency.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 39 / 64
![Page 84: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/84.jpg)
Swap-Space Location
I A swap space can reside in one of two places.
I It can be carved out of the normal file system.• A large file within the file system.• Normal file-system routines can be used to create it, name it, and
allocate its space.• Inefficient
I It can be in a separate disk partition.
• A separate raw partition.• Optimized for speed rather than for storage efficiency.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 39 / 64
![Page 85: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/85.jpg)
Swap-Space Location
I A swap space can reside in one of two places.
I It can be carved out of the normal file system.• A large file within the file system.• Normal file-system routines can be used to create it, name it, and
allocate its space.• Inefficient
I It can be in a separate disk partition.
• A separate raw partition.• Optimized for speed rather than for storage efficiency.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 39 / 64
![Page 86: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/86.jpg)
Swap-Space Location
I A swap space can reside in one of two places.
I It can be carved out of the normal file system.• A large file within the file system.• Normal file-system routines can be used to create it, name it, and
allocate its space.• Inefficient
I It can be in a separate disk partition.• A separate raw partition.• Optimized for speed rather than for storage efficiency.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 39 / 64
![Page 87: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/87.jpg)
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 40 / 64
![Page 88: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/88.jpg)
Swap-Space On Linux (1/2)
I Either a swap file on a regular file system or a dedicated swap par-tition.
I The swap space is used only for anonymous memory.• It is more efficient to reread a page from the file system than to
write it to swap space and then reread it from there.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 41 / 64
![Page 89: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/89.jpg)
Swap-Space On Linux (2/2)
I Each swap area consists of a series of 4KB page slots, which areused to hold swapped pages.
I Swap map: an array of integer counters associated with each swaparea.
• 0: the page slot is available.• > 0: the page slot is occupied.
I The value indicates the number of mappings to the swapped page.• E.g., a value of 3 indicates that the swapped page is mapped to
three different processes.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 42 / 64
![Page 90: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/90.jpg)
Swap-Space On Linux (2/2)
I Each swap area consists of a series of 4KB page slots, which areused to hold swapped pages.
I Swap map: an array of integer counters associated with each swaparea.
• 0: the page slot is available.• > 0: the page slot is occupied.
I The value indicates the number of mappings to the swapped page.• E.g., a value of 3 indicates that the swapped page is mapped to
three different processes.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 42 / 64
![Page 91: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/91.jpg)
Swap-Space On Linux (2/2)
I Each swap area consists of a series of 4KB page slots, which areused to hold swapped pages.
I Swap map: an array of integer counters associated with each swaparea.
• 0: the page slot is available.• > 0: the page slot is occupied.
I The value indicates the number of mappings to the swapped page.• E.g., a value of 3 indicates that the swapped page is mapped to
three different processes.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 42 / 64
![Page 92: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/92.jpg)
RAID Structure
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 43 / 64
![Page 93: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/93.jpg)
RAID Structure
I RAID: redundant array of inexpensive disks
I Multiple disk drives provides reliability via redundancy.
I Increases the mean time to failure.
• E.g., if the mean time to failure of a single disk is 100,000 hours.• The mean time to failure of some disk in an array of 100 disks will
be 100,000/100 = 1,000 hours, or 41.66 days• It is not long at all.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 44 / 64
![Page 94: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/94.jpg)
RAID Structure
I RAID: redundant array of inexpensive disks
I Multiple disk drives provides reliability via redundancy.
I Increases the mean time to failure.
• E.g., if the mean time to failure of a single disk is 100,000 hours.• The mean time to failure of some disk in an array of 100 disks will
be 100,000/100 = 1,000 hours, or 41.66 days• It is not long at all.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 44 / 64
![Page 95: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/95.jpg)
RAID Structure
I RAID: redundant array of inexpensive disks
I Multiple disk drives provides reliability via redundancy.
I Increases the mean time to failure.
• E.g., if the mean time to failure of a single disk is 100,000 hours.• The mean time to failure of some disk in an array of 100 disks will
be 100,000/100 = 1,000 hours, or 41.66 days• It is not long at all.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 44 / 64
![Page 96: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/96.jpg)
RAID Structure
I RAID: redundant array of inexpensive disks
I Multiple disk drives provides reliability via redundancy.
I Increases the mean time to failure.• E.g., if the mean time to failure of a single disk is 100,000 hours.
• The mean time to failure of some disk in an array of 100 disks willbe 100,000/100 = 1,000 hours, or 41.66 days
• It is not long at all.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 44 / 64
![Page 97: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/97.jpg)
RAID Structure
I RAID: redundant array of inexpensive disks
I Multiple disk drives provides reliability via redundancy.
I Increases the mean time to failure.• E.g., if the mean time to failure of a single disk is 100,000 hours.• The mean time to failure of some disk in an array of 100 disks will
be 100,000/100 = 1,000 hours, or 41.66 days
• It is not long at all.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 44 / 64
![Page 98: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/98.jpg)
RAID Structure
I RAID: redundant array of inexpensive disks
I Multiple disk drives provides reliability via redundancy.
I Increases the mean time to failure.• E.g., if the mean time to failure of a single disk is 100,000 hours.• The mean time to failure of some disk in an array of 100 disks will
be 100,000/100 = 1,000 hours, or 41.66 days• It is not long at all.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 44 / 64
![Page 99: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/99.jpg)
Mirroring
I The simplest approach to introducing redundancy is to duplicateevery disk, called mirroring.
I A logical disk consists of two physical disks, and every write is carriedout on both disks.
I If one of the disks in the volume fails, the data can be read fromthe other.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 45 / 64
![Page 100: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/100.jpg)
Mirroring
I The simplest approach to introducing redundancy is to duplicateevery disk, called mirroring.
I A logical disk consists of two physical disks, and every write is carriedout on both disks.
I If one of the disks in the volume fails, the data can be read fromthe other.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 45 / 64
![Page 101: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/101.jpg)
Mirroring
I The simplest approach to introducing redundancy is to duplicateevery disk, called mirroring.
I A logical disk consists of two physical disks, and every write is carriedout on both disks.
I If one of the disks in the volume fails, the data can be read fromthe other.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 45 / 64
![Page 102: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/102.jpg)
Mean Time to Failure of A Mirrored Volume
I Depends on two factors:• Mean time to failure of the individual disks.• Mean time to repair: to replace a failed disk and to restore the data
on it.
I Example• The mean time to failure of a single disk: 100,000 hours• The mean time to repair: 10 hours• The mean time to data loss of a mirrored disk system:
100, 0002/(2 × 10) = 500 × 106 hours, or 57,000 years!
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 46 / 64
![Page 103: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/103.jpg)
Mean Time to Failure of A Mirrored Volume
I Depends on two factors:• Mean time to failure of the individual disks.• Mean time to repair: to replace a failed disk and to restore the data
on it.
I Example• The mean time to failure of a single disk: 100,000 hours• The mean time to repair: 10 hours• The mean time to data loss of a mirrored disk system:
100, 0002/(2 × 10) = 500 × 106 hours, or 57,000 years!
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 46 / 64
![Page 104: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/104.jpg)
Improvement in Performance via Parallelism
I Disk striping uses a group of disks as one storage unit.
I Data striping consists of splitting the bits of each byte across mul-tiple disks.
• It is called bit-level striping.• E.g., if we have an array of eight disks, we write bit i of each byte
to disk i .
I Block-level striping: blocks of a file are striped across multiple disks.• E.g., with n disks, block i of a file goes to disk (i mod n) + 1.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 47 / 64
![Page 105: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/105.jpg)
Improvement in Performance via Parallelism
I Disk striping uses a group of disks as one storage unit.
I Data striping consists of splitting the bits of each byte across mul-tiple disks.
• It is called bit-level striping.• E.g., if we have an array of eight disks, we write bit i of each byte
to disk i .
I Block-level striping: blocks of a file are striped across multiple disks.• E.g., with n disks, block i of a file goes to disk (i mod n) + 1.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 47 / 64
![Page 106: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/106.jpg)
Improvement in Performance via Parallelism
I Disk striping uses a group of disks as one storage unit.
I Data striping consists of splitting the bits of each byte across mul-tiple disks.
• It is called bit-level striping.• E.g., if we have an array of eight disks, we write bit i of each byte
to disk i .
I Block-level striping: blocks of a file are striped across multiple disks.• E.g., with n disks, block i of a file goes to disk (i mod n) + 1.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 47 / 64
![Page 107: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/107.jpg)
RAID Levels
I RAID is arranged into six different levels.
I RAID schemes improve performance and improve the reliability ofthe storage system by storing redundant data.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 48 / 64
![Page 108: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/108.jpg)
RAID Level 0
I Disk arrays with striping at the level of blocks but without anyredundancy.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 49 / 64
![Page 109: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/109.jpg)
RAID Level 1
I Disk mirroring
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 50 / 64
![Page 110: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/110.jpg)
RAID Level 2
I Error-correcting code (ECC)
I Each byte is associated with a parity bit
I It indicates whether the number of bits in the byte set to 1 is even(parity = 0) or odd (parity = 1).
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 51 / 64
![Page 111: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/111.jpg)
RAID Level 3
I A single parity bit can be used for error detection and correction.
I If one of the sectors is damaged, we know exactly which sector it is
I We can figure out whether any bit in the sector is a 1 or a 0 bycomputing the parity of the corresponding bits from sectors in theother disks.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 52 / 64
![Page 112: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/112.jpg)
RAID Level 4
I Block-level striping, as in RAID 0.
I Keeps a parity block on a separate disk for corresponding blocksfrom N other disks.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 53 / 64
![Page 113: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/113.jpg)
RAID Level 5
I Spreads data and parity among all N+1 disks, rather than storingdata in N disks and parity in one disk.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 54 / 64
![Page 114: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/114.jpg)
RAID Level 6
I Like RAID level 5 but stores extra redundant information to guardagainst multiple disk failures.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 55 / 64
![Page 115: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/115.jpg)
RAID Level 0 + 1 and 1 + 0
I 0 + 1: RAID 0 provides the performance, while RAID 1 providesthe reliability.
I 1 + 0: disks are mirrored in pairs and then the resulting mirroredpairs are striped.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 56 / 64
![Page 116: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/116.jpg)
Stable-Storage Implementation
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 57 / 64
![Page 117: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/117.jpg)
Stable-Storage Implementation (1/4)
I Stable storage: data is never lost (due to failure, etc)
I Write-ahead log (WAL) scheme requires stable storage.
I In a system using WAL, all modifications are written to a log beforethey are applied.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 58 / 64
![Page 118: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/118.jpg)
Stable-Storage Implementation (1/4)
I Stable storage: data is never lost (due to failure, etc)
I Write-ahead log (WAL) scheme requires stable storage.
I In a system using WAL, all modifications are written to a log beforethey are applied.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 58 / 64
![Page 119: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/119.jpg)
Stable-Storage Implementation (1/4)
I Stable storage: data is never lost (due to failure, etc)
I Write-ahead log (WAL) scheme requires stable storage.
I In a system using WAL, all modifications are written to a log beforethey are applied.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 58 / 64
![Page 120: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/120.jpg)
Stable-Storage Implementation (2/4)
I To implement stable storage:
I Replicate information on more than one nonvolatile storage mediawith independent failure modes.
I Update information in a controlled manner to ensure that we canrecover the stable data after any failure during data transfer or re-covery.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 59 / 64
![Page 121: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/121.jpg)
Stable-Storage Implementation (3/4)
I Disk write has 1 of 3 outcomes:
I Successful completion: the data were written correctly on disk.
I Partial failure: a failure occurred in the midst of transfer, so onlysome of the sectors were written with the new data, and the sectorbeing written during the failure may have been corrupted.
I Total failure: the failure occurred before the disk write started, sothe previous data values on the disk remain intact.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 60 / 64
![Page 122: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/122.jpg)
Stable-Storage Implementation (3/4)
I Disk write has 1 of 3 outcomes:
I Successful completion: the data were written correctly on disk.
I Partial failure: a failure occurred in the midst of transfer, so onlysome of the sectors were written with the new data, and the sectorbeing written during the failure may have been corrupted.
I Total failure: the failure occurred before the disk write started, sothe previous data values on the disk remain intact.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 60 / 64
![Page 123: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/123.jpg)
Stable-Storage Implementation (3/4)
I Disk write has 1 of 3 outcomes:
I Successful completion: the data were written correctly on disk.
I Partial failure: a failure occurred in the midst of transfer, so onlysome of the sectors were written with the new data, and the sectorbeing written during the failure may have been corrupted.
I Total failure: the failure occurred before the disk write started, sothe previous data values on the disk remain intact.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 60 / 64
![Page 124: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/124.jpg)
Stable-Storage Implementation (3/4)
I Disk write has 1 of 3 outcomes:
I Successful completion: the data were written correctly on disk.
I Partial failure: a failure occurred in the midst of transfer, so onlysome of the sectors were written with the new data, and the sectorbeing written during the failure may have been corrupted.
I Total failure: the failure occurred before the disk write started, sothe previous data values on the disk remain intact.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 60 / 64
![Page 125: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/125.jpg)
Stable-Storage Implementation (4/4)
I If failure occurs during block write, recovery procedure restores blockto consistent state.
I System maintains two physical blocks per logical block and does thefollowing:
1 Write to 1st physical2 When successful, write to 2nd physical3 Declare complete only after then second write completes successfully
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 61 / 64
![Page 126: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/126.jpg)
Stable-Storage Implementation (4/4)
I If failure occurs during block write, recovery procedure restores blockto consistent state.
I System maintains two physical blocks per logical block and does thefollowing:
1 Write to 1st physical2 When successful, write to 2nd physical3 Declare complete only after then second write completes successfully
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 61 / 64
![Page 127: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/127.jpg)
Summary
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 62 / 64
![Page 128: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/128.jpg)
Summary
I Mass storage structure: platter, track, sector, cylinder
I Disk attachment: host-attached, network-attached, storage-area-network
I Disk scheduling: FCFS, SSTF, SCAN, C-SCAN, C-Look
I Disk management: formatting, boot block, bad blocks
I Swap management
I RAID: RAID0-RAID6
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 63 / 64
![Page 129: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/129.jpg)
Summary
I Mass storage structure: platter, track, sector, cylinder
I Disk attachment: host-attached, network-attached, storage-area-network
I Disk scheduling: FCFS, SSTF, SCAN, C-SCAN, C-Look
I Disk management: formatting, boot block, bad blocks
I Swap management
I RAID: RAID0-RAID6
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 63 / 64
![Page 130: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/130.jpg)
Summary
I Mass storage structure: platter, track, sector, cylinder
I Disk attachment: host-attached, network-attached, storage-area-network
I Disk scheduling: FCFS, SSTF, SCAN, C-SCAN, C-Look
I Disk management: formatting, boot block, bad blocks
I Swap management
I RAID: RAID0-RAID6
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 63 / 64
![Page 131: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/131.jpg)
Summary
I Mass storage structure: platter, track, sector, cylinder
I Disk attachment: host-attached, network-attached, storage-area-network
I Disk scheduling: FCFS, SSTF, SCAN, C-SCAN, C-Look
I Disk management: formatting, boot block, bad blocks
I Swap management
I RAID: RAID0-RAID6
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 63 / 64
![Page 132: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/132.jpg)
Summary
I Mass storage structure: platter, track, sector, cylinder
I Disk attachment: host-attached, network-attached, storage-area-network
I Disk scheduling: FCFS, SSTF, SCAN, C-SCAN, C-Look
I Disk management: formatting, boot block, bad blocks
I Swap management
I RAID: RAID0-RAID6
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 63 / 64
![Page 133: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/133.jpg)
Summary
I Mass storage structure: platter, track, sector, cylinder
I Disk attachment: host-attached, network-attached, storage-area-network
I Disk scheduling: FCFS, SSTF, SCAN, C-SCAN, C-Look
I Disk management: formatting, boot block, bad blocks
I Swap management
I RAID: RAID0-RAID6
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 63 / 64
![Page 134: Storage](https://reader036.fdocuments.in/reader036/viewer/2022062514/55ada0721a28abf12d8b4833/html5/thumbnails/134.jpg)
Questions?
Acknowledgements
Some slides were derived from Avi Silberschatz slides.
Amir H. Payberah (Tehran Polytechnic) Storage 1393/9/1 64 / 64