Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Prochaine révision
Révision précédente
elearning:workbooks:centos:8:admin:l118 [2021/10/27 15:50] – created adminelearning:workbooks:centos:8:admin:l118 [2022/06/05 17:57] (Version actuelle) admin
Ligne 1: Ligne 1:
 ~~PDF:LANDSCAPE~~ ~~PDF:LANDSCAPE~~
  
-Version : **2021.01**+Version : **2022.01**
  
-Updated: ~~LASTMOD~~+Last updated : ~~LASTMOD~~
  
-======LCE601 - Managing Integrated Peripherals======+======LCE512 Compiling the Kernel and Managing Quotas======
  
 =====Contents===== =====Contents=====
  
-  * **LCE601 - Managing Integrated Peripherals**+  * **LCE512 Compiling the Kernel and Managing Quotas**
     * Contents     * Contents
-    * Special Files  +    * The Linux Kernel 
-    * LAB #1 - Commands +    * LAB #1 - Modules 
-      * 1.1 - The lspci Command +    * LAB #2 - Compiling and Installing a Kernel and Modules 
-      * 1.2 - The lsusb Command +      * 2.1 - Move /home 
-      * 1.3 - The dmidecode Command +      * 2.2 - Preparing the Environment 
-    LAB #2 - The sysctl Command +      * 2.3 - Preparing the Kernel Source Tree 
-      * 2.The /proc Directory +        * The .config file 
-        Files +        * The Makefile file 
-          * /proc/cpuinfo +      * 2.Configuring the Kernel 
-          * /proc/interrupts +      2.5 - Compiling the Kernel 
-          * /proc/dma +      * 2.Installing the Kernel 
-          * /proc/ioports +    * LAB #3 - Managing Quotas 
-          * /proc/devices +      * 3.1 - The quotacheck Command 
-          * /proc/module +      * 3.2 - The edquota Command 
-          * /proc/diskstats +      * 3.3 - The quotaon Command 
-          * /proc/partitions +      * 3.4 - The repquota Command 
-          * /proc/swaps +      * 3.5 - The quota Command 
-          * /proc/loadavg +      * 3.6 - The warnquota Command
-          * /proc/meminfo +
-          * /proc/version +
-        * Directories +
-          * ide/scsi +
-          * acpi +
-          * bus +
-          * net +
-          * sys +
-      * 2.Using the sysctl Command     +
-    * LAB #3 - Interpreting Information in /proc +
-      * 3.1 - free +
-      * 3.2 - uptime ou w  +
-      * 3.3 - iostat +
-      * 3.4 - hdparm +
-      * 3.5 - vmstat +
-      * 3.6 - mpstat +
-      * 3.7 - sar +
-    * USB Modules +
-    * udev +
-      * The udevadm Command +
-    * The /sys Filesystem +
-    * LAB #4 - Limiting Ressources +
-      * 4.1 - ulimit+
  
-=====Special Files=====+=====The Linux Kernel=====
  
-In a PC, peripherals are connected to a **controler** which communicates with the processor via a **bus**. The controller and associated peripherals require specific driversUnder Linux, these drivers are normally supplied as kernel **modules**. Each peripheral is represented by a special file in the **/dev** directory. Each special file contains the information required by the system in order for it to use the driver.+The Kernel is the part of the OS that is responsible for managing peripherals' I/OSometimes it is necessary to recompile the Kernel in very **specific** scenarios:
  
-<WRAP center round important 60%> +  * reducing the Kernel footprint, 
-Peripherals that require the system to be halted prior to plugging or unplugging them are refered to as **Cold Plug Devices**. Peripherals that can be plugged/unplugged whilst the system is running are refered to as **Hot Plug Devices**. +  supporting new peripherals, 
-</WRAP> +  adding new functionalities, 
- +  optimising code, 
-The following output shows the typical content of the /dev directory:+  correcting bugs, 
 +  using experimental functions
 +   
 +Start by updating CentOS 8:
  
 <code> <code>
-[root@centos8 ~]# ls -l /dev | more +[root@centos8 ~]# dnf update 
-total 0 +... 
-crw-r--r-- 1 root root     10, 235 Jun 28 02:04 autofs +[root@centos8 ~]# reboot
-drwxr-xr-x 2 root root         180 Jun 28 02:04 block +
-drwxr-xr-x 2 root root         100 Jun 28 02:04 bsg +
-drwxr-xr-x. root root          60 Jun 28 02:04 bus +
-lrwxrwxrwx.  1 root root           3 Jun 28 02:04 cdrom -> sr0 +
-drwxr-xr-x.  2 root root        2940 Jun 28 02:04 char +
-drwxr-xr-x.  2 root root          80 Jun 28 02:04 cl_centos8 +
-crw-------.  1 root root      5,   1 Jun 28 02:04 console +
-lrwxrwxrwx.  1 root root          11 Jun 28 02:04 core -> /proc/kcore +
-drwxr-xr-x. 10 root root         200 Jun 28 02:04 cpu +
-crw-------.  1 root root     10,  62 Jun 28 02:04 cpu_dma_latency +
-drwxr-xr-x.  6 root root         120 Jun 28 02:04 disk +
-brw-rw----.  1 root disk    253,   0 Jun 28 02:04 dm-0 +
-brw-rw----.  1 root disk    253,   1 Jun 28 02:04 dm-1 +
-drwxr-xr-x.  3 root root          80 Jun 28 02:04 dri +
-crw-rw----.  1 root video    29,   0 Jun 28 02:04 fb0 +
-lrwxrwxrwx.  1 root root          13 Jun 28 02:04 fd -> /proc/self/fd +
-crw-rw-rw-.  1 root root      1,   7 Jun 28 02:04 full +
-crw-rw-rw-.  1 root root     10, 229 Jun 28 02:04 fuse +
-crw-------.  1 root root    245,   0 Jun 28 02:04 hidraw0 +
-crw-------.  1 root root     10, 228 Jun 28 02:04 hpet +
-drwxr-xr-x.  3 root root           0 Jun 28 02:04 hugepages +
-crw-------.  1 root root     10, 183 Jun 28 02:04 hwrng +
-lrwxrwxrwx.  1 root root          12 Jun 28 02:04 initctl -> /run/initctl +
-drwxr-xr-x.  4 root root         280 Jun 28 02:04 input +
-crw-r--r--.  1 root root      1,  11 Jun 28 02:04 kmsg +
-lrwxrwxrwx.  1 root root          28 Jun 28 02:04 log -> /run/systemd/journal/dev-log +
-crw-rw----.  1 root disk     10, 237 Jun 28 02:04 loop-control +
-crw-rw----.  1 root lp        6,   0 Jun 28 02:04 lp0 +
-crw-rw----.  1 root lp        6,   1 Jun 28 02:04 lp1 +
-crw-rw----.  1 root lp        6,   2 Jun 28 02:04 lp2 +
-crw-rw----.  1 root lp        6,   3 Jun 28 02:04 lp3 +
-drwxr-xr-x.  2 root root         100 Jun 28 02:04 mapper +
-crw-------.  1 root root     10, 227 Jun 28 02:04 mcelog +
-crw-r-----.  1 root kmem      1,   1 Jun 28 02:04 mem +
-drwxrwxrwt.  2 root root          40 Jun 28 02:04 mqueue +
-drwxr-xr-x.  2 root root          60 Jun 28 02:04 net +
-crw-rw-rw-.  1 root root      1,   3 Jun 28 02:04 null +
---More--+
 </code> </code>
  
-As you can see, certain files refer to **block** devices whilst others refer to **character** devices+Now identifiy the current Linux kernel:
  
 <code> <code>
-... +[root@centos8 ~]# uname -r 
-brw-rw----.  1 root disk      8,   1 Jun 28 02:04 sda1 +4.18.0-305.7.1.el8_4.x86_64
-..+
-crw-rw-rw-.  root tty       5,   0 Jun 28 02:04 tty +
-...+
 </code> </code>
  
-The major difference between these two types lies in the way that the communication between the system and the peripheral takes place. In the case of a block file, that communication uses a buffer whilst in the case of a character file the communication takes place directly byte by byte.+=====LAB #1 - Modules=====
  
-The figures that can be seen immediately before the date of the special file are called respectively the **major** and the **minor** :+Under normal circumstances it is however preferable to make use of the Kernel modules as opposed to recompiling the Kernel. Kernel modules can be found in the **/lib/modules/<kernel-version>** directory:
  
-  * the **major** identifies the peripheral's driver, +<code> 
-  * the **minor** identifies the peripheralFor instance 8,1 indicates the first partition of the **sda** disk.+[root@centos8 ~]# ls /lib/modules/`uname -r`/ 
 +bls.conf           modules.builtin      modules.networking   System.map 
 +build              modules.builtin.bin  modules.order        updates 
 +config             modules.dep          modules.softdep      vdso 
 +kernel             modules.dep.bin      modules.symbols      vmlinuz 
 +modules.alias      modules.devname      modules.symbols.bin  weak-updates 
 +modules.alias.bin  modules.drm          source 
 +modules.block      modules.modesetting  symvers.gz 
 +</code>
  
-=====LAB #1 - Commands=====+Commands used to manage modules are:
  
-====1.1 - The lspci Command====+  * insmod 
 +  * rmmod 
 +  * lsmod 
 +  * modprobe
  
-This command show a list of the peripherals connected to the PCI, AGP and PCI express buses:+For example :
  
 <code> <code>
-[root@centos8 ~]# lspci +[root@centos8 ~]# lsmod 
-00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) +Module                  Size  Used by 
-00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] +xt_CHECKSUM            16384  1 
-00:01.IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/Triton II] +ipt_MASQUERADE         16384 
-00:01.USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/Triton II] (rev 01) +xt_conntrack           16384 
-00:01.Bridge: Intel Corporation 82371AB/EB/MB PIIX4 ACPI (rev 03) +ipt_REJECT             16384 
-00:02.0 VGA compatible controller: Device 1234:1111 (rev 02) +nft_compat             20480  16 
-00:03.0 Unclassified device [00ff]: Red HatInc. Virtio memory balloon +nf_nat_tftp            16384  
-00:07.0 SATA controller: Intel Corporation 82801IR/IO/IH (ICH9R/DO/DH) 6 port SATA Controller [AHCI mode] (rev 02) +nft_objref             16384 
-00:12.0 Ethernet controller: Red HatInc. Virtio network device +nf_conntrack_tftp      16384  3 nf_nat_tftp 
-00:1e.0 PCI bridge: Red HatInc. QEMU PCI-PCI bridge +nft_counter            16384  33 
-00:1f.0 PCI bridge: Red HatInc. QEMU PCI-PCI bridge+tun                    53248  1 
 +bridge                192512  0 
 +stp                    16384  1 bridge 
 +llc                    16384  2 bridge,stp 
 +nft_fib_inet           16384  
 +nft_fib_ipv4           16384  1 nft_fib_inet 
 +nft_fib_ipv6           16384  1 nft_fib_inet 
 +nft_fib                16384  3 nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet 
 +nft_reject_inet        16384  5 
 +nf_reject_ipv4         16384  nft_reject_inet,ipt_REJECT 
 +nf_reject_ipv6         16384  1 nft_reject_inet 
 +nft_reject             16384  1 nft_reject_inet 
 +nft_ct                 20480  19 
 +nf_tables_set          49152  21 
 +nft_chain_nat          16384  12 
 +nf_nat                 45056  ipt_MASQUERADE,nf_nat_tftp,nft_chain_nat 
 +nf_conntrack          172032  6 xt_conntrack,nf_nat,nf_conntrack_tftp,nft_ct,ipt_MASQUERADE,nf_nat_tftp 
 +nf_defrag_ipv6         20480  1 nf_conntrack 
 +nf_defrag_ipv4         16384  1 nf_conntrack 
 +ip_set                 49152  
 +nf_tables             172032  414 nft_ct,nft_compat,nft_reject_inet,nft_fib_ipv6,nft_objref,nft_fib_ipv4,nft_counter,nft_chain_nat,nf_tables_set,nft_reject,nft_fib,nft_fib_inet 
 +nfnetlink              16384  4 nft_compat,nf_tables,ip_set 
 +sunrpc                540672 
 +ext4                  761856 
 +mbcache                16384  1 ext4 
 +jbd2                  131072  1 ext4 
 +virtio_balloon         20480  0 
 +pcspkr                 16384 
 +i2c_piix4              24576  0 
 +joydev                 24576 
 +ip_tables              28672  0 
 +xfs                  1515520 
 +libcrc32c              16384  4 nf_conntrack,nf_nat,nf_tables,xfs 
 +sr_mod                 28672  
 +sd_mod                 53248 
 +cdrom                  65536  1 sr_mod 
 +t10_pi                 16384  1 sd_mod 
 +sg                     40960  0 
 +ata_generic            16384  0 
 +bochs_drm              16384  1 
 +drm_vram_helper        28672  1 bochs_drm 
 +drm_kms_helper        233472  4 drm_vram_helper,bochs_drm 
 +syscopyarea            16384  1 drm_kms_helper 
 +sysfillrect            16384  1 drm_kms_helper 
 +sysimgblt              16384  1 drm_kms_helper 
 +fb_sys_fops            16384  1 drm_kms_helper 
 +drm_ttm_helper         16384  1 drm_vram_helper 
 +ttm                   114688  2 drm_vram_helper,drm_ttm_helper 
 +drm                   569344  7 drm_kms_helper,drm_vram_helper,bochs_drm,drm_ttm_helper,ttm 
 +ahci                   40960 
 +libahci                40960  1 ahci 
 +virtio_net             53248  0 
 +net_failover           24576  1 virtio_net 
 +ata_piix               36864 
 +serio_raw              16384  0 
 +failover               16384  1 net_failover 
 +libata                270336  4 ata_piix,libahci,ahci,ata_generic 
 +dm_mirror              28672  0 
 +dm_region_hash         20480  1 dm_mirror 
 +dm_log                 20480  2 dm_region_hash,dm_mirror 
 +dm_mod                151552  8 dm_log,dm_mirror 
 +fuse                  151552  3
 </code> </code>
  
-To obtain peripheral specific information, use the **-v** or **-vv** switches whilst specifying the peripheral ID:+To add a moduleyou can use either the **insmod** or the **modprobe** command. The latter also manages the dependencies of the to-be-installed module:
  
 <code> <code>
-[root@centos8 ~]# lspci -v -s 00:03.0 +[root@centos8 ~]# modprobe bonding 
-00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon +[root@centos8 ~]# lsmod | more 
-        Subsystem: Red Hat, Inc. Device 0005 +Module                  Size  Used by 
-        Physical Slot: +bonding               196608 
-        Flags: bus master, fast devsel, latency 0, IRQ 10 +xt_CHECKSUM            16384  1 
-        I/O ports at e000 [size=64] +ipt_MASQUERADE         16384  
-        Memory at fe400000 (64-bitprefetchable) [size=16K] +xt_conntrack           16384 
-        Capabilities: [84] Vendor Specific Information: VirtIO: <unknown> +ipt_REJECT             16384 
-        Capabilities: [70] Vendor Specific Information: VirtIO: Notify +nft_compat             20480  16 
-        Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg +nf_nat_tftp            16384  
-        Capabilities: [50] Vendor Specific Information: VirtIO: ISR +nft_objref             16384 
-        Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg +nf_conntrack_tftp      16384  3 nf_nat_tftp 
-        Kernel driver in use: virtio-pci+nft_counter            16384  33 
 +tun                    53248  1 
 +bridge                192512 
 +stp                    16384  1 bridge 
 +llc                    16384  2 bridge,stp 
 +nft_fib_inet           16384  1 
 +nft_fib_ipv4           16384  1 nft_fib_inet 
 +nft_fib_ipv6           16384  1 nft_fib_inet 
 +nft_fib                16384  3 nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet 
 +nft_reject_inet        16384  5 
 +nf_reject_ipv4         16384  2 nft_reject_inet,ipt_REJECT 
 +nf_reject_ipv6         16384  1 nft_reject_inet 
 +--More--
 </code> </code>
 +
 +To delete a module, you can use either the **rmmod** command or the **modprobe -r** command. The latter also deletes any unused dependencies of the deleted module:
  
 <code> <code>
-[root@centos8 ~]# lspci -vv -s 00:03.0 +[root@centos8 ~]# modprobe -r bonding 
-00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon +[root@centos8 ~]# lsmod | more 
-        Subsystem: Red Hat, Inc. Device 0005 +Module                  Size  Used by 
-        Physical Slot: +xt_CHECKSUM            16384  1 
-        Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx- +ipt_MASQUERADE         16384  
-        Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx- +xt_conntrack           16384  1 
-        Latency: +ipt_REJECT             16384 
-        Interrupt: pin A routed to IRQ 10 +nft_compat             20480  16 
-        Region 0: I/O ports at e000 [size=64] +nf_nat_tftp            16384  
-        Region 4: Memory at fe400000 (64-bit, prefetchable) [size=16K] +nft_objref             16384  1 
-        Capabilities: [84] Vendor Specific Information: VirtIO: <unknown> +nf_conntrack_tftp      16384  3 nf_nat_tftp 
-                BAR=0 offset=00000000 size=00000000 +nft_counter            16384  33 
-        Capabilities: [70] Vendor Specific Information: VirtIO: Notify +tun                    53248  1 
-                BAR=4 offset=00003000 size=00001000 multiplier=00000004 +bridge                192512  
-        Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg +stp                    16384  1 bridge 
-                BAR=4 offset=00002000 size=00001000 +llc                    16384  2 bridge,stp 
-        Capabilities: [50] Vendor Specific Information: VirtIO: ISR +nft_fib_inet           16384  1 
-                BAR=4 offset=00001000 size=00001000 +nft_fib_ipv4           16384  1 nft_fib_inet 
-        Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg +nft_fib_ipv6           16384  1 nft_fib_inet 
-                BAR=4 offset=00000000 size=00001000 +nft_fib                16384  3 nft_fib_ipv6,nft_fib_ipv4,nft_fib_inet 
-        Kernel driver in use: virtio-pci+nft_reject_inet        16384  5 
 +nf_reject_ipv4         16384  2 nft_reject_inet,ipt_REJECT 
 +nf_reject_ipv6         16384  1 nft_reject_inet 
 +nft_reject             16384  1 nft_reject_inet 
 +--More--
 </code> </code>
  
-===Command Line Switches=== +Module dependencies are resolved by the modprobe command by using the **/lib/modules/<kernel-version>/modules.dep** file. This latter can be created by using the **depmod** command:
- +
-The command line switches of this command are:+
  
 <code> <code>
