Directories and Device Nodes Flashcards

1
Q

The term file refers to…?

A

regular files, directories, symbolic links, device nodes, and others.

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

All files have common attributes..?

A

User owner, group owner, permissions, and timing information.

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

File meta-information is contained in…?

A

a data structure called inodes.

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

File names are contained in a data structure called…?

A

directory entries (dentries)

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

File meta-information can be examined with the…?

A

ls -l and stat commands.

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

Dentries…?

A

associate filenames with inodes.

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

Inodes which associate all of a file’s…?

A

attributes with its content.

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

every directory is referenced at least twice…?

A

once by itself (as the directory “.”), and once by its parent (with an actual directory name, such as report).

See Diagram 3.2 Dentry Tables for the report, report/html, and report/html/figures directories.

https://academy.redhat.com/courses/rha030-6.1/rha030_fsmngt_dirdev.html#rha030_fsmngt_dirdev_discussion

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

directories are simply collections of…?

A

dentries for the files the directory is said to contain, which map filenames to inodes.

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

Every directory contains at least…?

A

2 links, one from its own directory entry “.”, and one from its parent’s entry with the directory’s conventional name. Directories are referenced by additional link for every subdirectory, which refer to the directory as “..”.

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

Device nodes exist in the filesystem, but do not…?

A

contain data in the same way that regular files, or even directories and symbolic links, contain data. Instead the job of a device node is to act as a conduit to a particular device driver within the kernel.

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

When a user writes to a device node, the device node transfers the information to…?

A

the appropriate driver in the kernel.

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

When a user would like to collect information from a particular device, they read from…?

A

that device’s associated device node, just as reading from a file.

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

By convention, device nodes live within a dedicated directory called…?

A

/dev

(As there are over 7000 entries in the /dev directory, the output has been truncated to only the first several files. Focusing on the first character of each line, most of the files within /dev are not regular files or directories, but instead either character device nodes (“c”), or block device nodes (“b”). The two types of device nodes reflect the fact that device drivers in Linux fall into one of two major classes, character devices and block devices.)

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

Block devices are devices that …?

A

read and write information a chunk (“block”) at a time.

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

Block devices customarily allow random access, meaning that a block of data could be …?

A

read from anywhere on the device, in an order. Examples of block devices include hard drives, floppy drives, and CD/ROM drives.

17
Q

Character devices are often devices that…?

A

read and write information as streams of bytes (“characters”).

18
Q

There is a natural concept of what it means to read or write the…?

A

“next” character.

19
Q

Examples of character devices include …?

A

keyboards, mice, sound cards, and printers. Some character devices drivers support memory buffers as well.

20
Q

The real distinction between character and block device drivers relates to how the …?

A

devices interacts with the Linux kernel.

Block devices (“disks”) interact with the unified I/O cache, while character devices bypass the cache and interact with processes directly.

21
Q

When a user logs in, they take ownership of…?

A

the device node that controls their terminal.

Processes that they run are then able to read input or write output to the terminal. In general, the permissions on device nodes do not allow standard users to access devices directly. Two categories of exceptions occur.

22
Q

Because users need to be able to communicate with the system, they (or, more exactly, the processes that they run) must be able to read from and write to…?

A

the terminal they are using. Usually, part of the process of logging into a system involves transferring ownership of the terminal’s device node to the user.

23
Q

In Red Hat Enterprise Linux, users can be granted special permissions not because of who they are, but because of where…?

A

they logged in from.

Namely, when a user logs into a virtual console, or the graphical X server, they are considered a “console user”.

24
Q

Console users are granted access to hardware devices associated with the console, such as …?

A

the floppy drive and sound card.

25
Q

When the console user logs out of the system, ownerships for these devices are restored to…?

A

system defaults.

(None of this happens if a user logs in over the network, for example. (If the user is not sitting at the machine, would it be reasonable for them to use the floppy drive?)

26
Q

Linux (and Unix) uses device nodes to allow users access to devices…?

A

on the system.

27
Q

The managing of devices on a Linux system can be…?

A

A large and complicated topic.

28
Q

When writing programs, programmers do not need to deal with …?

A

device details. They can treat all input and output as if they were simply reading or writing to a file.

29
Q

Access to devices can be controlled through the same techniques of…?

A

file ownerships permissions that are used for regular files.