Chpt 2: Devices, Disks, Filesystems and the Kernel Flashcards

1
Q

What /var/ directory name stands for?

A

“variable”: programs record runtime information in it (like caches, system logging, etc.)

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

What is stored in /opt/ directory?

A

“optional”? May contain additional third-party software.

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

/usr/local dest

A

Admins can install their own software into it.

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

/usr/share dest

A

Contains files that should work on other kinds of Unix machines with no loss of functionality.
That’s the theory, anyway; a true share directory is becoming rare because there are no space issues
on modern disks. It is often more of a pain to maintain a share directory than it’s worth. In any case,
man, info, and some other subdirectories are often found here.

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

/usr/X11R6 dest

A

Holds the core Linux windowing system software, called XFree86. However, the custom
configuration files for your computer are usually in /etc/X11.

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

How to identify a device type in /dev/?

A

Run ls -l in it, it will show a string with devices listed. First character in permission string identifies devices. (b/c/p/s)

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

block device

A

Programs access data in a block device in fixed chunks. The hdb1 in the preceding
example is a disk device. Because disks break down into blocks of data, it is only natural that a disk
be a block device. A block device’s total size is fixed, and a program has random access to any block
in the device.

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

character device

A

eCharacter devices work with data streams. You can only read characters from or
write characters to these devices, like /dev/null in the previous example. Character devices don’t
have a size; when you read from or write to a character device, the kernel usually performs a read or
write operation on the device, leaving no record of the activity inside the kernel. Printers are character
devices, and after the kernel sends data to a printer, the responsibility for that data passes to the
printer; the kernel cannot back up and reexamine the data stream.

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

pipe device

A

Named pipes are like character devices, but there is another process at the other end of
the I/O stream instead of a kernel driver. An example of such a process is gpm, a program that can
duplicate mouse events and send them to the named pipe /dev/gpmdata for use by other programs.

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

Socket device

A

Sockets are special-purpose I/O files offering a type of network interface.

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

How dd command works and what it does?

A

Reblocks block devices. What does – add later.

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

Where to find hard disks listed on your system?

A

/dev/hd* (ATA/IDE disks and partitions)

“device without a number is an entire disks, with numbers are partitions” // really?

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

Where to find SCSI disks listed on your system?

A

SCSI disks carry the names /dev/sda, /dev/sdb, and so on, and the disks work much like their ATA
counterparts, although the SCSI disk names do not directly correspond to a SCSI host controller and
target. Linux assigns the devices in the order that it encounters the disks.

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

/dev/tty, /dev/pts

A

Terminals are devices for moving characters between the system and an I/O device, usually for text output
to a terminal screen. The terminal device interface goes back a long way, to the days when terminals were
typewriter-based devices.
Pseudo-terminal devices are emulated terminals that understand the I/O features of real terminals, but
rather than talk to a real piece of hardware, the kernel presents the I/O interface to a piece of software,
such as a shell window.
Two common terminal devices are /dev/tty1 (the first virtual console) and /dev/pts/0 (the first
pseudo-terminal device).
The /dev/tty device is the controlling terminal of the current process. If a program is currently reading
from and writing to a terminal, this device is a synonym for that terminal. A proccess does not need to be
attached to a terminal.

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

What are /dev/ttyS* devices?

A

Serial ports are special terminal devices. You can’t do much on the command line with serial port devices
because there are too many settings to worry about, such as baud rate and flow control.
The port known as COM1 on Windows is /dev/ttyS0, COM2 is /dev/ttyS1, and so on.

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

What are /dev/lp0, /dev/lp1

A

Parallel port devices.

17
Q

How to partition a disk?

A

Use fdisk!

18
Q

What is ext2 fs?

A

It is fairly quick, and it defragments itself.

Nearly every Linux system uses ext2 or its newer, journaled version, ext3.

19
Q

What is ext3 fs?

A

Journaled version of ext2

20
Q

How to add a journal file to an existing filesystem?

A

tune2fs -j /dev/[diskname] // also change ext2 to ext3 in /etc/fstab file

21
Q

Для чего нужен /etc/fstab?

A

Именно в данном файле описывается, какой раздел на каком диске куда должен быть подмонтирован. Каждая строчка в данном файле описывает одну точку монтирования. Каждая строчка состоит из шести полей: устройство, точка монтирования, тип файловой системы, опции, флаг проверки, флаг резервного копирования.

Все описанные в этом файлике системы монтируются во время загрузки. А вот прописывать их надо туда руками (емнип).

22
Q

Command to check and repair a filesystem:

A

fsck. BUT you should always unmount the filesystem first! otherwise it can be corrupted.

23
Q

What is the purpose of tmpfs?

A

You can employ your physical memory and swap space as temporary
storage with tmpfs. You can mount tmpfs wherever you like, using the size and nr_blocks long
options to control the maximum size.