File Systems: Difference between revisions

From COMP15212 Wiki
pc>Yuron
No edit summary
 
gravatar W81054ch [userbureaucratinterface-adminsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmludGVyZmFjZS1hZG1pbjxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs)
m (1 revision imported)
 
(2 intermediate revisions by 2 users not shown)
Line 3: Line 3:
-->{{#invoke:Dependencies|add|Filing System,5}}
-->{{#invoke:Dependencies|add|Filing System,5}}
<blockquote>
<blockquote>
You should be reasonably happy about the principle of a [[Filing_System|filing
You should be reasonably happy about the principle of a [[Filing_System|filing system]] before proceeding with this article.
system]] before proceeding with this article.
</blockquote>
</blockquote>
There is <em>the</em> filing system – the overall system whereby files (in
There is <em>the</em> filing system – the overall system whereby files (in general) are kept and then there can be <em>a</em> file system which is a component of the whole.  This is probably most easily illustrated on a Windows system: a ‘memory stick’ contains its own file system which may or may not be implemented in the same way as (for example) the hard disk drive file system(s).  In Windows it appears as a visibly separate device.  Nevertheless files can easily be transferred back-and-forth.
general) are kept and then there can be <em>a</em> file system which is a
component of the whole.  This is probably most easily illustrated on a
Windows system: a ‘memory stick’ contains its own file
system which may or may not be implemented in the same way as (for
example) the hard disk drive file system(s).  In Windows it appears as
a visibly separate device.  Nevertheless files can easily be
transferred back-and-forth.


Each
Each [https://en.wikipedia.org/wiki/Volume_%28computing%29 <strong>volume</strong>] may have its own file system.  A volume is a <em>logical drive</em>.  Typically a volume may correspond to a [[Disk Partition|disk partition]], although this is not mandatory.  Having some awareness of the volume in which a file resides can sometimes be useful.  For example, <em>moving</em> a file within a volume is probably just a matter of <em>renaming</em> it and, possibly, changing a couple of directory entries; moving a file between volumes involves copying all the bytes – and that can take a long time for a big file.
[https://en.wikipedia.org/wiki/Volume_%28computing%29 <strong>volume</strong>] may
have its own file system.  A volume is a <em>logical drive</em>.  Typically a
volume may correspond to a [[Disk_Partition|disk partition]], although
this is not mandatory.  Having some awareness of the volume in which a
file resides can sometimes be useful.  For example, <em>moving</em> a file
within a volume is probably just a matter of <em>renaming</em> it and,
possibly, changing a couple of directory entries; moving a file
between volumes involves copying all the bytes – and that can take a
long time for a big file.


There are a number of
There are a number of [https://en.wikipedia.org/wiki/Comparison_of_file_systems choices] already in existence - some of which are now somewhat obsolete.  (Like many aspects of computing, the capacity of storage devices has increased enormously, over the years.)
[https://en.wikipedia.org/wiki/Comparison_of_file_systems choices]
already in existence - some of which are now somewhat obsolete.  (Like
many aspects of computing, the capacity of storage devices has
increased enormously, over the years.)


=== Example: Linux ext2 ===
=== Example: Linux ext2 ===
This is just a <em>sketch</em> of a file system to give some idea as to <em>a</em>
This is just a <em>sketch</em> of a file system to give some idea as to <em>a</em> way it can be done.  Some (actually, quite a few!) details are therefore omitted.
way it can be done.  Some (actually, quite a few!) details are
therefore omitted.


For the details of how the data blocks are assembled into files (in
For the details of how the data blocks are assembled into files (in this system), consult the more detailed article on [[Inodes|i-nodes]].
this system), consult the more detailed article on [[Inodes|i-nodes]].


[[Image:ext2.png|link=|alt=ext2 file system sketch]]
[[Image:ext2.png|link=|alt=ext2 file system sketch]]
Line 49: Line 25:


----
----
 
{{BookChapter|15.1|597-598}}
{{PageGraph}}
{{PageGraph}}
{{Category|Filing System}}
{{Category|Filing System}}

Latest revision as of 10:03, 5 August 2019

On path: Filing 1: Filing System • 2: File Systems • 3: Files • 4: File Attributes • 5: File Types • 6: File Permissions • 7: File Access • 9: Filing System Implementation • 10: I-nodes • 11: Links • 12: File Descriptor
Depends on Filing System

You should be reasonably happy about the principle of a filing system before proceeding with this article.

There is the filing system – the overall system whereby files (in general) are kept and then there can be a file system which is a component of the whole. This is probably most easily illustrated on a Windows system: a ‘memory stick’ contains its own file system which may or may not be implemented in the same way as (for example) the hard disk drive file system(s). In Windows it appears as a visibly separate device. Nevertheless files can easily be transferred back-and-forth.

Each volume may have its own file system. A volume is a logical drive. Typically a volume may correspond to a disk partition, although this is not mandatory. Having some awareness of the volume in which a file resides can sometimes be useful. For example, moving a file within a volume is probably just a matter of renaming it and, possibly, changing a couple of directory entries; moving a file between volumes involves copying all the bytes – and that can take a long time for a big file.

There are a number of choices already in existence - some of which are now somewhat obsolete. (Like many aspects of computing, the capacity of storage devices has increased enormously, over the years.)

Example: Linux ext2

This is just a sketch of a file system to give some idea as to a way it can be done. Some (actually, quite a few!) details are therefore omitted.

For the details of how the data blocks are assembled into files (in this system), consult the more detailed article on i-nodes.

ext2 file system sketch

  • The superblock and group descriptor specify details like the size of the group, the number of i-node entries, the start of the free-block list and so forth.
  • The bitmaps are a convenient way of indicating whether a data block/i-node is used or not.
  • The i-node table is an array of records which defines both the file (data blocks) and its attributes.
  • The data blocks are managed in some way which is (hopefully) efficient for access on the particular medium. For example, spaces may be left deliberately to reduce file fragmentation if a file grows gradually.
  • A directory is just a file which contains a linked list of entries. File-names vary in length so space is allocated (and deallocated) in much the same way as RAM; this sometimes leaves ‘gaps’ (unused bytes) in the file.

Also refer to: Operating System Concepts, 10th Edition: Chapter 15.1, pages 597-598