1 / 79

Operating Systems Storage Management

Operating Systems Storage Management. William Eras Lage Carlos Nicolás Ortuño. Storage Management. 1- File-System Interface 2- File System Implementation 3- Mass-Storage Systems. 1- File-System Interface. File Concept Access Methods Directory Structure File-System Mounting

Télécharger la présentation

Operating Systems Storage Management

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. OperatingSystemsStorageManagement William Eras Lage Carlos NicolásOrtuño Operating Systems - Storage Management

  2. StorageManagement 1- File-System Interface 2- File System Implementation 3- Mass-Storage Systems Operating Systems - Storage Management

  3. 1- File-System Interface File Concept Access Methods Directory Structure File-System Mounting File Sharing Protection Operating Systems - Storage Management

  4. 1.1- File Concept Contiguous logical address space, abstraction mechanism Types: - Regular -stores data numeric character binary - Directory - contains information used to access other files - Special Defines a FIFO (first-in, first-out) pipe file or a physical device Operating Systems - Storage Management

  5. File Structure None - Sequence of words, bytes Simple record structure - Lines - Fixed length - Variable length Complex Structures - Formatted document - Move load file Operating Systems - Storage Management

  6. File Attributes Name – only information kept in human-readable form Identifier – unique tag (number) identifies file within file system Type – needed for systems that support different types Location – pointer to file location on device Size – current file size Protection – controls who can do reading, writing, executing Time, date, and user identification – data for protection, security, and usage monitoring Information about files are kept in the directory structure, which is maintained on the disk Operating Systems - Storage Management

  7. File Operations File is an abstract data type Create Write Read Reposition within file Delete Truncate Open (file) – search the directory structure on disk for entry file, and move the content of entry to memory Close (file) – move the content of entry file in memory to directory structure on disk Operating Systems - Storage Management

  8. File Types – Name, Extension Operating Systems - Storage Management

  9. 1.2- Access Methods Imag. 1- Sequential-access File Sequential Access - read next - write next - reset - no read after last write Direct Access - read n - write n - position to n - read next - write next n = relative block number Imag. 2- Example of Index and Relative Files Operating Systems - Storage Management

  10. 1.3- Directory Structure Directory A collection of nodes containing information about all files Both the directory structures and the files reside on disk Backups of these two structures are kept on tapes Files F 1 F 2 F 3 F 4 F n Imag. 3- Connection between D and F Imag. 4- A Typical File-system Organization Operating Systems - Storage Management

  11. Operations Performed on Directory Organize the Directory (Logically) to Obtain Search for a file Create a file Delete a file List a directory Rename a file Traverse the file system • Efficiency – locating a file quickly • Naming – convenient to users • - Two users can have same name for different files • - The same file can have several different names • Grouping – logical grouping of files by properties, (e.g., all Java programs, all games, …) Operating Systems - Storage Management

  12. Single-Level Directory A single directory for all users Naming problem Grouping problem Imag. 5- Single-LevelDirectory Operating Systems - Storage Management

  13. Two-Level Directory Separate directory for each user Path name Can have the same file name for different user Efficient searching No grouping capability Imag. 6- Two-LevelDirectory Operating Systems - Storage Management

  14. Tree-Structured Directories Efficient searching Grouping Capability Imag. 7- Tree-LevelDirectory Operating Systems - Storage Management

  15. Acyclic-Graph Directories Have shared subdirectories and files Imag. 8- Acyclic-GraphDirectory Operating Systems - Storage Management

  16. General Graph Directory How do we guarantee no cycles? - Allow only links to file not subdirectories - Garbage collection Every time a new link is added use a cycle detection algorithm to determine whether it is OK Imag. 9- General GraphDirectory Operating Systems - Storage Management

  17. 1.4- File-System Mounting A file system must be mounted before it can be accessed A unmounted file system is mounted at a mount point Imag. 10- (a) Existing. (b) Unmounted Partition Operating Systems - Storage Management

  18. 1.5- File Sharing Sharing of files on multi-user systems is desirable Sharing may be done through a protection scheme On distributed systems, files may be shared across a network Network File System (NFS) is a common distributed file-sharing method Operating Systems - Storage Management

  19. 1.6- Protection File owner/creator should be able to control: - what can be done - by whom Types of access - Read - Write - Execute - Append - Delete - List Operating Systems - Storage Management

  20. Access Lists and Groups Mode of access: read, write, execute Three classes of users RWX a) owner access 7  1 1 1 RWX b) group access 6  1 1 0 RWX c) public access 1  0 0 1 Imag. 11- A Sample UNIX Directory Listing Operating Systems - Storage Management

  21. 2- File System Implementation File-System Structure Directory Implementation Allocation Methods Free-Space Management Efficiency and Performance Recovery NFS Operating Systems - Storage Management

  22. 2.1- File-System Structure File structure - Logical storage unit - Collection of related information File system resides on secondary storage (disks) File system organized into layers File control block – storage structure consisting of information about a file Imag. 12- A Typical File Control Block Operating Systems - Storage Management

  23. Virtual File Systems Virtual File Systems (VFS) provide an object-oriented way of implementing file systems. VFS allows the same system call interface (the API) to be used for different types of file systems. The API is to the VFS interface, rather than any specific type of file system. Imag. 13- Schematic View of Virtual File System Operating Systems - Storage Management

  24. 2.2- Directory Implementation Linear list of file names with pointer to the data blocks. - simple to program - time-consuming to execute Hash Table – linear list with hash data structure. - decreases directory search time - collisions – situations where two file names hash to the same location - fixed size Operating Systems - Storage Management

  25. 2.3- Allocation Methods An allocation method refers to how disk blocks are allocated for files: Contiguous allocation Linked allocation Indexed allocation Operating Systems - Storage Management

  26. Contiguous Allocation Each file occupies a set of contiguous blocks on the disk Simple – only starting location (block #) and length (number of blocks) are required Random access Wasteful of space (dynamic storage-allocation problem) Files cannot grow Imag. 14- Contiguous Allocation of Disk Space Operating Systems - Storage Management

  27. Linked Allocation Each file is a linked list of disk blocks: blocks may be scattered anywhere on the disk. Simple – need only starting address Free-space management system – no waste of space No random access Mapping Imag. 15- Linked Allocation Operating Systems - Storage Management

  28. Indexed Allocation Brings all pointers together into the index block. Need index table. Random access. Dynamic access without external fragmentation, but have overhead of index block. Imag. 16- Indexed Allocation Operating Systems - Storage Management

  29. Indexed Allocation (cont.) Mapping from logical to physical in a file of maximum size of 256K words and block size of 512 words. We need only 1 block for index table. Two-level index: maximum size is 5123 files Imag. 16- Two Level Indexed Mapping Operating Systems - Storage Management

  30. 2.4- Free-Space Management 0 1 2 n-1 … 0  block[i] free 1 block[i] occupied bit[i] =  Bit vector (n blocks) Bit map requires extra space Easy to get contiguous files Linked list (free list) Cannot get contiguous space easily - No waste of space Imag. 17- Linked Free Space List on Disk Operating Systems - Storage Management

  31. Free-Space Management (cont.) Need to protect: Pointer to free list Bit map - Must be kept on disk - Copy in memory and disk may differ - Cannot allow for block[i] to have a situation where bit[i] = 1 in memory and bit[i] = 0 on disk Solution: - Set bit[i] = 1 in disk - Allocate block[i] - Set bit[i] = 1 in memory Operating Systems - Storage Management

  32. 2.5- Efficiency and Performance Efficiency depends on: - disk allocation and directory algorithms - types of data kept in file’s directory entry Performance - disk cache – separate section of main memory for frequently used blocks - free-behind and read-ahead – techniques to optimize sequential access - improve PC performance by dedicating section of memory as virtual disk, or RAM disk Operating Systems - Storage Management

  33. Page Cache The caches of cache page rather than disk blocks using virtual memory techniques Memory-mapped I/O uses a page cache Routine I/O through the file system uses the buffer (disk) cache Imag. 18- I/O Without a Unified Buffer Cache Operating Systems - Storage Management

  34. Unified Buffer Cache A unified buffer cache uses the same page cache to cache both memory-mapped pages and ordinary file system I/O Imag. 19- I/O Using a Unified Buffer Cache Operating Systems - Storage Management

  35. 2.6- Recovery Consistency checking – compares data in directory structure with data blocks on disk, and tries to fix inconsistencies Use system programs to back up data from disk to another storage device (floppy disk, magnetic tape, other magnetic disk, optical) Recover lost file or disk by restoring data from backup Operating Systems - Storage Management

  36. 2.7- Network File System (NFS) An implementation and a specification of a software system for accessing remote files across LANs (or WANs) Interconnected workstations viewed as a set of independent machines with independent file systems, which allows sharing among these file systems in a transparent manner A remote directory is mounted over a local file system directory - The mounted directory looks like an integral subtree of the local file system, replacing the subtree descending from the local directory Subject to access-rights accreditation, potentially any file system (or directory within a file system), can be mounted remotely on top of any local directory NFS is designed to operate in a heterogeneous environment of different machines, operating systems, and network architectures; the NFS specifications independent of these media Operating Systems - Storage Management

  37. NFS Mount Protocol Establishes initial logical connection between server and client Mount operation includes name of remote directory to be mounted and name of server machine storing it Following a mount request that conforms to its export list, the server returns a file handle—a key for further accesses File handle – a file-system identifier, and a number to identify the mounted directory within the exported file system The mount operation changes only the user’s view and does not affect the server side Operating Systems - Storage Management

  38. Three Major Layers of NFS Architecture UNIX file-system interface (based on the open, read, write, and close calls, and file descriptors) Virtual File System (VFS) layer – distinguishes local files from remote ones, and local files are further distinguished according to their file-system types - The VFS activates file-system-specific operations to handle local requests according to their file-system types - Calls the NFS protocol procedures for remote requests NFS service layer – bottom layer of the architecture - Implements the NFS protocol Imag. 20- Schematic View of NFS Architecture Operating Systems - Storage Management

  39. NFS Remote Operations Nearly one-to-one correspondence between regular UNIX system calls and the NFS protocol NFS employs buffering and caching techniques for the sake of performance File-blocks cache – when a file is opened, the kernel checks with the remote server whether to fetch or revalidate the cached attributes - Cached file blocks are used only if the corresponding cached attributes are up to date File-attribute cache – the attribute cache is updated whenever new attributes arrive from the server Operating Systems - Storage Management

  40. 3- Mass-Storage Systems Overview of Mass Storage Mass Storage Structure Disk Structure Disk Attachment Disk Scheduling Disk Management Swap-Space Management RAID Structure Stable-Storage Implementation Off-line Storage Devices Operating System Issues Performance Issues Operating Systems - Storage Management

  41. 3.1- Overview of Mass Storage In computing, mass storage refers to the storage of large amounts of data in a persisting and machine-readable fashion. Mass storage include hard disks, floppy disks, flash memory, optical discs, magneto-optical discs, magnetic tape, drum memory, punched tape (mostly historic) and holographic memory (experimental). Mass storage includes devices with removable and non-removable media. Operating Systems - Storage Management

  42. Storage Hierarchy Primary storage: the only storage accessible to CPU; - delay lines, rotating magnetic drums, RAM, cache… Non-volatile: ROM only Secondary storage: not directly accessible by CPU; - hard disk, floppy, CD / DVD / BD, flash memory, magnetic and paper tapes Tertiary storage: system where robotic arm mounts and dismounts removable mass storage media; no human operators; used for archivisation; - tape libraries, optical jukeboxes Off-line storage: disconnected storage; not under control of CPU; human operator needed; - flash drives, optical disks, floppy disks, magnetic tapes, CD / DVD / BD Operating Systems - Storage Management

  43. 3.2- Mass Storage Structure Magnetic disks provide bulk of secondarystorage of modern computers - Drives rotate at 60 to 200 times per second - Transfer rate is the ratio at which data flow between drive and computer (scale: 1 GT/s means 109 transfers per second or 1 MT/s is 106 transfers per second) - Positioning time (random-access time) is time to move disk arm to desired cylinder and time for desired sector to rotate under the disk head - Head crash is a hard disk failure that occurs when the read-write head of a hard disk drive touches its rotating platter resulting in catastrophic damage to themagnetic media Disks can be removable Drive attached to computer via I/O bus - Host controller in computer uses bus to talk to disk controller built into drive or storage array Operating Systems - Storage Management

  44. Disk Mechanism Imag. 21- Hard drive Imag. 22- Moving-head Disk Mechanism Imag. 23- Disk structure A – track B – geometrical sector C – sector D - cluster Operating Systems - Storage Management

  45. 3.3- 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 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 innermost. Operating Systems - Storage Management

  46. 3.4- Disk Attachment Host-attached storage accessed through I/O ports talking to I/O busses SCSI (SmallComputerSystem Interface) is a set of standards for physically connecting and transferring data between computers and peripheral devices. SCSI itself is a bus, up to 16 devices on one cable, SCSI initiator requests operation and SCSI targets perform tasks - Each target can have up to 8 logical units (disks attached to device controller) FC (FibreChannel) is high-speed serial architecture - Can be point-to-point (FC-P2P) two devices are connected - Can be arbitrated loop (FC-AL) of 126 devices - Can be switched fabric (FC-SW)with 24-bit address space – the basis of storage area networks (SANs) in which many hosts attach to many storage units Operating Systems - Storage Management

  47. Network-Attached Storage Network-attached storage (NAS) is storage made available over a network rather than over a local connection (such as a bus) NAS systems usually contain one or more hard disks, often arranged into logical, redundant storage containers or RAID arrays (redundant array of inexpensive disks), as do traditional file servers. NFS (Network File System) and CIFS (Common Internet File System) are common protocols for NAS Implemented via remote procedure calls (RPCs) between host and storage Imag. 24- Network-Attached Storage Operating Systems - Storage Management

  48. Storage Area Network Common in large storage environments (and becoming more common) Multiple hosts attached to multiple storage arrays Network designed to attach computer storage devices such as disk array controllers and tape libraries to servers Imag. 25- SAN vs NAS Imag. 26- Storage Area Network OperatingSystems - StorageManagement

  49. 3.5- Disk Scheduling The operating 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 components - Seek time is the time for the disk are to move the heads to the cylinder containing the desired sector. - Rotational latency is the additional time waiting for the disk to rotate the desired sector to the disk head. Minimize seek time so minimize seek distance Disk 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. 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, 67 Head pointer 53 Operating Systems - Storage Management

  50. FCFS (First Come FirstServed) Total head movement of 640 cylinders. Imag. 27- FCFS Operating Systems - Storage Management

More Related