File Systems Flashcards
Attributes of a file
name, identifier
type
location
size
protection
Goals of file management
- provide a convenient naming scheme for files
- provide uniform I/O support for variety of storage device types
- provide a standardized set of I/O interface functions
- minimize/eliminate loss or corruption of data
typical file control block includes…
- file permissions
- file dates (create, access, write)
- file owner, group, ACL
- file size
- file data blocks or pointers to file data blocks
How does contiguous allocation work? also name advantages & disadvantages
A contiguous array of blocks is allocated for each newly created file. A file can’t become larger than the pre-allocated space. The FS only needs to store the start block and the size of each file.
+ It allows for sequential and direct access.
- Can’t grow beyond initially reserved size
How does chained allocation work? also name advantages & disadvantages
The FS stores a pointer to the first block of each file, but each block now contains a pointer to the next block that belongs to the same file.
+ no need to pre-allocate disk blocks for files
+ no external fragmentation
- only sequential access possible
What is the idea of linked listed allocation with a file allocation table (FAT)?
The FAT approach is very similar to the chained allocation approach but stores the list information in a separate data structure. The entire list has to be walked to find a byte in a file, but it doesn’t require disk accesses if FAT is cached.
- the size of the FAT doesn’t depend on the number or size of files, but on the size of the hard disk
How does indexed allocation work?
It groups the pointers to disk blocks occupied by a specific file together into a single data structure, the index block. There is one index block for each file. Once an index block is loaded to the main memory, it is easy to find a specific block of the file.
What are hard links?
Each directory entry is a hard link; they simply map a name to an inode. They are thus implemented through the file system. Having created a file f and a link l to it, f and l are indistinguishable. Both names f and l are hard links to the file represented by the inode both of them map to.
What are symbolic links?
Their content is interpreted by the VFS and consists only of the relative or absolute path to the pointed file. They are files of the type “symbolic link”.