《operatingsystem操作系统ch12massstoragesystems49.ppt》由会员分享,可在线阅读,更多相关《operatingsystem操作系统ch12massstoragesystems49.ppt(48页珍藏版)》请在课桌文档上搜索。
1、Chapter 12:Mass-Storage Systems,汝刃偶溶乓硝梧昌担瞎桅握谗冯机抓挠吵捣歉贾渗账柠韵胰姻言唉邻稠截operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Chapter 12:Mass-Storage Systems,Overview of Mass Storage StructureDisk StructureDisk AttachmentDisk SchedulingDisk ManagementSwap-Space Man
2、agementRAID StructureDisk AttachmentStable-Storage ImplementationTertiary Storage DevicesOperating System IssuesPerformance Issues,喷看球氧猎殖李熔糠与舱敦艘定旋断攻坎步茎牲拙洲党领格赵狞庆摩碎乘operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Objectives,Describe the physical structu
3、re of secondary and tertiary storage devices and the resulting effects on the uses of the devicesExplain the performance characteristics of mass-storage devicesDiscuss operating-system services provided for mass storage,including RAID and HSM,刻帜寥譬绎氮起嗓傈绳渭凄湃雀辖襟釉招绥微宫转廊梨锻叔旦拴曰癣芯贾operating system操作系统ch12-
4、mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Overview of Mass Storage Structure,Magnetic disks provide bulk of secondary storage of modern computersDrives rotate at 60 to 200 times per secondTransfer rate is rate at which data flow between drive and computerPositioning tim
5、e(random-access time)is time to move disk arm to desired cylinder(seek time)and time for desired sector to rotate under the disk head(rotational latency)Head crash results from disk head making contact with the disk surfaceThats badDisks can be removableDrive attached to computer via I/O busBusses v
6、ary,including EIDE,ATA,SATA,USB,Fibre Channel,SCSIHost controller in computer uses bus to talk to disk controller built into drive or storage array,煤福迎巨岗无妓猾膀辰邵挽荫瞧早各猩拳改眩怠挠迹纤板苞哈择牌钉批吞operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Moving-head Disk Machan
7、ism,鲤洋旬咱唉奋创灭伯勘透隧蔫软胳帽亥滴拂闰涯毡谢慰跃酌浦童叮鲸农赖operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Overview of Mass Storage Structure(Cont.),Magnetic tapeWas early secondary-storage mediumRelatively permanent and holds large quantities of dataAccess time slowRandom
8、access 1000 times slower than diskMainly used for backup,storage of infrequently-used data,transfer medium between systemsKept in spool and wound or rewound past read-write headOnce data under head,transfer rates comparable to disk20-200GB typical storageCommon technologies are 4mm,8mm,19mm,LTO-2 an
9、d SDLT,啤睛病十叛铰佳椎盎遇血肉烬集朴芥咒软葬瑚曙窑该演碑补沸刻苦桐诵渠operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Disk Structure,Disk drives are addressed as large 1-dimensional arrays of logical blocks,where the logical block is the smallest unit of transfer.The 1-dimensional
10、array of logical blocks is mapped into the sectors of the disk sequentially.Sector 0 is the first sector of the first track on the outermost cylinder.Mapping proceeds in order through that track,then the rest of the tracks in that cylinder,and then through the rest of the cylinders from outermost to
11、 innermost.,汾口硬季包湖鹤铭多登篓仆集婪职巩柜亿状宛谚沟蛊疙逢铡坎弄馋荤围抉operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Disk Attachment,Host-attached storage accessed through I/O ports talking to I/O bussesSCSI itself is a bus,up to 16 devices on one cable,SCSI initiator request
12、s operation and SCSI targets perform tasks Each target can have up to 8 logical units(disks attached to device controllerFC is high-speed serial architectureCan be switched fabric with 24-bit address space the basis of storage area networks(SANs)in which many hosts attach to many storage unitsCan be
13、 arbitrated loop(FC-AL)of 126 devices,瞳闻腆柱栈倾牙锅遮脖苟违借屁铡崇磕卯身尘玄唱琼逛寺席氨尚姐产俭镑operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Network-Attached Storage,Network-attached storage(NAS)is storage made available over a network rather than over a local connection(su
14、ch as a bus)NFS and CIFS are common protocolsImplemented via remote procedure calls(RPCs)between host and storageNew iSCSI protocol uses IP network to carry the SCSI protocol,革纪药画逆径哆卵娘乐各偷忘哮委佐桩予年屹策珊星踞河料檬袒畅挑幻韭operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems
15、-49,Storage Area Network,Common in large storage environments(and becoming more common)Multiple hosts attached to multiple storage arrays-flexible,紊哈吴版朱糜惶懒全实滔掠邻是颤笺患呐堵哉尼培詹败伺徊睡珊肘漂壁塔operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Disk Scheduling,The oper
16、ating system is responsible for using hardware efficiently for the disk drives,this means having a fast access time and disk bandwidth.Access time has two major componentsSeek time is the time for the disk are to move the heads to the cylinder containing the desired sector.Rotational latency is the
17、additional time waiting for the disk to rotate the desired sector to the disk head.Minimize seek timeSeek time seek distanceDisk bandwidth is the total number of bytes transferred,divided by the total time between the first request for service and the completion of the last transfer.,碾过闸饭番耍株欠龋踢爽爱矢劳翔
18、啮耙动闸肃涪子纶疾纯泞英寄溪解茹率operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Disk Scheduling(Cont.),Several algorithms exist to schedule the servicing of disk I/O requests.We illustrate them with a request queue(0-199).98,183,37,122,14,124,65,67Head pointer 53,入笔
19、仁回饯锣凳衰斩咎感褒鸽攫恕残旁诌球妻苞笋栖沽兰兔健供膝革程钥operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,FCFS,Illustration shows total head movement of 640 cylinders.,助地拢漏抒凉旬镭牛琅衡对俭乙涉侵甭淤霓移堰疼泣狠邵互币埠献贺跌柳operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-s
20、torage systems-49,SSTF,Selects the request with the minimum seek time from the current head position.SSTF scheduling is a form of SJF scheduling;may cause starvation of some requests.Illustration shows total head movement of 236 cylinders.,刁竿侯初叮曝籽卓确裕烈乓慧续炕刽戈绵坞快排英治焊区昨鼻觅踞奋鞍捏operating system操作系统ch12-mas
21、s-storage systems-49operating system操作系统ch12-mass-storage systems-49,SSTF(Cont.),线镜苯穷药忙裳旗秸剿焕翼霍建擎夏遥辜处富蒋铲匀诛灯凰学鞘姓辕孜公operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,SCAN,The disk arm starts at one end of the disk,and moves toward the other end,servicing r
22、equests until it gets to the other end of the disk,where the head movement is reversed and servicing continues.Sometimes called the elevator algorithm.Illustration shows total head movement of 208 cylinders.,猾汾还思茎喘瑚芋晕殖铝澎岭迷单硷怔伸姑岂烃抽质肤衰瓜皮竖颇断袭毒operating system操作系统ch12-mass-storage systems-49operating sy
23、stem操作系统ch12-mass-storage systems-49,SCAN(Cont.),秃妇花稍诈锰洪选荣药享乎尖柜阀痴殃扁柜荣棱仆挪穗虐颖户镍熬白殃抉operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,C-SCAN,Provides a more uniform wait time than SCAN.The head moves from one end of the disk to the other.servicing requests
24、 as it goes.When it reaches the other end,however,it immediately returns to the beginning of the disk,without servicing any requests on the return trip.Treats the cylinders as a circular list that wraps around from the last cylinder to the first one.,镑赏彤午赘双轨将笆激孵昏邯索眩污姐论频财楷发壳顺瞩瞧戮湿沈篙吗喳operating system操
25、作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,C-SCAN(Cont.),忙斡藉齐况骚坦框老柱旅盯猜纵扒赵阜目僧叶诫罢素颗昧果狱沫早谬汪宵operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,C-LOOK,Version of C-SCANArm only goes as far as the last request in each dire
26、ction,then reverses direction immediately,without first going all the way to the end of the disk.,蜘彝挺购慑冗举教重愤俘识团吏鼠盟挨亲枉缮贷疆攫谓愧隘双宵淋土闪辱operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,C-LOOK(Cont.),汞士拌亭砧诺恃殷痊幂铱昔观丢芳祥局缘肥驾积给浦荐务鸵饮憎胯衬容肄operating system操作系统ch12-ma
27、ss-storage systems-49operating system操作系统ch12-mass-storage systems-49,Selecting a Disk-Scheduling Algorithm,SSTF is common and has a natural appealSCAN and C-SCAN perform better for systems that place a heavy load on the disk.Performance depends on the number and types of requests.Requests for disk
28、service can be influenced by the file-allocation method.The disk-scheduling algorithm should be written as a separate module of the operating system,allowing it to be replaced with a different algorithm if necessary.Either SSTF or LOOK is a reasonable choice for the default algorithm.,族药容吮酗掘达歼几娇坪耘数惺
29、诀陛翟蛛痰画对蹋去现寥猜家炽彝淋懈阳operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,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 sti
30、ll 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”.Boot block initializes system.The bootstrap is stored in ROM.Bootstrap loader program.Methods such as sector sparing used to handle bad blocks.,箱
31、椭右蜘殖耽启馅饭傍亦劫赂斩限槛添刽级琐曼揩卡迭隧琳辊爆楷窜擎冀operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Booting from a Disk in Windows 2000,佣荤术见篇麦坏概贷劈哥暑汐某处间施腐掀茧奈桩怜寻愉跑防喘铺衷开蜒operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Swap-Sp
32、ace 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 management4.3BSD allocates swap space when process starts;holds text segment(the program)a
33、nd 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.,乡赋拽倾淑落窝扣涣黄尼睦专强凌狼赏距蛰额搭炙优兢擦氦惺砖贵个煤货operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-m
34、ass-storage systems-49,Data Structures for Swapping on Linux Systems,渐臣靛塑吠衡抬临陶酣妹瘸煤力凉抉屁达姬恿瘦伊督堪临拂俺傈馏畜慧辐operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,RAID Structure,RAID multiple disk drives provides reliability via redundancy.RAID is arranged into six
35、 different levels.,慈弟众惠树鲤墓氨踊绅采崖十可孩菠流圭惰割加邯现敛逸啊桌裔请猪蛤哭operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,RAID(cont),Several improvements in disk-use techniques involve the use of multiple disks working cooperatively.Disk striping uses a group of disks as on
36、e storage unit.RAID schemes improve performance and improve the reliability of the storage system by storing redundant data.Mirroring or shadowing keeps duplicate of each disk.Block interleaved parity uses much less redundancy.,夷抠焙艾察乓锋篇说期哎暴灿睹吓壬蒂骨娥底润粘欣酿蛤础魂身浇畔崔洁operating system操作系统ch12-mass-storage sy
37、stems-49operating system操作系统ch12-mass-storage systems-49,RAID Levels,帆孔寞震昌赚瘩诲笨调悔得稚瞅嫁命乒走主涧蘸站涎送绊玛那雷注权拨徘operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,RAID(0+1)and(1+0),蘑邱邑潍拽住暑鞘挖椅糕庐仪贴还罪桃祥诊壬崩鲜琅辕敛教甫疙粕笆绎袖operating system操作系统ch12-mass-storage systems-49oper
38、ating system操作系统ch12-mass-storage systems-49,Stable-Storage Implementation,Write-ahead log scheme requires stable storage.To implement stable storage:Replicate information on more than one nonvolatile storage media with independent failure modes.Update information in a controlled manner to ensure th
39、at we can recover the stable data after any failure during data transfer or recovery.,唱划办孽灼硫英烫恼默砸诉箭赶驯频抹究磋弟仕藐壤栽淘战解性累肖洽察operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Tertiary Storage Devices,Low cost is the defining characteristic of tertiary storage.
40、Generally,tertiary storage is built using removable mediaCommon examples of removable media are floppy disks and CD-ROMs;other types are available.,叶筋势炬硫撂蝉饼策匣构宇喉晕摘鞭窟耘砖咏烦犹豪醚骑柱龟瀑揭篷捏峡operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Removable Disks,Floppy
41、disk thin flexible disk coated with magnetic material,enclosed in a protective plastic case.Most floppies hold about 1 MB;similar technology is used for removable disks that hold more than 1 GB.Removable magnetic disks can be nearly as fast as hard disks,but they are at a greater risk of damage from
42、 exposure.,央撑综坐贤搐可迄寂垣氮临纯碧扭芯涝商躬碰妖剁艘个众奴轴锋疚晦扔伶operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Removable Disks(Cont.),A magneto-optic disk records data on a rigid platter coated with magnetic material.Laser heat is used to amplify a large,weak magnetic fi
43、eld to record a bit.Laser light is also used to read data(Kerr effect).The magneto-optic head flies much farther from the disk surface than a magnetic disk head,and the magnetic material is covered with a protective layer of plastic or glass;resistant to head crashes.Optical disks do not use magneti
44、sm;they employ special materials that are altered by laser light.,孰深溪舜隐函锗宰喘镍免戒爵磋畜冀湃臭优瘩钥蝴坤厢沏仆毕裹瘤脉镑魁operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,WORM Disks,The data on read-write disks can be modified over and over.WORM(“Write Once,Read Many Times”)d
45、isks can be written only once.Thin aluminum film sandwiched between two glass or plastic platters.To write a bit,the drive uses a laser light to burn a small hole through the aluminum;information can be destroyed by not altered.Very durable and reliable.Read Only disks,such ad CD-ROM and DVD,com fro
46、m the factory with the data pre-recorded.,他妊牵虽拜鞍聊祭城帆碱互东咙源隐蘸核阑秤帮屡猫纽拳胸袒黍苏轿卿享operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Tapes,Compared to a disk,a tape is less expensive and holds more data,but random access is much slower.Tape is an economical medi
47、um for purposes that do not require fast random access,e.g.,backup copies of disk data,holding huge volumes of data.Large tape installations typically use robotic tape changers that move tapes between tape drives and storage slots in a tape library.stacker library that holds a few tapessilo library
48、that holds thousands of tapes A disk-resident file can be archived to tape for low cost storage;the computer can stage it back into disk storage for active use.,息拱瘩皂歼诚爵譬婆倦抗狠绕悟遮纸避峭衙昼埂沪钒渺追猿健酪唾沏长毅operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Operating
49、System Issues,Major OS jobs are to manage physical devices and to present a virtual machine abstraction to applicationsFor hard disks,the OS provides two abstraction:Raw device an array of data blocks.File system the OS queues and schedules the interleaved requests from several applications.,剃洛哗捍鳞婆状
50、潦欲裔髓郑抚头懈什抵救惕孽走五沥乓东协凡苞猩亩劲啦operating system操作系统ch12-mass-storage systems-49operating system操作系统ch12-mass-storage systems-49,Application Interface,Most OSs handle removable disks almost exactly like fixed disks a new cartridge is formatted and an empty file system is generated on the disk.Tapes are pre