Chapter 3 - Configuring Hardware Flashcards

(127 cards)

1
Q

what is PCI?

A

peripheral component interconnect
allowed devices to communicate with the CPU/memory through a common interface

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

what is PCIe?

A

PCI express
modern; uses a serial port to point the connection

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

how does PCI/PCIe work?

A
  1. device plugs into motherboard via the pci/pcie slot
  2. firmware and os detect the device
  3. data moves through dedicates lanes between the cpu and device
  4. devices communicate using standard protocols
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

types of devices that use PCI examples

A

internal/external hard drives
network interface cards
wireless cards

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

What are the two requirements for using the USB interface in Linux?

A
  1. linux kernel must have a module installed to be able to recognize the usb controller
  2. linux system must have a kernel module installed for the individual device type that’s plugged in.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is GPIO?

A

general purpose input/output
helps support communication to external devices.
each input/output line can be controlled individually

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

what are device files? what are the two types?

A

the kernel creates device files to interface with hardware devices. it allows the data transfer to and from the device.
the two types of device files are character device files, and block device files.

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

What is a character device file?

A

transfer data one character at a time.
used for serial devices

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

what is a block device file?

A

transfer data in large blocks
used for high speed devices such as hard drives and network cards.

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

how can you tell if it’s a block/character file?

A

denoted by first letter in the permissions list.

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

what is a device mapper?

A

maps physical block devices to virtual block devices.

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

what is a virtual block device?

A

allows the system to intercept data written to or read from a physical device and perform some operation

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

what is the LVM

A

logical volume manager
uses mapped devices for creating logical drives

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

what is LUKS

A

linux unified key setup
uses mapped devices for encrypting data on hard drives when those features are installed on the linux system

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

where are virtual devices created?

A

in /dev/mapper

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

what is in the /proc directory? what’s its purpose?

A

has info about the system hardware settings and status

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

what is IRQ?

A

interrupt requests
allows hardware devices to indicate when they have data to send to the pu

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

what command to see current IRQs?

A

cat /proc/interrupts

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

How are IRQs assigned?

A

some are reserved for specific devices (such as 0 for system timer, and 1 for system keyboard). others are assigned at boot time in the order they’re detected

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

What are I/O ports?

A

locations in memory where the cpu can send data to and receive data from the device.

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

where to view the current I/O ports?

A

cat /proc/ioports

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

what is setpci?

A

to mannually override settings if two devices are assigned to the same i/o port

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

what is a DMA channel?

A

direct memory access
sends data from a hardware device directly to memory without waiting for the cpu. the cpu can read those memory locations whenever its ready

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

Command to view the channels in use?

A

