10 - Storage Flashcards

1
Q

Main components of file system

A
  1. Directory service

2. Storage service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Directory service : what

A
  1. Map file names => file identifiers

2. Handle access and existence control

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Storage service : what

A
  1. Provide mechanism to store data on disk

2. Means to implement directory service

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is a file?

A
  1. Abstraction for non-volatile storage
  2. User abstraction ???
  3. Different types : data (numeric, character, binary), program (source, object, executable), documents.
  4. Typically comprises a single contiguous logical address space
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Internal structure of file

A

Can be:

  1. None : simple sequence of words / bytes
  2. Simple record structure : lines, fixed length, variable length
  3. Complex internal structure : formatted document, relocatable object file.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Difference between text and binary

A

Text vs binary ??

  1. Sequence of lines, each terminated by a special character
  2. Explicit EOF character

Can map anything to a byte sequence by insertion of control characters, and interpretation in code.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Compare programmer / OS deciding control characters

A
  1. OS : may be easier for programmer but will lack flexibility (e.g. ?)
  2. Programmer : has to do more work (why?) but can evolve and develop format (how?).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

State two ways of naming files

A

At least two kinds:

  1. System file ID (SFID)
    - typically a unique integer value associated with a file, used within file system itself.
  2. Human name
    - e.g. hello.java, what users like to use
  3. User file ID
    - used to identify open files in applications
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Purpose of the directory data structure [not directory service as a whole]

A
  1. Store mapping from human name to SFID

=> Provide means to translate (user) name to location of file on disk.

more purposes?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Storage of directories

A
  1. Directories are also non-volatile,
    .: store on disk with files
  2. Storage system sits “below” directory service (since storage system prerequisite to directory service).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Information contained in file metadata

A

What : any data about file excluding the contents of the file
EG
1.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

File control block :

A

Directory resolves name to SFID, then need to map from SFID to FCB (file control block) – this mapping is file specific [diagram]

FCB:
- Contents, name(s)

Metadata

  • Location : ptr to file location on device
  • Size in bytes
  • Time, date of creation,
  • User / owner identification : data for access permissions, security and usage monitoring.
  • Protection : controls who can read, write
  • Type : e.g. file vs directory
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Requirements of directory datastructure

A

=> Purpose: Provide means to translate (user) name to location of file on disk.

Requirements:
EFFICIENCY : locate physical location of file with user name quickly
NAMING : user convenience
- Allow two ( … N) users to have same name for different files.
- Allow one file to have several different names
GROUPING
- Logical grouping of files by properties, e.g. “all Java programs”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Evaluate single level directory

A

What : one directory shared between all users

  • Naming problem : why
  • Grouping problem : why
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Evaluate two level directory

A

One directory per user
- Access via pathname (e.g. bob : hello.java )
- Can have same filename for different user
- But still no grouping capability.
=> add a general hierarchy for more flexibility.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Describe : tree structure hierarchies

A
  1. Directories hold files, OR further directories,
  2. Reflect structure of organisation, users’ files …. (etc ?)
  3. Creation/ deletion of files is relative to given directory
  4. Can search efficiently.
  5. Arbitrary grouping capability
  6. Human name = full path name, but can get unwieldy (separate qn)
17
Q

How to resolve user name = long path name problem with tree structured directories.

A
  1. Resolve with
    - relative naming
    - login directory
    - current working directory
    [how?]
  2. Sub-directory deletion either by requiring that the directory is empty, or by recursively deleting. [what ?]
18
Q

Describe : DAG directory structure

A
  1. Hierarchy is useful but tree only allows one name per file.
  2. Extend tree to DAG structure - allow shared subdirectories and files,
  3. Allow multiple aliases for same file.
  4. Manage dangling references - using back references or reference counts.
19
Q

Issues with DAG directory structure

A
  1. Deletion [more generally, permission - why?]
  2. Knowing when OK to free disk blocks [why?]
  3. Accounting - who gets “charged” for disk usage;
  4. Cycles, and how we prevent them

[slide needs work]

20
Q

Explain how directories are implemented

A
  1. Directories are non-volatile
    .: store as “files” on disk
    - each directory has own SFID.

[slide needs significant work]

21
Q

State basic operations which can be performed on files

A
  1. Open
    - UFID = open ( < pathname > )
    - UFID = create ( < pathname > )

=> Directory service recursively searches directories for components of

  • Eventually get SFID for file => SFID used to create UFID and returned.
  • Various modes can be used [e.g.?]
  1. Use
    - info here?
  2. Close
    - Closing a file
    => status = close (UFID)
    - copy new FCB back to HDD and invalidate UFID [where?]

[split into smaller cards]

22
Q

Discuss implementation of files

A
  1. Associate file position with each open file (i.e associate file position with UFID)
    - initialise cursor / file posn to start of file.
  2. Basic operations : read next or write next few bytes …
    => read (UFID, buf , nbytes)
    => read (UFID, buf, nrecords)
23
Q

Types of file access patterns

A
  1. Sequential : adds rewind (UFID) to above [what is this?]
  2. Direct access : [what?]
    - read (N)
    - write (N)
    using
    - seek (UFID, pos)
  3. Maybe others including append-only, indexed sequential access mode (ISAM) [what?]
24
Q

Outline how file system provides access controls

A
  1. File owner / creator should have control over WHAT can be done, and by WHOM.

=> file usually only accessible IF user has :
a. Directory access rights (lookup process: can’t look it up => can’t open it)
AND
b. File access rights

Assuming a DAG structure, do we use the presented or absolute path [what?]

Access control normally provided by the directory service, so checks done at file-open time. EG read, write, execute, append, delete, list, rename. [what?]

More advanced schemes are possible [see later??]

25
Q

Explain issues of existence control

A

What do we do if user deletes a file?
=> Probably want to keep file in existence while a valid pathname referencing it exists.
=> Need to check entire FS periodically for garbage.
=> Existence control can also be a factor when file is renamed / moved [why]

26
Q

Issues : concurrency control

A

=> Need locking to handle simultaneous access

  1. Can be mandatory or advisory
  2. Locks may be shared or exclusive
  3. Granularity may be file or subset.