งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

งานนำเสนอกำลังจะดาวน์โหลด โปรดรอ

Mass-Storage Structure

งานนำเสนอที่คล้ายกัน


งานนำเสนอเรื่อง: "Mass-Storage Structure"— ใบสำเนางานนำเสนอ:

1 Mass-Storage Structure
Transfer rate disk <-> head Effective transfer rate block <-> OS

2 รูปจาก internet

3 Constant angular velocity – harddisk
Modern disk drives = large one-dimensional array of logical blocks. A logical block is the smallest unit of transfer. The size of a logical block is usually 512 bytes (from factory), but can be low-level formatted to 1024 bytes (less header and trailer, but more internal fragmentation). Constant linear velocity – CD-ROM, DVD-ROM Constant angular velocity – harddisk Magnetic tapes are already obsolete. Block (sector) Header Data 512 bytes Trailer ความเร็วเชิงเส้น (m/s) คงที่ เวลาหัวอ่านเลื่อนเข้าไปอ่านข้อมูลที่ track ข้างใน แกนจะหมุนเร็วขึ้น (rpm) เพื่อให้ความเร็วเชิงเส้นคงที่ ใช้ความเร็วรอบ (rpm) คงที่เสมอ เปลืองไฟ data density decreases in outer tracks

4 Disk Attachment Host-Attached Storage (local I/O port)
IDE, Serial ATA (SATA) for typical PCs (2 devices per bus) SCSI (อ่านว่า scuzzy), FC for high-end workstations SCSI (1 SCSI initiator + 15 SCSI targets per bus) Each device (SCSI target) can have 8 logical units. FC (Fiber channel) i) 24-bit address space (basis of SAN) ii) FC-AL (arbitrated loop) 126 devices and controllers. Network-Attached Storage (LAN or TCP/IP) Storage-Area Network (private network, storage protocols) Reading Assignment: Solid-state disk (only electronics no mechanics)

5 SATA On board (left figure) Only 1 disk per port
SATA Multiplier (optional, slower) Using PCI card for more ports

6

7 SCSI มีทั้งแบบ onboard หรือ PCI card

8 สาย LAN ใช้ bandwidth ร่วมกัน กับ applications
เหมาะกับการใช้งานตามบ้านหรือองค์กรขนาดเล็ก (ระวังคอขวดที่ network ใช้ GbE หรือ 10 GbE แทน 10/100 เดิม หรือถ้าใช้ wireless ก็ Gigabit wireless) สาย LAN

9 Share Switch ใช้ bandwidth แยก จาก applications
ใช้ network protocol สำหรับ storage เหมาะกับองค์กรขนาดใหญ่

10 Disk Scheduling FCFS scheduling SSTF scheduling SCAN scheduling
C-SCAN scheduling LOOK/C-LOOK scheduling Note: FCFS = First Come First Serve SSTF = Shortest Seek Time First C = Circular

11 (cylinder ดูรูปในหน้าแรก)
หยุดอ่าน วิ่ง หยุดอ่าน วิ่ง หยุดอ่าน

12

13 ชนขอบ Going back and forth

14 Service only in one direction (left to right)
provide more uniform wait time ชนขอบ ชนขอบ ถ้ามี request เพิ่มเข้ามาใน queue แบบ SCAN ก็จะ service ตอนวิ่งกลับจากขวามาซ้าย ทำให้ A โชคร้าย เพราะมาก่อน แต่ต้องรอนานมากกว่าจะได้ service A

15 เหมือน C-SCAN แต่ไม่ต้องวิ่งไปชนขอบ แบบนี้ฮาร์แวร์น่าจะออกแบบยากกว่า เพราะต้องดูข้อมูลใน queue ด้วย
High-end harddisk เช่น SCSI น่าจะใช้ disk scheduling ที่ซับซ้อน ทำให้ฮาร์ดแวร์มีราคาแพง

