unix file system Flashcards

1
Q

double/triple indirect reference

A

index block points to index block etc

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

what is an inode

A

a top level index block that contains permissions, the owner, the group the file belongs to, time stamps, reference count, block count

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

why is it a benefit that unix uses multilevel and indexed approach

A

allows both large files and small files to have fast access

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

what is the reference count

A

the number of directories/ file entries that reference this file

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

what happens when the reference count of a file goes to 0

A

it is deleted so the space can be freed

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

hard links

A

the aliases are the same and you cant tell which was first to be referenced

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

what happens to the reference count when a file is deleted by a user

A

theyre only deleting the reference to the inode so the reference count drops

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

symbolic links

A

creates a separate file so we get a new inode with a ref count of 1
the content of this file is the path to the actual file in text (basic file path)

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

what are the two alias types

A

hard and symbolic links

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

what is a positive of symbolic links

A

the link isnt specific or constrained by a single file system

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

what is a negative of symbolic links (broken link)

A

dont know what it exists until the path is traversed so when its deleted the file will be deleted too as the ref count is now 0 -> broken link

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

what is the purpose of the open file descriptor table

A

optimises the way files are accessed by processes

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

how does the open file descriptor table work

A

processes need to record all the files they have open and the position within that file
the table has the position the mode of access and the inode of the file

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

what happens when an unrelated process opens a file already in the file descriptor table

A

it gets a separate entry within the table but with different information (e.g. access modes)

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

why is it important to match the block size to the average file size

A

bigger block size with smaller files means a greater penalty for them
larger files with small block size means youll be using a lot of blocks = bigger overhead

tend to go for larger blocks as smaller files can occupy a fraction of it

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

how does the directory structure work

A

each entry has an inode number, length, type and name length

17
Q

what does the length of an entry tell us

A

where the next inode entry is

18
Q

what does the inode numbr of an entry tell us

19
Q

why do we store both the name length and the length in the entry

A

length - name length = how much unused space between it and the next entry if the space adjacent is empty

20
Q

how do we look up file paths in this directory

A

we simply search for the name then follow the pointers to the next inode, then search for the name etc