File Management Flashcards
Why do we need management?
To meet the data management needs and requirements e.g create, delete, read and change fules, control the access to own files, controlled access to other users filels etc.
What are the two types of file systems? Briefly describe them.
Storage service: clients don’t know about the physical characteristics of the disks or where the files have been stored on them. Must make sure no file is lost, even if there are hardware failures or software crashes.
Directory service: clients can give convenient text names to files and group them in directories (establishing some relationship with them).
What is static and dynamic allocation?
Static allocation-
Declare max size in advance (may be hard to guess and may overestimate space). Should be ok if the file never changes. Easy and simple to implement. Fixed memory address.
Dynamic allocation-
Get space as the file needs it. Files are often no longer contiguous.
What is a block? What is it’s max/min?
A portion (unit) size.
Maximum: a single block large enough to hold the entire file.
Minimum: multiple blocks, each block on disk is allocated one disk cell at a time.
When choosing the unit allocation size, there is a tradeoff between…
-Efficiency from the point of view of a single file.
-Efficiency of the overall system.
What are some issues faced with in file allocation?
-> Having lots of small units requires more space for allocation tables (i.e record where those units are located)
-> Fixed-size portions simplify the reallocation of space.
-> Small fixed-size units reduce wasted space (allocating a unit but not using it entirely)
Name and describe 3 File allocation methods.
Contiguous Allocation- single contiguous set of blocks is allocated to a file at the time of file creation (pre-allocation strategy). This has a good performance especially for sequential files. External fragmentation tends to occur (leaves a small amount of unusable memory).
Chained Allocation- each block contains a pointer to the next block in the chain. Allocate on the basis of individual blocks. Best suited to sequential files. Directory only links to the first block and each block points to the next block. There is no accomodation for locality. Files should be “Consolidated” using some utility software to accomodaye locality in chained allocation.
Indexed Allocation- contains a separate index level for each file; the index has one entry for each allocated portion to the file. This supports both sequential and random access to a file.
What is free space and why is it managed?
Free space is space that is not currently allocated. To be able to perform file allocation, we need to know what blocks on the disk are available. Therefore, free space needs to be managed.
Define a file directory.
A file directory is a structure associated with any file management system and collection of files. It contains info (handled by the OS) about the files, including attributes, location and ownership. The directory itself is a file, owned by the OS and accessible by various file management routines,
What are some typical ‘Basic’ Directory Entries?
Name (unique in directory)
Type (text, binary etc)
Organisation (sequential, indexed etc)
What are some typical ‘Address’ Directory Entries?
Device (which disk holds the file)
Starting address/blocks used (location id)
Size used (may be in bytes or blocks)
Size allocated (max space allocated for this file)
What are some typical ‘Access Control’ Directory Entries?
Owner (who has control of the file)
Access Info (what users are allowed to work with the file)
Permitted Actions (controls reading/writing etc)
What are some typical ‘Usage Info’ Directory Entries?
Date created
Identity of creator
Date last read access
Identity of last reader
Date last modified
Identity of last modifier
Date of last backup
Current usage (who ahs the file open, is it locked etc)
Describe a type of directory structure.
Tree-structured file system- single master directory (root). Each directory may contain files or subdirectories. Names are unique. Note that paths are used to get from the master directory to files.