-[root@centos8 ~]# lspci --help +[root@centos8 ~]# more /lib/modules/`uname -r`/modules.dep 
-lspciinvalid option -- '-' +kernel/arch/x86/events/amd/power.ko.xz: 
-Usagelspci [<switches>] +kernel/arch/x86/events/intel/intel-uncore.ko.xz: 
- +kernel/arch/x86/events/intel/intel-cstate.ko.xz
-Basic display modes+kernel/arch/x86/events/rapl.ko.xz
--mm             Produce machine-readable output (single -m for an obsolete format) +kernel/arch/x86/kernel/cpu/mce/mce-inject.ko.xz: 
--t              Show bus tree +kernel/arch/x86/crypto/des3_ede-x86_64.ko.xzkernel/crypto/des_generic.ko.xz 
- +kernel/arch/x86/crypto/camellia-x86_64.ko.xz: 
-Display options+kernel/arch/x86/crypto/blowfish-x86_64.ko.xz: kernel/crypto/blowfish_common.ko.xz 
--v              Be verbose (-vv or -vvv for higher verbosity) +kernel/arch/x86/crypto/twofish-x86_64.ko.xz: kernel/crypto/twofish_common.ko.xz 
--k              Show kernel drivers handling each device +kernel/arch/x86/crypto/twofish-x86_64-3way.ko.xz: kernel/arch/x86/crypto/twofish-x86_64.ko. 
--x              Show hex-dump of the standard part of the config space +xz kernel/crypto/twofish_common.ko.xz 
--xxx            Show hex-dump of the whole config space (dangerous; root only) +kernel/arch/x86/crypto/chacha20-x86_64.ko.xz: kernel/crypto/chacha20_generic.ko.xz 
--xxxx           Show hex-dump of the 4096-byte extended config space (root only) +kernel/arch/x86/crypto/serpent-sse2-x86_64.ko.xzkernel/crypto/serpent_generic.ko.xz 
--b              Bus-centric view (addresses and IRQ's as seen by the bus) +kernel/arch/x86/crypto/ghash-clmulni-intel.ko.xz: 
--D              Always show domain numbers +kernel/arch/x86/crypto/crc32c-intel.ko.xz: 
--P              Display bridge path in addition to bus and device number +kernel/arch/x86/crypto/crc32-pclmul.ko.xz
--PP             Display bus path in addition to bus and device number +kernel/arch/x86/crypto/sha512-ssse3.ko.xzkernel/crypto/sha512_generic.ko.xz 
- +kernel/arch/x86/crypto/crct10dif-pclmul.ko.xz
-Resolving of device ID's to names+kernel/arch/x86/crypto/poly1305-x86_64.ko.xzkernel/crypto/poly1305_generic.ko.xz 
--n              Show numeric ID's +kernel/arch/x86/crypto/camellia-aesni-avx-x86_64.ko.xz: kernel/arch/x86/crypto/camellia-x86 
--nn             Show both textual and numeric ID's (names & numbers) +_64.ko.xz 
--q              Query the PCI ID database for unknown ID's via DNS +kernel/arch/x86/crypto/cast5-avx-x86_64.ko.xz: kernel/crypto/cast5_generic.ko.xz kernel/cry 
--qq             As above, but re-query locally cached entries +--More--(0%)
--Q              Query the PCI ID database for all ID's via DNS +
- +
-Selection of devices+
--s [[[[<domain>]:]<bus>]:][<slot>][.[<func>]]   Show only devices in selected slots +
--d [<vendor>]:[<device>][:<class>             Show only devices with specified ID's +
- +
-Other options+
--i <file>       Use specified ID database instead of /usr/share/hwdata/pci.ids +
--p <file>       Look up kernel modules in a given file instead of default modules.pcimap +
--M              Enable `bus +
 </code> </code>
  
-====1.2 - The lsusb Command==== +To see information about specific module, use the **modinfo** command:
- +
-This command show list of the peripherals connected to the USB bus:+
  
 <code> <code>
-[root@centos8 ~]# lsusb +[root@centos8 ~]# modinfo bonding 
-Bus 001 Device 002ID 0627:0001 Adomax Technology Co., Ltd  +filename      /lib/modules/4.18.0-305.7.1.el8_4.x86_64/kernel/drivers/net/bonding/bonding.ko.xz 
-Bus 001 Device 001ID 1d6b:0001 Linux Foundation 1.1 root hub +author:         Thomas Davistadavis@lbl.gov and many others 
- +description   Ethernet Channel Bonding Driver 
-[root@centos8 ~]# lsusb -vt +license       GPL 
-/ Bus 01.Port 1: Dev 1, Class=root_hubDriver=uhci_hcd/2p12M +alias:          rtnl-link-bond 
-    |__ Port 1: Dev 2If 0, Class=Human Interface DeviceDriver=usbhid12M+rhelversion:    8.4 
 +srcversion:     445F4CC9A2F7E64E3A87FD0 
 +depends:         
 +intree:         Y 
 +name:           bonding 
 +vermagic:       4.18.0-305.7.1.el8_4.x86_64 SMP mod_unload modversions  
 +sig_id:         PKCS#
 +signer:         CentOS kernel signing key 
 +sig_key:        3B:5A:0A:B8:8E:4A:51:C0:AA:FF:97:FD:CB:94:D6:B6:D2:46:B8:17 
 +sig_hashalgo:   sha256 
 +signature:      B2:3A:20:BE:2B:F3:E0:5A:1A:74:0E:69:76:40:2A:D4:80:10:2C:5A: 
 +                B7:F1:1E:7A:71:13:29:F0:0A:4A:28:EE:81:33:C8:C2:5C:BD:FF:E4: 
 +                3F:A9:15:A3:9A:0E:A7:98:9E:99:06:23:10:47:D3:B2:48:B3:F1:61: 
 +                BE:4B:B0:FC:62:B9:3B:D6:64:CC:E3:29:01:4D:91:92:32:FD:EB:54: 
 +                44:F1:2C:1B:23:30:F1:3E:EE:69:EA:94:54:D9:A0:8D:16:53:F5:20: 
 +                DE:38:A0:13:E8:2F:89:66:CB:11:D7:AA:30:37:7B:EC:DF:A1:69:29: 
 +                7F:4E:80:4D:34:6E:F2:07:01:FA:18:23:94:58:10:C6:97:27:68:B9: 
 +                D8:08:5E:9D:00:17:F4:1B:48:BE:CA:BF:5C:5A:A8:6D:36:EE:3F:95: 
 +                BA:BE:59:82:EE:7B:CA:BB:32:1E:E3:05:ED:C9:C2:C8:10:64:B9:29: 
 +                B8:09:4B:79:42:65:1A:FA:99:96:BA:7E:2D:6E:75:F1:91:0E:F4:9A: 
 +                8F:11:10:9F:70:BD:35:06:BE:F0:4C:D8:AB:D5:C4:E1:B3:A2:2A:CA: 
 +                58:CA:9E:16:1D:0C:BE:9C:37:A1:82:20:6F:24:CD:23:63:F7:F5:BC: 
 +                6E:81:14:F0:52:DA:04:0E:9D:CC:17:60:2D:B0:D8:BD:6E:2C:AD:E7: 
 +                50:48:49:B6:57:96:AC:FD:A4:29:33:01:43:92:32:88:A2:AC:CB:93: 
 +                2F:C3:29:F3:01:77:84:00:AB:AA:C8:59:43:F1:DA:90:7B:5F:9A:A9: 
 +                CA:60:97:34:85:5E:98:56:73:03:0D:D7:8D:A6:AB:51:D4:8C:92:91: 
 +                0C:0A:BA:6B:92:01:16:FE:8B:86:80:11:5F:8E:21:BD:C2:2F:02:58: 
 +                A6:CF:6C:E3:87:28:8B:4D:CE:54:8C:00:B3:F7:AE:9E:01:81:1E:83: 
 +                AE:6D:58:B0:10:98:36:D9:69:76:E2:C0:E2:15:94:3B:D4:14:19:D9: 
 +                59:86:75:31 
 +parm:           max_bonds:Max number of bonded devices (int) 
 +parm:           tx_queues:Max number of transmit queues (default = 16) (int) 
 +parm:           num_grat_arp:Number of peer notifications to send on failover event (alias of num_unsol_na) (int) 
 +parm:           num_unsol_na:Number of peer notifications to send on failover event (alias of num_grat_arp) (int) 
 +parm:           miimon:Link check interval in milliseconds (int) 
 +parm:           updelay:Delay before considering link up, in milliseconds (int) 
 +parm:           downdelay:Delay before considering link down, in milliseconds (int) 
 +parm:           use_carrier:Use netif_carrier_ok (vs MII ioctls) in miimon; 0 for off, 1 for on (default) (int) 
 +parm:           mode:Mode of operation; 0 for balance-rr, 1 for active-backup, 2 for balance-xor, 3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, 6 for balance-alb (charp) 
 +parm:           primary:Primary network device to use (charp) 
 +parm:           primary_reselect:Reselect primary slave once it comes up; 0 for always (default), for only if speed of primary is better, 2 for only on active slave failure (charp) 
 +parm          lacp_rate:LACPDU tx rate to request from 802.3ad partner; 0 for slow, for fast (charp) 
 +parm:           ad_select:802.3ad aggregation selection logic; 0 for stable (default)1 for bandwidth2 for count (charp) 
 +parm:           min_links:Minimum number of available links before turning on carrier (int) 
 +parm:           xmit_hash_policy:balance-alb, balance-tlb, balance-xor, 802.3ad hashing method; 0 for layer 2 (default), 1 for layer 3+4, 2 for layer 2+3, 3 for encap layer 2+3, 4 for encap layer 3+4, 5 for vlan+srcmac (charp) 
 +parm:           arp_interval:arp interval in milliseconds (int) 
 +parm:           arp_ip_target:arp targets in n.n.n.n form (array of charp) 
 +parm:           arp_validate:validate src/dst of ARP probes; 0 for none (default)1 for active, 2 for backup, 3 for all (charp) 
 +parm:           arp_all_targets:fail on any/all arp targets timeout; 0 for any (default), for all (charp) 
 +parm          fail_over_mac:For active-backupdo not set all slaves to the same MAC; for none (default)1 for active2 for follow (charp) 
 +parm:           all_slaves_active:Keep all frames received on an interface by setting active flag for all slaves; 0 for never (default)1 for always. (int) 
 +parm:           resend_igmp:Number of IGMP membership reports to send on link failure (int) 
 +parm:           packets_per_slave:Packets to send per slave in balance-rr mode; 0 for a random slave, 1 packet per slave (default), >1 packets per slave. (int) 
 +parm:           lp_interval:The number of seconds between instances where the bonding driver sends learning packets to each slaves peer switch. The default is 1. (uint)
 </code> </code>
  
-===Command Line Switches===+Finally, files in the **/etc/modprobe.d** directory are used to specify certain options to be passed to modules when they are loaded and also any aliases used to refer to modules:
  
-The command line switches of this command are:+<code> 
 +[root@centos8 ~]# ls /etc/modprobe.d 
 +firewalld-sysctls.conf  lockd.conf  nvdimm-security.conf  tuned.conf 
 +kvm.conf                mlx4.conf   truescale.conf        vhost.conf
  
-<code> +[root@centos8 ~]# cat /etc/modprobe.d/kvm.conf  
-[root@centos8 ~]# lsusb --help +# Setting modprobe kvm_intel/kvm_amd nested = 1 
-Usage: lsusb [options]... +only enables Nested Virtualization until the next reboot or 
-List USB devices +# module reload. Uncomment the option applicable 
-  -v, --verbose +# to your system below to enable the feature permanently. 
-      Increase verbosity (show descriptors) +# 
-  -s [[bus]:][devnum] +# User changes in this file are preserved across upgrades. 
-      Show only devices with specified device and/or +
-      bus numbers (in decimal) +# For Intel 
-  -d vendor:[product] +#options kvm_intel nested=1 
-      Show only devices with the specified vendor and +# 
-      product ID numbers (in hexadecimal) +# For AMD 
- .LAB#1 +#options kvm_amd nested=1
-  -D device +
-      Selects which device lsusb will examine +
-  -t, --tree +
-      Dump the physical USB device hierarchy as a tree +
-  -V, --version +
-      Show version of program +
-  -h, --help +
-      Show usage and help+
 </code> </code>
  
-====1.3 The dmidecode Command====+=====LAB #2 Compiling and Installing a Kernel and Modules=====
  
-The **dmidecode** Command reads the **DMI** (//Desktop Management Interface//) table, also called the **SMBIOS** (//System Management BIOS//) and provides information on: +Firstly, activate the **CentOS-Linux-PowerTools** repository by setting the **enabled** directive to **1**:
- +
-  * the current status of each peripheral, +
-  * possible extensions.+
  
 <code> <code>
-[root@centos8 ~]# dmidecode +[root@centos8 ~]# vi /etc/yum.repos.d/CentOS-Linux-PowerTools.repo  
-dmidecode 3.2 +[root@centos8 ~]cat /etc/yum.repos.d/CentOS-Linux-PowerTools.repo  
-Getting SMBIOS data from sysfs+# CentOS-Linux-PowerTools.repo 
-SMBIOS 2.8 present+
-11 structures occupying 511 bytes+# The mirrorlist system uses the connecting IP address of the client and the 
-Table at 0x000F5870.+# update status of each mirror to pick current mirrors that are geographically 
 +# close to the client You should use this for CentOS updates unless you are 
 +# manually picking other mirrors
 +
 +# If the mirrorlist does not work for you, you can try the commented out 
 +# baseurl line instead.
  
-Handle 0x0000, DMI type 0, 24 bytes +[powertools] 
-BIOS Information +name=CentOS Linux $releasever - PowerTools 
-        VendorSeaBIOS +mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=PowerTools&infra=$infra 
-        Version: rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org +#baseurl=http://mirror.centos.org/$contentdir/$releasever/PowerTools/$basearch/os/ 
-        Release Date04/01/2014 +gpgcheck=
-        Address: 0xE8000 +enabled=
-        Runtime Size: 96 kB +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
-        ROM Size: 64 kB +
-        Characteristics: +
-                BIOS characteristics not supported +
-                Targeted content distribution is supported +
-        BIOS Revision: 0.+
- +
-Handle 0x0100, DMI type 1, 27 bytes +
-System Information +
-        Manufacturer: QEMU +
-        Product Name: Standard PC (i440FX + PIIX, 1996) +
-        Version: pc-i440fx-5.2 +
-        Serial Number: Not Specified +
-        UUID: 95bd69e3-4a74-44a7-b58c-b74fbfb86df2 +
-        Wake-up Type: Power Switch +
-        SKU Number: Not Specified +
-        Family: Not Specified +
- +
-Handle 0x0300, DMI type 3, 22 bytes +
-Chassis Information +
-        Manufacturer: QEMU +
-        Type: Other +
-        Lock: Not Present +
-        Version: pc-i440fx-5.2 +
-        Serial Number: Not Specified +
-        Asset Tag: Not Specified +
-        Boot-up State: Safe +
-        Power Supply State: Safe +
-        Thermal State: Safe +
-        Security Status: Unknown +
-        OEM Information: 0x00000000 +
-        Height: Unspecified +
-        Number Of Power Cords: Unspecified +
-        Contained Elements: 0 +
-        SKU Number: Not Specified +
- +
-Handle 0x0400, DMI type 4, 42 bytes +
-Processor Information +
-        Socket Designation: CPU 0 +
-        Type: Central Processor +
-        Family: Other +
-        Manufacturer: QEMU +
-        ID: 61 0F 00 00 FF FB 8B 07 +
-        Version: pc-i440fx-5.2 +
-        Voltage: Unknown +
-        External Clock: Unknown +
-        Max Speed: 2000 MHz +
-        Current Speed: 2000 MHz +
-        Status: Populated, Enabled +
-        Upgrade: Other +
-        L1 Cache Handle: Not Provided +
-        L2 Cache Handle: Not Provided +
-        L3 Cache Handle: Not Provided +
-        Serial Number: Not Specified +
-        Asset Tag: Not Specified +
-        Part Number: Not Specified +
-        Core Count: 4 +
-        Core Enabled: 4 +
-        Thread Count: +
-        Characteristics: None +
- +
-Handle 0x0401, DMI type 4, 42 bytes +
-Processor Information +
-        Socket Designation: CPU +
-        TypeCentral Processor +
-        Family: Other +
-        Manufacturer: QEMU +
-        ID: 61 0F 00 00 FF FB 8B 07 +
-        Version: pc-i440fx-5.2 +
-        Voltage: Unknown +
-        External Clock: Unknown +
-        Max Speed: 2000 MHz +
-        Current Speed: 2000 MHz +
-        Status: Populated, Enabled +
-        Upgrade: Other +
-        L1 Cache Handle: Not Provided +
-        L2 Cache Handle: Not Provided +
-        L3 Cache Handle: Not Provided +
-        Serial Number: Not Specified +
-        Asset Tag: Not Specified +
-        Part Number: Not Specified +
-        Core Count: 4 +
-        Core Enabled: 4 +
-        Thread Count: 1 +
-        Characteristics: None +
- +
-Handle 0x1000, DMI type 16, 23 bytes +
-Physical Memory Array +
-        Location: Other +
-        Use: System Memory +
-        Error Correction Type: Multi-bit ECC +
-        Maximum Capacity: 4 GB +
-        Error Information Handle: Not Provided +
-        Number Of Devices: 1 +
- +
-Handle 0x1100, DMI type 17, 40 bytes +
-Memory Device +
-        Array Handle: 0x1000 +
-        Error Information Handle: Not Provided +
-        Total Width: Unknown +
-        Data Width: Unknown +
-        Size: 4 GB +
-        Form Factor: DIMM +
-        Set: None +
-        Locator: DIMM 0 +
-        Bank Locator: Not Specified +
-        Type: RAM +
-        Type Detail: Other +
-        Speed: Unknown +
-        Manufacturer: QEMU +
-        Serial Number: Not Specified +
-        Asset Tag: Not Specified +
-        Part Number: Not Specified +
-        Rank: Unknown +
-        Configured Memory Speed: Unknown +
-        Minimum Voltage: Unknown +
-        Maximum Voltage: Unknown +
-        Configured Voltage: Unknown +
- +
-Handle 0x1300, DMI type 19, 31 bytes +
-Memory Array Mapped Address +
-        Starting Address: 0x00000000000 +
-        Ending Address: 0x000BFFFFFFF +
-        Range Size: 3 GB +
-        Physical Array Handle: 0x1000 +
-        Partition Width: 1 +
- +
-Handle 0x1301, DMI type 19, 31 bytes +
-Memory Array Mapped Address +
-        Starting Address: 0x00100000000 +
-        Ending Address: 0x0013FFFFFFF +
-        Range Size: 1 GB +
-        Physical Array Handle: 0x1000 +
-        Partition Width: 1 +
- +
-Handle 0x2000, DMI type 32, 11 bytes +
-System Boot Information +
-        Status: No errors detected +
- +
-Handle 0x7F00, DMI type 127, 4 bytes +
-End Of Table+
 </code> </code>
  
-===Command Line Switches=== +Now install the package group "Development Tools" and the packages required for compiling the Kernel:
- +
-The command line switches of this command are:+
  
 <code> <code>
-[root@centos7 ~]# dmidecode --help +[root@centos8 ~]# dnf groupinstall "Development Tools" 
-Usage: dmidecode [OPTIONS] +... 
-Options are: +[root@centos8 ~]# dnf install asciidoc audit-libs-devel bash bc binutils binutils-devel bison diffutils elfutils elfutils-devel elfutils-libelf-devel findutils flex gawk gcc gettext gzip hmaccalc hostname make module-init-tools ncurses-devel net-tools newt-devel numactl-devel openssl patch pciutils-devel perl perl-ExtUtils-Embed pesign redhat-rpm-config rpm-build rpmdevtools sh-utils tar xmlto xz zlib-devel 
- -d, --dev-mem FILE     Read memory from device FILE (default: /dev/mem) +...
- -h, --help             Display this help text and exit +
- -q, --quiet            Less verbose output +
- -s, --string KEYWORD   Only display the value of the given DMI string +
- -t, --type TYPE        Only display the entries of given type +
- -u, --dump             Do not decode the entries +
-     --dump-bin FILE    Dump the DMI data to a binary file +
-     --from-dump FILE   Read the DMI data from a binary file +
- -V, --version          Display the version and exit+
 </code> </code>
  
-=====LAB #2 - The sysctl Command=====+====2.1 Move /home====
  
-====2.1 The /proc Directory====+<WRAP center round alert 60%> 
 +**Important** You should not compile a Kernel as the root user for security reasons. To compile a Kernel a user requires **at least** 20 GB of free disk space in their home directory. 
 +</WRAP>
  
-The /proc directory contains virtual files and directories wich are created dynamically when consulted. Only root can consult all of the information in /proc. +<WRAP center round todo 60%
- +**To do** - **Log out** of your **CentOS8_SSH_10.0.2.45** session and open a new session using the **CentOS8_ROOT_10.0.2.45** connection. 
-<code+</WRAP>
-[root@centos8 ~]# ls /proc +
-1      16391  19    2212  2427  2622  431   59    84    999          mdstat +
-10     16476  1931  2215  2428  2659  432       842   acpi         meminfo +
-1007   16534  1956  2222  2431  2667  433   60    8465  buddyinfo    misc +
-11     16576  1960  2226  2432  2686  434   61    866   bus          modules +
-11805  16593      2230  2435  27    435   63    867   cgroups      mounts +
-12     16598  20    2237  2439  28    436   64    868   cmdline      mtrr +
-1219   16600  2007  2238  244   29    437   65    869   consoles     net +
-1228   16613  2029  2241  2443  3     44    6568  87    cpuinfo      pagetypeinfo +
-1232   16646  203   2244  2445  31    446   66    870   crypto       partitions +
-1234   16673  2034  2247  2449  32    45    67    871   devices      sched_debug +
-1235   16677  2037  2260  2451  33    46    674   872   diskstats    schedstat +
-1247   16711  2054  2262  2465  34    47    68    874   dma          scsi +
-13     16712  2062  2267  2472  35    4790  69    875   driver       self +
-1307   16729  21    2268  2473  37    49    70    878   execdomains  slabinfo +
-1339   16742  210   2274  2474  38    50    701   879   fb           softirqs +
-1356   17     2118  2275  2475  39    5076  71    880   filesystems  stat +
-14     1764   2121  2280  2476  4     51    714   884   fs           swaps +
-1441   180    2124  2287  2478  40    52    72    887   interrupts   sys +
-1443   181    2126  2292  2481  402   53    73    9     iomem        sysrq-trigger +
-1444   1817   2156  23    2484  41    532   74    901   ioports      sysvipc +
-1446   182    2160  2302  25    419   539   75    903   irq          thread-self +
-14977  1828   2164  2307  2536  420   55    76    9144  kallsyms     timer_list +
-15     1829   2165  2310  2539  421   568       916   kcore        tty +
-15067  183    2167  2330  2571  422   569   808   918   keys         uptime +
-1536   1845   2169  2332  2578  423   570   809   919   key-users    version +
-1553   185    2177  2349  2579  425   571   81    921   kmsg         vmallocinfo +
-15594  186    2187  2358  259   426   572   833   969   kpagecgroup  vmstat +
-15735  187    2190  2373  2593  427   573   835   986   kpagecount   zoneinfo +
-16     1880   2194  2384  26    428   574   837   989   kpageflags +
-16165  1883   22    239   2602  43    575   838   990   loadavg +
-16167  1888   2204  241   2608  430   576   839   993   locks +
-</code> +
- +
-===Files===+
  
-==/proc/cpuinfo==+Create a partition on **/dev/sdc** :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/cpuinfo +[root@centos8 ~]# fdisk /dev/sdc
-processor       : 0 +
-vendor_id       : GenuineIntel +
-cpu family      : 15 +
-model           : 6 +
-model name      : Common KVM processor +
-stepping        : 1 +
-microcode       : 0x1 +
-cpu MHz         : 1999.987 +
-cache size      : 16384 KB +
-physical id     : 0 +
-siblings        : 4 +
-core id         : 0 +
-cpu cores       : 4 +
-apicid          : 0 +
-initial apicid  : 0 +
-fpu             : yes +
-fpu_exception   : yes +
-cpuid level     : 13 +
-wp              : yes +
-flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti +
-bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit +
-bogomips        : 3999.97 +
-clflush size    : 64 +
-cache_alignment : 128 +
-address sizes   : 40 bits physical, 48 bits virtual +
-power management:+
  
-processor       : 1 +Welcome to fdisk (util-linux 2.32.1)
-vendor_id       : GenuineIntel +Changes will remain in memory onlyuntil you decide to write them. 
-cpu family      : 15 +Be careful before using the write command.
-model           : 6 +
-model name      : Common KVM processor +
-stepping        : 1 +
-microcode       : 0x1 +
-cpu MHz         : 1999.987 +
-cache size      : 16384 KB +
-physical id     : 0 +
-siblings        : 4 +
-core id         : 1 +
-cpu cores       : 4 +
-apicid          : 1 +
-initial apicid  : 1 +
-fpu             : yes +
-fpu_exception   : yes +
-cpuid level     : 13 +
-wp              : yes +
-flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti +
-bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit +
-bogomips        : 3999.97 +
-clflush size    : 64 +
-cache_alignment : 128 +
-address sizes   : 40 bits physical48 bits virtual +
-power management:+
  
-processor       : 2 +Device does not contain a recognized partition table
-vendor_id       : GenuineIntel +Created a new DOS disklabel with disk identifier 0xc321702b.
-cpu family      : 15 +
-model           : 6 +
-model name      : Common KVM processor +
-stepping        : 1 +
-microcode       : 0x1 +
-cpu MHz         : 1999.987 +
-cache size      : 16384 KB +
-physical id     : 0 +
-siblings        : 4 +
-core id         : 2 +
-cpu cores       : 4 +
-apicid          : 2 +
-initial apicid  : 2 +
-fpu             : yes +
-fpu_exception   : yes +
-cpuid level     : 13 +
-wp              : yes +
-flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti +
-bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit +
-bogomips        : 3999.97 +
-clflush size    : 64 +
-cache_alignment : 128 +
-address sizes   : 40 bits physical, 48 bits virtual +
-power management:+
  
-processor       3 +Command (m for help)n 
-vendor_id       : GenuineIntel +Partition type 
-cpu family      : 15 +   p   primary (primary, 0 extended, free) 
-model           : 6 +     extended (container for logical partitions) 
-model name      : Common KVM processor +Select (default p)
-stepping        : 1 +
-microcode       : 0x1 +
-cpu MHz         : 1999.987 +
-cache size      : 16384 KB +
-physical id     : 0 +
-siblings        : +
-core id         : 3 +
-cpu cores       : 4 +
-apicid          : 3 +
-initial apicid  : 3 +
-fpu             : yes +
-fpu_exception   : yes +
-cpuid level     : 13 +
-wp              : yes +
-flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti +
-bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit +
-bogomips        : 3999.97 +
-clflush size    : 64 +
-cache_alignment : 128 +
-address sizes   : 40 bits physical, 48 bits virtual +
-power management:+
  
-processor       : 4 +Using default response p
-vendor_id       : GenuineIntel +Partition number (1-4, default 1):  
-cpu family      : 15 +First sector (2048-41943039, default 2048):  
-model           : 6 +Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039)
-model name      : Common KVM processor +
-stepping        : 1 +
-microcode       : 0x1 +
-cpu MHz         : 1999.987 +
-cache size      : 16384 KB +
-physical id     : 1 +
-siblings        : 4 +
-core id         0 +
-cpu cores       4 +
-apicid          : 4 +
-initial apicid  : 4 +
-fpu             : yes +
-fpu_exception   : yes +
-cpuid level     : 13 +
-wp              : yes +
-flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti +
-bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit +
-bogomips        : 3999.97 +
-clflush size    : 64 +
-cache_alignment : 128 +
-address sizes   : 40 bits physical48 bits virtual +
-power management:+
  
-processor       : 5 +Created a new partition of type 'Linux' and of size 20 GiB.
-vendor_id       : GenuineIntel +
-cpu family      : 15 +
-model           : 6 +
-model name      : Common KVM processor +
-stepping        : 1 +
-microcode       : 0x1 +
-cpu MHz         : 1999.987 +
-cache size      : 16384 KB +
-physical id     : 1 +
-siblings        : 4 +
-core id         : 1 +
-cpu cores       : 4 +
-apicid          : 5 +
-initial apicid  : 5 +
-fpu             : yes +
-fpu_exception   : yes +
-cpuid level     : 13 +
-wp              : yes +
-flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti +
-bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit +
-bogomips        : 3999.97 +
-clflush size    : 64 +
-cache_alignment : 128 +
-address sizes   : 40 bits physical, 48 bits virtual +
-power management:+
  
-processor       6 +Command (m for help)w 
-vendor_id       : GenuineIntel +The partition table has been altered
-cpu family      : 15 +Calling ioctl() to re-read partition table
-model           : 6 +Syncing disks.
-model name      : Common KVM processor +
-stepping        : 1 +
-microcode       : 0x1 +
-cpu MHz         : 1999.987 +
-cache size      : 16384 KB +
-physical id     : 1 +
-siblings        : 4 +
-core id         : 2 +
-cpu cores       : 4 +
-apicid          : 6 +
-initial apicid  : 6 +
-fpu             : yes +
-fpu_exception   : yes +
-cpuid level     : 13 +
-wp              : yes +
-flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti +
-bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit +
-bogomips        : 3999.97 +
-clflush size    : 64 +
-cache_alignment : 128 +
-address sizes   : 40 bits physical, 48 bits virtual +
-power management: +
- +
-processor       : 7 +
-vendor_id       : GenuineIntel +
-cpu family      : 15 +
-model           : 6 +
-model name      : Common KVM processor +
-stepping        : 1 +
-microcode       : 0x1 +
-cpu MHz         : 1999.987 +
-cache size      : 16384 KB +
-physical id     : 1 +
-siblings        : 4 +
-core id         : 3 +
-cpu cores       : 4 +
-apicid          : 7 +
-initial apicid  : 7 +
-fpu             : yes +
-fpu_exception   : yes +
-cpuid level     : 13 +
-wp              : yes +
-flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx lm constant_tsc nopl xtopology cpuid tsc_known_freq pni cx16 x2apic hypervisor lahf_lm cpuid_fault pti +
-bugs            : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit +
-bogomips        : 3999.97 +
-clflush size    : 64 +
-cache_alignment : 128 +
-address sizes   : 40 bits physical, 48 bits virtual +
-power management:+
 </code> </code>
  
-==/proc/interrupts==+Now create an ext4 filesystem on **/dev/sdc1** :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/interrupts +[root@centos8 ~]# mkfs.ext4 /dev/sdc1 
-           CPU0       CPU1       CPU2       CPU3       CPU4       CPU5       CPU6       CPU7        +mke2fs 1.45.6 (20-Mar-2020) 
-  0:        109          0          0          0          0          0          0          0   IO-APIC   2-edge      timer +Discarding device blocksdone                             
-  1:          0          0          0          0          9          0          0          0   IO-APIC   1-edge      i8042 +Creating filesystem with 16776960 4k blocks and 4194304 inodes 
-  8                  0          0          0          0          1          0          0   IO-APIC   8-edge      rtc0 +Filesystem UUIDdc92c0d7-919b-4fff-8719-53e9e7e628dd 
-  9:          0          0          0          0          0          0          0          0   IO-APIC   9-fasteoi   acpi +Superblock backups stored on blocks:  
- 10                  0          0          0      47098          0          0          0   IO-APIC  10-fasteoi   virtio0 +        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,  
- 11:          0          0         31          0          0          0          0          0   IO-APIC  11-fasteoi   uhci_hcd:usb1 +        4096000, 7962624, 11239424
- 12                  0          0         15          0          0          0          0   IO-APIC  12-edge      i8042 +
- 14:          0          0          0          0          0          0          0          0   IO-APIC  14-edge      ata_piix +
- 15:       7376          0        144          0          0          0          0      84588   IO-APIC  15-edge      ata_piix +
- 24:          0          0          0          0          0          0          0          0   PCI-MSI 294912-edge      virtio1-config +
- 25:          0          0          0          0          0       5640          0         16   PCI-MSI 294913-edge      virtio1-input.0 +
- 26:         36          0          0       5058          0          0          0          0   PCI-MSI 294914-edge      virtio1-output.0 +
- 27:          0      16008          0       9431          0          0          0          0   PCI-MSI 114688-edge      ahci[0000:00:07.0] +
-NMI:          0          0          0          0          0          0          0          0   Non-maskable interrupts +
-LOC:     870537     771900    1117711     288839     833717     502365     758229     405110   Local timer interrupts +
-SPU:          0          0          0          0          0          0          0          0   Spurious interrupts +
-PMI:          0          0          0          0          0          0          0          0   Performance monitoring interrupts +
-IWI:          0          0          0          0          2          0          0          0   IRQ work interrupts +
-RTR:          0          0          0          0          0          0          0          0   APIC ICR read retries +
-RES:     178171      67749      43116      65994      71361     118585      54139      53452   Rescheduling interrupts +
-CAL:      11095      11007      10841      10343      14679       9998      12165      12443   Function call interrupts +
-TLB:       2295       2297       2000       1728       2330       2338       1991       1861   TLB shootdowns +
-TRM:          0          0          0          0          0          0          0          0   Thermal event interrupts +
-THR:          0          0          0          0          0          0          0          0   Threshold APIC interrupts +
-DFR:          0          0          0          0          0          0          0          0   Deferred Error APIC interrupts +
-MCE:          0          0          0          0          0          0          0          0   Machine check exceptions +
-MCP:        288        288        288        288        288        288        288        288   Machine check polls +
-HYP:          0          0          0          0          0          0          0          0   Hypervisor callback interrupts +
-HRE:          0          0          0          0          0          0          0          0   Hyper-V reenlightenment interrupts +
-HVS:          0          0          0          0          0          0          0          0   Hyper-V stimer0 interrupts +
-ERR:          0 +
-MIS:          0 +
-PIN:          0          0          0          0          0          0          0          0   Posted-interrupt notification event +
-NPI:          0          0          0          0          0          0          0          0   Nested posted-interrupt event +
-PIW:          0          0          0          0          0          0          0          0   Posted-interrupt wakeup event +
-</code>+
  
-<WRAP center round important 60%> +Allocating group tables: done                             
-**Important** The use of an IRQ by a peripheral is exclusive. +Writing inode tablesdone                             
-</WRAP>  +Creating journal (65536 blocks): done 
- +Writing superblocks and filesystem accounting informationdone 
-==/proc/dma== +
- +
-<code> +
-[root@centos8 ~]# cat /proc/dma +
- 4cascade+
 </code> </code>
  
-==/proc/ioports==+Mount **/dev/sdc1** on /mnt :
  
 <code> <code>
-root@centos8 ~]# cat /proc/ioports | more +[root@centos8 ~]# mount /dev/sdc1 /mnt
-0000-0cf7 : PCI Bus 0000:00 +
-  0000-001f : dma1 +
-  0020-0021 : pic1 +
-  0040-0043 : timer0 +
-  0050-0053 : timer1 +
-  0060-0060 : keyboard +
-  0064-0064 : keyboard +
-  0070-0077 : rtc0 +
-  0080-008f : dma page reg +
-  00a0-00a1 : pic2 +
-  00c0-00df : dma2 +
-  00f0-00ff : fpu +
-  0170-0177 : 0000:00:01.1 +
-    0170-0177 : ata_piix +
-  01f0-01f7 : 0000:00:01.1 +
-    01f0-01f7 : ata_piix +
-  0376-0376 : 0000:00:01.1 +
-    0376-0376 : ata_piix +
-  03c0-03df : vga+ +
-  03f6-03f6 : 0000:00:01.1 +
-    03f6-03f6 : ata_piix +
---More--+
 </code> </code>
  
-<WRAP center round alert 60%> +Copy the content of /home to /mnt :
-**Important** - If two peripherals use the same IO Port, both become unusable. +
-</WRAP> +
- +
-==/proc/devices==+
  
 <code> <code>
-[root@centos8 ~]# cat /proc/devices +[root@centos8 ~]# cp -a /home//mnt
-Character devices: +
-  1 mem +
-  4 /dev/vc/0 +
-  4 tty +
-  4 ttyS +
-  5 /dev/tty +
-  5 /dev/console +
-  5 /dev/ptmx +
-  7 vcs +
- 10 misc +
- 13 input +
- 21 sg +
- 29 fb +
-128 ptm +
-136 pts +
-162 raw +
-180 usb +
-188 ttyUSB +
-189 usb_device +
-202 cpu/msr +
-203 cpu/cpuid +
-226 drm +
-244 aux +
-245 hidraw +
-246 usbmon +
-247 bsg +
-248 watchdog +
-249 ptp +
-250 pps +
-251 rtc +
-252 dax +
-253 tpm +
-254 gpiochip +
- +
-Block devices: +
-  8 sd +
-  9 md +
- 11 sr +
- 65 sd +
- 66 sd +
- 67 sd +
- 68 sd +
- 69 sd +
- 70 sd +
- 71 sd +
-128 sd +
-129 sd +
-130 sd +
-131 sd +
-132 sd +
-133 sd +
-134 sd +
-135 sd +
-253 device-mapper +
-254 mdp +
-259 blkext+
 </code> </code>
  
-==/proc/modules==+Unmount /dev/sdc1 and move /home to /root :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/modules | more +[root@centos8 ~]# umount /mnt 
-xt_CHECKSUM 16384 1 - Live 0xffffffffc09a8000 +[root@centos8 ~]# mv /home /root
-ipt_MASQUERADE 16384 3 - Live 0xffffffffc09a3000 +
-xt_conntrack 16384 1 - Live 0xffffffffc099e000 +
-ipt_REJECT 16384 2 - Live 0xffffffffc0999000 +
-nft_compat 20480 16 - Live 0xffffffffc0993000 +
-nf_nat_tftp 16384 0 - Live 0xffffffffc098b000 +
-nft_objref 16384 1 - Live 0xffffffffc0986000 +
-nf_conntrack_tftp 16384 3 nf_nat_tftp, Live 0xffffffffc0981000 +
-nft_counter 16384 33 - Live 0xffffffffc097c000 +
-tun 53248 1 - Live 0xffffffffc096e000 +
-bridge 192512 0 - Live 0xffffffffc093e000 +
-stp 16384 1 bridge, Live 0xffffffffc0939000 +
-llc 16384 2 bridge,stp, Live 0xffffffffc0930000 +
-nft_fib_inet 16384 1 - Live 0xffffffffc08f5000 +
-nft_fib_ipv4 16384 1 nft_fib_inet, Live 0xffffffffc08ed000 +
-nft_fib_ipv6 16384 1 nft_fib_inet, Live 0xffffffffc08e8000 +
-nft_fib 16384 3 nft_fib_inet,nft_fib_ipv4,nft_fib_ipv6, Live 0xffffffffc08e3000 +
-nft_reject_inet 16384 5 - Live 0xffffffffc08de000 +
-nf_reject_ipv4 16384 2 ipt_REJECT,nft_reject_inet, Live 0xffffffffc08d9000 +
-nf_reject_ipv6 16384 1 nft_reject_inet, Live 0xffffffffc08d4000 +
-nft_reject 16384 1 nft_reject_inet, Live 0xffffffffc08cf000 +
---More--+
 </code> </code>
  
-==/proc/diskstats==+Get the UUID of /dev/sdc1 :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/diskstats +[root@centos8 ~]# ls -l /dev/disk/by-uuid/ | grep sdc1 
-         0 sda 15481 112 1445637 154103 10272 2377 277530 890611 0 237219 1044714 0 0 0 0 +lrwxrwxrwx. root root 10 Jul 19 12:02 f76d6b66-985b-4a91-af9c-4987e8c1443c -> ../../sdc 
-   8       sda1 402 3 66754 13349 31 18 392 4632 0 2824 17981 0 0 0 0 +[root@centos8 ~]# 
-         2 sda2 14915 109 1375516 140528 8450 2359 277138 869788 0 225416 1010316 0 0 0 0 +
-        16 sdb 230 0 5991 36 0 0 0 0 0 110 36 0 0 0 0 +
-  11       0 sr0 10 0 4 2 0 0 0 0 0 9 2 0 0 0 0 +
- 253       0 dm-0 11651 0 1364532 72138 12121 0 288727 1208138 0 227630 1280276 0 0 0 0 +
- 253       1 dm-1 104 0 4440 79 0 0 0 0 0 71 79 0 0 0 0+
 </code> </code>
  
-==/proc/partitions==+Edit the **/etc/fstab** file add a line for /dev/sdc1:
  
 <code> <code>
-[root@centos8 ~]# cat /proc/partitions +[root@centos8 ~]# vi /etc/fstab 
-major minor  #blocks  name+[root@centos8 ~]cat /etc/fstab
  
-          0   33554432 sda +# 
-   8        1    1048576 sda1 +# /etc/fstab 
-   8        2   32504832 sda2 +# Created by anaconda on Wed Jun 16 06:21:32 2021 
-         16    4194304 sdb +
-  11        0    1048575 sr0 +# Accessible filesystems, by reference, are maintained under '/dev/disk/'
- 253          29143040 dm-+# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. 
- 253           3358720 dm-1+# 
 +# After editing this file, run 'systemctl daemon-reload' to update systemd 
 +# units generated from this file. 
 +
 +/dev/mapper/cl_centos8-root /                       xfs     defaults        0 0 
 +UUID=1c04981e-5317-4b73-9695-3ce25246835d /boot                   ext4    defaults        
 +/dev/mapper/cl_centos8-swap swap                    swap    defaults        0 0 
 +UUID=f76d6b66-985b-4a91-af9c-4987e8c1443c /home     ext4          defaults            2
 </code> </code>
  
-==/proc/swaps==+Create a new mount point foe /home:
  
 <code> <code>
-[root@centos8 ~]# cat /proc/swaps +[root@centos8 ~]# mkdir /home
-Filename                                Type            Size    Used    Priority +
-/dev/dm-1                               partition       3358716 0       -2+
 </code> </code>
  
-==/proc/loadavg==+Mount /dev/sdc1 :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/loadavg +[root@centos8 ~]# mount -a 
-0.00 0.00 0.00 1/697 16936+[root@centos8 ~]# mount 
 +sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel) 
 +proc on /proc type proc (rw,nosuid,nodev,noexec,relatime) 
 +devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=1882880k,nr_inodes=470720,mode=755) 
 +securityfs on /sys/kernel/security type securityfs (rw,nosuid,nodev,noexec,relatime) 
 +tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev,seclabel) 
 +devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000) 
 +tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,mode=755) 
 +tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,seclabel,mode=755) 
 +cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd) 
 +pstore on /sys/fs/pstore type pstore (rw,nosuid,nodev,noexec,relatime,seclabel) 
 +bpf on /sys/fs/bpf type bpf (rw,nosuid,nodev,noexec,relatime,mode=700) 
 +cgroup on /sys/fs/cgroup/hugetlb type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,hugetlb) 
 +cgroup on /sys/fs/cgroup/memory type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,memory) 
 +cgroup on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,cpu,cpuacct) 
 +cgroup on /sys/fs/cgroup/rdma type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,rdma) 
 +cgroup on /sys/fs/cgroup/pids type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,pids) 
 +cgroup on /sys/fs/cgroup/cpuset type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,cpuset) 
 +cgroup on /sys/fs/cgroup/perf_event type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,perf_event) 
 +cgroup on /sys/fs/cgroup/freezer type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,freezer) 
 +cgroup on /sys/fs/cgroup/blkio type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,blkio) 
 +cgroup on /sys/fs/cgroup/net_cls,net_prio type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,net_cls,net_prio) 
 +cgroup on /sys/fs/cgroup/devices type cgroup (rw,nosuid,nodev,noexec,relatime,seclabel,devices) 
 +none on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) 
 +configfs on /sys/kernel/config type configfs (rw,relatime) 
 +/dev/mapper/cl_centos8-root on / type xfs (rw,relatime,seclabel,attr2,inode64,logbufs=8,logbsize=32k,noquota) 
 +selinuxfs on /sys/fs/selinux type selinuxfs (rw,relatime) 
 +mqueue on /dev/mqueue type mqueue (rw,relatime,seclabel) 
 +hugetlbfs on /dev/hugepages type hugetlbfs (rw,relatime,seclabel,pagesize=2M) 
 +debugfs on /sys/kernel/debug type debugfs (rw,relatime,seclabel) 
 +systemd-1 on /proc/sys/fs/binfmt_misc type autofs (rw,relatime,fd=40,pgrp=1,timeout=0,minproto=5,maxproto=5,direct,pipe_ino=6022) 
 +fusectl on /sys/fs/fuse/connections type fusectl (rw,relatime) 
 +/dev/sda1 on /boot type ext4 (rw,relatime,seclabel) 
 +sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw,relatime) 
 +tmpfs on /run/user/1000 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=382500k,mode=700,uid=1000,gid=1000) 
 +tmpfs on /run/user/42 type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=382500k,mode=700,uid=42,gid=42) 
 +gvfsd-fuse on /run/user/1000/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000) 
 +tmpfs on /run/user/type tmpfs (rw,nosuid,nodev,relatime,seclabel,size=382500k,mode=700) 
 +gvfsd-fuse on /run/user/0/gvfs type fuse.gvfsd-fuse (rw,nosuid,nodev,relatime,user_id=0,group_id=0) 
 +/dev/sdc1 on /home type ext4 (rw,relatime,seclabel)
 </code> </code>
  
-==/proc/meminfo==+Check the current size of /home :
  
 <code> <code>
-[root@centos8 ~]# cat /proc/meminfo +[root@centos8 ~]# df -h 
-MemTotal:        3825032 kB +Filesystem                   Size  Used Avail Use% Mounted on 
-MemFree:         1862116 kB +devtmpfs                     1.8G      1.8G   0% /dev 
-MemAvailable:    2420560 kB +tmpfs                        1.9G     0  1.9G   0% /dev/shm 
-Buffers:            3300 kB +tmpfs                        1.9G  9.4M  1.9G   1% /run 
-Cached:           750496 kB +tmpfs                        1.9G     0  1.9G   0% /sys/fs/cgroup 
-SwapCached:            kB +/dev/mapper/cl_centos8-root   28G  5.2G   23G  19% / 
-Active:           315572 kB +/dev/sda1                    976M  289M  620M  32% /boot 
-Inactive:        1400260 kB +tmpfs                        374M   16K  374M   1% /run/user/1000 
-Active(anon):       1856 kB +tmpfs                        374M  1.2M  373M   1% /run/user/42 
-Inactive(anon):   974728 kB +/dev/sdc1                     63G   67M   60G   1% /home
-Active(file):     313716 kB +
-Inactive(file):   425532 kB +
-Unevictable:           kB +
-Mlocked:               0 kB +
-SwapTotal:       3358716 kB +
-SwapFree:        3358716 kB +
-Dirty:                 0 kB +
-Writeback:             0 kB +
-AnonPages:        962004 kB +
-Mapped:           261084 kB +
-Shmem:             14552 kB +
-KReclaimable:      46980 kB +
-Slab:             118396 kB +
-SReclaimable:      46980 kB +
-SUnreclaim:        71416 kB +
-KernelStack:       11280 kB +
-PageTables:        46532 kB +
-NFS_Unstable:          0 kB +
-Bounce:                0 kB +
-WritebackTmp:          0 kB +
-CommitLimit:     5271232 kB +
-Committed_AS:    5072744 kB +
-VmallocTotal:   34359738367 kB +
-VmallocUsed:           0 kB +
-VmallocChunk:          0 kB +
-Percpu:             5920 kB +
-HardwareCorrupted:     0 kB +
-AnonHugePages:    546816 kB +
-ShmemHugePages:        kB +
-ShmemPmdMapped:        0 kB +
-FileHugePages:         0 kB +
-FilePmdMapped:         0 kB +
-HugePages_Total:       0 +
-HugePages_Free:        0 +
-HugePages_Rsvd:        0 +
-HugePages_Surp:        0 +
-Hugepagesize:       2048 kB +
-Hugetlb:               0 kB +
-DirectMap4k:      173944 kB +
-DirectMap2M:     4020224 kB+
 </code> </code>
  
-==/proc/version==+<WRAP center round todo 60%> 
 +**To do** - **Log out** of your **CentOS8_ROOT_10.0.2.45** session and open a new session using the **CentOS8_SSH_10.0.2.45** connection. 
 +</WRAP>
  
-<code> +====2.Preparing the Environment====
-[root@centos8 ~]# cat /proc/version +
-Linux version 4.18.0-305.3.1.el8.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 8.4.1 20200928 (Red Hat 8.4.1-1) (GCC)) #1 SMP Tue Jun 1 16:14:33 UTC 2021 +
-</code>+
  
-===Répertoires===+To create the Kernel Source Tree in /home/trainee, use the **rpmdev-setuptree** command:
  
-==ide/scsi==+<code> 
 +[trainee@centos8 ~]$ rpmdev-setuptree 
 +...> 
 +[trainee@centos8 ~]$ ls -laR rpmbuild/ 
 +rpmbuild/: 
 +total 28 
 +drwxrwxr-x.  7 trainee trainee 4096 Jul 19 12:10 . 
 +drwxr-xr-x. 17 trainee trainee 4096 Jul 19 12:10 .. 
 +drwxrwxr-x.  2 trainee trainee 4096 Jul 19 12:10 BUILD 
 +drwxrwxr-x.  2 trainee trainee 4096 Jul 19 12:10 RPMS 
 +drwxrwxr-x.  2 trainee trainee 4096 Jul 19 12:10 SOURCES 
 +drwxrwxr-x.  2 trainee trainee 4096 Jul 19 12:10 SPECS 
 +drwxrwxr-x.  2 trainee trainee 4096 Jul 19 12:10 SRPMS
  
-This sub-directory contains disk capacity, disk type and disk geometry information.+rpmbuild/BUILD: 
 +total 8 
 +drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . 
 +drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 ..
  
-==acpi==+rpmbuild/RPMS: 
 +total 8 
 +drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . 
 +drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 ..
  
-This sub-directory contains information on energy management, temperatures, fan speeds and battery levels.+rpmbuild/SOURCES: 
 +total 8 
 +drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . 
 +drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 ..
  
-==bus==+rpmbuild/SPECS: 
 +total 8 
 +drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . 
 +drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 ..
  
-This sub-directory contains a sub-directory for each bus.+rpmbuild/SRPMS: 
 +total 8 
 +drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . 
 +drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. 
 +</code>
  
-==net==+Download the Kernel source RPM:
  
-This sub-directory contains information concerning the network.+<code> 
 +[trainee@centos8 ~]$ uname -
 +Linux centos8.ittraining.loc 4.18.0-305.7.1.el8_4.x86_64 #1 SMP Tue Jun 29 21:55:12 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  
-==sys==+[trainee@centos8 ~]$ cat /etc/centos-release 
 +CentOS Linux release 8.4.2105
  
-This sub-directory contains files used by root to configure the kernel. For instancethe following command configiresthe kernel to ignore incoming pings:+[trainee@centos8 ~]$ wget https://vault.centos.org/8.4.2105/BaseOS/Source/SPackages/kernel-4.18.0-305.7.1.el8_4.src.rpm 
 +--2021-07-14 02:54:14--  https://vault.centos.org/8.4.2105/BaseOS/Source/SPackages/kernel-4.18.0-305.7.1.el8_4.src.rpm 
 +Resolving vault.centos.org (vault.centos.org)... 81.171.33.1942a05:d014:10:7803:4af1:9320:7050:d28e 
 +Connecting to vault.centos.org (vault.centos.org)|81.171.33.194|:443... connected. 
 +HTTP request sent, awaiting response... 200 OK 
 +Length: 123000617 (117M) [application/x-rpm] 
 +Saving to: ‘kernel-4.18.0-305.7.1.el8_4.src.rpm’
  
-  # echo 1 > /proc/sys/net/ipv4/icmp_echo_ignore_all [Enter]+kernel-4.18.0-305.7.1. 100%[===========================>] 117.30M  1.49MB/s    in 79s     
  
-====2.Using the sysctl Command==== +2021-07-14 02:55:33 (1.49 MB/s) ‘kernel-4.18.0-305.7.1.el8_4.src.rpm’ saved [123000617/123000617] 
- +</code>
-Files in the **/proc/sys** can be administered by using the **sysctl** command. +
  
-The **sysctl** command applies rules at system boot that are defined in the **/etc/sysctl.conf** file:+Now install the required dependencies:
  
 <code> <code>
-[root@centos8 ~]# cat /etc/sysctl.conf +[trainee@centos8 ~]$ su - 
-# sysctl settings are defined through files in +Mot de passe : fenestros
-# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/+
-+
-# Vendors settings live in /usr/lib/sysctl.d/+
-# To override a whole file, create a new file with the same in +
-# /etc/sysctl.d/ and put new settings there. To override +
-# only specific settings, add a file with a lexically later +
-# name in /etc/sysctl.d/ and put new settings there. +
-+
-# For more information, see sysctl.conf(5) and sysctl.d(5).+
  
-[root@centos8 ~]# ls -l /etc/sysctl.d/ +[root@centos8 ~]# dnf install yum-utils 
-total 0 +...
-lrwxrwxrwx1 root root 14 Mar 16 15:42 99-sysctl.conf -> ../sysctl.conf +
-[root@centos8 ~]# ls -l /usr/lib/sysctl.d/ +
-total 24 +
--rw-r--r--. 1 root root 1810 Dec 22  2020 10-default-yama-scope.conf +
--rw-r--r--. 1 root root  524 Mar 16 15:42 50-coredump.conf +
--rw-r--r--. 1 root root 1270 Mar 16 15:42 50-default.conf +
--rw-r--r--. 1 root root  246 Jun 15  2020 50-libkcapi-optmem_max.conf +
--rw-r--r--. 1 root root  636 Mar 16 15:42 50-pid-max.conf +
--rw-r--r--. 1 root root  499 Nov 26  2019 60-libvirtd.conf+
  
-[root@centos8 ~]# cat /usr/lib/sysctl.d/50-default.conf  +[root@centos8 ~]# yum-builddep /home/trainee/kernel-4.18.0-305.7.1.el8_4.src.rpm  
-#  This file is part of systemd. +... 
-+</code>
-#  systemd is free software; you can redistribute it and/or modify it +
-#  under the terms of the GNU Lesser General Public License as published by +
-#  the Free Software Foundation; either version 2.1 of the License, or +
-#  (at your option) any later version.+
  
-# See sysctl.d(5) and core(5) for documentation.+Install the **kernel-4.18.0-305.7.1.el8_4.src.rpm** package:
  
-# To override settings in this file, create a local file in /etc +<code> 
-(e.g/etc/sysctl.d/90-override.conf), and put any assignments +[root@centos8 ~]exit 
-there.+logout 
 +[trainee@centos8 ~]$ rpm -Uvh kernel-4.18.0-305.7.1.el8_4.src.rpm 
 +Updating installing... 
 +   1:kernel-4.18.0-305.7.1.el8_4      warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +################################# [100%] 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +warning: user mockbuild does not exist - using root 
 +warning: group mockbuild does not exist - using root 
 +</code>
  
-# System Request functionality of the kernel (SYNC) +<WRAP center round important 60%> 
-+**Important** - Note that the errors are not important
-# Use kernel.sysrq = 1 to allow all keys+</WRAP>
-# See https://www.kernel.org/doc/html/latest/admin-guide/sysrq.html for a list +
-# of values and keys. +
-kernel.sysrq = 16+
  
-# Append the PID to the core filename +====2.3 - Preparing the Kernel Source Tree====
-kernel.core_uses_pid 1+
  
-# https://bugzilla.redhat.com/show_bug.cgi?id=1689346 +Move to the **~/rpmbuild/SPECS** directory and use the **rpmbuild** command to create the Kernel Source Tree:
-kernel.kptr_restrict = 1+
  
-# Source route verification +<code> 
-net.ipv4.conf.all.rp_filter = 1 +[trainee@centos7 ~]$ cd ~/rpmbuild/SPECS 
- +[trainee@centos7 SPECS]$ rpmbuild -bp --target=$(uname -m) kernel.spec 
-# Do not accept source routing +...
-net.ipv4.conf.all.accept_source_route +
- +
-# Promote secondary addresses when the primary address is removed +
-net.ipv4.conf.all.promote_secondaries = 1 +
- +
-# Fair Queue CoDel packet scheduler to fight bufferbloat +
-net.core.default_qdisc = fq_codel +
- +
-# Enable hard and soft link protection +
-fs.protected_hardlinks = 1 +
-fs.protected_symlinks = 1+
 </code> </code>
  
-The command line switches of this command are:+At the end of the process, check what has been created:
  
 <code> <code>
-Usage: +[trainee@centos8 SPECS]$ ls -la ~/rpmbuild/BUILD/kernel-4.18.0-305.7.1.el8_4/linux-4.18.0-305.7.1.el8.x86_64/ 
- sysctl [options] [variable[=value] ...] +total 812 
- +drwxr-xr-x.  26 trainee trainee   4096 Jul 14 03:13 . 
-Options+drwxr-xr-x.   3 trainee trainee   4096 Jul 14 03:12 .. 
-  -a, --all            display all variables +drwxr-xr-x.  27 trainee trainee   4096 Jul 14 03:13 arch 
-  -A                   alias of -a +drwxr-xr-x.   3 trainee trainee   4096 Jun 14 10:33 block 
-  -X                   alias of -a +drwxr-xr-x.   2 trainee trainee   4096 Jul 14 03:13 certs 
-      --deprecated     include deprecated parameters to listing +-rw-r--r--.   1 trainee trainee  13079 Jun 14 10:33 .clang-format 
-  -b, --binary         print value without new line +-rw-r--r--.   1 trainee trainee     59 Jun 14 10:33 .cocciconfig 
-  -e, --ignore         ignore unknown variables errors +drwxr-xr-x.   2 trainee trainee   4096 Jul 14 03:13 configs 
-  -N, --names          print variable names without values +-rw-r--r--.   1 trainee trainee    423 Jun 14 10:33 COPYING-4.18.0 
-  -n, --values         print only values of the given variable(s) +-rw-r--r--.   1 trainee trainee  98651 Jun 14 10:33 CREDITS 
-  -p, --load[=<file> read values from file +drwxr-xr-x.   4 trainee trainee   4096 Jun 14 10:33 crypto 
-  -f                   alias of -p +drwxr-xr-x. 119 trainee trainee   4096 Jul 14 03:13 Documentation 
-      --system         read values from all system directories +drwxr-xr-x. 137 trainee trainee   4096 Jun 14 10:33 drivers 
-  -r--pattern <expression> +drwxr-xr-x.   2 trainee trainee   4096 Jul 14 03:13 firmware 
-                       select setting that match expression +drwxr-xr-x.  73 trainee trainee   4096 Jun 14 10:33 fs 
-  -q, --quiet          do not echo variable set +-rw-r--r--.   1 trainee trainee     68 Jun 14 10:33 .get_maintainer.conf 
-  -w, --write          enable writing a value to variable +-rw-r--r--.   1 trainee trainee     31 Jun 14 10:33 .get_maintainer.ignore 
-  -o                   does nothing +-rw-r--r--.   1 trainee trainee     76 Jun 14 10:33 .gitattributes 
-  -x                   does nothing +-rw-r--r--.   1 trainee trainee   1639 Jun 14 10:33 .gitlab-ci-private.yml 
-  -d                   alias of -h +-rw-r--r--.   1 trainee trainee   1668 Jun 14 10:33 .gitlab-ci.yml 
- +drwxr-xr-x.  30 trainee trainee   4096 Jun 14 10:33 include 
- -h, --help     display this help and exit +drwxr-xr-x.   2 trainee trainee   4096 Jun 14 10:33 init 
- -V, --version  output version information and exit +drwxr-xr-x.   2 trainee trainee   4096 Jun 14 10:33 ipc 
- +-rw-r--r--.   1 trainee trainee   2245 Jun 14 10:33 Kbuild 
-For more details see sysctl(8).+-rw-r--r--.   1 trainee trainee    575 Jun 14 10:33 Kconfig 
 +drwxr-xr-x.  19 trainee trainee   4096 Jul 14 03:13 kernel 
 +drwxr-xr-x.  20 trainee trainee  12288 Jul 14 03:13 lib 
 +drwxr-xr-x.   5 trainee trainee   4096 Jun 14 10:33 LICENSES 
 +-rw-r--r--.   1 trainee trainee   9559 Jun 14 10:33 .mailmap 
 +-rw-r--r--.   1 trainee trainee 471696 Jun 14 10:33 MAINTAINERS 
 +-rw-r--r--.   1 trainee trainee  61558 Jun 14 10:33 Makefile 
 +-rw-r--r--.   1 trainee trainee   1324 Jun 14 10:33 Makefile.rhelver 
 +-rw-r--r--.   1 trainee trainee      0 Jul 14 03:13 .mismatches 
 +drwxr-xr-x.   3 trainee trainee   4096 Jun 14 10:33 mm 
 +drwxr-xr-x.  72 trainee trainee   4096 Jun 14 10:33 net 
 +-rw-r--r--.   1 trainee trainee    800 Jun 14 10:33 README 
 +drwxr-xr-x.  28 trainee trainee   4096 Jun 14 10:33 samples 
 +-rw-r--r--.   1 trainee trainee      0 Jul 14 03:12 .scmversion 
 +drwxr-xr-x.  14 trainee trainee   4096 Jul 14 03:13 scripts 
 +drwxr-xr-x.  10 trainee trainee   4096 Jun 14 10:33 security 
 +drwxr-xr-x.  26 trainee trainee   4096 Jun 14 10:33 sound 
 +drwxr-xr-x 33 trainee trainee   4096 Jun 14 10:33 tools 
 +drwxr-xr-x.   2 trainee trainee   4096 Jul 14 03:13 usr 
 +drwxr-xr-x.   4 trainee trainee   4096 Jun 14 10:33 virt
 </code> </code>
  
-=====LAB#3 - Interpreting Information in /proc===== +===The .config File===
- +
-The information found in files in the /proc filesystem can be interpreted using the following commands: +
- +
-  * free, +
-  * uptime et w, +
-  * iostat, +
-  * hdparm +
-  * vmstat, +
-  * mpstat, +
-  * sar +
- +
-====3.1 - The free Command====+
  
-The **free** command shows total, used, free, shared, buffered, cached and swapped memory:+Move to **~/rpmbuild/BUILD/kernel-*/linux-*/**:
  
 <code> <code>
-[root@centos8 ~]# free -+[trainee@centos8 SPECS]$ cd ~/rpmbuild/BUILD/kernel-*/linux-*/
-              total        used        free      shared  buff/cache   available +
-Mem:           3735        1135        1818          14         782        2363 +
-Swap:          3279                  3279+
 </code> </code>
  
-In the above example, you can see: +Copy the **configs/kernel-4.18.0-`uname -m`.config** file to **.config** in the current working directory:
- +
-  3735 MB of total physical memory, +
-  1135 MB of used physical memory and 1818 MB of free physical memory, +
-  3279 MB of swap space with 0MB being used. +
- +
-The command line switches of this command are:+
  
 <code> <code>
-[root@centos8 ~]# free --help +[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp configs/kernel-4.18.0-`uname -m`.config .config
- +
-Usage: +
- free [options] +
- +
-Options: +
- -b, --bytes         show output in bytes +
-     --kilo          show output in kilobytes +
-     --mega          show output in megabytes +
-     --giga          show output in gigabytes +
-     --tera          show output in terabytes +
-     --peta          show output in petabytes +
- -k, --kibi          show output in kibibytes +
- -m, --mebi          show output in mebibytes +
- -g, --gibi          show output in gibibytes +
-     --tebi          show output in tebibytes +
-     --pebi          show output in pebibytes +
- -h, --human         show human-readable output +
-     --si            use powers of 1000 not 1024 +
- -l, --lohi          show detailed low and high memory statistics +
- -t, --total         show total for RAM + swap +
- -s N, --seconds N   repeat printing every N seconds +
- -c N, --count N     repeat printing N times, then exit +
- -w, --wide          wide output +
- +
-     --help     display this help and exit +
- -V, --version  output version information and exit +
- +
-For more details see free(1).+
 </code> </code>
  
-====3.2 - The uptime and w Commands==== +Update the .config file with the configuration Kernel settings:
- +
-Each of these commands show the load average over the past 1, 5 and 15 minutes:+
  
 <code> <code>
-[root@centos8 ~]# uptime +[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ make oldconfig 
- 04:39:03 up 1 day,  2:34,  1 user,  load average: 0.00, 0.00, 0.00 +scripts/kconfig/conf  --oldconfig Kconfig 
-  +
-[root@centos8 ~]# w +# configuration written to .config 
- 04:39:04 up day,  2:34,  1 user,  load average: 0.00, 0.00, 0.00 +#
-USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT +
-trainee  pts/0    10.0.2.1         03:58    0.00s  0.11s  0.02s sshd: trainee [priv]+
 </code> </code>
  
-The **load average** indicates the number of processes being executed and waiting to be executed for the period concerned.+<WRAP center round important 60%> 
 +**Important** - The above command reads the .config file of the current Kernel and compares the contents with the new configuration. In the case where there are any new configurations that are required, the command asks for the relevant information. 
 +</WRAP>
  
-If the load average of a single-core system was **3.48  4.00  3.85** this would indicate a bottleneck since, on average:+The **.config** file is generated by one of three binaries and should not be edited manually:
  
-  * 2.48 processes would have been waiting to be executed over the last minute, +  * make config 
-  * 3.00 processes would have been waiting to be executed over the last 5 minutes, +  * make menuconfig 
-  * 2.85 processes would have been waiting to be executed over the last 15 minutes, +  * make xconfig 
- +   
-The command line switches of these commands are:+Run the **make menuconfig** command:
  
 <code> <code>
-[root@centos8 ~]# uptime --help+[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ make menuconfig 
 +  UPD     scripts/kconfig/.mconf-cfg 
 +  HOSTCC  scripts/kconfig/mconf.o 
 +  HOSTCC  scripts/kconfig/lxdialog/checklist.o 
 +  HOSTCC  scripts/kconfig/lxdialog/inputbox.o 
 +  HOSTCC  scripts/kconfig/lxdialog/menubox.o 
 +  HOSTCC  scripts/kconfig/lxdialog/textbox.o 
 +  HOSTCC  scripts/kconfig/lxdialog/util.o 
 +  HOSTCC  scripts/kconfig/lxdialog/yesno.o 
 +  HOSTLD  scripts/kconfig/mconf 
 +scripts/kconfig/mconf  Kconfig 
 +# 
 +# using defaults found in /boot/config-4.18.0-305.7.1.el8_4.x86_64 
 +
 +</code>
  
-Usage: +Looking at the interface, you will see lines used to configure the Kernel. In the case a letter is used, these are:
- uptime [options]+
  
-Options: +  * **y**, 
- -p, --pretty   show uptime in pretty format +    * the configuration is included in the Kernel
- -h--help     display this help and exit +  * **m**
- -s--since    system up since +    * the configuration is not included in the Kernel but in a Kernel module, 
- -V--version  output version information and exit+  * **n**, 
 +    * the configuration is neither included in the Kernel nor in a Kernel module.
  
-For more details see uptime(1).+At this stage, simply save the configuration and exit the interface:
  
-[root@centos8 ~]# w --help +<code> 
- +*** End of the configuration. 
-Usage: +*** Execute 'make' to start the build or try 'make help'.
- w [options] +
- +
-Options: +
- -h, --no-header     do not print header +
- -u, --no-current    ignore current process username +
- -s, --short         short format +
- -f, --from          show remote hostname field +
- -o, --old-style     old style output +
- -i, --ip-addr       display IP address instead of hostname (if possible) +
- +
-     --help     display this help and exit +
- -V, --version  output version information and exit +
- +
-For more details see w(1).+
 </code> </code>
  
-====3.3 - The iostat Command==== +Check the presence of the **.config** file:
- +
-The **iostat** command show disk, terminal and streamer statistics:+
  
 <code> <code>
-[root@centos8 ~]# iostat +[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ ls -a 
-bash: iostat: command not found... +     certs          configs         Documentation  .get_maintainer.conf    .gitlab-ci.yml  Kbuild   LICENSES     Makefile.rhelver  README       security  virt 
-Install package 'sysstat' to provide command 'iostat'? [N/y] y+..     .clang-format  COPYING-4.18.0  drivers        .get_maintainer.ignore  include         Kconfig  .mailmap     .mismatches       samples      sound 
 +arch   .cocciconfig   CREDITS         firmware       .gitattributes          init            kernel   MAINTAINERS  mm                .scmversion  tools 
 +block  .config        crypto          fs             .gitlab-ci-private.yml  ipc             lib      Makefile     net               scripts      usr 
 +</code>
  
- +Lokk at the contents of the .config file:
- * Waiting in queue...  +
-The following packages have to be installed: +
- lm_sensors-libs-3.4.0-22.20180522git70f7e08.el8.x86_64 Lm_sensors core libraries +
- sysstat-11.7.3-5.el8.x86_64    Collection of performance monitoring tools for Linux +
-Proceed with changes? [N/y] y +
- +
- +
- * Waiting in queue...  +
- * Waiting for authentication...  +
- * Waiting in queue...  +
- * Downloading packages...  +
- * Requesting data...  +
- * Testing changes...  +
- * Installing packages...  +
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_(8 CPU) +
- +
-avg-cpu %user   %nice %system %iowait  %steal   %idle +
-           0.03    0.00    0.03    0.01    0.00   99.93 +
- +
-Device             tps    kB_read/   kB_wrtn/   kB_read    kB_wrtn +
-sda               0.28         7.67         1.49     735338     142510 +
-sdb               0.00         0.03         0.00       2995          0 +
-scd0              0.00         0.00         0.00          2          0 +
-dm-0              0.26         7.25         1.55     694786     148837 +
-dm-1              0.00         0.02         0.00       2220          0 +
-</code>+
  
 <code> <code>
-[root@centos8 ~]# iostat -d -+[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ more .config 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_        (8 CPU)+
 +# Automatically generated file; DO NOT EDIT. 
 +# Linux/x86 4.18.0 Kernel Configuration 
 +#
  
-Device            r/s     w/    rkB/    wkB/  rrqm/  wrqm/ %rrqm  %wrqm r_await w_await aqu-sz rareq-sz wareq-sz  svctm  %util +# 
-sda              0.20    0.16     11.67      1.81     0.00     0.03   0.48  17.45    6.79   69.99   0.01    58.28    11.33   9.13   0.33 +# Compiler: gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) 
-sdb              0.00    0.00      0.02      0.00     0.00     0.00   0.00   0.00    0.13    0.00   0.00     8.81     0.00   0.51   0.00 +
-scd0             0.00    0.00      0.00      0.00     0.00     0.00   0.00   0.00    0.20    0.00   0.00     0.20     0.00   0.90   0.00 +CONFIG_64BIT=y 
-dm-0             0.12    0.19      3.98      1.90     0.00     0.00   0.00   0.00    4.18   79.07   0.02    32.88    10.07  10.34   0.32 +CONFIG_X86_64=y 
-dm-1             0.00    0.00      0.01      0.00     0.00     0.00   0.00   0.00    0.76    0.00   0.00    21.35     0.00   0.68   0.00+CONFIG_X86=y 
 +CONFIG_INSTRUCTION_DECODER=y 
 +CONFIG_OUTPUT_FORMAT="elf64-x86-64" 
 +CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig" 
 +CONFIG_LOCKDEP_SUPPORT=y 
 +CONFIG_STACKTRACE_SUPPORT=y 
 +CONFIG_MMU=y 
 +CONFIG_ARCH_MMAP_RND_BITS_MIN=28 
 +CONFIG_ARCH_MMAP_RND_BITS_MAX=32 
 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 
 +CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 
 +CONFIG_GENERIC_ISA_DMA=y 
 +CONFIG_GENERIC_BUG=y 
 +CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y 
 +CONFIG_GENERIC_HWEIGHT=y 
 +CONFIG_ARCH_MAY_HAVE_PC_FDC=y 
 +CONFIG_GENERIC_CALIBRATE_DELAY=y 
 +CONFIG_ARCH_HAS_CPU_RELAX=y 
 +CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y 
 +CONFIG_ARCH_HAS_FILTER_PGPROT=y 
 +CONFIG_HAVE_SETUP_PER_CPU_AREA=y 
 +CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y 
 +CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y 
 +CONFIG_ARCH_HIBERNATION_POSSIBLE=y 
 +CONFIG_ARCH_SUSPEND_POSSIBLE=y 
 +CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y 
 +CONFIG_ARCH_WANT_GENERAL_HUGETLB=y 
 +CONFIG_ZONE_DMA32=y 
 +CONFIG_AUDIT_ARCH=y 
 +CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y 
 +CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y 
 +CONFIG_HAVE_INTEL_TXT=y 
 +CONFIG_X86_64_SMP=y 
 +--More--(0%)
 </code> </code>
  
-The command line switches of this command are:+===The Makefile File===
  
-<code> +The Makefile contains the Kernel name and the following information:
-[root@centos8 ~]# iostat --help +
-Usageiostat [ options ] [ <interval> [ <count> ] ] +
-Options are: +
-[ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -s ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ] +
-[ -j { ID | LABEL | PATH | UUID | ... } ] [ --human ] [ -o JSON ] +
-[ [ -H ] -g <group_name> ] [ -p [ <device> [,...] | ALL ] ] +
-[ <device> [...] | ALL ] +
-</code>+
  
-====3.4 - The hdparm Command====+  * VERSION, 
 +  * PATCHLEVEL, 
 +  * SUBLEVEL, 
 +  * EXTRAVERSION.
  
-The hdparm command measures disk reads:+Values for the first three directives are managed directly by **kernel.org** and Linus Torvalds whilst the EXTRAVERSION is managed by Red Hat:
  
 <code> <code>
-[root@centos8 ~]# hdparm -t /dev/sda+[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ more Makefile 
 +SPDX-License-Identifier: GPL-2.0 
 +VERSION = 4 
 +PATCHLEVEL = 18 
 +SUBLEVEL = 0 
 +EXTRAVERSION = 
 +NAME = Merciless Moray
  
-/dev/sda: +# 
- Timing buffered disk reads: 1410 MB in  3.00 seconds 469.98 MB/sec +# DRM backport version 
-</code>+
 +RHEL_DRM_VERSION 5 
 +RHEL_DRM_PATCHLEVEL = 9 
 +RHEL_DRM_SUBLEVEL = 14
  
-====3.5 - La Commande vmstat====+# *DOCUMENTATION* 
 +# To see a list of typical targets execute "make help" 
 +# More info can be located in ./README 
 +# Comments in this file are targeted only to the developer, do not 
 +# expect to learn how to build the kernel reading this file.
  
-The **vmstat** commands shows memory, pagination and processor statistics:+# That's our default target when none is given on the command line 
 +PHONY := _all 
 +_all:
  
-<code> +# o Do not use make's built-in rules and variables 
-[root@centos8 ~]vmstat 1 10 +  (this increases performance and avoids hard-to-debug behaviour); 
-procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- +# o Look for make include files relative to root of kernel src 
-  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st +MAKEFLAGS += -rR --include-dir=$(CURDIR)
-  0      0 1765216   2256 866336    0    0            9   12  0  0 100  0  0 +
-  0      0 1765136   2256 866336    0    0           57   80  0  0 100  0  0 +
-  0      0 1765136   2256 866376    0    0           54   77  0  0 100  0  0 +
-  0      0 1765136   2256 866376    0    0           66  100  0  0 100  0  0 +
-  0      0 1765136   2256 866376    0    0          103  125  0  0 100  0  0 +
-  0      0 1765108   2256 866376    0    0           64   86  0  0 100  0  0 +
-  0      0 1765108   2256 866376    0    0           62   88  0  0 100  0  0 +
-  0      0 1765108   2256 866376    0    0           68   97  0  0 100  0  0 +
-  0      0 1765108   2256 866376    0    0           60   88  0  0 100  0  0 +
-  0      0 1765108   2256 866376    0    0          177  251  0  0 100  0  0 +
-</code>+
  
-The command line switches of this command are:+# Avoid funny character set dependencies 
 +unexport LC_ALL 
 +LC_COLLATE=C 
 +LC_NUMERIC=C 
 +export LC_COLLATE LC_NUMERIC
  
-<code> +Avoid interference with shell env settings 
-[root@centos8 ~]vmstat --help+unexport GREP_OPTIONS
  
-Usage: +# Set RHEL variables 
- vmstat [options] [delay [count]]+# Use this spot to avoid future merge conflicts 
 +include Makefile.rhelver
  
-Options: +# We are using recursive buildso we need to do a little thinking 
- -a, --active           active/inactive memory +--Plus--(2%)
- -f, --forks            number of forks since boot +
- -m, --slabs            slabinfo +
- -n, --one-header       do not redisplay header +
- -s, --stats            event counter statistics +
- -d, --disk             disk statistics +
- -D, --disk-sum         summarize disk statistics +
- -p, --partition <dev>  partition specific statistics +
- -S, --unit <char>      define display unit +
- -w, --wide             wide output +
- -t, --timestamp        show timestamp +
- +
- -h, --help     display this help and exit +
- -V, --version  output version information and exit +
- +
-For more details see vmstat(8).+
 </code> </code>
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : By default vmstat shows statistics from boot until current time.+**Important** - The 2.6 version of the Linux Kernel came into being in **2003**. Version 3.0 came out on the 20th anniversary of the Linux Kernel.
 </WRAP> </WRAP>
  
-====3.The mpstat Command====+====2.Configuring the Kernel====
  
-La commande **mpstat** affiche des statistiques détaillées sur le CPU :+Add the value shown by the **uname -i** command to the first line of the .config file:
  
 <code> <code>
-[root@centos8 ~]# mpstat +[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ uname -i 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_(8 CPU)+x86_64 
 +[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ vi .config 
 +[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ head .config 
 +# x86_64 
 +
 +# Automatically generated file; DO NOT EDIT. 
 +# Linux/x86 4.18.0 Kernel Configuration 
 +#
  
-04:53:22     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +# 
-04:53:22     all    0.03    0.00    0.01    0.02    0.01    0.01    0.00    0.00    0.00   99.92+# Compilergcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) 
 +
 +CONFIG_64BIT=y
 </code> </code>
  
-If there are several CPU's in the system, statistics can be viewed by core and as an average:+Rename the .config file and place it in the **~/rpmbuild/SOURCES/** directory:
  
 <code> <code>
-[root@centos8 ~]# mpstat -P ALL +[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp .config ~/rpmbuild/SOURCES/config-`uname -m`-generic 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_(8 CPU) +[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ ls ~/rpmbuild/SOURCES 
- +centos-ca-secureboot.der  cpupower.config            filter-x86_64.sh                           kernel-s390x.config                mod-extra.list           Module.kabi_s390x 
-04:54:28     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +centos-dup.x509           cpupower.service           generate_all_configs.sh                    kernel-s390x-debug.config          mod-internal.list        Module.kabi_x86_64 
-04:54:28     all    0.03    0.00    0.01    0.02    0.01    0.01    0.00    0.00    0.00   99.92 +centos-kpatch.x509        debrand-rh-i686-cpu.patch  generate_bls_conf.sh                       kernel-s390x-zfcpdump.config       mod-sign.sh              parallel_xz.sh 
-04:54:28          0.03    0.00    0.01    0.00    0.01    0.00    0.00    0.00    0.00   99.94 +centos.pem                debrand-rh_taint.patch     kernel-aarch64.config                      kernel-x86_64.config               Module.kabi_aarch64      process_configs.sh 
-04:54:28          0.02    0.00    0.02    0.03    0.02    0.00    0.00    0.00    0.00   99.91 +centossecureboot001.der   debrand-single-cpu.patch   kernel-aarch64-debug.config                kernel-x86_64-debug.config         Module.kabi_dup_aarch64  x509.genkey 
-04:54:28       2    0.02    0.00    0.01    0.01    0.01    0.04    0.00    0.00    0.00   99.90 +centossecureboot201.der   filter-aarch64.sh          kernel-abi-stablelists-4.18.0-305.tar.bz2  kvm_stat.logrotate                 Module.kabi_dup_ppc64le 
-04:54:28          0.01    0.00    0.01    0.02    0.00    0.00    0.00    0.00    0.00   99.95 +centossecurebootca2.der   filter-modules.sh          kernel-kabi-dw-4.18.0-305.tar.bz2          linux-4.18.0-305.7.1.el8_4.tar.xz  Module.kabi_dup_s390x 
-04:54:28          0.05    0.00    0.02    0.03    0.01    0.00    0.00    0.00    0.00   99.88 +check-kabi                filter-ppc64le.sh          kernel-ppc64le.config                      linux-kernel-test.patch            Module.kabi_dup_x86_64 
-04:54:28          0.03    0.01    0.01    0.02    0.01    0.00    0.00    0.00    0.00   99.92 +config-x86_64-generic     filter-s390x.sh            kernel-ppc64le-debug.config                mod-blacklist.sh                   Module.kabi_ppc64le
-04:54:28          0.02    0.00    0.02    0.01    0.01    0.00    0.00    0.00    0.00   99.95 +
-04:54:28          0.02    0.00    0.01    0.01    0.01    0.00    0.00    0.00    0.00   99.94+
 </code> </code>
  
-Finally, mpstat is capable of showing statistics over time. In the following example you can see 5 data sets, one taken every 2 seconds:+Copy the entire contents of the **configs** directory to the **~/rpmbuild/SOURCES/** directory:
  
 <code> <code>
-[root@centos8 ~]# mpstat -P ALL 2 5 +[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp configs/* ~/rpmbuild/SOURCES/
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU) +
- +
-04:55:11     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +
-04:55:13     all    0.00    0.00    0.00    0.00    0.00    0.00    0.06    0.00    0.00   99.94 +
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.50    0.00    0.00   99.50 +
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:13          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
- +
-04:55:13     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +
-04:55:15     all    0.00    0.00    0.00    0.00    0.06    0.00    0.00    0.00    0.00   99.94 +
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:15          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:15          0.00    0.00    0.00    0.00    0.50    0.00    0.00    0.00    0.00   99.50 +
- +
-04:55:15     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +
-04:55:17     all    0.00    0.00    0.00    0.00    0.06    0.00    0.00    0.00    0.00   99.94 +
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:17          0.00    0.00    0.00    0.00    0.50    0.00    0.00    0.00    0.00   99.50 +
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:17          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
- +
-04:55:17     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +
-04:55:19     all    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:19          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
- +
-04:55:19     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +
-04:55:21     all    0.06    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00   99.94 +
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:21          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-04:55:21          0.50    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00   99.50 +
- +
-Average:     CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest  %gnice   %idle +
-Average:     all    0.01    0.00    0.00    0.00    0.02    0.00    0.01    0.00    0.00   99.95 +
-Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-Average:          0.00    0.00    0.00    0.00    0.10    0.00    0.00    0.00    0.00   99.90 +
-Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.10    0.00    0.00   99.90 +
-Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-Average:          0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00    0.00  100.00 +
-Average:          0.10    0.00    0.00    0.00    0.10    0.00    0.00    0.00    0.00   99.80+
 </code> </code>
  
-The command line switches of this command are:+Edit the **buildid** directive in the **~/rpmbuild/SPECS/kernel.spec** file in order to distinguish the future newly compiled Kernel from the current Kernel:
  
 <code> <code>
-[root@centos8 ~]# mpstat --help +[trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cd ~/rpmbuild/SPECS
-Usage: mpstat [ options [ <interval> [ <count> ] ] +
-Options are: +
-[ -A ] [ -n ] [ -u ] [ -V ] [ -I { SUM | CPU | SCPU | ALL } ] +
-[ -N { <node_list> | ALL } ] [ -o JSON ] [ -P { <cpu_list> | ALL } ] +
-</code>+
  
-====3.7 - The sar Command====+[trainee@centos8 SPECS]$ vi kernel.spec
  
-The **sar** command can survey all system resources dependant upon the switch that is usedSeveral important switches are:+[trainee@centos8 SPECS]$ head -n 50 kernel.spec 
 +# We have to override the new %%install behavior because, well... the kernel is special. 
 +%global __spec_install_pre %{___build_pre}
  
-^ Switch ^ Description ^ +# At the time of this writing (2019-03), RHEL8 packages use w2.xzdio 
--u | CPU usage in % | +# compression for rpms (xz, level 2). 
-| -q | Number of processes in the process queue | +# Kernel has several large (hundreds of mbytes) rpms, they take ~5 mins 
--r | Memory usage | +# to compress by single-threaded xz. Switch to threaded compression, 
-| -w | Swap usage | +# and from level 2 to 3 to keep compressed sizes close to "w2" results. 
-| -p | Pagination usage | +# 
-| -b | Buffer usage | +# NB: if default compression in /usr/lib/rpm/redhat/macros ever changes, 
-| -d | Disk usage |+# this one might need tweaking (e.g. if default changes to w3.xzdio, 
 +# change below to w4T.xzdio): 
 +%define _binary_payload w3T.xzdio
  
-The **/usr/lib64/sa/sadc** command is used to collect data:+# For a kernel released for public testing, released_kernel should be 1. 
 +# For internal testing builds during development, it should be 0. 
 +%global released_kernel 1
  
-<code> +%global distro_build 305
-[root@centos8 ~]# ls /usr/lib64/sa +
-sa1  sa2  sadc +
-</code>+
  
-The **/usr/lib64/sa/sa1** script calls the **/usr/lib/sa/sadc** command and can use two switches:+# Sign the x86_64 kernel for secure boot authentication 
 +%ifarch x86_64 aarch64 
 +%global signkernel 1 
 +%else 
 +%global signkernel 0 
 +%endif
  
-^ Switch ^ Description ^ +# Sign modules on all arches 
-| -t | Interval | +%global signmodules 1
-| -n | Count |+
  
-The **/usr/lib64/sa/sa2** script also creates a log at **/var/log/sa/sar<dd>**, where <dd> is the day of the month.+# Compress modules only for architectures that build modules 
 +%ifarch noarch 
 +%global zipmodules 0 
 +%else 
 +%global zipmodules 1 
 +%endif
  
-<code> +%if %{zipmodules} 
-[root@centos8 ~]# ls /var/log/sa+%global zipsed -e 's/\.ko$/\.ko.xz/' 
-sa29  s+%endif
  
 +%define buildid .i2tch
  
-ar29 +%define rpmversion 4.18.0 
-</code>+%define pkgrelease 305.7.1.el8_4
  
-Using CentOS / RHEL 8, the interval between collects is configured using systemd **timers** de systemd and not cron as was previously the case:+# allow pkg_release to have configurable %%{?dist} tag 
 +%define specrelease 305.7.1%{?dist}
  
-<code> +%define pkg_release %{specrelease}%{?buildid}
-[root@centos8 ~]# cat /usr/lib/systemd/system/sysstat-collect.timer +
-# /usr/lib/systemd/system/sysstat-collect.timer +
-# (C) 2014 Tomasz Torcz <tomek@pipebreaker.pl> +
-+
-# sysstat-11.7.3 systemd unit file: +
-#        Activates activity collector every 10 minutes +
- +
-[Unit] +
-Description=Run system activity accounting tool every 10 minutes +
- +
-[Timer] +
-OnCalendar=*:00/10 +
- +
-[Install] +
-WantedBy=sysstat.service+
 </code> </code>
  
-The **OnCalendar** value indicates a collect every 10 minutes.+====2.5 - Compiling the Kernel====
  
-To change this value, you need to create an **override** file in **/etc/systemd/system/** by using the **systemctl edit** commandYou should never edit directly files in **/usr/lib/systemd/system** :+Compiling the Kernel can take a long time (~5 heures)Execute the following command:
  
 <code> <code>
-[root@centos8 ~]# systemctl edit sysstat-collect.timer +[trainee@centos7 SPECS]$ rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log &
-[root@centos8 ~]# cat /etc/systemd/system/sysstat-collect.timer.d/override.conf  +
-[Unit] +
-Description=Run system activity accounting tool every 2 minutes +
- +
-[Timer] +
-OnCalendar= +
-OnCalendar=*:00/+
-AccuracySec=0+
 </code> </code>
  
 <WRAP center round important 60%> <WRAP center round important 60%>
-**Important** : Note the line **OnCalendar=** which is required to override the default value.+**Important** - Once you are sure that the compilation process has started without errors, stop it using ^C. Stop the virtual machine and ask the Instructor to start the virtual machine in which the Kernel has already been compiled.
 </WRAP> </WRAP>
  
-Now check if the configuration has been applied:+When the compilation has finished, you would see the following output:
  
 <code> <code>
-[root@centos8 ~]# systemctl status sysstat-collect.timer +... 
-● sysstat-collect.timer Run system activity accounting tool every 2 minutes +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-   Loadedloaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; vendor presetdisabled) +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-  Drop-In: /etc/systemd/system/sysstat-collect.timer.d +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-           └─override.conf +Wrote/home/trainee/rpmbuild/RPMS/x86_64/kernel-debuginfo-common-x86_64-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-   Activeactive (waiting) since Tue 2021-06-29 06:16:04 EDT; 3h 2min ago +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/perf-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-  TriggerTue 2021-06-29 09:20:00 EDT; 1min 19s left+Wrote: /home/trainee/rpmbuild/RPMS/x86_64/perf-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/python3-perf-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote/home/trainee/rpmbuild/RPMS/x86_64/python3-perf-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote/home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote/home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-libs-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote/home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-libs-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote/home/trainee/rpmbuild/RPMS/x86_64/kernel-tools-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote/home/trainee/rpmbuild/RPMS/x86_64/bpftool-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/bpftool-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-selftests-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-modules-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debug-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-modules-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Wrote: /home/trainee/rpmbuild/RPMS/x86_64/kernel-ipaclones-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
 +Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.rkOgfs
  
-Jun 29 06:16:04 centos8.ittraining.loc systemd[1]: Started Run system activity accounting tool every 10 minutes.+[1]+  Done                    rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log
 </code> </code>
 +
 +The installable RPMs can be found in the **/home/trainee/rpmbuild/RPMS/x86_64/** directory:
  
 <code> <code>
-[root@centos8 ~]# journalctl -g sysstat-collect.service +[trainee@centos8 SPECS]$ cd ../RPMS 
--- Logs begin at Mon 2021-06-28 02:04:10 EDT, end at Tue 2021-06-29 09:18:00 EDT. -- +[trainee@centos8 RPMS]$ ls 
-Jun 29 06:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +x86_64 
-Jun 29 06:26:29 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded+[trainee@centos8 RPMS]$ cd x86_64/ 
-Jun 29 06:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +[trainee@centos8 x86_64]$ ls 
-Jun 29 06:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded+bpftool-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                 kernel-debuginfo-common-x86_64-4.18.0-305.7.1.el8.i2tch.x86_64.rpm  kernel-selftests-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-Jun 29 06:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +bpftool-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm       kernel-debug-modules-4.18.0-305.7.1.el8.i2tch.x86_64.rpm            kernel-tools-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-Jun 29 07:00:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded+kernel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                  kernel-debug-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64.rpm      kernel-tools-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-Jun 29 07:10:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +kernel-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm             kernel-debug-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm   kernel-tools-libs-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-Jun 29 07:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded+kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm    kernel-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                    kernel-tools-libs-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-Jun 29 07:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +kernel-debug-4.18.0-305.7.1.el8.i2tch.x86_64.rpm            kernel-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                  perf-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-Jun 29 07:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded+kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm       kernel-ipaclones-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm       perf-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-Jun 29 07:50:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +kernel-debug-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm  kernel-modules-4.18.0-305.7.1.el8.i2tch.x86_64.rpm                  python3-perf-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-Jun 29 07:53:56 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded+kernel-debug-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm      kernel-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64.rpm            python3-perf-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm 
-Jun 29 07:54:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm        kernel-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64.rpm
-Jun 29 07:56:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded+
-Jun 29 07:58:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. +
-Jun 29 08:00:00 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded+
-...+
 </code> </code>
  
-Execute the sar command:+Note that the compilation has consumed over 20 GB of disk space:
  
 <code> <code>
-[root@centos8 ~]# sar +[trainee@centos8 x86_64]$ df -h 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU)+Filesystem                   Size  Used Avail Use% Mounted on 
 +devtmpfs                     1.8G      1.8G   0% /dev 
 +tmpfs                        1.9G      1.9G   0% /dev/shm 
 +tmpfs                        1.9G  9.4M  1.9G   1% /run 
 +tmpfs                        1.9G      1.9G   0% /sys/fs/cgroup 
 +/dev/mapper/cl_centos8-root   28G  5.5G   23G  20% / 
 +/dev/sda1                    976M  289M  620M  32% /boot 
 +tmpfs                        374M   24K  374M   1% /run/user/1000 
 +tmpfs                        374M  1.2M  373M   1% /run/user/42 
 +/dev/sdc1                     63G   21G   39G  35% /home 
 +</code>
  
-06:16:04     LINUX RESTART      (8 CPU)+====2.6 - Installing the Kernel====
  
-06:20:33        CPU     %user     %nice   %system   %iowait    %steal     %idle +Now install the new KernelInstalling the new Kernel can take a long time (~2 heures)Use the following command:
-06:26:29        all      0.03      0.00      0.03      0.00      0.00     99.94 +
-06:30:33        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-06:40:33        all      0.02      0.00      0.03      0.00      0.00     99.94 +
-06:50:33        all      0.02      0.00      0.02      0.00      0.00     99.95 +
-07:00:33        all      0.02      0.00      0.02      0.00      0.00     99.95 +
-07:10:33        all      0.02      0.00      0.02      0.00      0.00     99.95 +
-07:20:33        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-07:30:33        all      0.02      0.01      0.03      0.00      0.00     99.94 +
-07:40:33        all      0.03      0.00      0.04      0.00      0.00     99.93 +
-07:50:33        all      0.03      0.00      0.03      0.00      0.00     99.94 +
-07:53:56        all      0.08      0.00      0.06      0.00      0.00     99.86 +
-07:54:00        all      0.09      0.00      0.06      0.00      0.00     99.85 +
-Average:        all      0.03      0.00      0.03      0.00      0.00     99.94+
  
-07:55:44     LINUX RESTART      (8 CPU)+<code> 
 +[root@centos8 x86_64]# dnf localinstall kernel-*.rpm 
 +Last metadata expiration check2:25:32 ago on Tue 20 Jul 2021 08:37:00 EDT. 
 +Dependencies resolved. 
 +=============================================================================================================================================================================================================== 
 + Package                                                       Architecture                          Version                                                 Repository                                   Size 
 +=============================================================================================================================================================================================================== 
 +Installing: 
 + kernel                                                        x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                5.9 M 
 + kernel-core                                                   x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 36 M 
 + kernel-cross-headers                                          x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 11 M 
 + kernel-debug                                                  x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                5.9 M 
 + kernel-debug-core                                             x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 63 M 
 + kernel-debug-debuginfo                                        x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                683 M 
 + kernel-debug-devel                                            x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 19 M 
 + kernel-debug-modules                                          x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 54 M 
 + kernel-debug-modules-extra                                    x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                7.2 M 
 + kernel-debug-modules-internal                                 x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.3 M 
 + kernel-debuginfo                                              x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                570 M 
 + kernel-debuginfo-common-x86_64                                x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 75 M 
 + kernel-devel                                                  x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 18 M 
 + kernel-ipaclones-internal                                     x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 20 M 
 + kernel-modules                                                x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 28 M 
 + kernel-modules-extra                                          x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.5 M 
 + kernel-modules-internal                                       x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.1 M 
 + kernel-selftests-internal                                     x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                 19 M 
 + kernel-tools-debuginfo                                        x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.2 M 
 + kernel-tools-libs-devel                                       x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                5.9 M 
 +Downgrading: 
 + kernel-headers                                                x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                7.1 M 
 + kernel-tools                                                  x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                6.1 M 
 + kernel-tools-libs                                             x86_64                                4.18.0-305.7.1.el8.i2tch                                @commandline                                5.9 M
  
-07:56:00        CPU     %user     %nice   %system   %iowait    %steal     %idle +Transaction Summary 
-07:58:00        all      0.03      0.00      0.03      0.00      0.00     99.94 +=============================================================================================================================================================================================================== 
-08:00:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +Install    20 Packages 
-08:02:00        all      0.02      0.00      0.03      0.00      0.00     99.94 +Downgrade   3 Packages
-08:04:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:06:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:08:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:10:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:12:00        all      0.03      0.00      0.03      0.00      0.00     99.95 +
-08:14:00        all      0.02      0.00      0.03      0.01      0.00     99.94 +
-08:16:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:18:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:20:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:22:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:24:00        all      0.02      0.00      0.02      0.00      0.00     99.95 +
-08:26:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:28:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:30:00        all      0.02      0.05      0.05      0.00      0.00     99.87 +
-08:32:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:34:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:36:00        all      0.03      0.00      0.04      0.00      0.00     99.94 +
-08:38:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:40:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:42:00        all      0.02      0.00      0.03      0.00      0.00     99.94 +
-08:44:00        all      0.03      0.00      0.03      0.00      0.00     99.94 +
-08:46:00        all      0.02      0.00      0.03      0.00      0.00     99.94 +
-08:48:00        all      0.03      0.00      0.03      0.00      0.00     99.95 +
-08:50:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:52:00        all      0.02      0.00      0.06      0.00      0.00     99.92 +
-08:54:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-08:56:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-08:58:00        all      0.02      0.00      0.02      0.00      0.00     99.96 +
-09:00:00        all      0.07      0.00      0.05      0.00      0.00     99.88 +
-09:02:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-09:04:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-09:06:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-09:08:00        all      0.02      0.00      0.04      0.00      0.00     99.94 +
-09:10:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +
-09:12:00        all      0.02      0.00      0.03      0.00      0.00     99.94+
  
-09:12:00        CPU     %user     %nice   %system   %iowait    %steal     %idle +Total size1.6 G 
-09:14:00        all      0.02      0.00      0.03      0.00      0.00     99.95 +Is this ok [y/N]y
-09:16:00        all      0.02      0.00      0.06      0.00      0.00     99.92 +
-09:18:00        all      0.03      0.00      0.03      0.00      0.00     99.95 +
-09:20:00        all      0.02      0.00      0.03      0.00      0.00     99.94 +
-Average:        all      0.02      0.00      0.03      0.00      0.00     99.94+
 </code> </code>
  
-===CPU Stats=== +When all is installed, re-start the virtual machine:
- +
-Use the -u switch+
  
 <code> <code>
-[root@centos8 ~]# sar -u 5 3 +[root@centos7 ~]# reboot
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU) +
- +
-09:22:52        CPU     %user     %nice   %system   %iowait    %steal     %idle +
-09:22:57        all      0.03      0.00      0.03      0.00      0.00     99.95 +
-09:23:02        all      0.03      0.00      0.03      0.00      0.00     99.95 +
-09:23:07        all      0.00      0.00      0.03      0.00      0.00     99.97 +
-Average:        all      0.02      0.00      0.03      0.00      0.00     99.96+
 </code> </code>
  
-More information can be shown by using the **ALL** argument:+Open a session as trainee and become root. List the installed Kernels:
  
 <code> <code>
-[root@centos8 ~]# sar -u ALL 5 3 +[root@centos8 ~]# rpm -qa | grep kernel 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_(8 CPU) +kernel-modules-4.18.0-305.3.1.el8.x86_64 
- +kernel-tools-4.18.0-305.7.1.el8.i2tch.x86_64 
-01:49:14        CPU      %usr     %nice      %sys   %iowait    %steal      %irq     %soft    %guest    %gnice     %idle +kernel-headers-4.18.0-305.7.1.el8.i2tch.x86_64 
-01:49:19        all      0.03      0.00      0.00      0.00      0.00      0.03      0.00      0.00      0.00     99.95 +kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 
-01:49:24        all      0.03      0.00      0.03      0.00      0.00      0.10      0.05      0.00      0.00     99.80 +kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64 
-01:49:29        all      0.00      0.00      0.00      0.25      0.00      0.10      0.05      0.00      0.00     99.60 +kernel-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64 
-Average:        all      0.02      0.00      0.01      0.08      0.00      0.08      0.03      0.00      0.00     99.78+kernel-modules-4.18.0-305.7.1.el8_4.x86_64 
 +kernel-debug-modules-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-devel-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-tools-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-tools-libs-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-debug-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-core-4.18.0-305.7.1.el8_4.x86_64 
 +kernel-devel-4.18.0-305.7.1.el8_4.x86_64 
 +kernel-debuginfo-common-x86_64-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-debug-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-debug-devel-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-tools-libs-devel-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-4.18.0-305.7.1.el8_4.x86_64 
 +kernel-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-core-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-selftests-internal-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-debug-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-debug-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-4.18.0-305.3.1.el8.x86_64 
 +kernel-core-4.18.0-305.3.1.el8.x86_64 
 +kernel-modules-4.18.0-305.7.1.el8.i2tch.x86_64 
 +kernel-ipaclones-internal-4.18.0-305.7.1.el8.i2tch.x86_64
 </code> </code>
  
-To see the statistics from a specific core, use the **-P** switch:+Check the **saved-entry** from the **/boot/grub2/grubenv** file:
  
 <code> <code>
-[root@centos8 ~]# sar -u -P 1 5 3 +[root@centos8 ~]# grep i2tch /boot/grub2/grubenv  
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU) +saved_entry=95bd69e34a7444a7b58cb74fbfb86df2-4.18.0-305.7.1.el8.i2tch.x86_64
- +
-01:51:52        CPU     %user     %nice   %system   %iowait    %steal     %idle +
-01:51:57          1      0.00      0.00      0.00      0.00      0.00    100.00 +
-01:52:02          1      0.20      0.00      0.00      0.00      0.00     99.80 +
-01:52:07          1      0.00      0.00      0.00      0.00      0.00    100.00 +
-Average:          1      0.07      0.00      0.00      0.00      0.00     99.93 +
-[root@centos8 ~]# sar -u -P 5 5 3 +
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU) +
- +
-01:52:16        CPU     %user     %nice   %system   %iowait    %steal     %idle +
-01:52:21          5      0.00      0.00      0.00      0.00      0.00    100.00 +
-01:52:26          5      0.00      0.00      0.00      0.00      0.00    100.00 +
-01:52:31          5      0.00      0.00      0.00      0.00      0.00    100.00 +
-Average:          5      0.00      0.00      0.00      0.00      0.00    100.00+
 </code> </code>
  
-===Memory and Swap Statistics=== +Finally, check the output of the **uname -r** command:
- +
-Use the **-r** switch to see memory statistics:+
  
 <code> <code>
-[root@centos8 ~]# sar -r 5 3 +[root@centos8 ~]# uname -r 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_(8 CPU) +4.18.0-305.7.1.el8.i2tch.x86_64
- +
-07:33:32    kbmemfree   kbavail kbmemused  %memused kbbuffers  kbcached  kbcommit   %commit  kbactive   kbinact   kbdirty +
-07:33:37      1647240   2297232   2177792     56.94      3356    827396   5096432     70.94    359072   1486368         0 +
-07:33:42      1647232   2297224   2177800     56.94      3356    827396   5095788     70.93    359072   1486300         0 +
-07:33:47      1647232   2297224   2177800     56.94      3356    827396   5095788     70.93    359072   1486376         0 +
-Average:      1647235   2297227   2177797     56.94      3356    827396   5096003     70.94    359072   1486348         0+
 </code> </code>
  
-Use the **-S** switch to see swap statistics:+=====LAB #3 Managing Quotas=====
  
-<code> +User and group disk quotas can be placed on partitions **only**.
-[root@centos8 ~]# sar -S 5 3 +
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_(8 CPU)+
  
-07:31:58    kbswpfree kbswpused  %swpused  kbswpcad   %swpcad +<WRAP center round todo 60%> 
-07:32:03      3358716              0.00              0.00 +**To do** - **Log out** of your **CentOS8_SSH_10.0.2.45** session and open a new session using the **CentOS8_ROOT_10.0.2.45** connection
-07:32:08      3358716              0.00              0.00 +</WRAP>
-07:32:13      3358716              0.00              0.00 +
-Average:      3358716              0.00              0.00 +
-</code>+
  
-===I/O Statistics=== +Before configuring the quotas, set SELINUX to **permissive** mode for the current session:
- +
-Use the **-b** switch:+
  
 <code> <code>
-[root@centos8 ~]# sar -b 5 3 +[root@centos8 ~]# getenforce 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU) +Enforcing 
- +[root@centos8 ~]# setenforce permissive 
-09:24:49          tps      rtps      wtps   bread/  bwrtn/s +[root@centos8 ~]# getenforce 
-09:24:54         0.00      0.00      0.00      0.00      0.00 +Permissive 
-09:24:59         1.20      0.00      1.20      0.00     20.20 +[root@centos8 ~]# 
-09:25:04         0.00      0.00      0.00      0.00      0.00 +
-Average:         0.40      0.00      0.40      0.00      6.73+
 </code> </code>
  
-===Disk I/O Statistics=== +Edit the **/etc/sysconfig/selinux** file:
- +
-Use the **-d** switch:+
  
 <code> <code>
-[root@centos8 ~]# sar -d 5 3 +[root@centos8 ~]# vi /etc/sysconfig/selinux 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        29/06/21        _x86_64_        (8 CPU)+[root@centos8 ~]# cat /etc/sysconfig/selinux
  
-09:25:45          DEV       tps     rkB/s     wkB/  areq-sz    aqu-sz     await     svctm     %util +# This file controls the state of SELinux on the system. 
-09:25:50       dev8-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +# SELINUX= can take one of these three values: 
-09:25:50      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +    enforcing SELinux security policy is enforced. 
-09:25:50      dev11-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +    permissive SELinux prints warnings instead of enforcing
-09:25:50     dev253-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +#     disabled No SELinux policy is loaded
-09:25:50     dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00+SELINUX=permissive 
 +# SELINUXTYPE= can take one of these three values: 
 +#     targeted Targeted processes are protected, 
 +    minimum Modification of targeted policyOnly selected processes are protected.  
 +    mls Multi Level Security protection. 
 +SELINUXTYPE=targeted
  
-09:25:50          DEV       tps     rkB/s     wkB/  areq-sz    aqu-sz     await     svctm     %util +</code>
-09:25:55       dev8-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-09:25:55      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-09:25:55      dev11-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-09:25:55     dev253-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-09:25:55     dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00+
  
-09:25:55          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util +Now check that the **quota** package is installed:
-09:26:00       dev8-0      0.60      0.00      0.30      0.50      0.01     13.00     13.00      0.78 +
-09:26:00      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-09:26:00      dev11-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-09:26:00     dev253-0      0.60      0.00      0.50      0.83      0.01     12.67     13.00      0.78 +
-09:26:00     dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00+
  
-Average:          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util +<code> 
-Average:       dev8-0      0.20      0.00      0.10      0.50      0.00     13.00     13.00      0.26 +[root@centos8 ~]# rpm -qa | grep quota 
-Average:      dev8-16      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +quota-4.04-12.el8.x86_64 
-Average:      dev11-0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +quota-nls-4.04-12.el8.noarch
-Average:     dev253-0      0.20      0.00      0.17      0.83      0.00     12.67     13.00      0.26 +
-Average:     dev253-1      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00+
 </code> </code>
  
-The **DEV** column identifies the disks by their major/minor numbers. To see the names of the disks add the**-p** switch:+Edit the **/etc/fstab** file and add the **usrquota** and **grpquota** options to the **/home** line:
  
 <code> <code>
-[root@centos8 ~]# sar -p -d 5 3 +[root@centos8 ~]# vi /etc/fstab 
-Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc)        30/06/21        _x86_64_        (8 CPU)+[root@centos8 ~]# cat /etc/fstab
  
-07:48:32          DEV       tps     rkB/s     wkB/s   areq-sz    aqu-sz     await     svctm     %util +
-07:48:37          sda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +/etc/fstab 
-07:48:37          sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +# Created by anaconda on Wed Jun 16 06:21:32 2021 
-07:48:37          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-07:48:37    cl_centos8-root      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +# Accessible filesystems, by reference, are maintained under '/dev/disk/'
-07:48:37    cl_centos8-swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +# See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info
- +
-07:48:37          DEV       tps     rkB/s     wkB/s   areq-sz    aqu-sz     await     svctm     %util +# After editing this file, run 'systemctl daemon-reload' to update systemd 
-07:48:42          sda      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +# units generated from this file
-07:48:42          sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +# 
-07:48:42          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +/dev/mapper/cl_centos8-root /                       xfs     defaults        0 0 
-07:48:42    cl_centos8-root      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +UUID=1c04981e-5317-4b73-9695-3ce25246835d /boot                   ext4    defaults        1 2 
-07:48:42    cl_centos8-swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +/dev/mapper/cl_centos8-swap swap                    swap    defaults        0 0 
- +UUID=f76d6b66-985b-4a91-af9c-4987e8c1443c /home     ext4          defaults,usrquota,grpquota            1 2
-07:48:42          DEV       tps     rkB/s     wkB/  areq-sz    aqu-sz     await     svctm     %util +
-07:48:47          sda      0.40      0.00      0.40      1.00      0.02     56.00     56.50      2.26 +
-07:48:47          sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-07:48:47          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-07:48:47    cl_centos8-root      0.40      0.00      0.80      2.00      0.02     56.00     56.50      2.26 +
-07:48:47    cl_centos8-swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
- +
-Average:          DEV       tps     rkB/    wkB/  areq-sz    aqu-sz     await     svctm     %util +
-Average:          sda      0.13      0.00      0.13      1.00      0.01     56.00     56.50      0.75 +
-Average:          sdb      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-Average:          sr0      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00 +
-Average:    cl_centos8-root      0.13      0.00      0.27      2.00      0.01     56.00     56.50      0.75 +
-Average:    cl_centos8-swap      0.00      0.00      0.00      0.00      0.00      0.00      0.00      0.00+
 </code> </code>
  
-The command line switches of this command are:+Restart the virtual machine:
  
 <code> <code>
-[root@centos8 ~]# sar --help +[root@centos8 ~]# reboot
-Usage: sar [ options ] [ <interval> [ <count> ] ] +
-Main options and reports (report name between square brackets): +
-        -B      Paging statistics [A_PAGE] +
-        -b      I/O and transfer rate statistics [A_IO] +
-        -d      Block devices statistics [A_DISK] +
-        -F [ MOUNT ] +
-                Filesystems statistics [A_FS] +
-        -H      Hugepages utilization statistics [A_HUGE] +
-        -I { <int_list> | SUM | ALL } +
-                Interrupts statistics [A_IRQ] +
-        -m { <keyword> [,...] | ALL } +
-                Power management statistics [A_PWR_...] +
-                Keywords are: +
-                CPU     CPU instantaneous clock frequency +
-                FAN     Fans speed +
-                FREQ    CPU average clock frequency +
-                IN      Voltage inputs +
-                TEMP    Devices temperature +
-                USB     USB devices plugged into the system +
-        -n { <keyword> [,...] | ALL } +
-                Network statistics [A_NET_...] +
-                Keywords are: +
-                DEV     Network interfaces +
-                EDEV    Network interfaces (errors) +
-                NFS     NFS client +
-                NFSD    NFS server +
-                SOCK    Sockets (v4) +
-                IP      IP traffic      (v4) +
-                EIP     IP traffic      (v4) (errors) +
-                ICMP    ICMP traffic    (v4) +
-                EICMP   ICMP traffic    (v4) (errors) +
-                TCP     TCP traffic     (v4) +
-                ETCP    TCP traffic     (v4) (errors) +
-                UDP     UDP traffic     (v4) +
-                SOCK6   Sockets (v6) +
-                IP6     IP traffic      (v6) +
-                EIP6    IP traffic      (v6) (errors) +
-                ICMP6   ICMP traffic    (v6) +
-                EICMP6  ICMP traffic    (v6) (errors) +
-                UDP6    UDP traffic     (v6) +
-                FC      Fibre channel HBAs +
-                SOFT    Software-based network processing +
-        -q      Queue length and load average statistics [A_QUEUE] +
-        -r [ ALL ] +
-                Memory utilization statistics [A_MEMORY] +
-        -S      Swap space utilization statistics [A_MEMORY] +
-        -u [ ALL ] +
-                CPU utilization statistics [A_CPU] +
-        -v      Kernel tables statistics [A_KTABLES] +
-        -W      Swapping statistics [A_SWAP] +
-        -w      Task creation and system switching statistics [A_PCSW] +
-        -y      TTY devices statistics [A_SERIAL]+
 </code> </code>
  
-=====USB Modules=====+<WRAP center round todo 60%> 
 +**To do** - Open a new session using the **CentOS8_ROOT_10.0.2.45** connection. 
 +</WRAP>
  
-The Universal Serial Bus can offer data transfer speeds of upto 480Mb/s for version 2.0 and upto 4.8 Gb/s for version 3.0. Under Linux the USB modules are:+Check that the **usrquota** and **grpquota** options have been activated on /home:
  
-^ USB Version ^ Module ^ Name ^ +<code> 
-|  1.0\1.1  | **UHCI** | //Universal Controller Host Interface// | +[root@centos8 ~]# cat /etc/mtab | grep /home 
-|  :::  | **OHCI** | //Open Controller Host Interface// | +/dev/sdc1 /home ext4 rw,seclabel,relatime,quota,usrquota,grpquota 0 
-|  2. | **EHCI** | //Enhanced Host Controller Interface// | +</code>
-|  3.0  | **XHCI** | //Extensible Host Controller Interface// |+
  
-The following table shows a list of commonly used USB modules:+====3.1 - The quotacheck Command====
  
-^ Module ^ Peripheral ^  +To activate the quotas on /home, use the **quotacheck** command:
-|  **usb_storage**  | Block devices | +
-|  **usbhid**  | Human Interface Device | +
-|  **snd-usb-audio**  | Sound cards | +
-|  **usbvidéo**  | Video acquisition cards | +
-|  **irda-usb**  | IR peripherals | +
-|  **usbnet**  | NICs |+
  
-These modules can be loaded by any one of the following:+<code> 
 +[root@centos8 ~]# quotacheck -cugvm -f /dev/sdc1 
 +quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. 
 +quotacheck: Scanning /dev/sdc1 [/home] done 
 +quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. 
 +quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. 
 +quotacheck: Cannot stat old user quota file /home/aquota.user: No such file or directory. Usage will not be subtracted. 
 +quotacheck: Cannot stat old group quota file /home/aquota.group: No such file or directory. Usage will not be subtracted. 
 +quotacheck: Checked 6763 directories and 129772 files 
 +quotacheck: Old file not found. 
 +quotacheckOld file not found. 
 +</code>
  
-  * Initramfs, +The command line switches of the **quotacheck** command are as follows:
-  * The init process, +
-  * kmod by using the **/lib/modules/2.6.32-358.23.2.el6.i686/modules.usbmap** file, +
-  udev, +
-  manually.+
  
-=====udev=====+<code> 
 +[root@centos8 ~]# quotacheck --help 
 +Utility for checking and repairing quota files. 
 +quotacheck [-gucbfinvdmMR] [-F <quota-format>] filesystem|-a
  
-Since the 2.6 Kernel seriesLinux capable of **hotplugging**. Linux uses three componants to manage hotplugging:+-u, --user                check user files 
 +-g, --group               check group files 
 +-c, --create-files        create new quota files 
 +-b, --backup              create backups of old quota files 
 +-f, --force               force check even if quotas are enabled 
 +-i, --interactive         interactive mode 
 +-n, --use-first-dquot     use the first copy of duplicated structure 
 +-v--verbose             print more information 
 +-d, --debug               print even more messages 
 +-m, --no-remount          do not remount filesystem read-only 
 +-M, --try-remount         try remounting filesystem read-only, 
 +                          continue even if it fails 
 +-R, --exclude-root        exclude root when checking all filesystems 
 +-F, --format=formatname   check quota files of specific format 
 +-a, --all                 check all filesystems 
 +-h, --help                display this message and exit 
 +-V, --version             display version information and exit
  
-  * Udev, +Bugs to jack@suse.cz 
-  * HAL, +</code>
-  * Dbus.+
  
-The roles of each componant are as follows: +Two files, **aquota.user** and **aquota.group** are created in /home:
- +
-  * Udev dynamically creates/deletes nodes in the **/dev** directory, +
-  * HAL obtains information from udev, creates a files in XML format representing the peripheral and then informs Nautilus by using Dbus, +
-  Dbus acts as a system bus and is used for inter-process communication. +
- +
-When Linux is booted, udev plays an important role: +
- +
-  at boot **tmpfs** is mounted on /dev, +
-  * udev copies any statically configured nodes from **/lib/udev/devices** to /dev, +
-  * the **udevd** daemon collects **uevents** from the kernel and looks for anappropriate rule in the **/lib/udev/rules.d/** directory, +
-  * udev creates the nodes and any required symbolic links specified in the rule previously identified, +
-  udev stores in RAM the rules from **/lib/udev/rules.d/*.rules**, +
-  * when a change occurs udev updates the the rules in the RAM. +
- +
-udev uses the **sysfs** filesystem mounted on /sys which renders the peripherals visible to udev in user space. For example when a USB stick is inserted, udev creates **/dev/sdb1** automatically +
- +
-The main configuration file for udev is **/etc/udev/udev.conf** :+
  
 <code> <code>
-[root@centos8 ~]# cat /etc/udev/udev.conf +[root@centos8 ~]# ls -la /home 
-# see udev.conf(5) for details +total 40 
-# +drwxr-xr-x.  4 root    root     4096 Jul 21 11:27 
-# udevd is also started in the initrd.  When this file is modified you might +dr-xr-xr-x. 17 root    root      224 Jul 19 12:05 .
-# also want to rebuild the initrd, so that it will include the modified configuration+-rw-------.  1 root    root     7168 Jul 21 11:27 aquota.group 
- +-rw-------.  1 root    root     7168 Jul 21 11:27 aquota.user 
-#udev_log="info"+drwx------ 2 root    root    16384 Jul 19 12:02 lost+found 
 +drwxr-xr-x. 17 trainee trainee  4096 Jul 21 11:22 trainee 
 </code> </code>
  
-Rules files can be foud in **/lib/udev/rules.d/** :+Now create a user called **fenestros** having a password **fenestros** :
  
 <code> <code>
-[root@centos8 ~]# ls /lib/udev/rules.d+[root@centos8 ~]# groupadd fenestros && useradd fenestros -c FenestrOs -d /home/fenestros -g fenestros -s /bin/bash 
-01-md-raid-creating.rules              70-uaccess.rules +[root@centos8 ~]# passwd fenestros 
-10-dm.rules                            70-wacom.rules +Changing password for user fenestros
-11-dm-lvm.rules                        71-biosdevname.rules +New password:  
-11-dm-mpath.rules                      71-nvmf-iopolicy-netapp.rules +BAD PASSWORD: The password contains the user name in some form 
-11-dm-parts.rules                      71-prefixdevname.rules +Retype new password:  
-13-dm-disk.rules                       71-seat.rules +passwd: all authentication tokens updated successfully.
-39-usbmuxd.rules                       73-idrac.rules +
-40-elevator.rules                      73-seat-late.rules +
-40-libgphoto2.rules                    75-net-description.rules +
-40-redhat.rules                        75-probe_mtd.rules +
-40-usb-blacklist.rules                 75-rdma-description.rules +
-40-usb_modeswitch.rules                77-mm-cinterion-port-types.rules +
-50-udev-default.rules                  77-mm-dell-port-types.rules +
-60-alias-kmsg.rules                    77-mm-ericsson-mbm.rules +
-60-block.rules                         77-mm-fibocom-port-types.rules +
-60-cdrom_id.rules                      77-mm-haier-port-types.rules +
-60-drm.rules                           77-mm-huawei-net-port-types.rules +
-60-evdev.rules                         77-mm-longcheer-port-types.rules +
-60-fido-id.rules                       77-mm-mtk-port-types.rules +
-60-input-id.rules                      77-mm-nokia-port-types.rules +
-60-libfprint-2-autosuspend.rules       77-mm-pcmcia-device-blacklist.rules +
-60-net.rules                           77-mm-quectel-port-types.rules +
-60-persistent-alsa.rules               77-mm-sierra.rules +
-60-persistent-input.rules              77-mm-simtech-port-types.rules +
-60-persistent-storage.rules            77-mm-telit-port-types.rules +
-60-persistent-storage-tape.rules       77-mm-ublox-port-types.rules +
-60-persistent-v4l.rules                77-mm-usb-device-blacklist.rules +
-60-raw.rules                           77-mm-usb-serial-adapters-greylist.rules +
-60-rdma-ndd.rules                      77-mm-x22x-port-types.rules +
-60-rdma-persistent-naming.rules        77-mm-zte-port-types.rules +
-60-sensor.rules                        78-sound-card.rules +
-60-serial.rules                        80-drivers.rules +
-60-tpm-udev.rules                      80-iio-sensor-proxy.rules +
-61-gdm.rules                           80-libinput-device-groups.rules +
-61-gnome-bluetooth-rfkill.rules        80-mm-candidate.rules +
-61-gnome-settings-daemon-rfkill.rules  80-net-setup-link.rules +
-61-scsi-sg3_id.rules                   80-udisks2.rules +
-62-multipath.rules                     81-kvm-rhel.rules +
-63-fc-wwpn-id.rules                    84-nm-drivers.rules +
-63-md-raid-arrays.rules                85-nm-unmanaged.rules +
-63-scsi-sg3_symlink.rules              85-regulatory.rules +
-64-btrfs.rules                         90-alsa-restore.rules +
-64-md-raid-assembly.rules              90-bolt.rules +
-65-libwacom.rules                      90-fwupd-devices.rules +
-65-md-incremental.rules              Limiter les Ressources  90-iprutils.rules +
-65-sane-backends.rules                 90-libinput-fuzz-override.rules +
-66-kpartx.rules                        90-nm-thunderbolt.rules +
-68-del-part-nodes.rules                90-pulseaudio.rules +
-69-btattach-bcm.rules                  90-rdma-hw-modules.rules +
-69-cd-sensors.rules                    90-rdma-ulp-modules.rules +
-69-dm-lvm-metad.rules                  90-rdma-umad.rules +
-69-libmtp.rules                        90-vconsole.rules +
-69-md-clustered-confirm-device.rules   91-drm-modeset.rules +
-70-hypervfcopy.rules                   95-cd-devices.rules +
-70-hypervkvp.rules                     95-dm-notify.rules +
-70-hypervvss.rules                     95-upower-csr.rules +
-70-joystick.rules                      95-upower-hid.rules +
-70-mouse.rules                         95-upower-wup.rules +
-70-nvmf-autoconnect.rules              98-kexec.rules +
-70-power-switch.rules                  99-qemu-guest-agent.rules +
-70-printers.rules                      99-systemd.rules +
-70-spice-vdagentd.rules                99-vmware-scsi-udev.rules +
-70-touchpad.rules+
 </code> </code>
  
-<WRAP center round important 60%> +====3.2 The edquota Command====
-**Important** : You can create your own rules by putting them in the **99-local.rules** file. +
-</WRAP>+
  
-The default udev rule file is **50-udev-default.rules**:+Set a 10Mo quota for the fenestros user:
  
 <code> <code>
-[root@centos8 ~]# cat /lib/udev/rules.d/50-udev-default.rules | more +[root@centos8 ~]# edquota -u fenestros -f /home 
-# do not edit this file, it will be overwritten on update+</code>
  
-# run a command on remove events +The **vi** editor launches and you will see the following output:
-ACTION=="remove", ENV{REMOVE_CMD}!="", RUN+="$env{REMOVE_CMD}" +
-ACTION=="remove", GOTO="default_end"+
  
-SUBSYSTEM=="virtio-ports", KERNEL=="vport*", ATTR{name}=="?*", SYMLINK+="virtio-ports/$attr{name}"+<file> 
 +Disk quotas for user fenestros (uid 1001): 
 +  Filesystem                   blocks       soft       hard     inodes     soft     hard 
 +  /dev/sdc1                                  0          0          0        0        0 
 +</file>
  
-# select "system RTC" or just use the first one +Change the file as follows:
-SUBSYSTEM=="rtc", ATTR{hctosys}=="1", SYMLINK+="rtc" +
-SUBSYSTEM=="rtc", KERNEL=="rtc0", SYMLINK+="rtc", OPTIONS+="link_priority=-100"+
  
-SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_device", IMPORT{builtin}="usb_id", IMPORT{builtin}="hwdb --subsystem=usb" +<file> 
-ENV{MODALIAS}!="", IMPORT{builtin}="hwdb --subsystem=$env{SUBSYSTEM}"+Disk quotas for user fenestros (uid 1001): 
 +  Filesystem                   blocks       soft       hard     inodes     soft     hard 
 +  /dev/sdc1                               8000      10000          0        0        0 
 +</file>
  
-ACTION!="add"GOTO="default_end"+<WRAP center round important 60%> 
 +**Important** - This sets a **soft** quota of 8 000 KB and a **hard** quota of 10 000 KB for the fenestros user. When fenestros goes over the soft limithe/she will recieve a warning message. Going over the hard limit means thet he/she can no longer save files to **/home/fenestros**. Note that you can set a quota by size or by the number of inodes. 
 +</WRAP>
  
-SUBSYSTEM=="tty", KERNEL=="ptmx", GROUP="tty", MODE="0666" +Save and quit the file.
-SUBSYSTEM=="tty", KERNEL=="tty", GROUP="tty", MODE="0666" +
-SUBSYSTEM=="tty", KERNEL=="tty[0-9]*", GROUP="tty", MODE="0620" +
-SUBSYSTEM=="tty", KERNEL=="sclp_line[0-9]*", GROUP="tty", MODE="0620" +
-SUBSYSTEM=="tty", KERNEL=="ttysclp[0-9]*", GROUP="tty", MODE="0620" +
-SUBSYSTEM=="tty", KERNEL=="3270/tty[0-9]*", GROUP="tty", MODE="0620" +
-SUBSYSTEM=="vc", KERNEL=="vcs*|vcsa*", GROUP="tty" +
-KERNEL=="tty[A-Z]*[0-9]|ttymxc[0-9]*|pppox[0-9]*|ircomm[0-9]*|noz[0-9]*|rfcomm[0-9]*", GROUP="dialout"+
  
-SUBSYSTEM=="mem", KERNEL=="mem|kmem|port", GROUP="kmem", MODE="0640"+The command line switches of the **edquota** command are as follows:
  
-SUBSYSTEM=="input", GROUP="input" +<code> 
-SUBSYSTEM=="input", KERNEL=="js[0-9]*", MODE="0664"+[root@centos8 ~]# edquota --help 
 +edquota: Usage: 
 +        edquota [-rm[-u] [-F formatname] [-p username] [-f filesystem] username ... 
 +        edquota [-rm] -g [-F formatname] [-p groupname] [-f filesystem] groupname ... 
 +        edquota [-rm] -P [-F formatname] [-p projectname] [-f filesystem] projectname ... 
 +        edquota [-u|g|-P] [-F formatname] [-f filesystem] -t 
 +        edquota [-u|g|-P] [-F formatname] [-f filesystem] -T username|groupname|projectname ...
  
-SUBSYSTEM=="video4linux"GROUP="video" +-u--user                    edit user data 
-SUBSYSTEM=="graphics"GROUP="video" +-g--group                   edit group data 
-SUBSYSTEM=="drm"KERNEL!="renderD*"GROUP="video" +-P--project                 edit project data 
-SUBSYSTEM=="dvb"GROUP="video" +-r--remote                  edit remote quota (via RPC) 
-SUBSYSTEM=="media"GROUP="video" +-m, --no-mixed-pathnames      trim leading slashes from NFSv4 mountpoints 
-SUBSYSTEM=="cec"GROUP="video"+-F, --format=formatname       edit quotas of a specific format 
 +-p--prototype=name          copy data from a prototype user/group 
 +    --always-resolve          always try to resolve nameeven if it is 
 +                              composed only of digits 
 +-f, --filesystem=filesystem   edit data only on a specific filesystem 
 +-t--edit-period             edit grace period 
 +-T, --edit-times              edit grace time of a user/group 
 +-h, --help                    display this help text and exit 
 +-V, --version                 display version information and exit
  
-SUBSYSTEM=="drm", KERNEL=="renderD*", GROUP="render", MODE="0666" +Bugs to: jack@suse.cz
-SUBSYSTEM=="kfd", GROUP="render", MODE="0666" +
- +
-SUBSYSTEM=="sound", GROUP="audio",+
-  OPTIONS+="static_node=snd/seq", OPTIONS+="static_node=snd/timer" +
---More--+
 </code> </code>
  
-Each rule has the following format: +<WRAP center round important 60%> 
- +**Important** - The procedure is similar in the case that you specify group quotaIn this caseuse the **-g** switch of the edquota command
-KEY, [KEY, ...] NAME [, SYMLINK] +</WRAP>
- +
-The Key is a **type=value** pair which uniquely identifies a peripheral. The **type** can be one of the following: +
- +
-^ Type ^ Description ^ Examples ^ +
-| BUS | Bus type | usb, scsi, ide | +
-| KERNEL | The default name given to the peripheral by the kernel | hda, ttyUSB0, lp0 | +
-| SUBSYSTEM | The default sub-system name given by the Kernel, generally identical to the BUS value | usb, scsi | +
-| DRIVER | The name of the module used by the peripheral | usb-storage | +
-| ID | The position of the peripheral on its bus | PCI bus id, USB id | +
-| PLACE | The topological position of USB oeripheral on its bus| S/O | +
-| SYSFS{filename} | The name of the peripheral file in /sys. This file contains the manufacturer's name, the label, the serial number and the UUID of the peripheralEach rule can contains upto five references to files. | S/O | +
-| PROGRAM | An eventual external program to be called in order to identify the peripheral | S/O | +
-| RESULT | Value expected from PROGRAM | S/O | +
- +
-NAME and SYMLINK are used to tell udev what to do with the peripheral: +
- +
-^ Type ^ Description ^  +
-| NAME | The name of the peripheral in /dev | +
-| SYMLINK | The eventual symbolic links that point to NAME |+
  
-====The udevadm Command====+====3.3 - The quotaon Command====
  
-To obtain information from udev on a particular peripheral, you can use the **udevadm** command which has replaced the **udevinfo** command available in Red Hat/CentOS 5:+Now apply the quotas :
  
 <code> <code>
-[root@centos8 ~]# udevadm info --query=all -n /dev/sda +[root@centos8 ~]# quotaon -a
-P: /devices/pci0000:00/0000:00:07.0/ata3/host2/target2:0:0/2:0:0:0/block/sda +
-N: sda +
-S: disk/by-id/ata-QEMU_HARDDISK_QM00005 +
-S: disk/by-id/scsi-0ATA_QEMU_HARDDISK_QM00005 +
-S: disk/by-id/scsi-1ATA_QEMU_HARDDISK_QM00005 +
-S: disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00005 +
-S: disk/by-path/pci-0000:00:07.0-ata-1 +
-E: DEVLINKS=/dev/disk/by-path/pci-0000:00:07.0-ata-1 /dev/disk/by-id/scsi-SATA_QEMU_HARDDISK_QM00005 /dev/disk/by-id/ata-QEMU_HARDDISK_QM00005 /dev/disk/by-id/scsi-0ATA_QEMU_HARDDISK_QM00005 /dev/disk/by-id/scsi-1ATA_QEMU_HARDDISK_QM00005 +
-E: DEVNAME=/dev/sda +
-E: DEVPATH=/devices/pci0000:00/0000:00:07.0/ata3/host2/target2:0:0/2:0:0:0/block/sda +
-E: DEVTYPE=disk +
-E: ID_ATA=1 +
-E: ID_ATA_FEATURE_SET_SMART=1 +
-E: ID_ATA_FEATURE_SET_SMART_ENABLED=1 +
-E: ID_ATA_SATA=1 +
-E: ID_ATA_WRITE_CACHE=1 +
-E: ID_ATA_WRITE_CACHE_ENABLED=1 +
-E: ID_BUS=ata +
-E: ID_MODEL=QEMU_HARDDISK +
-E: ID_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 +
-E: ID_PART_TABLE_TYPE=dos +
-E: ID_PART_TABLE_UUID=b39ec5c8 +
-E: ID_PATH=pci-0000:00:07.0-ata-1 +
-E: ID_PATH_TAG=pci-0000_00_07_0-ata-1 +
-E: ID_REVISION=2.5+ +
-E: ID_SCSI=1 +
-E: ID_SCSI_INQUIRY=1 +
-E: ID_SERIAL=QEMU_HARDDISK_QM00005 +
-E: ID_SERIAL_SHORT=QM00005 +
-E: ID_TYPE=disk +
-E: ID_VENDOR=ATA +
-E: ID_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 +
-E: MAJOR=8 +
-E: MINOR=0 +
-E: SCSI_IDENT_LUN_ATA=QEMU_HARDDISK_QM00005 +
-E: SCSI_IDENT_LUN_T10=ATA_QEMU_HARDDISK_QM00005 +
-E: SCSI_IDENT_LUN_VENDOR=QM00005 +
-E: SCSI_IDENT_SERIAL=QM00005 +
-E: SCSI_MODEL=QEMU_HARDDISK +
-E: SCSI_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20 +
-E: SCSI_REVISION=2.5+ +
-E: SCSI_TPGS=0 +
-E: SCSI_TYPE=disk +
-E: SCSI_VENDOR=ATA +
-E: SCSI_VENDOR_ENC=ATA\x20\x20\x20\x20\x20 +
-E: SUBSYSTEM=block +
-E: TAGS=:systemd: +
-E: USEC_INITIALIZED=8735808+
 </code> </code>
  
-The command line switches of this command are:+The command line switches of the **quotaon** command are as follows:
  
 <code> <code>
-[root@centos8 ~]# udevadm --help +[root@centos8 ~]# quotaon --help 
-udevadm [--help] [--version] [--debugCOMMAND [COMMAND OPTIONS]+quotaon: Usage: 
 +        quotaon [-guPvp] [-F quotaformat] [-x state] -a 
 +        quotaon [-guPvp] [-F quotaformat] [-x statefilesys ...
  
-Send control commands or test the device manager.+-a, --all                turn quotas on for all filesystems 
 +-f, --off                turn quotas off 
 +-u, --user               operate on user quotas 
 +-g, --group              operate on group quotas 
 +-P, --project            operate on project quotas 
 +-p, --print-state        print whether quotas are on or off 
 +-x, --xfs-command=cmd    perform XFS quota command 
 +-F, --format=formatname  operate on specific quota format 
 +-v, --verbose            print more messages 
 +-h, --help               display this help text and exit 
 +-V, --version            display version information and exit 
 +</code>
  
-Commands: +<WRAP center round important 60%> 
-  info          Query sysfs or the udev database +**important** - To turn **off** quotas, use the **quotaoff** command.  
-  trigger       Request events from the kernel +</WRAP>
-  settle        Wait for pending udev events +
-  control       Control the udev daemon +
-  monitor       Listen to kernel and udev events +
-  test          Test an event run +
-  test-builtin  Test a built-in command+
  
-[root@centos8 ~]# udevadm info --help +====3.4 The repquota Command====
-udevadm info [OPTIONS] [DEVPATH|FILE]+
  
-Query sysfs or the udev database.+To see quotas, use the **repquota** command:
  
-  ---help                   Print this message +<code> 
-  ---version                Print version of the program +[root@centos8 ~]# repquota /home 
-  ---query=TYPE             Query device information: +*** Report for user quotas on device /dev/sdc1 
-       name                     Name of device node +Block grace time: 7days; Inode grace time: 7days 
-       symlink                  Pointing to node +                        Block limits                File limits 
-       path                     sysfs device path +User            used    soft    hard  grace    used  soft  hard  grace 
-       property                 The device properties +---------------------------------------------------------------------- 
-       all                      All values +root      --      20                          2                
-  ---path=SYSPATH           sysfs device path used for query or attribute walk +trainee   -- 21495888                     136532                      
-  ---name=NAME              Node or symlink name used for query or attribute walk +   
-  ---root                   Prepend dev directory to path names +
-  ---attribute-walk         Print all key matches walking along the chain +
-                              of parent devices +
-  ---device-id-of-file=FILE Print major:minor of device containing this file +
-  ---export                 Export key/value pairs +
-  ---export-prefix          Export the key name with a prefix +
-  ---export-db              Export the content of the udev database +
-  ---cleanup-db             Clean up the udev database+
 </code> </code>
  
-=====The /sys Filesystem=====+<WRAP center round important 60%> 
 +**Important** - Note that fenestros is not visible in this list. With RHEL CentOS, quotas are not visible until the user has connected for the first time.  
 +</WRAP>
  
-The virtual filesystem **/sys** was introduced with the 2.6 Kernel. Its role is to identify and describe peripherals for udev:+The command line switches of the **repquota** command are as follows:
  
 <code> <code>
-[root@centos8 ~]# ls -l /sys +[root@centos8 ~]# repquota --help 
-total 0 +repquota: Utility for reporting quotas. 
-drwxr-xr-x.   2 root root 0 Jul 12 08:15 block +Usage: 
-drwxr-xr-x.  33 root root 0 Jul 12 08:15 bus +repquota [-vugsi] [-c|C] [-t|n] [-F quotaformat] [-O (default | xml | csv)] (-a | mntpoint) 
-drwxr-xr-x.  57 root root 0 Jul 12 08:15 class + 
-drwxr-xr-x.   4 root root 0 Jul 12 08:15 dev +-v, --verbose               display also users/groups without any usage 
-drwxr-xr-x.  14 root root 0 Jul 12 08:15 devices +-u, --user                  display information about users 
-drwxr-xr-x  6 root root 0 Jul 12 08:15 firmware +-g, --group                 display information about groups 
-drwxr-xr-x.   root root 0 Jul 12 08:15 fs +-P, --project               display information about projects 
-drwxr-xr-x.   2 root root 0 Jul 12 08:15 hypervisor +-s, --human-readable        show numbers in human friendly units (MB, GB, ...) 
-drwxr-xr-x.  15 root root 0 Jul 12 08:15 kernel +-t, --truncate-names        truncate names to characters 
-drwxr-xr-x. 153 root root 0 Jul 12 08:15 module +-p, --raw-grace             print grace time in seconds since epoch 
-drwxr-xr-x  2 root root 0 Jul 12 08:15 power+-n, --no-names              do not translate uid/gid to name 
 +-i, --no-autofs             avoid autofs mountpoints 
 +-c, --cache                 translate big number of ids at once 
 +-C, --no-cache              translate ids one by one 
 +-F, --format=formatname     report information for specific format 
 +-O, --output=format         format output as xml or csv 
 +-a, --all                   report information for all mount points with quotas 
 +-h, --help                  display this help message and exit 
 +-V, --version               display version information and exit 
 + 
 +Bugs to jack@suse.cz
 </code> </code>
  
-Each directory contains specific information:+====3.5 - The quota Command====
  
-  * **block** +To see quotas for a specific user, use the **quota** command:
-    * information concerning block devices +
-  * **bus** +
-    * information concerning buses +
-  * **class** +
-    * information concerning classes +
-  * **devices** +
-    * information concerning the posiion of devices on their bus +
-  * **firmware** +
-    * information concerning APCI +
-  * **module** +
-    * information concerning kernel modules +
-  * **power** +
-    * information concerning power management +
-  * **fs** +
-    information concerning file systems +
- +
-For example:+
  
 <code> <code>
-[root@centos ~]# cat /sys/block/sda/sda1/size +[root@centos8 ~]# quota fenestros 
-2097152+Disk quotas for user fenestros (uid 1001): no limited resources used 
 +[root@centos8 ~]# su - fenestros 
 +[fenestros@centos8 ~]$ touch test 
 +[fenestros@centos8 ~]$ exit 
 +logout 
 +[root@centos8 ~]# quota fenestros 
 +Disk quotas for user fenestros (uid 1001):  
 +     Filesystem  blocks   quota   limit   grace   files   quota   limit   grace 
 +      /dev/sdc1          8000   10000                                       
 </code> </code>
  
-The figure returned is in sectors.+The command line switches of the **quota** command are as follows:
  
-=====LAB #Limiting Ressources=====+<code> 
 +[root@centos8 ~]quota --help 
 +quota: Usage: quota [-guPqvswim] [-l | [-Q | -A]] [-F quotaformat] 
 +        quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -u username ... 
 +        quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -g groupname ... 
 +        quota [-qvswugPQm] [-F quotaformat] -f filesystem ...
  
-====4.ulimit====+-u, --user                display quota for user 
 +-g, --group               display quota for group 
 +-P, --project             display quota for project 
 +-q, --quiet               print more terse message 
 +-v, --verbose             print more verbose message 
 +-s, --human-readable      display numbers in human friendly units (MB, GB...) 
 +    --always-resolve      always try to translate name to id, even if it is 
 +                          composed of only digits 
 +-w, --no-wrap             do not wrap long lines 
 +-p, --raw-grace           print grace time in seconds since epoch 
 +-l, --local-only          do not query NFS filesystems 
 +-Q, --quiet-refuse        do not print error message when NFS server does 
 +                          not respond 
 +-i, --no-autofs           do not query autofs mountpoints 
 +-F, --format=formatname   display quota of a specific format 
 +-f, --filesystem-list     display quota information only for given filesystems 
 +-A, --all-nfs             display quota for all NFS mountpoints 
 +-m, --no-mixed-pathnames  trim leading slashes from NFSv4 mountpoints 
 +    --show-mntpoint       show mount point of the file system in output 
 +    --hide-device         do not show file system device in output 
 +-h, --help                display this help message and exit 
 +-V, --version             display version information and exit
  
-Resources available to users can be limited by using the **ulimit** command+Bugs to: jack@suse.cz 
 +</code>
  
-The **ulimit** command manages two limits:+====3.6 - The warnquota Command====
  
-  a //hard// hard limit by specifying the **-H** switch, +The **warnquota** command checks user and group disk usage and sends out messages when the **soft** limit is reachedThis command is normally called by a cron job however it is possible to use it interactively. With RHEL/CentOS, warnquota is not installd by default:
-  a //soft// soft limit by specifying the **-S** switch.+
  
-The soft limit is the limit imposed on the user whilst the hard limit is the limit that a user can obtain once he has gone over the soft limit.+<code> 
 +[root@centos8 ~]# which warnquota 
 +/usr/bin/which: no warnquota in (/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin) 
 +</code>
  
-Only root can position a hard limit and only if the limit does not exceed real resource levels. +Install the **quota-warnquota** package
- +
-Root can define limits by editing the **/etc/security/limits.conf** file:+
  
 <code> <code>
-[root@centos8 ~]# cat /etc/security/limits.conf +[root@centos7 ~]# dnf install quota-warnquota
-# /etc/security/limits.conf +
-+
-#This file sets the resource limits for the users logged in via PAM. +
-#It does not affect resource limits of the system services. +
-+
-#Also note that configuration files in /etc/security/limits.d directory, +
-#which are read in alphabetical order, override the settings in this +
-#file in case the domain is the same or more specific. +
-#That means for example that setting a limit for wildcard domain here +
-#can be overriden with a wildcard setting in a config file in the +
-#subdirectory, but a user specific setting here can be overriden only +
-#with a user specific setting in the subdirectory. +
-+
-#Each line describes a limit for a user in the form: +
-+
-#<domain>        <type>  <item>  <value> +
-+
-#Where: +
-#<domain> can be: +
-#        a user name +
-#        - a group name, with @group syntax +
-#        - the wildcard *, for default entry +
-#        - the wildcard %, can be also used with %group syntax, +
-#                 for maxlogin limit +
-+
-#<type> can have the two values: +
-#        - "soft" for enforcing the soft limits +
-#        - "hard" for enforcing hard limits +
-+
-#<item> can be one of the following: +
-#        - core - limits the core file size (KB) +
-#        - data - max data size (KB) +
-#        - fsize - maximum filesize (KB) +
-#        - memlock - max locked-in-memory address space (KB) +
-#        - nofile - max number of open file descriptors +
-#        - rss - max resident set size (KB) +
-#        - stack - max stack size (KB) +
-#        - cpu - max CPU time (MIN) +
-#        - nproc - max number of processes +
-#        - as - address space limit (KB) +
-#        - maxlogins - max number of logins for this user +
-#        - maxsyslogins - max number of logins on the system +
-#        - priority - the priority to run user process with +
-#        - locks - max number of file locks the user can hold +
-#        - sigpending - max number of pending signals +
-#        - msgqueue - max memory used by POSIX message queues (bytes) +
-#        - nice - max nice priority allowed to raise to values: [-20, 19] +
-#        - rtprio - max realtime priority +
-+
-#<domain>      <type>  <item>         <value> +
-+
- +
-#*               soft    core            0 +
-#*               hard    rss             10000 +
-#@student        hard    nproc           20 +
-#@faculty        soft    nproc           20 +
-#@faculty        hard    nproc           50 +
-#ftp             hard    nproc           0 +
-#@student        -       maxlogins       4 +
- +
-# End of file +
-</code>  +
- +
-<WRAP center round important 60%> +
-**Important** : The limit can be a number or the word **unlimited**. +
-</WRAP> +
- +
-For example if root adds the two following lines to /etc/security/limits.conf: +
- +
-<file>+
 ... ...
-trainee                soft        nofile          1024 
-trainee                hard        nofile          4096 
-... 
-</file> 
- 
-the number of open files for trainee is limited to 1024. However trainee can increase this limit to 4 096 by using the following command: 
- 
-<code> 
-$ ulimit -n 4096 
 </code> </code>
  
-To see the list of the current limits use the **-a** switch:+The command line switches of the **warnquota** command are as follows:
  
 <code> <code>
-[root@centos8 ~]# ulimit -+[root@centos8 ~]# warnquota --help 
-core file size          (blocks, -c) unlimited +warnquota: Usage: 
-data seg size           (kbytes, -d) unlimited +  warnquota [-ugsid] [-F quotaformat] [-c configfile] [-q quotatabfile] [-a adminsfile] [filesystem...]
-scheduling priority             (-e) 0 +
-file size               (blocks, -f) unlimited +
-pending signals                 (-i) 14702 +
-max locked memory       (kbytes, -l) 64 +
-max memory size         (kbytes, -m) unlimited +
-open files                      (-n) 1024 +
-pipe size            (512 bytes, -p) 8 +
-POSIX message queues     (bytes, -q) 819200 +
-real-time priority              (-r) 0 +
-stack size              (kbytes, -s) 8192 +
-cpu time               (seconds, -t) unlimited +
-max user processes              (-u) 14702 +
-virtual memory          (kbytes, -v) unlimited +
-file locks                      (-x) unlimited +
-</code>+
  
-The command line switches of this command are:+-u, --user                      warn users 
 +-g, --group                     warn groups 
 +-s, --human-readable            send information in more human friendly units 
 +-i, --no-autofs                 avoid autofs mountpoints 
 +-d, --no-details                do not send quota information itself 
 +-F, --format=formatname         use quotafiles of specific format 
 +-c, --config=config-file        non-default config file 
 +-q, --quota-tab=quotatab-file   non-default quotatab 
 +-a, --admins-file=admins-file   non-default admins file 
 +-h, --help                      display this help message and exit 
 +-v, --version                   display version information and exit
  
-<code> +warnquotaBugs to jack@suse.cz
-[root@centos8 ~]# help ulimit +
-ulimitulimit [-SHabcdefiklmnpqrstuvxPT] [limit] +
-    Modify shell resource limits. +
-     +
-    Provides control over the resources available to the shell and processes +
-    it creates, on systems that allow such control. +
-     +
-    Options: +
-      -S        use the `soft' resource limit +
-      -H        use the `hard' resource limit +
-      -a        all current limits are reported +
-      -b        the socket buffer size +
-      -c        the maximum size of core files created +
-      -d        the maximum size of a process's data segment +
-      -e        the maximum scheduling priority (`nice'+
-      -f        the maximum size of files written by the shell and its children +
-      -i        the maximum number of pending signals +
-      -k        the maximum number of kqueues allocated for this process +
-      -l        the maximum size a process may lock into memory +
-      -m        the maximum resident set size +
-      -n        the maximum number of open file descriptors +
-      -p        the pipe buffer size +
-      -q        the maximum number of bytes in POSIX message queues +
-      -r        the maximum real-time scheduling priority +
-      -s        the maximum stack size +
-      -t        the maximum amount of cpu time in seconds +
-      -u        the maximum number of user processes +
-      -v        the size of virtual memory +
-      -x        the maximum number of file locks +
-      -P        the maximum number of pseudoterminals +
-      -T        the maximum number of threads +
-     +
-    Not all options are available on all platforms. +
-     +
-    If LIMIT is given, it is the new value of the specified resource; the +
-    special LIMIT values `soft', `hard', and `unlimited' stand for the +
-    current soft limit, the current hard limit, and no limit, respectively. +
-    Otherwise, the current value of the specified resource is printed.  If +
-    no option is given, then -f is assumed. +
-     +
-    Values are in 1024-byte increments, except for -t, which is in seconds, +
-    -p, which is in increments of 512 bytes, and -u, which is an unscaled +
-    number of processes. +
-     +
-    Exit Status: +
-    Returns success unless an invalid option is supplied or an error occurs.+
 </code> </code>
  
 ----- -----
-<html> +Copyright © 2022 Hugh Norris.
-<div align="center"> +
-Copyright © 2021 Hugh Norris. +
-</html>+
Menu