Lesson 9: Managing Devices Flashcards
What folder is the hardware mapped to?
in the /dev folder
What does the udev service do?
service udev identifies the attached hardware, sticks a name to it and maps to the /dev folder
How do you override a devices assigned name?
rules.d which contains rules that override udev naming convention, you can find udev configuration in /etc/udev. For override settings to take place you can reboot system, unplug and plug back in the device or force udev to update and reapply rules – use the utility “udevadm control –reload-rules” then udevadm trigger
How would you confirm that the system detected hardware properly?
When hardware is detected it will be present in the /sys folder (a virtual folder).
In /sys/dev you’ll see block (drivers) and char (tape)
In /sys/devices you’ll see additional devices
How would you list specify hardware such as all pci devices?
You can simple do ls{device_type}
lspci which will list all pci devices
lsusb to list all usb devices
How will dmesg help you troubleshoot hardware not being detected ?
will show you a log of loaded hardware from boot
dmesg {pipe} {less}
timestamp = the number of seconds since the kernel loaded
How would you watch the system for any real time hardware changes?
Use the command
dmesg –follow OR dmesg -w
udevadm monitoring
dmidecode
note. to add to a text file try dmidecode > -/file_name.txt
What is CUPS?
CUPS is a print management system for Linux that enables a computer to function as aprint server.
How do you install CUPS?
Install cups -> yum list cups
-> systemectl enable –now cups
to verify status -> systemctl status cups
note. CUPS install a web interface. Navigate to locale host @ 127.0.0.1:631
How do you add printers ?
You can add printer from the CUPS web interface
note. CUPS install a web interface. Navigate to locale host @ 127.0.0.1:631 lpadmin -h localhost -p {printer name} -E (to enable) -v socket://{IP_address} -P {ppd_file_path}
How do you print?
lp -d {printer_name} {file_to_print} OR lpr print
How do you check the status of a print job?
lpstat -p {printer_name} OR lpq
How to set a default printer?
LPDEST={printer_name}
test. echo $LPDEST
What is the lpr command?
The lpr command submits files for printing. The syntax of the lpr command is lpr [options] [file names]
- E Force encryption when connecting to the server.
- P {destination} Send the print job to the destination printer specified.
- # {copies} Set the number of copies to print from 1 to 100.
- T {name} Set the job name.
- l Specify that the print file is already formatted and should be sent to the destination without being filtered.
- o {option} Set a job option, like printing in landscape mode, scaling the printed output, printing double-sided, etc. Job optionsvary depending on the printer.
- p Print the specified files with a shaded header that includesthe date, time, job name, and page number.
- r Specify that the printed files should be deleted afterprinting.
How do you cancel a print job
cancel {print_job_ID} OR lprm {print_job_ID}
What is GPIO?
General-purpose input/output (GPIO) refers to pins on a circuit board that have nodesignated purpose, but are controllable by the user at runtime.
What is the Isdev command?
The lsdev command displays various information about a system’s hardware asreported by the kernel. It compiles this information from three files in the /proc/directory:
/interrupts
/ioports
/dma
System logs that record a “Machine Check Exception” error message usually indicate what type of issue?
An issue with RAM. The mcelog command can retrieve and print these error messages for easier analysis.
note. To confirm RAM module failure, you can use utilities like MemTest, MemTest86+, andmemtester to perform a stress test on all RAM modules for several hours, reportingany errors that are encountered.
What command lists each detected hardware component on the system and provides details about each device?
The lshw command, the syntax of the lshw command is lshw [options]
What does the dmidecode command do?
The dmidecode command dumps the system’s Desktop Management Interface(DMI) table and presents it in a human-readable format. The syntax of the dmidecode command is dmidecode [options]