16 Disk Management 1. Disk Formatting
Physical formatting (sector, track, ..) Logical formatting (partition) Block (sector) Logical block 0, 1, 2, 3, 4, … (ที่ OS เห็น) จะถูก map กับ defect-free sector เช่น Sector 475, 476, 980, 981, 982, … Metadata (Sector ID) Header Data 512 bytes Read: disk controller คำนวณ code ใหม่ และเช็คว่าตรงกับ code ใน trailer หรือไม่ ถ้าไม่อาจจะลองพยายามอ่านใหม่อีกครั้ง ถ้าเกิน n ครั้งไม่สำเร็จจะ error Write: disk controller คำนวณ code ใหม่ และเขียนทับลงใน trailer Error-detecting code Error-correcting code (ECC) Trailer Soft Error: สามารถ recover ได้จาก ECC Hard Error: ไม่สามารถ recover ได้จาก ECC (bad sector)

17 MBR = master boot record
Disk Management Boot Block 3. Bad Blocks MBR = master boot record Booting steps: โหลด first program (BIOS) จาก ROM First program จะไปอ่าน boot code จากใน MBR Boot code จะอ่าน partition table ได้และต้องรู้ว่าไปโหลดโปรแกรมต่อไปมาจาก partition ใด โหลด OS kernel จาก boot partition Logical Formatting Cheap disk: OS manages bad sectors. SCSI disk: OS calls disk controller. Controller ฉลาด !!! Spared sectors Used sectors All sectors Bad sectors (from factory)

18 Swap-Space Management (swapping = paging)
Located on file system1 (ขยายได้) or raw partition2 (perf ดีกว่า, contiguous) Windows ใช้แบบ 1 มี page file Linux ใช้ แบบ 2 มี swap partition (หรือจะใช้ file sys ก็ได้)

19 RAID (Redundant Array of Inexpensive Disks)
Error detection (parity bit) 1 1 1 1 Even parity SEND ส่งผิด 1 1 1 Even parity RECEIVE Error detected, need retransmission (ผิดได้ไม่เกิน 1 บิท หรือจำนวนคี่)

20 ถ้าได้ 000 คือไม่มีที่ผิด ใส่ redundant 3 บิท ต่อข้อมูล 4 บิท
RAID (Redundant Array of Inexpensive Disks) Error correction (Hamming code) 1 2 3 4 5 6 7 SEND 1 1 1 ส่งผิด RECEIVE 1 1 1 1 XOR XOR XOR 4,5,6,7 2,3,6,7 1,3,5,7 1 1 บิทที่ 110 = 6 ผิด ถ้าได้ 000 คือไม่มีที่ผิด ใส่ redundant 3 บิท ต่อข้อมูล 4 บิท

21 ไม่มี redundant แต่ ทำให้เขียนหรืออ่านได้เร็วขึ้น
RAID (Redundant Array of Inexpensive Disks) Data striping (bit/byte/block) Stripping 6 1 Disk 1 7 2 Disk 2 10 9 8 7 6 5 4 3 2 1 8 3 Disk 3 9 4 Disk 4 10 5 Disk 5 ไม่มี redundant แต่ ทำให้เขียนหรืออ่านได้เร็วขึ้น

22 RAID0 วัตถุประสงค์หลักของ RAID คือ ป้องกัน disk เสียหายทั้งตัว! ป้องกัน disk ตัวใดตัวหนึ่งเสีย แต่ถ้าเสียพร้อมกันทั้งสองตัวก็ช่วยไม่ได้ Stripping ทำให้อ่านเขียนได้เร็วขึ้น RAID1 pair Mirroring มีข้อมูลซ้ำกัน 2 ชุด อ่านได้เร็วขึ้น ป้องกันการ เสียหายของ disk ตัวใดตัวหนึ่ง RAID2 Obsolete! Correction code Error correction Bit stripping แก้ไขข้อผิดพลาดระดับบิทได้ ทุกๆ 7 บิท อ่านผิดได้ 1 บิท RAID3 Error detection Obsolete! RAID2 และ RAID3 cannot service multiple requests simultaneously เพราะข้อมูล 1 block มันกระจายอยู่บน disk ทุกตัว จะอ่าน 1 block ก็ต้องอ่าน disk ทุกตัว RAID2 และ RAID3 ต้อง sync ตัว spindle ด้วย คือให้หมุนไปพร้อมๆ กัน why? Byte stripping Parity bit ใช้บอกว่าข้อมูลผิด แต่ไม่ได้บอกว่าตัวไหนผิด

