Lecture 15: File systems

Previous lecture Next lecture

Exam

Files as an abstraction of disk space and their management

Important questions:

Background storage

The file abstraction

Accessing files

The Unix virtual file system (VFS) switch

Virtual file system: mounting

System Call:

int mount(const char *source, const char
  *target, const char *filesystemtype,
  unsigned long mountflags, const void *data);

Attaches ("mounts") a file system to the given directory in the global directory tree System Call:

int umount(const char *target);

Removes the attachment. Note: umount, not unmount! Using both system calls requires system administrator privileges! When the system is booted, all filesystems listed in /etc/fstab are automatically mounted.

File storage

Contigous storage

Contiguous storage problems

Linked list storage

Linked list storage problems

Linked list storage: FAT

Linked list storage problems (2)

Discussion: chunks/extents/clusters

Indexed storage

Indexed storage: Unix inodes

Indexed storage: discussion

files

Tree sequential storage

Free space management

Similar to free main memory management

Directory management: lists

Using hash functions

List elements with variable length

Unix example: System V file system

Unix example: Berkeley Fast File System

Unix example: Linux ext2/3/4 file system

Conclusion

File systems are an operating system abstraction