Hello and welcome to this video on Oracle Linux 8.
In this video, we will cover Oracle Linux 8's sysfs file system.
For our objectives today, after viewing this video, you should be able to:
Describe the sysfs file system.
Explain the lshw utility.
Describe the lshw-gui utility.
And lastly you will be able to explain the sysctl utility.
In addition to /proc, the kernel also exports information to another virtual file system
called sysfs.
sysfs is used by programs such as udev to access device and device driver information.
The creation of sysfs helped clean up the proc file system because much of the hardware
information has been moved from proc to sysfs.
The sysfs file system is mounted on /sys.
The following is a brief description of some of the top-level directories:
/sys/block: This directory contains entries for each block device in the system.
/sys/bus: This directory contains subdirectories for each physical bus type supported in the
kernel.
/sys/class: This directory contains every device class registered with the kernel.
Let's explore the sys directory.
Use the ls command with the -l option to display the contents of the sys directory.
Next, use the ls command to display the virtual disk block dm-0 devices on your system.
Let's determine which power states are supported.
Change directory to the power directory.
Then list the contents of the directory.
Use the cat command on the state file.
As you can see, the possible states are freeze which is suspend-to-idle,
mem has possible states of suspend-to-idle, power-on suspend, or suspend-to-ram,
and the third state is disk which is suspend-to-disk.
The lshw utility provides hardware information about a system.
This includes information about memory, firmware, CPU, network interfaces and more.
The output is displayed in a textual tree format.
The example on this slide shows the initial output when running lshw with no options.
Running the lshw command displays a textual tree structure of the hardware for the system
as demonstrated.
As you can see, the system is broken down to its components such as firmware, memory,
cpu, disks, volumes, displays, networking, etc.
Alternatively, a graphical user interface is available for displaying and viewing a
system's hardware.
The lshw-gui utility is the graphical program version of the
A sample graphical output from running the lshw-gui utility is displayed on this slide.
By running the command lshw-gui, a GUI appears.
You can look through the hardware configuration by clicking items successively through the
tree.
You can double-click items in bold to drill down to see further items available to be
viewed.
When finished click quit.
The sysctl utility can also be used to view or modify values to writeable files in the
/proc/sys directory.
To view the current kernel settings, enter the command sysctl -a.
You can assign values using the -w option a kernel parameter and a value.
For example, you can assign ip forwarding using the sysctl command with the net.ipv4.ip_forward
parameter and a value of 1.
Changes made by using the sysctl command are lost when the system is rebooted.
To make custom settings permanent, you can add them to files created in /etc/sysctl.d.
Values added to these files take effect each time the system boots.
You can also make immediate changes by using the -p argument and a target filename.
Now let's try the sysctl utility.
Use the cat command to view the current setting of the ip_forward file.
Next, run the sysctl command with the -w option and setting the ip_forward value to 0.
To verify ip forwarding run the cat command again.
Use the sysctl command to enable IP forwarding by setting the value to 1.
Verify that ip forwarding is enabled again.
Now display the current kernel settings by piping the output to the less command.
And finally use the less command to view the contents of the 99-sysctl.conf file located
in /etc/sysctl.d.
After watching this video, you should now be able to:
Describe the sysfs file system
Explain the lshw utility
Describe the lshw-gui utility
And lastly you should now be able to explain the sysctl utility.
Oracle provides an extensive number of resources which you can use to learn more about this
subject and others.
Look for additional videos on the Oracle Linux 8 boot process covering GRUB2, systemd and
other Linux boot process topics.
This concludes the video.
Thank you for watching.