Post on 21-Dec-2015
1
Storage Hierarchy
Cache
MainMemory
VirtualMemory
FileSystem
TertiaryStorage
Programs
DBMS
Capacity&
Cost
Secondary Storage
2
Disks
Direct access storage devices (DASD) It is possible to access data directly as well as
sequentially Accessing data has a lower overhead than serial devices
(e.g., tapes)
Types Fixed-head hard disks Removable hard disks Floppy disks
6
Capacity Calculation
Capacity = #cylinders Cylinder capacity
= #cylinders (# tracks/cylinder Track capacity)
= #cylinders #tracks/cylinder #sectors/track *
Bytes/sector
7
Data Organization
Sector organization of track fixed length determined by the operating system
Block organization of track variable length user defined
8
Sector Organization
Clusters contiguous group of sectors on cylinder fixed size smallest space assigned to a file
Extents collection of contiguous clusters
can be accessed with a minimum amount of seeking
Therefore each extent consists of several adjacent clusters each cluster consists of several adjacent sectors
10
Sector Organization
Advantages simplifies allocation of storage space simplifies address calculation simplifies synchronization of CPU computation with
record accessing
Disadvantage internal fragmentation: space unused within a sector
11
Block Organization
no internal fragmentation complicated address calculations increased non-data overhead
datablock
datablock
countblock
countblock
User defined length
…
12
Disk Access Time = Seek time + Rotational delay + transfer time Seek time: time to move access arm to correct cylinder
T(seek) = S + Const N ,
where S = Initial time, N = # of cylinders moved For PC’s T(seek)= 20 + 0.3 N ms; For large disks T(seek)= 3 + 0.1 N ms
Rotational delay: time to find correct place on track on average: half a revolution
Transfer time: time to move data (# of bytes transferred)(# of bytes of track ) rotation time
Cost of Disk Access
13
Example Consider
A 300 Mbyte disk with average seek time = 18 msec, rotational delay = 8.3 msec, 512 Bytes/sector, 8 sectors/cluster
A file of 8000 256-byte records = 2048 K bytes 500 clusters within 100 extents Case 1:
The file is stored in 100 extents, i.e., 100 seek times and transfer time for one extent is 16.7 msec.
Total time = 100 ( 18 + 8.3 + 16.7) = 4.3 seconds Case 2:
The file is stored in 8000 sectors, randomly distributed over the disk, thus, 8000 seek times are needed
Total time = 8000 (18 + 8.3 + 3.3 ) = 236.8 seconds
14
Program requests Write OS passes job to file manager File manager
finds physical file name does security check search FAT for physical address in disk transfer data to buffer pass job to I/O processor
I/O processor gets data from buffer breaks it into sectors sends it to disk controller
Disk controller instructs disk driver to do dirty job
Disk Access Process
15
Improving Access Time
Organize data by cylinders Use multiple disks Mirror disks More intelligent disk scheduling
Elevator algorithm
Prefetching and buffering
16
Buffer Management
Goal: reduce the number of disk accesses Reside in RAM Buffer strategies
multiple buffering buffer pooling
Program data area
Program data areaI/O Buffer
I/O Buffer
I/O Buffer
I/O Buffer
Disk
Disk
18
parity track
Nine Track Tape
Above set-up assumes odd, vertical parity There is no concept of an address; reading is sequential
100010010
19
data block
gap
Tape Layout
A data block is a group of frames whose sizes can very from a few bytes to many kilobytes.
An interblock gap is a space on tape without information that separates blocks. the gap provides sufficient space for the tape to start and/or stop.
20
Tape Drivers
Tape density bits per inch (bpi) commonly 800, 1600, 6250, ... , bpi
Tape speed inches per second (ips) usually 30 to 200 ips
Size of intergap: commonly between 0.3in and 0.75in
21
Calculating Space Requirements
Space requirements: s = n (b + g)
whereb = block size (inches)
g = gap (inches)
n = number of blocks
s = total space
Blocking factor: number of records stored in a physical block