1 / 18

File Systems - IV

CS423UG Operating Systems . File Systems - IV. Indranil Gupta Lecture 25 10/24/2005. Content . File systems implementation. File System Implementation. A possible file system layout.

eleazar
Download Presentation

File Systems - IV

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. CS423UG Operating Systems File Systems - IV Indranil Gupta Lecture 25 10/24/2005

  2. Content • File systems implementation CS 423UG Operating Systems, Indranil Gupta

  3. File System Implementation A possible file system layout (so, MBR and superblock could be different if disk has multiple partitions!) CS 423UG Operating Systems, Indranil Gupta

  4. Allocation of Disk Space • Low level access methods depend upon the disk allocation scheme used to store file data • Contiguous allocation • Linked list allocation • Block allocation CS 423UG Operating Systems, Indranil Gupta

  5. Contiguous Allocation CS 423UG Operating Systems, Indranil Gupta

  6. Contiguous Allocation Issues • Access method suits sequential and direct (random) access • Directory table maps files into starting physical address and length • Easy to recover in event of system crash • Fast, often requires no head movement and when it does, head only moves one track CS 423UG Operating Systems, Indranil Gupta

  7. Contiguous Allocation Issues • File is allocated large contiguous chunks • User knows size of the file • Expanding the file requires copying • Dynamic storage allocation - first fit, best fit • External fragmentation may occurs on disk • Users tend to overestimate space => internal fragmentation • What happens if a block is “lost”? CS 423UG Operating Systems, Indranil Gupta

  8. Linked Allocation CS 423UG Operating Systems, Indranil Gupta

  9. Linked List Allocation Issues • Each file is a linked list of chunks • Pointers in list are not accessible to user • Directory table maps files into head of list for a file • A node in the list can be a fixed size physical block or a contiguous collection of blocks • Easy to use - no estimation of size necessary • What happens if a block is “lost”? CS 423UG Operating Systems, Indranil Gupta

  10. Linked List Allocation Issues • Can grow in middle and at ends • Space efficient, little fragmentation • Slow - defies the principle of locality. Need to read through linked list nodes sequentially to find record of interest blocks • Suited for sequential access but not direct (random) access CS 423UG Operating Systems, Indranil Gupta

  11. Linked List Allocation Issues • Disk space must be used to store pointers (if disk block is 512 bytes, and disk address requires 4 bytes, then the user sees blocks of only 508 bytes) • Not very reliable. System crash can scramble files being updated. • Important variation on linked allocation method: `file-allocation table' (FAT) - OS/2 and MS-DOS CS 423UG Operating Systems, Indranil Gupta

  12. Linked List Allocation Issues • Summary: linked allocation solves the external fragmentation and size-declaration problems of contiguous allocation, • However, it can't support efficient direct access CS 423UG Operating Systems, Indranil Gupta

  13. Indexed Allocation CS 423UG Operating Systems, Indranil Gupta

  14. Indexed Allocation • Solves external fragmentation • Supports sequential, direct and indexed access • Direct (random) Access requires at most one access to index block first. This index block can be cached in main memory. CS 423UG Operating Systems, Indranil Gupta

  15. Indexed Allocation • File can be extended by rewriting a few blocks and index block • Requires extra space for index block, possible wasted space • Extension to big files? CS 423UG Operating Systems, Indranil Gupta

  16. Other Forms of Indexed FileLinked Link full index blocks together using last entry. CS 423UG Operating Systems, Indranil Gupta

  17. Other Forms of Indexed File - Multilevel Index Multiple levels of index blocks CS 423UG Operating Systems, Indranil Gupta

  18. Reading • Reading for this lecture: Section 6.3-6.3.5 • Reading for Friday’s lecture: Rest of Section 6.3 • TAs will handle Wednesday lecture CS 423UG Operating Systems, Indranil Gupta

More Related