cat /proc/dma

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
what's in /sys directory?
provides info about hardware evices
26
how to view /sys and its subdirectories?
sudo ls -al /sys
27
what does lsdev command do?
retrieves info from /proc/interrupts, /proc/ioports, and /proc/dma
28
what does lsblk command do? with the -S option?
has info about block devices installed and indicates if blocks are related (device-mapped LVM volumes or associated physical hard drives) with the -s option: info about the scsi block devices
29
Command to view currently installed PCI/PCIe cards on the system?
lspci
30
what is the command to find basic info about usb devices?
lsusb
31
what is a kernel module?
individual hardware driver files that can be linked into kernel at runtime.
32
where are module files stored?
/lib/modules
33
what are two linux utilities that find module files?
insmod and modprobe
34
how are module files distributed?
as source code to be compiled into the binary or already as binary object files ready to be dynamically linked to the main kernel binary.
35
what are the module binary files saved as? (what is the extension)
.ko
36
T/F each kernel/kernel version has its own directory for its own modules
T
37
what is an example path for where the modules for kernel version 4.3.3 are stored?
/lib/modules/4.3.3
38
Where are modules loaded from at boot time?
/etc.modules
39
T/F Modules can't be loaded dynamically as the system detects hardware devices
F
40
where are kernel module configs stored?
/etc/modules.conf
41
what is modules.dep
when certain modules depend on other modules to load to operate properly. Their relationships are defined in this file.
42
how is modules.dep generated/made?
by the utility depmod
43
what is depmod
determines module dependencies
44
where is modules.dep stored?
/lib/modules/kernel-versision
45
What are the functions of lsmod?
lists all the modules installed on the system. Shows dependencies.
46
what are the functions of modinfo?
Gives more info about specific modules, such as which module file is used and where it is.
47
what is the format/command using modinfo?
modinfo
48
how to install new modules?
insmod, modprobe
49
how to use insmod?
specify exact module file to upload
50
how to use modprobe?
don't need full module file; just name. more flexible/versatile. resolves module dependency issues.
51
two ways to remove modules?
rmmod modprobe -r
52
what are two types of storage devices?
HDD and SSD
53
what are the three drive connections?
PATA, SATA, and SCSI
54
what is a raw device?
when a new drive/device is connected, the kernel assigns it a file in the /dev directory. Writing or reading that file means writing/reading directly from the drive.
55
how are PATA devices denoted or how are they stored?
/dev/hdx
56
how are SATA devices denoted/how are they stored?
/dev/sdx
57
what is a partition?
a self-contained section within the drive that the OS treats as a separate storage space
58
how are BIOS systems partitioned?
into 4 primary partitions. Any of those can be extended, but only 1.
59
how are partitions managed in a BIOS system?
by the MBR
60
how are partitions managed in a UEFI system?
by the GUID Partition Table (GPT)
61
How many partitions are supported in the UEFI system?
128
62
how to write/denote location of the second SATA device, first partition?
/dev/sdb1
63
what is udev?
an application that runs in the background all the time and automatically detects new hardware connections and assigns them unique device filenames in /dev
64
why are links created by udev?
because when you add/remove removable devices, the name of it given to it by the system might change. Links make it easier to find the same device every time.
65
were are the udev links stored?
/dev/disk
66
what are the four directories created for storing the udev links?
/dev/disk/by-id /dev/disk/by-label /dev/disk/by-path /dev/disk/-by-uuid
67
benefit of using udev links?
you can reference a storage device by a permanent identifer rather than where/when it was plugged into the system.
68
what is DM?
device multipathing. allows you to configure multiple paths between the linux system and network storage devices.
69
what are multipath tools? (4)
dm-multipath multipath multipathd kpartx
70
what is multipathd
daemon; background process for monitoring paths and de/activated paths.
71
what is dm-multipath
kernel module that provides multipath support
72
what is multipath
command for viewing multipath devices
73
what is kpartx?
command-line tool for creating device entries for multipath storage device.
74
how does DM uses /dev/mapper?
contains a file called mpath N for each multipath storage device you add to the rest.
75
how does LVM use /dev/mapper?
aggregates phyical drive partitions into virtual volumes and can then treat it as a single partition.
76
what LVM tools are used to create and manage logical volumes?
pvcreate vgcreate lvcreate
77
where are the logical volumes created?
/dev/mapper
78
RAID 0
disk striping
79
what is disk striping
spreads data across multiple disks for faster access
80
what is parity
81
RAID 1
disk mirroring
82
RAID 10
disk mirroring with striping
83
RAID 4
disk striping with parity
84
RAID 5
disk striping with distributed party
85
RAID 6
disk striping with double parity
86
what are the benefits of using RAID
improves data access, performance, reliability, implements redundancy
87
what is mdadm
utility that can specify multiple partitions to be used in any type of RAID environment.
88
what are the two types of partitioning tools?
fdisk and gdisk
89
fdisk -p
see current partition scheme
90
fdisk -a
set boot flag for a partition to boot the system from
91
example command on how to partition the drive sda?
sudo fdisk /dev/sda
92
fdisk
a BIOS system tool to partition drives. can create, view, delete, and modify partitions.
93
gdisk
UEFI system tool for partitioning drives.
94
sudo parted
95
96
gparted
97
virtual directory
98
mount point
99
Filesystem hierarchy system
100
swap
virtual memory for the system. can swap data in and out of your normal memory into the swap space.
101
mkfs
create a filesystem
102
mkfs -t ext4 /dev/sdb1
make a ext4 filesystem in sdb device first partition
103
mkswap
create a swap space
104
what does mounting mean?
adding it to the virtual directory
105
mount -t ext4 /dev/sdb1 /media/usb1
mount ext4 filesystem type to sdb1 device in the /media/usb1 directory in the virtual filesystem.
106
mount -o
-o is to specify additional features of the filesystem.
107
drawback of using mount (manually mounting)
only temporarily mounts the device. once you reboot the system, it's gone.
108
how to remove a mountpoint?
umount command umount umount
109
how to automatically mount?
/etc/fstab this directory indicates which devices should be mounted to the virtual directory at boot time.
110
/etc/fstab structure
table that contains: drive device file mount point location filesystem type any additional options
111
df
displays disk usage by partition
112
du
displays disk usage by directory good for finding which users or applications are taking up the most disk space
113
iostat
displays real-time chart of disk stats by partition
114
lsblk
displays current partition sizes and mount points
115
which files in the /proc and /sys directories are helpful in filesystem stats?
/proc/partitions /proc/mounts /sys/block
116
/sys/block
directory contains separate directories for each mounted drive, showing partitions and kernel-level stats
117
inode
an entry in the index table that tracks file stored on the filesystem. inode determines how many files; if inode entries run out, cannot create a new file even if there's space available on the system
118
e2fsprongs
package that provides tool utilities for working with ext filesystems
119
blkid
info about block devices
120
chattr
change file attributes
121
debugfs
manually view and modify the filesystem structure
122
dump2fs
display block and superblock group info
123
e2labl
change label on the filesystem
124
resize2fs
expand or shrink a filesystem
125
tune2fs
modify the filesystem parameters
126
program to use if there is corruption?
fsck
127
tools used for an xfs filesystem?
xfs_admin xfs_db xfs_fsr