23 RAID4 RAID2 และ RAID3 เขียน 1 block ต้องเขียน disk ทุกตัว RAID4 เขียน 1 block ต้องเขียน disk 1 ตัว และ p-disk Stripping at block level Similar to RAID3 but, a block read/write accesses only one disk. อ่านหลายๆ block พร้อมกันได้ เช่น อ่าน block 1,2,3,4 และ parity ได้พร้อมกัน(block 1,2,3,4 ต้องอยู่ในแนวเดียวกันกับ parity) Block stripping p-disk จะเสียก่อน RAID5 Distribute parity blocks Reduce the workload of P-disk. Every write updates P-disk. RAID6 P + Q redundancy scheme Allow multiple disk failures. RAID controller ซับซ้อนมาก RAID ทำ HOT SWAP หรือ HOT PLUG ได้ (มี HOT SPARE แล้ว) อ่านเพิ่มเติม

24 RAID 1+0 (more tolerant than RAID 0+1)
RAID0+1 yields the same data on ten disks, but the bottom level is striping (RAID0). However, most RAID0 controllers do not know how to use the redundant data on another side. Information from: .com/ 2008/01/15/difference-between-raid-01-vs-raid-10/ ทน disk เสียได้มากที่สุด 4 ตัว และรับได้หลาย combination ด้วย ขออย่าให้เป็น disk ตัวที่คู่กัน Photo from Fujitsu

25 A Layer ข้างบนจะลงไปล้วงลูก layer ข้างล่างไม่ได้ ยกเว้น layer ข้างล่างมี API ให้ layer ข้างบนเรียกใช้ RAID 1+0 vs. 0+1 B C D Mirroring A A’ B B’ C C’ D D’ Striping Striping A B C D A’ B’ C’ D’ Case 1: A และ A’ เสียทำงานต่อไม่ได้แน่ๆ Case 2: (A และ B’) เสีย RAID controller ปกติจะไม่ฉลาดพอที่จะไปยืมข้อมูลมาจากอีกฝั่ง ดังนั้นถ้าเสียฝั่งละตัวก็จะทำงานต่อไม่ได้ ฝั่ง 1 ฝั่ง 2 ทน disk เสียได้มากที่สุด 4 ตัว และต้องอยู่ฝั่งเดียวกันหมด ถ้ามี disk เสียทั้งสองฝั่ง แม้เพียงฝั่งละตัว ก็จะทำงานต่อไม่ได้

26 Hardware Layers RAID1 RAID0 RAID0
สั่งให้ทำ stripping ได้ ทั้ง write และ read สั่งให้ทำ stripping ได้ ทั้ง write และ read สั่งให้ทำ mirror ลง RAID 0 ซ้ายและขวาได้ อ่านจาก RAID0 ซ้าย “หรือ” ขวาได้ แต่เอามาผสมกันไม่ได้

27 กำหนดให้มี disk ทั้งหมด 8 ตัว และความน่าจะเป็นที่ disk ตัวหนึ่งจะเสียหลังจากใช้งาน
ไประยะเวลาหนึ่งเท่ากับ จงแสดงการคำนวณความน่าจะเป็นที่ RAID 1+0 จะเสีย จนทำงานต่อไม่ได้ และแสดงการคำนวณของ RAID 0+1 ด้วย

28 Tertiary-Storage Structure
Removable media Low cost

29 QNAP (TS-1079 Pro) NAS RAID? (hot swap, hot spare) Storage (USB connected to PC) File sharing (LAN, TCP/IP) File syn. (iOS, Android)

30 SCSI ทำงานอย่างไร. ทำอะไรได้บ้าง. http://www. howstuffworks. com/scsi
SCSI ทำงานอย่างไร? ทำอะไรได้บ้าง? SATA มีหลายเกรด Reading Assignment


ดาวน์โหลด ppt Mass-Storage Structure

งานนำเสนอที่คล้ายกัน


Ads by Google