Presentation is loading. Please wait.

Presentation is loading. Please wait.

CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time.

Similar presentations


Presentation on theme: "CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time."— Presentation transcript:

1 CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time. Improving disk access performance.

2 CPSC 231 Secondary storage (D.H.)2 Secondary Storage Management Secondary storage devices: have much longer access time than main memory have access times that vary from one access to another (some accesses are relatively fast and other accesses are slower on the same device) have a lot of more storage than main memory have storage that is non-volatile

3 CPSC 231 Secondary storage (D.H.)3 Disks Types of commonly used disks hard disks floppy disks Iomega ZIP disks Jaz disks

4 CPSC 231 Secondary storage (D.H.)4 The Organization of Disks Data is stored on the surface of one or more platters. Disk storage units are: tracks and cylinders sectors Sectors Tracks

5 CPSC 231 Secondary storage (D.H.)5 Disk Storage Capacity The amount of data that can be held on a disk depends on how densely bits can be stored on the disk surface The capacity of the disk is a function of: the number of cylinders the number of tracks per cylinder the capacity of a track Track capacity =number of sectors per track  bytes per sector Cylinder capacity=number of tracks per cylinder  track capacity Drive capacity = number of cylinders  cylinder capacity

6 Calculations Calculate the drive capacity if: Sector capacity = 1024 bytes. Number of sectors per track = 179 Number of tracks per cylinder = 80 Number of cylinders = 4062 CPSC 231 Secondary storage (D.H.)6

7 Answer Track capacity = 179 X 1024 = 183296 Bytes Cylinder capacity = 80 X 183296 = 14663680 Bytes. Drive capacity = 2 X 4062 X 14663680 = 119127736320 Bytes = 111 GB CPSC 231 Secondary storage (D.H.)7

8 8 How is the Data Read from or Written to a Disk? The operating system sends control signals to the disk via a disk driver to read or to write data from a given sector of a given cylinder. The disk is rotating to position the needed sector under the read/write head (rotational delay) The read/write head is moving to the needed cylinder (seek time).

9 CPSC 231 Secondary storage (D.H.)9 Specification of Disk Drives Capacity: e.g. 2 GB Minimum (track to track) seek time: e.g. 1 msec Average seek time : e.g. 12 msec (milliseconds) Maximum seek time: e.g. 22 msec Spindle speed: e.g. 5200 rpm (rotations per minute) Average rotational delay: e.g. 6 msec Mximum transfer rate: e.g.2796 bytes/msec=2730K/sec Bytes per sector: e.g. 512 Sectors per track: e.g. 63 Tracks per cylinder: e.g. 16 Cylinders: 4092

10 CPSC 231 Secondary storage (D.H.)10 Organizing Data by Sectors Consecutive physical sectors sometimes are not consecutive logically this is called sector interleaving In the early 1990s, controller speeds improved so that disks can now offer non- interleaving (also known as 1:1 interleaving)

11 CPSC 231 Secondary storage (D.H.)11 Clusters A cluster is a fixed number of consecutive (logical) disk sectors. Some operating systems view each file as a series of clusters. Clusters are designed to improve performance since all sectors in one cluster can be accessed without an additional seek.

12 CPSC 231 Secondary storage (D.H.)12 Extents Extents of a file are those parts of the file which are stored in contiguous clusters. It is very beneficial to store the whole file in one extent (seek time is minimized).

13 CPSC 231 Secondary storage (D.H.)13 Fragmentation Fragmentation is the wasted disk space due to the fact that the smallest organizational unit of a disk is one sector. If a sector size is 512 bytes than even if we need to store only one byte, we have to allocate to it one whole sector. Thus 511 bytes are wasted.

14 CPSC 231 Secondary storage (D.H.)14 Blocks Some disk allow for storing data in user defined blocks instead of sectors. When the data on a disk is organized in blocks, this usually means that the amount of data transferred in a single I/O operation can vary. Blocks can be either variable or fixed length. Block organization can be more efficient than sector organization but it is much more complex.

15 CPSC 231 Secondary storage (D.H.)15 Non-data Overhead Non-data overhead includes at the beginning of each sector: sector address track address sector usability

16 CPSC 231 Secondary storage (D.H.)16 The Cost of Disk Access Seek time the time required to move the r/w head to the correct cylinder Rotational delay the time required to rotate the disk so that the correct sector is positioned under the r/w head Transfer time the time required to transfer the data: number of bytes transferred Transfer time =  rotation time number of bytes on a track

17 Calculations Calculate the transfer time for a disk if: Number of bytes transferred = 256 Bytes Track capacity = 1 MB Rotation time = 5.7 msec. CPSC 231 Secondary storage (D.H.)17

18 Answer Transfer time = 256 / (1024 X 1024) X 5.7 = 256 / 1048576 X 5.7 = 0.0012 msec. CPSC 231 Secondary storage (D.H.)18

19 CPSC 231 Secondary storage (D.H.)19 Disks as Bottlenecks Disk speeds lag far behind CPU main memory local network Computer programs spend most of time awaiting data from the disk

20 CPSC 231 Secondary storage (D.H.)20 Improving Disk Performance Disk striping splitting the parts of a single file on several drives RAID Redundant Array of Inexpensive Disks RAM disk Disk caching Buffering


Download ppt "CPSC 231 Secondary storage (D.H.)1 Learning Objectives Understanding disk organization. Sectors, clusters and extents. Fragmentation. Disk access time."

Similar presentations


Ads by Google