COMP 3000 2011 Week 8 Notes

From Soma-notes
Jump to navigation Jump to search

File Systems and Initialization

Initialization (i.e. "booting"): setting up many concurrent processes to run in an organized manner

Legacy code: in booting, we use legacy code and build up on it. The legacy code may not seem necessary or relevent anymore, but removing it entirely causes everything to break and the system can no longer boot properly.

CHS (cylinder head sector): how partitions are specified--geometry of the disk

Boot Loader: loads the kernel then the kernel runs init. Lilo was the original Linux boot loader.

Block Device: store data on block devices in fixed size units of storage (from 512 bytes - 8K). Use random access with these (i.e. can address arbitrary blocks), however, this can be very slow.

Index: unorganized data, can be used as an alternate sort for a list. Index doesn't need to map linearly (i.e. index 1 doesn't need to map to the first piece of data in a block device).

A way to organize the file system is to have block pointers in inodes, but to have the last pointer in the inode point to another inode, and repeat this process. However, this spawns a complicated data structure that takes up a lot of space. As well, if the this tree gets corrupted, the entire file system will be corrupted.

Superblock: root of a tree, this normally has more than one backup. This file will contain pointers to other things (e.g. indoes). This contains the metadata of the file system.

fsck: repairs file systems (data structure repair)

Mount: directory to be shadowed by what you mount on top of it

Loopback mounts: gets its data from a file (already in a file system) and mounts the file. The data from the file will be mounted on the given mount point.

Example of flow of events in a file system: Read:

  1. Find the right data blocks from the inode
  2. Retrieve them
  3. Transfer them to buffer