Lecture 7 - Secondary Storage Flashcards
<p>What is Secondary Storage?</p>
It is a non-volatile repository for (both user and system) data and programs
<p>Who manages Secondary Storage?</p>
File System –part of the OS
<p>What kind of data can be stored in Secondary Storage?</p>
Programs (source, object), temporary storage, virtual memory
<p>What are the main requirements on file systems?</p>
- Should provide persistent storage
- Handle very large information (large chunks, large numbers)
- Concurrent access
<p>What are main user requirements of file system?</p>
- How the storage appears to them
* File naming and protection, operations allowed on files
<p>What is a file?</p>
A file is a named collection of related information, usually as a sequence of bytes, with two views.
<p>What are the two views of a file?</p>
Logical (programmer’s ) view, as the users see it.
Physical (operating system) view, as it actually resides on secondary storage.
<p>What is the difference between a file and a data structure in memory?</p>
- files are intended to be non-volatile; hence in principle, they are long lasting
- files are intended to be moved around (i.e., copied from one place to another), accessed by different programs and users
<p>What are file attributes? Give a few examples</p>
Each file is associated with a collection of information, known as attributes:
- NAME, owner, creator* type (e.g., source, data, binary)
- location (e.g., I-node or disk address)
- organization (e.g., sequential, indexed, random)
<p>What are file names?</p>
Files provide a way to store and retrieve data from backing storage using file names
<p>What's the difference between UNIX and Windows file name extensions?</p>
- In UNIX, files extensions are just conventions and not enforced by OS
- MS-Windows associates programs with files using file extensions.
<p>How does UNIX system know what a file's type is?</p>
By checking the file’s fingerprint against a hash table, eg: first few lines.
<p>What is a directory?</p>
Is a symbol tablethat can be searched for information about the files. Implemented as a file.
* Directories give a name space for the objects (files) to be placed.
<p>What is a directory entry?</p>
Directory entry contains information (attributes) about a file.
Entries are added in a directory as files are created, and are removed when files are deleted.
<p>Name 3 common directory structures and briefly explain each.</p>
Single-level (flat):shared by all users –worlds’ first supercomputer CDC 6600 also had
Two-level: one level for each user –should have some form of “user” login to identify the user and locate the user’s files.
Tree: arbitrary (sub)-tree for each user –login required.
<p>What structure do UNIX directories use?</p>
UNIX uses directed acyclic-graph (DAG) structure for directory
<p>What are the 5 basic services of a file system?</p>
- keeping track of files (knowing location),
- I/O support, especially the transmission mechanism to and from main memory,
- management of secondary storage,
- sharing of I/O devices,
- providing protection mechanisms for information held on the system.
<p>What are the 4 levels of File system abstraction? Name their Objects and Typical Operations</p>
- Interactive (Shells)
+ files
- copy, delete, rename - Applications and system programs
+ logical elements (records)
- open/close, buffering seek (logical) - File system
file system check soft repair partitioning - Devices
+ physical elements (head, cylinder, …)
- raw read/write,seek (physical)low-level format
<p>What are the 5 components of a Unix filesystem's disk partitions?</p>
- Boot Block
- Super Block
- Free space management
- I-nodes
- Files and directories
What is the disk partition represented as?
Array of blocks
What is the main issue with File Sharing?
File sharing raises the issue of protection
Name one approach to protect file systems.
One approach is to provide controlled accessto files through a set of operations such as read, write, delete, list, and append.
One popular protection mechanism is a condensed version of access list containing: user, group, and other
What are the 7 common file operations? Briefly explain each.
- Create
* file is created with no data
* sets some file attributes - Delete
* file is no longer needed
* storage released to free pool - Open
* process first opens a file –fetch the attributes and list of disk addresses into main memory - Close
* frees the internal table space
* OSs enforce by limiting number of open files - Read
* comes from current position in file
* bytes to read and where to put specified - Seek
* repositions the file pointer for random access
* after seeking data can be read or written - Write
* data written to file at current position
* If current position is at end-of-file, file’s size increases
What are the three file access methods?
Sequential: in order, one record after another. Convenient with sequential access devices (e.g., magnetic tape).
Direct (random): in any order, skipping the previous records.
Indexed: in any order, but accessed using particular key(s); e.g., hash table or dictionary. Database access (e.g., patient database in a hospital).