File Management Flashcards
File system
–resides on secondary storage (disks)
* Provided user interface to storage, mapping logical to physical
* Provides efficient and convenient access to disk by allowing data to be stored, located retrieved easily
File control block (FCB)
Also called File Descriptor is a storage structure consisting of information about a file
File System Layers
–Application programs
–Logical file system
–File-organization module
–Basic file system
–IO control
–Devices
Application programs
file created by user and giver to logical file system
Logical file system
Accepts file name as input and check if file is present in directory structure, if yes it finds the location of the file as well as the logical block member
File-organization module
Accepts logical block member as input and it performs a mapping in order to find the physical block member in the hard disk
Basic file system
Accepts block member and issues a command to I/O control with help of block member
IO control
Accepts commands form basic file system and contains device drivers or driver files which interacts with devices
Stream-block translation
is the process by which the file system maps the logical view of the data (the stream) into the physical blocks on the disk.
File Control Block (FCB)
– Contains many details about the file:
* typically inode number, permissions, size, dates
* NFTS stores into in master file table using relational DB structures
File Descriptor
Maintains information about the
file including:
- External name: symbolic name of the file
- Current state: i.e. open for reading, open for execution, closed, etc.
- Sharable: File is sharable if many processes can have it once
- Owner: identity of file owner
- User: list of processes that have the file open
- Locks: read locks and write locks are used to indicate that the file is open for reading or writing
- Protection setting: file permissions
- Reference count: the number of directories in which the file appear
- Length; time of creation; time of last access, time of last modification, etc.
Three classes of users on Unix / Linux
a) owner access 7
b) group access 6
c) public access 1
How file system can keep track of allocated blocks to a file
- Contiguous Allocation
- Linked List Allocation
- Index Table Allocation
- UNIX file structure
Contiguous Allocation
Maps N logical blocks of the file into N continuously physical blocks
Linked allocation
Each file a linked list of blocks
- File ends at nil pointer
- No external fragmentation
- Each block contains pointer to next block
- No compaction, external fragmentation
- Free space management system called when new block needed
- Improve efficiency by clustering blocks into groups but increases internal fragmentation
- Reliability can be a problem
- Locating a block can take many I/Os and disk seeks