Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
elearning:workbooks:centos:8:avance:l112 [2023/12/08 15:12] – admin | elearning:workbooks:centos:8:avance:l112 [2024/10/01 08:07] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
~~PDF: | ~~PDF: | ||
- | Version : **2023.01** | + | Version : **2024.01** |
Dernière mise-à-jour : ~~LASTMOD~~ | Dernière mise-à-jour : ~~LASTMOD~~ | ||
- | ======LCF603 | + | ======LCF604 |
+ | |||
+ | < | ||
+ | [root@centos8 ~]# sed -i ' | ||
+ | [root@centos8 ~]# sed -i ' | ||
+ | </ | ||
=====Contenu du Module===== | =====Contenu du Module===== | ||
- | * **LCF603 | + | * **LCF604 |
* Contenu du Module | * Contenu du Module | ||
- | * Rôle du noyau | + | * Présentation des Fichiers Spéciaux |
- | * LAB #1 - Modules | + | * LAB #1 - Découvrir le Matériel |
- | * LAB #2 - Compilation et installation du noyau et des modules | + | * 1.1 - La Commande lspci |
- | * 2.1 - Déplacer /home | + | * 1.2 - La Commande lsusb |
- | * 2.2 - Préparer l' | + | * 1.3 - La Commande lsblk |
- | * 2.3 - Préparer l' | + | * 1.4 - La Commande lsscsi |
- | * Le Fichier | + | * 1.5 - La Commande lscpu |
- | * Le Fichier Makefile | + | * 1.6 - La Commande lshw |
- | * 2.4 - Paramétrage du noyau | + | * 1.7 - La Commande dmidecode |
- | * 2.5 - Compiler le Noyau | + | * 1.8 - La Commande smartctl |
- | * 2.6 - Installer le Nouveau Noyau | + | * 1.9 - Les Commandes accton et dump-acct |
- | * LAB #3 - Gestion | + | * 1.10 - La Commande lastcomm |
- | * 3.1 - La Commande quotacheck | + | * 1.11 - La Commande sa |
- | * 3.2 - La Commande edquota | + | * 1.12 - La Commande ac |
- | * 3.3 - La Commande quotaon | + | * LAB #2 - La Commande sysctl |
- | * 3.4 - La Commande repquota | + | * 2.1 - Répertoire /proc |
- | * 3.5 - La Commande quota | + | * Fichiers |
- | * 3.6 - La Commande | + | * Processeur |
+ | * Interruptions système | ||
+ | * Canaux DMA | ||
+ | * Plages d' | ||
+ | * Périphériques | ||
+ | * Modules | ||
+ | * Statistiques de l' | ||
+ | * Partitions | ||
+ | * Espaces de pagination | ||
+ | * Statistiques d' | ||
+ | * Statistiques d' | ||
+ | * Version du noyau | ||
+ | * Répertoires | ||
+ | * ide/scsi | ||
+ | * acpi | ||
+ | * bus | ||
+ | * net | ||
+ | * sys | ||
+ | * 2.2 - Utilisation de la Commande sysctl | ||
+ | * LAB #3 - Interprétation | ||
+ | * 3.1 - free | ||
+ | * 3.2 - uptime ou w | ||
+ | * 3.3 - iostat | ||
+ | * 3.4 - hdparm | ||
+ | * 3.5 - vmstat | ||
+ | * 3.6 - mpstat | ||
+ | * 3.7 - sar | ||
+ | * Modules usb | ||
+ | * udev | ||
+ | * La Commande udevadm | ||
+ | * Système de fichiers /sys | ||
+ | * LAB #4 - Limiter les Ressources | ||
+ | * 4.1 - ulimit | ||
+ | * 4.2 - Groupes de Contrôle | ||
+ | * La Limitation de la Mémoire | ||
+ | * La Commande cgcreate | ||
+ | * La Commande cgdelete | ||
+ | * Le Fichier / | ||
+ | * La Commande | ||
- | =====Rôle du noyau===== | + | =====Présentation des Fichiers Spéciaux===== |
- | Le noyau ou //kernel// est la partie du système d'exploitation qui gère les entrées/ | + | Dans l'ordinateur |
- | * la diminution de la taille du noyau, | + | <WRAP center round important 60%> |
- | * la prise en charge de nouveau matériel, | + | **Important** : Les périphériques qui nécessitent à ce que l'ordinateur soit éteint afin des les brancher/ |
- | | + | </ |
- | | + | |
- | | + | Consultez le contenu du répertoire /dev : |
- | | + | |
- | + | ||
- | Commencez par mettre à jour CentOS 8 : | + | |
< | < | ||
- | [root@centos8 ~]# dnf update | + | [root@centos8 ~]# ls -l /dev | more |
- | ... | + | total 0 |
- | [root@centos8 ~]# reboot | + | crw-r--r--. 1 root root 10, 235 Jun 28 02:04 autofs |
+ | 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. | ||
+ | lrwxrwxrwx. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | crw-------. | ||
+ | lrwxrwxrwx. | ||
+ | drwxr-xr-x. 10 root root 200 Jun 28 02:04 cpu | ||
+ | crw-------. | ||
+ | drwxr-xr-x. | ||
+ | brw-rw----. | ||
+ | brw-rw----. | ||
+ | drwxr-xr-x. | ||
+ | crw-rw----. | ||
+ | lrwxrwxrwx. | ||
+ | crw-rw-rw-. | ||
+ | crw-rw-rw-. | ||
+ | crw-------. | ||
+ | crw-------. | ||
+ | drwxr-xr-x. | ||
+ | crw-------. | ||
+ | lrwxrwxrwx. | ||
+ | drwxr-xr-x. | ||
+ | crw-r--r--. | ||
+ | lrwxrwxrwx. | ||
+ | crw-rw----. | ||
+ | crw-rw----. | ||
+ | crw-rw----. | ||
+ | crw-rw----. | ||
+ | crw-rw----. | ||
+ | drwxr-xr-x. | ||
+ | crw-------. | ||
+ | crw-r-----. | ||
+ | drwxrwxrwt. | ||
+ | drwxr-xr-x. | ||
+ | crw-rw-rw-. | ||
+ | --More-- | ||
</ | </ | ||
- | Identifiez ensuite le noyau utilisé par votre machine virtuelle : | + | On peut noter dans la sortie de la commande que certains fichiers sont de type **bloc** (**b**), tandis que d' |
< | < | ||
- | [root@centos8 ~]# uname -r | + | ... |
- | 4.18.0-305.7.1.el8_4.x86_64 | + | brw-rw----. |
+ | ... | ||
+ | crw-rw-rw-. 1 root tty | ||
+ | ... | ||
</ | </ | ||
- | =====LAB #1 - Modules===== | + | La différence entre les deux repose sur le type de communication entre le système et le module. Dans le premier cas le système accède au périphérique par des coordonnées du bloc de données sur le support tandis que dans le deuxième cas la communication d' |
- | Dans le cas d'une utilisation courante de Linux, il est cependant préférable de faire appel aux **modules**. Les modules se trouvent dans le répertoire | + | Les deux informations clefs du fichier spécial sont situées à la place de la taille |
+ | |||
+ | * le **majeur** identifie le pilote | ||
+ | | ||
+ | |||
+ | =====LAB #1 - Découvrir le Matériel===== | ||
+ | |||
+ | ====1.1 - La Commande lspci==== | ||
+ | |||
+ | Cette commande vous renseigne sur les adaptateurs reliés aux bus PCI, AGP et PCI express | ||
< | < | ||
- | [root@centos8 ~]# ls / | + | [root@centos8 ~]# lspci |
- | bls.conf | + | 00:00.0 Host bridge: Intel Corporation 440FX - 82441FX PMC [Natoma] (rev 02) |
- | build modules.builtin.bin modules.order updates | + | 00:01.0 ISA bridge: Intel Corporation 82371SB PIIX3 ISA [Natoma/Triton II] |
- | config | + | 00:01.1 IDE interface: Intel Corporation 82371SB PIIX3 IDE [Natoma/ |
- | kernel | + | 00:01.2 USB controller: Intel Corporation 82371SB PIIX3 USB [Natoma/ |
- | modules.alias modules.devname | + | 00:01.3 Bridge: Intel Corporation 82371AB/ |
- | modules.alias.bin modules.drm | + | 00:02.0 VGA compatible controller: Device 1234:1111 (rev 02) |
- | modules.block | + | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon |
+ | 00:07.0 SATA controller: Intel Corporation 82801IR/ | ||
+ | 00:12.0 Ethernet controller: Red Hat, Inc. Virtio network device | ||
+ | 00:1e.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge | ||
+ | 00:1f.0 PCI bridge: Red Hat, Inc. QEMU PCI-PCI bridge | ||
</ | </ | ||
- | Les commandes pour manipuler les modules sont : | + | Pour obtenir de l' |
- | * insmod | + | < |
- | * rmmod | + | [root@centos8 ~]# lspci -v -s 00:03.0 |
- | * lsmod | + | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon |
- | * modprobe | + | |
+ | Physical Slot: 3 | ||
+ | Flags: bus master, fast devsel, latency 0, IRQ 10 | ||
+ | I/O ports at e000 [size=64] | ||
+ | Memory at fe400000 (64-bit, prefetchable) [size=16K] | ||
+ | Capabilities: | ||
+ | Capabilities: | ||
+ | Capabilities: | ||
+ | Capabilities: | ||
+ | Capabilities: | ||
+ | Kernel driver in use: virtio-pci | ||
+ | </ | ||
- | Par exemple | + | ou : |
< | < | ||
- | [root@centos8 ~]# lsmod | + | [root@centos8 ~]# lspci -vv -s 00:03.0 |
- | Module | + | 00:03.0 Unclassified device [00ff]: Red Hat, Inc. Virtio memory balloon |
- | xt_CHECKSUM | + | |
- | ipt_MASQUERADE | + | |
- | xt_conntrack | + | |
- | ipt_REJECT | + | |
- | nft_compat | + | |
- | nf_nat_tftp | + | |
- | nft_objref | + | |
- | nf_conntrack_tftp | + | |
- | nft_counter | + | |
- | tun 53248 1 | + | BAR=0 offset=00000000 size=00000000 |
- | bridge | + | |
- | stp 16384 1 bridge | + | BAR=4 offset=00003000 size=00001000 multiplier=00000004 |
- | llc 16384 2 bridge,stp | + | |
- | nft_fib_inet | + | |
- | nft_fib_ipv4 | + | |
- | nft_fib_ipv6 | + | |
- | nft_fib | + | |
- | nft_reject_inet | + | |
- | nf_reject_ipv4 | + | |
- | nf_reject_ipv6 | + | |
- | nft_reject | + | |
- | nft_ct | + | |
- | nf_tables_set | + | |
- | nft_chain_nat | + | |
- | nf_nat | + | |
- | nf_conntrack | + | |
- | nf_defrag_ipv6 | + | |
- | nf_defrag_ipv4 | + | |
- | ip_set | + | |
- | nf_tables | + | |
- | nfnetlink | + | |
- | sunrpc | + | |
- | ext4 761856 | + | |
- | mbcache | + | |
- | jbd2 131072 | + | |
- | virtio_balloon | + | |
- | pcspkr | + | |
- | i2c_piix4 | + | |
- | joydev | + | |
- | ip_tables | + | |
- | xfs 1515520 | + | |
- | libcrc32c | + | |
- | sr_mod | + | |
- | sd_mod | + | |
- | cdrom 65536 1 sr_mod | + | |
- | t10_pi | + | |
- | sg | + | |
- | ata_generic | + | |
- | bochs_drm | + | |
- | drm_vram_helper | + | |
- | drm_kms_helper | + | |
- | syscopyarea | + | |
- | sysfillrect | + | |
- | sysimgblt | + | |
- | fb_sys_fops | + | |
- | drm_ttm_helper | + | |
- | ttm | + | |
- | drm | + | |
- | ahci | + | |
- | libahci | + | |
- | virtio_net | + | |
- | net_failover | + | |
- | ata_piix | + | |
- | serio_raw | + | |
- | failover | + | |
- | libata | + | |
- | dm_mirror | + | |
- | dm_region_hash | + | |
- | dm_log | + | |
- | dm_mod | + | |
- | fuse 151552 | + | |
</ | </ | ||
- | Pour ajouter un module, on peut utiliser | + | ===Options de la commande=== |
+ | |||
+ | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 ~]# modprobe bonding | + | [root@centos8 ~]# lspci --help |
- | [root@centos8 ~]# lsmod | more | + | lspci: invalid option -- ' |
- | Module | + | Usage: lspci [< |
- | bonding | + | |
- | xt_CHECKSUM | + | Basic display modes: |
- | ipt_MASQUERADE | + | -mm |
- | xt_conntrack | + | -t Show bus tree |
- | ipt_REJECT | + | |
- | nft_compat | + | Display options: |
- | nf_nat_tftp | + | -v Be verbose (-vv or -vvv for higher verbosity) |
- | nft_objref | + | -k Show kernel drivers handling each device |
- | nf_conntrack_tftp | + | -x Show hex-dump of the standard part of the config space |
- | nft_counter | + | -xxx Show hex-dump of the whole config space (dangerous; root only) |
- | tun 53248 1 | + | -xxxx Show hex-dump of the 4096-byte extended config space (root only) |
- | bridge | + | -b Bus-centric view (addresses and IRQ's as seen by the bus) |
- | stp 16384 1 bridge | + | -D Always show domain numbers |
- | llc 16384 2 bridge,stp | + | -P Display |
- | nft_fib_inet | + | -PP |
- | nft_fib_ipv4 | + | |
- | nft_fib_ipv6 | + | Resolving of device ID's to names: |
- | nft_fib | + | -n Show numeric ID's |
- | nft_reject_inet | + | -nn Show both textual and numeric ID's (names & numbers) |
- | nf_reject_ipv4 | + | -q Query the PCI ID database for unknown ID's via DNS |
- | nf_reject_ipv6 | + | -qq As above, but re-query locally cached entries |
- | --More-- | + | -Q Query the PCI ID database for all ID's via DNS |
+ | |||
+ | Selection of devices: | ||
+ | -s [[[[< | ||
+ | -d [< | ||
+ | |||
+ | Other options: | ||
+ | -i < | ||
+ | -p < | ||
+ | -M Enable `bus | ||
</ | </ | ||
- | Pour supprimer un module, on peut utiliser la commande **rmmod** ou **modprobe | + | ====1.2 |
+ | |||
+ | Cette commande vous renseigne sur les adaptateurs reliés au bus usb : | ||
< | < | ||
- | [root@centos8 ~]# modprobe -r bonding | + | [root@centos8 ~]# lsusb |
- | [root@centos8 ~]# lsmod | more | + | Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd |
- | Module | + | Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub |
- | xt_CHECKSUM | + | |
- | ipt_MASQUERADE | + | [root@centos8 ~]# lsusb -vt |
- | xt_conntrack | + | /: Bus 01.Port |
- | ipt_REJECT | + | |__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M |
- | nft_compat | + | |
- | nf_nat_tftp | + | |
- | nft_objref | + | |
- | nf_conntrack_tftp | + | |
- | nft_counter | + | |
- | tun 53248 1 | + | |
- | bridge | + | |
- | stp 16384 1 bridge | + | |
- | llc 16384 | + | |
- | nft_fib_inet | + | |
- | nft_fib_ipv4 | + | |
- | nft_fib_ipv6 | + | |
- | nft_fib | + | |
- | nft_reject_inet | + | |
- | nf_reject_ipv4 | + | |
- | nf_reject_ipv6 | + | |
- | nft_reject | + | |
- | --More-- | + | |
</ | </ | ||
- | Les dépendances des modules sont résolues par la commande | + | ===Options de la commande=== |
+ | |||
+ | Les options de cette commande | ||
< | < | ||
- | [root@centos8 ~]# more / | + | [root@centos8 ~]# lsusb --help |
- | kernel/ | + | Usage: lsusb [options]... |
- | kernel/ | + | List USB devices |
- | kernel/ | + | -v, --verbose |
- | kernel/ | + | |
- | kernel/ | + | -s [[bus]:][devnum] |
- | kernel/ | + | Show only devices with specified device and/or |
- | kernel/ | + | bus numbers (in decimal) |
- | kernel/ | + | -d vendor:[product] |
- | kernel/ | + | Show only devices with the specified vendor and |
- | kernel/arch/ | + | |
- | xz kernel/ | + | .LAB#1 |
- | kernel/ | + | -D device |
- | kernel/ | + | |
- | kernel/ | + | -t, --tree |
- | kernel/ | + | Dump the physical USB device hierarchy as a tree |
- | kernel/ | + | |
- | kernel/ | + | Show version of program |
- | kernel/ | + | -h, --help |
- | kernel/ | + | Show usage and help |
- | kernel/ | + | |
- | _64.ko.xz | + | |
- | kernel/ | + | |
- | --More--(0%) | + | |
</ | </ | ||
- | Il est possible d' | + | ====1.3 - La Commande lsblk==== |
+ | |||
+ | Cette commande | ||
< | < | ||
- | [root@centos8 ~]# modinfo bonding | + | [root@centos8 ~]# lsblk |
- | filename: / | + | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT |
- | author: Thomas Davis, tadavis@lbl.gov and many others | + | sda 8:0 0 |
- | description: | + | ├─sda1 |
- | license: GPL | + | └─sda2 |
- | alias: | + | |
- | rhelversion: | + | |
- | srcversion: 445F4CC9A2F7E64E3A87FD0 | + | sdb 8:16 |
- | depends: | + | sdc 8:32 |
- | intree: | + | └─sdc1 |
- | name: | + | sdd 8:48 0 |
- | vermagic: | + | sr0 |
- | sig_id: PKCS#7 | + | |
- | signer: | + | [root@centos8 ~]# lsblk -l |
- | sig_key: | + | NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT |
- | sig_hashalgo: sha256 | + | sda 8:0 0 |
- | signature: | + | sda1 8:1 0 1G 0 part /boot |
- | | + | sda2 8:2 0 |
- | | + | sdb 8:16 |
- | | + | sdc 8:32 0 64G |
- | 44: | + | sdc1 8:33 0 64G 0 part /home |
- | DE: | + | sdd 8:48 0 32G 0 disk |
- | | + | sr0 11:0 1 1024M |
- | | + | cl_centos8-root 253:0 0 27.8G 0 lvm / |
- | | + | cl_centos8-swap 253:1 |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | 50: | + | |
- | 2F: | + | |
- | CA: | + | |
- | 0C: | + | |
- | A6: | + | |
- | AE: | + | |
- | 59: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: primary: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: ad_select: | + | |
- | parm: min_links: | + | |
- | parm: | + | |
- | parm: arp_interval: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: all_slaves_active: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: lp_interval: | + | |
</ | </ | ||
- | Dernièrement, | + | ===Options de la commande=== |
+ | |||
+ | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 ~]# ls / | + | [root@centos8 ~]# lsblk --help |
- | firewalld-sysctls.conf | + | |
- | kvm.conf | + | |
- | [root@centos8 ~]# cat / | + | Usage: |
- | # Setting modprobe kvm_intel/ | + | |
- | # only enables Nested Virtualization until the next reboot or | + | |
- | # module reload. Uncomment | + | List information about block devices. |
- | # to your system below to enable | + | |
- | # | + | Options: |
- | # User changes in this file are preserved across upgrades. | + | -a, --all print all devices |
- | # | + | -b, --bytes |
- | # For Intel | + | -d, --nodeps |
- | #options kvm_intel nested=1 | + | -D, --discard |
- | # | + | -z, --zoned |
- | # For AMD | + | -e, --exclude < |
- | #options kvm_amd nested=1 | + | -f, --fs |
+ | -i, --ascii | ||
+ | -I, --include < | ||
+ | -J, --json | ||
+ | -l, --list | ||
+ | -T, --tree | ||
+ | -m, --perms | ||
+ | -n, --noheadings | ||
+ | -o, --output < | ||
+ | -O, --output-all | ||
+ | -p, --paths | ||
+ | -P, --pairs | ||
+ | -r, --raw use raw output format | ||
+ | -s, --inverse | ||
+ | -S, --scsi | ||
+ | -t, --topology | ||
+ | -x, --sort < | ||
+ | |||
+ | -h, --help | ||
+ | -V, --version | ||
+ | |||
+ | Available output columns: | ||
+ | NAME device name | ||
+ | | ||
+ | | ||
+ | FSTYPE | ||
+ | MOUNTPOINT | ||
+ | LABEL filesystem LABEL | ||
+ | UUID filesystem UUID | ||
+ | PARTTYPE | ||
+ | | ||
+ | PARTUUID | ||
+ | | ||
+ | RA read-ahead of the device | ||
+ | RO read-only device | ||
+ | RM removable device | ||
+ | | ||
+ | | ||
+ | SERIAL | ||
+ | SIZE size of the device | ||
+ | STATE state of the device | ||
+ | OWNER user name | ||
+ | GROUP group name | ||
+ | | ||
+ | ALIGNMENT | ||
+ | | ||
+ | | ||
+ | PHY-SEC | ||
+ | LOG-SEC | ||
+ | ROTA rotational device | ||
+ | | ||
+ | | ||
+ | TYPE device type | ||
+ | DISC-ALN | ||
+ | | ||
+ | DISC-MAX | ||
+ | | ||
+ | | ||
+ | | ||
+ | RAND adds randomness | ||
+ | PKNAME | ||
+ | HCTL Host: | ||
+ | TRAN device transport type | ||
+ | SUBSYSTEMS | ||
+ | | ||
+ | VENDOR | ||
+ | | ||
+ | |||
+ | For more details see lsblk(8). | ||
</ | </ | ||
- | =====LAB #2 - Compilation et installation du noyau et des modules===== | + | ====1.4 - La Commande lsscsi==== |
- | Activez le dépôt **CentOS-Linux-PowerTools** en passant la directive **enabled** à **1** : | + | Cette commmande vous renseigne sur les périphériques SCSI et NVMe : |
< | < | ||
- | [root@centos8 ~]# vi / | + | [root@centos8 ~]# lsscsi |
- | [root@centos8 ~]# cat /etc/yum.repos.d/CentOS-Linux-PowerTools.repo | + | [1: |
- | # CentOS-Linux-PowerTools.repo | + | [2:0:0:0] |
- | # | + | [3: |
- | # The mirrorlist system uses the connecting IP address of the client and the | + | [4: |
- | # update status of each mirror to pick current mirrors that are geographically | + | [5: |
- | # close to the client. | + | </ |
- | # manually picking other mirrors. | + | |
- | # | + | |
- | # If the mirrorlist does not work for you, you can try the commented out | + | |
- | # baseurl line instead. | + | |
- | [powertools] | + | ===Options de la commande=== |
- | name=CentOS Linux $releasever - PowerTools | + | |
- | mirrorlist=http:// | + | Les options de cette commande sont : |
- | #baseurl=http://mirror.centos.org/$contentdir/$releasever/PowerTools/ | + | |
- | gpgcheck=1 | + | < |
- | enabled=1 | + | [root@centos8 ~]# man lsscsi |
- | gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial | + | [root@centos8 ~]# lsscsi --help |
+ | Usage: lsscsi | ||
+ | [--help] [--hosts] [--kname] [--list] [--long] [--long-unit] | ||
+ | [--lunhex] [--no-nvme] [--pdt] [--protection] [--prot-mode] | ||
+ | [--scsi_id] [--size] [--sz-lbs] [--sysfsroot=PATH] [--transport] | ||
+ | [--unit] [--verbose] [--version] [--wwn] | ||
+ | where: | ||
+ | --brief|-b | ||
+ | --classic|-c | ||
+ | --controllers|-C | ||
+ | like SCSI hosts | ||
+ | --device|-d | ||
+ | --generic|-g | ||
+ | --help|-h | ||
+ | --hosts|-H | ||
+ | --kname|-k | ||
+ | --list|-L | ||
+ | attribute=value per line | ||
+ | --long|-l | ||
+ | --long-unit|-U | ||
+ | '.naa', 'eui.', ' | ||
+ | --lunhex|-x | ||
+ | use twice to get full 16 digit hexadecimal LUN | ||
+ | --no-nvme|-N | ||
+ | --pdt|-D | ||
+ | --protection|-p | ||
+ | --protmode|-P | ||
+ | --scsi_id|-i | ||
+ | | ||
+ | twice for power of two (e.g. 2.7 GiB), | ||
+ | | ||
+ | --sysfsroot=PATH|-y PATH set sysfs mount point to PATH (def: /sys) | ||
+ | --sz-lbs|-S | ||
+ | adds comma followed by logical block size in bytes | ||
+ | --transport|-t | ||
+ | given, for initiator | ||
+ | --unit|-u | ||
+ | --verbose|-v | ||
+ | --version|-V | ||
+ | --wwn|-w | ||
+ | < | ||
+ | < | ||
+ | <' | ||
+ | |||
+ | List SCSI devices or hosts, followed by NVMe namespaces or controllers. | ||
+ | Many storage devices (e.g. SATA disks and USB attached storage) use SCSI | ||
+ | command sets and hence are also listed by this utility. Hyphenated long | ||
+ | options can also take underscore (and vice versa). | ||
</ | </ | ||
- | Installez maintenant les paquets nécessaires | + | ====1.5 - La Commande lscpu==== |
+ | |||
+ | Cett commande vous renseigne sur l' | ||
< | < | ||
- | [root@centos8 ~]# dnf groupinstall " | + | [root@centos8 ~]# lscpu |
- | ... | + | Architecture: |
- | [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 | + | CPU op-mode(s): |
- | ... | + | Byte Order: |
+ | CPU(s): | ||
+ | On-line CPU(s) list: 0-7 | ||
+ | Thread(s) per core: 1 | ||
+ | Core(s) per socket: | ||
+ | Socket(s): | ||
+ | NUMA node(s): | ||
+ | Vendor ID: | ||
+ | BIOS Vendor ID: QEMU | ||
+ | CPU family: | ||
+ | Model: | ||
+ | Model name: Intel(R) Xeon(R) CPU E3-1270 v6 @ 3.80GHz | ||
+ | BIOS Model name: pc-i440fx-7.0 | ||
+ | Stepping: | ||
+ | CPU MHz: 3791.998 | ||
+ | BogoMIPS: | ||
+ | Virtualization: | ||
+ | Hypervisor vendor: | ||
+ | Virtualization type: full | ||
+ | L1d cache: | ||
+ | L1i cache: | ||
+ | L2 cache: | ||
+ | L3 cache: | ||
+ | NUMA node0 CPU(s): | ||
+ | Flags: | ||
</ | </ | ||
- | ====2.1 - Déplacer /home==== | + | ===Options de la commande=== |
- | <WRAP center round alert 60%> | + | Les options |
- | **Important** - Il n'est pas conseillé | + | |
- | </ | + | |
- | <WRAP center round todo 60%> | + | <code> |
- | **A faire** | + | [root@centos8 ~]# lscpu --help |
- | </ | + | |
- | Créez ensuite une seule partition | + | Usage: |
+ | lscpu [options] | ||
+ | |||
+ | Display information about the CPU architecture. | ||
+ | |||
+ | Options: | ||
+ | -a, --all print both online and offline CPUs (default for -e) | ||
+ | -b, --online | ||
+ | -c, --offline | ||
+ | -J, --json | ||
+ | -e, --extended[=< | ||
+ | -p, --parse[=< | ||
+ | -s, --sysroot < | ||
+ | -x, --hex print hexadecimal masks rather than lists of CPUs | ||
+ | -y, --physical | ||
+ | |||
+ | -h, --help | ||
+ | -V, --version | ||
+ | |||
+ | Available output columns: | ||
+ | | ||
+ | CORE logical core number | ||
+ | SOCKET | ||
+ | | ||
+ | NODE logical NUMA node number | ||
+ | BOOK logical book number | ||
+ | DRAWER | ||
+ | | ||
+ | POLARIZATION | ||
+ | | ||
+ | CONFIGURED | ||
+ | ONLINE | ||
+ | MAXMHZ | ||
+ | MINMHZ | ||
+ | |||
+ | For more details see lscpu(1). | ||
+ | </ | ||
+ | |||
+ | ====1.6 - La Command lshw==== | ||
+ | |||
+ | Cette commande vous renseigne | ||
< | < | ||
- | [root@centos8 ~]# fdisk /dev/sdc | + | [root@centos8 ~]# lshw -businfo |
+ | Bus info Device | ||
+ | ==================================================== | ||
+ | system | ||
+ | bus Motherboard | ||
+ | memory | ||
+ | cpu@0 | ||
+ | cpu@1 | ||
+ | memory | ||
+ | memory | ||
+ | pci@0000: | ||
+ | pci@0000: | ||
+ | input PnP device PNP0303 | ||
+ | input PnP device PNP0f13 | ||
+ | storage | ||
+ | system | ||
+ | pci@0000: | ||
+ | scsi@1: | ||
+ | pci@0000: | ||
+ | usb@1 | ||
+ | usb@1: | ||
+ | pci@0000: | ||
+ | pci@0000: | ||
+ | pci@0000: | ||
+ | virtio@0 | ||
+ | pci@0000: | ||
+ | scsi@2: | ||
+ | scsi@2: | ||
+ | scsi@2: | ||
+ | scsi@3: | ||
+ | scsi@4: | ||
+ | scsi@4: | ||
+ | scsi@5: | ||
+ | pci@0000: | ||
+ | virtio@1 | ||
+ | pci@0000: | ||
+ | virtio@2 | ||
+ | pci@0000: | ||
+ | pci@0000: | ||
+ | input0 | ||
+ | input1 | ||
+ | input3 | ||
+ | input4 | ||
+ | input6 | ||
+ | </ | ||
- | Welcome to fdisk (util-linux 2.32.1). | + | Consultez maintenant le matériel de la classe **system** : |
- | Changes will remain in memory only, until you decide to write them. | + | |
- | Be careful before using the write command. | + | |
- | Device does not contain a recognized partition table. | + | < |
- | Created a new DOS disklabel with disk identifier 0xc321702b. | + | [root@centos8 ~]# lshw -c system |
+ | centos8.ittraining.loc | ||
+ | | ||
+ | product: Standard PC (i440FX + PIIX, 1996) | ||
+ | vendor: QEMU | ||
+ | version: pc-i440fx-7.0 | ||
+ | width: 64 bits | ||
+ | capabilities: | ||
+ | configuration: | ||
+ | *-pnp00: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
- | Command (m for help): n | + | Consultez maintenant le matériel des autres classes principales |
- | Partition type | + | |
- | | + | |
- | | + | |
- | Select (default p): | + | |
- | Using default response p. | + | < |
- | Partition number (1-4, default | + | [root@centos8 ~]# lshw -c memory |
- | First sector (2048-41943039, default 2048): | + | *-firmware |
- | Last sector, +sectors or +size{K,M,G,T,P} (2048-41943039, default 41943039): | + | |
+ | | ||
+ | | ||
+ | | ||
+ | date: 04/01/2014 | ||
+ | size: 96KiB | ||
+ | *-memory | ||
+ | | ||
+ | physical id: 1000 | ||
+ | size: 16GiB | ||
+ | | ||
+ | | ||
+ | | ||
+ | description: | ||
+ | vendor: QEMU | ||
+ | physical id: 0 | ||
+ | slot: DIMM 0 | ||
- | Created a new partition 1 of type ' | + | [root@centos8 ~]# lshw -c video |
+ | *-display | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: pci@0000: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
- | Command | + | |
- | The partition table has been altered. | + | [root@centos8 ~]# lshw -c storage |
- | Calling ioctl() to re-read partition | + | *-pnp00: |
- | Syncing disks. | + | |
+ | | ||
+ | | ||
+ | *-ide | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: pci@0000: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: pci@0000: | ||
+ | logical name: scsi2 | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | [root@centos8 ~]# lshw -c disk | ||
+ | *-cdrom | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@1: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | *-disk:0 | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@2: | ||
+ | | ||
+ | | ||
+ | | ||
+ | size: 32GiB (34GB) | ||
+ | | ||
+ | | ||
+ | *-disk:1 | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@3: | ||
+ | | ||
+ | | ||
+ | | ||
+ | size: 4GiB (4294MB) | ||
+ | | ||
+ | *-disk:2 | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@4: | ||
+ | | ||
+ | | ||
+ | | ||
+ | size: 64GiB (68GB) | ||
+ | | ||
+ | | ||
+ | *-disk:3 | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@5: | ||
+ | | ||
+ | | ||
+ | | ||
+ | size: 32GiB (34GB) | ||
+ | | ||
+ | |||
+ | |||
+ | [root@centos8 ~]# lshw -c volume | ||
+ | *-volume: | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@2: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | size: 1GiB | ||
+ | | ||
+ | | ||
+ | | ||
+ | *-volume: | ||
+ | | ||
+ | | ||
+ | bus info: scsi@2:0.0.0,2 | ||
+ | logical name: /dev/sda2 | ||
+ | | ||
+ | size: 30GiB | ||
+ | | ||
+ | | ||
+ | *-volume | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: scsi@4: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | size: 63GiB | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | [root@centos8 ~]# lshw -c network | ||
+ | *-network: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: pci@0000: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | description: | ||
+ | physical id: 0 | ||
+ | bus info: virtio@1 | ||
+ | logical name: ens18 | ||
+ | serial: 5e: | ||
+ | capabilities: | ||
+ | configuration: | ||
+ | *-network: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | bus info: pci@0000: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | description: | ||
+ | physical id: 0 | ||
+ | bus info: virtio@2 | ||
+ | logical name: ens19 | ||
+ | serial: ea: | ||
+ | capabilities: | ||
+ | configuration: | ||
</ | </ | ||
- | Créez maintenant un système | + | ===Options |
+ | |||
+ | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 ~]# mkfs.ext4 /dev/sdc1 | + | [root@centos8 ~]# lshw -h |
- | mke2fs 1.45.6 (20-Mar-2020) | + | Hardware Lister (lshw) - B.02.19.2 |
- | Discarding device blocks: done | + | usage: lshw [-format] [-options ...] |
- | Creating filesystem with 16776960 4k blocks and 4194304 inodes | + | |
- | Filesystem UUID: dc92c0d7-919b-4fff-8719-53e9e7e628dd | + | |
- | Superblock backups stored on blocks: | + | |
- | 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, | + | |
- | 4096000, 7962624, 11239424 | + | |
- | Allocating group tables: done | + | -version |
- | Writing inode tables: done | + | |
- | Creating journal | + | format can be |
- | Writing superblocks and filesystem accounting | + | -html |
+ | -xml output hardware tree as XML | ||
+ | -json | ||
+ | -short | ||
+ | -businfo | ||
+ | |||
+ | options can be | ||
+ | -dump filename | ||
+ | | ||
+ | -C CLASS same as ' | ||
+ | -c CLASS same as ' | ||
+ | -disable TEST | ||
+ | -enable TEST enable a test (like pci, isapnp, cpuid, etc. ) | ||
+ | -quiet | ||
+ | -sanitize | ||
+ | -numeric | ||
+ | -notime | ||
</ | </ | ||
- | Montez | + | ====1.7 - La Commande dmidecode==== |
+ | |||
+ | La commande | ||
+ | |||
+ | * l' | ||
+ | * les extensions possibles. | ||
< | < | ||
- | [root@centos8 ~]# mount /dev/sdc1 /mnt | + | [root@centos8 ~]# dmidecode |
+ | # dmidecode 3.2 | ||
+ | Getting SMBIOS data from sysfs. | ||
+ | SMBIOS 2.8 present. | ||
+ | 11 structures occupying 511 bytes. | ||
+ | Table at 0x000F5870. | ||
+ | |||
+ | Handle 0x0000, DMI type 0, 24 bytes | ||
+ | BIOS Information | ||
+ | Vendor: SeaBIOS | ||
+ | Version: rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org | ||
+ | Release Date: 04/01/2014 | ||
+ | Address: 0xE8000 | ||
+ | Runtime Size: 96 kB | ||
+ | ROM Size: 64 kB | ||
+ | Characteristics: | ||
+ | BIOS characteristics not supported | ||
+ | Targeted content distribution is supported | ||
+ | BIOS Revision: 0.0 | ||
+ | |||
+ | Handle 0x0100, DMI type 1, 27 bytes | ||
+ | System Information | ||
+ | Manufacturer: | ||
+ | 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: | ||
+ | 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: | ||
+ | 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: | ||
+ | Type: Central Processor | ||
+ | Family: Other | ||
+ | Manufacturer: | ||
+ | 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: | ||
+ | |||
+ | Handle 0x0401, DMI type 4, 42 bytes | ||
+ | Processor Information | ||
+ | Socket Designation: | ||
+ | Type: Central Processor | ||
+ | Family: Other | ||
+ | Manufacturer: | ||
+ | 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: | ||
+ | |||
+ | 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: | ||
+ | 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 | ||
</ | </ | ||
- | Copiez le contenu | + | ===Options |
+ | |||
+ | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 | + | [root@centos7 |
+ | Usage: dmidecode [OPTIONS] | ||
+ | Options are: | ||
+ | -d, --dev-mem FILE Read memory from device FILE (default: | ||
+ | -h, --help | ||
+ | -q, --quiet | ||
+ | -s, --string KEYWORD | ||
+ | -t, --type TYPE Only display the entries of given type | ||
+ | -u, --dump | ||
+ | | ||
+ | | ||
+ | -V, --version | ||
</ | </ | ||
- | Démontez | + | ====1.8 - La Commande smartctl==== |
+ | |||
+ | **smartctl** contrôle le système SMART (Self-Monitoring, | ||
< | < | ||
- | [root@centos8 ~]# umount | + | [root@centos8 ~]# smartctl --smart=on --saveauto=on --offlineauto=on |
- | [root@centos8 ~]# mv /home /root | + | |
+ | [root@centos8 ~]# smartctl -a /dev/sdb | ||
+ | smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-305.7.1.el8_4.x86_64] (local build) | ||
+ | Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org | ||
+ | |||
+ | === START OF INFORMATION SECTION === | ||
+ | Device Model: | ||
+ | Serial Number: | ||
+ | Firmware Version: 2.5+ | ||
+ | User Capacity: | ||
+ | Sector Size: 512 bytes logical/ | ||
+ | Device is: Not in smartctl database [for details use: -P showall] | ||
+ | ATA Version is: | ||
+ | Local Time is: Sun Nov 13 09:12:18 2022 CET | ||
+ | SMART support is: Available - device has SMART capability. | ||
+ | SMART support is: Enabled | ||
+ | |||
+ | === START OF READ SMART DATA SECTION === | ||
+ | SMART overall-health self-assessment test result: PASSED | ||
+ | |||
+ | General SMART Values: | ||
+ | Offline data collection status: | ||
+ | was completed without error. | ||
+ | Auto Offline Data Collection: Disabled. | ||
+ | Self-test execution status: | ||
+ | without error or no self-test has ever | ||
+ | been run. | ||
+ | Total time to complete Offline | ||
+ | data collection: | ||
+ | Offline data collection | ||
+ | capabilities: | ||
+ | No Auto Offline data collection support. | ||
+ | Suspend Offline collection upon new | ||
+ | command. | ||
+ | Offline surface scan supported. | ||
+ | Self-test supported. | ||
+ | No Conveyance Self-test supported. | ||
+ | No Selective Self-test supported. | ||
+ | SMART capabilities: | ||
+ | power-saving mode. | ||
+ | Supports SMART auto save timer. | ||
+ | Error logging capability: | ||
+ | No General Purpose Logging support. | ||
+ | Short self-test routine | ||
+ | recommended polling time: ( 2) minutes. | ||
+ | Extended self-test routine | ||
+ | recommended polling time: ( 54) minutes. | ||
+ | |||
+ | SMART Attributes Data Structure revision number: 1 | ||
+ | Vendor Specific SMART Attributes with Thresholds: | ||
+ | ID# ATTRIBUTE_NAME | ||
+ | 1 Raw_Read_Error_Rate | ||
+ | 3 Spin_Up_Time | ||
+ | 4 Start_Stop_Count | ||
+ | 5 Reallocated_Sector_Ct | ||
+ | 9 Power_On_Hours | ||
+ | 12 Power_Cycle_Count | ||
+ | 190 Airflow_Temperature_Cel 0x0003 | ||
+ | |||
+ | SMART Error Log Version: 1 | ||
+ | No Errors Logged | ||
+ | |||
+ | SMART Self-test log structure revision number 1 | ||
+ | No self-tests have been logged. | ||
+ | |||
+ | Selective Self-tests/ | ||
</ | </ | ||
- | Identifiez l' | + | ===Options |
+ | |||
+ | Les options de cette commande sont : | ||
< | < | ||
- | [root@centos8 ~]# ls -l /dev/disk/by-uuid/ | grep sdc1 | + | [root@centos8 ~]# smartctl |
- | lrwxrwxrwx. 1 root root 10 Jul 19 12:02 f76d6b66-985b-4a91-af9c-4987e8c1443c | + | smartctl 7.1 2020-04-05 r5049 [x86_64-linux-4.18.0-305.7.1.el8_4.x86_64] (local build) |
- | [root@centos8 ~]# | + | Copyright (C) 2002-19, Bruce Allen, Christian Franke, www.smartmontools.org |
+ | |||
+ | Usage: smartctl [options] device | ||
+ | |||
+ | ============================================ SHOW INFORMATION OPTIONS ===== | ||
+ | |||
+ | -h, --help, --usage | ||
+ | | ||
+ | |||
+ | -V, --version, --copyright, | ||
+ | Print license, copyright, and version information and exit | ||
+ | |||
+ | -i, --info | ||
+ | Show identity information for device | ||
+ | |||
+ | --identify[=[w][nvb]] | ||
+ | Show words and bits from IDENTIFY DEVICE data (ATA) | ||
+ | |||
+ | -g NAME, --get=NAME | ||
+ | Get device setting: all, aam, apm, dsn, lookahead, security, | ||
+ | wcache, rcache, wcreorder, wcache-sct | ||
+ | |||
+ | -a, --all | ||
+ | Show all SMART information for device | ||
+ | |||
+ | -x, --xall | ||
+ | Show all information for device | ||
+ | |||
+ | --scan | ||
+ | Scan for devices | ||
+ | |||
+ | --scan-open | ||
+ | Scan for devices and try to open each device | ||
+ | |||
+ | ================================== SMARTCTL RUN-TIME BEHAVIOR OPTIONS ===== | ||
+ | |||
+ | -j, --json[=[cgiosuv]] | ||
+ | Print output in JSON format | ||
+ | |||
+ | -q TYPE, --quietmode=TYPE | ||
+ | Set smartctl quiet mode to one of: errorsonly, silent, noserial | ||
+ | |||
+ | -d TYPE, --device=TYPE | ||
+ | | ||
+ | ata, scsi[+TYPE], | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | -b TYPE, --badsum=TYPE | ||
+ | Set action on bad checksum to one of: warn, exit, ignore | ||
+ | |||
+ | -r TYPE, --report=TYPE | ||
+ | | ||
+ | |||
+ | -n MODE[, | ||
+ | No check if: never, sleep, standby, idle (see man page) | ||
+ | |||
+ | ============================== DEVICE FEATURE ENABLE/DISABLE COMMANDS ===== | ||
+ | |||
+ | -s VALUE, --smart=VALUE | ||
+ | Enable/ | ||
+ | |||
+ | -o VALUE, --offlineauto=VALUE | ||
+ | Enable/ | ||
+ | |||
+ | -S VALUE, --saveauto=VALUE | ||
+ | Enable/ | ||
+ | |||
+ | -s NAME[, | ||
+ | Enable/ | ||
+ | dsn, | ||
+ | standby, | ||
+ | wcreorder, | ||
+ | |||
+ | ======================================= READ AND DISPLAY DATA OPTIONS ===== | ||
+ | |||
+ | -H, --health | ||
+ | Show device SMART health status | ||
+ | |||
+ | -c, --capabilities | ||
+ | Show device SMART capabilities | ||
+ | |||
+ | -A, --attributes | ||
+ | Show device SMART vendor-specific Attributes and values | ||
+ | |||
+ | -f FORMAT, --format=FORMAT | ||
+ | Set output format for attributes: old, brief, hex[, | ||
+ | |||
+ | -l TYPE, --log=TYPE | ||
+ | Show device log. TYPE: error, selftest, selective, directory[, | ||
+ | xerror[, | ||
+ | sasphy[, | ||
+ | scttempint, | ||
+ | gplog, | ||
+ | |||
+ | | ||
+ | Set display OPTION for vendor Attribute N (see man page) | ||
+ | |||
+ | | ||
+ | Use firmware bug workaround: | ||
+ | none, nologdir, samsung, samsung2, samsung3, xerrorlba, swapid | ||
+ | |||
+ | -P TYPE, --presets=TYPE | ||
+ | Drive-specific presets: use, ignore, show, showall | ||
+ | |||
+ | -B [+]FILE, --drivedb=[+]FILE | ||
+ | Read and replace [add] drive database from FILE | ||
+ | [default is +/ | ||
+ | and then | ||
+ | |||
+ | ============================================ DEVICE SELF-TEST OPTIONS ===== | ||
+ | |||
+ | -t TEST, --test=TEST | ||
+ | Run test. TEST: offline, short, long, conveyance, force, vendor,N, | ||
+ | | ||
+ | |||
+ | -C, --captive | ||
+ | Do test in captive mode (along with -t) | ||
+ | |||
+ | -X, --abort | ||
+ | Abort any non-captive test on device | ||
+ | |||
+ | =================================================== SMARTCTL EXAMPLES ===== | ||
+ | |||
+ | smartctl --all / | ||
+ | |||
+ | smartctl --smart=on --offlineauto=on --saveauto=on /dev/sda | ||
+ | (Enables SMART on first disk) | ||
+ | |||
+ | smartctl --test=long / | ||
+ | |||
+ | smartctl --attributes --log=selftest --quietmode=errorsonly /dev/sda | ||
+ | (Prints Self-Test & Attribute errors) | ||
+ | smartctl --all --device=3ware, | ||
+ | smartctl --all --device=3ware, | ||
+ | smartctl --all --device=3ware, | ||
+ | smartctl --all --device=3ware, | ||
+ | (Prints all SMART info for 3rd ATA disk on 3ware RAID controller) | ||
+ | smartctl --all --device=hpt, | ||
+ | (Prints all SMART info for the SATA disk attached to the 3rd PMPort | ||
+ | of the 1st channel on the 1st HighPoint RAID controller) | ||
+ | smartctl --all --device=areca, | ||
+ | (Prints all SMART info for 3rd ATA disk of the 1st enclosure | ||
+ | on Areca RAID controller) | ||
</ | </ | ||
- | Editez le fichier **/ | + | ====1.9 - Les Commandes accton |
+ | |||
+ | Cette commande permet d' | ||
< | < | ||
- | [root@centos8 ~]# vi /etc/fstab | + | [root@centos8 ~]# accton on |
- | [root@centos8 ~]# cat /etc/fstab | + | Turning on process accounting, file set to the default '/var/account/ |
+ | [root@centos8 ~]# systemctl status psacct | ||
+ | ● psacct.service - Kernel process accounting | ||
+ | | ||
+ | | ||
+ | ...skipping... | ||
+ | ● psacct.service - Kernel process accounting | ||
+ | | ||
+ | | ||
- | # | + | [root@centos8 ~]# systemctl enable psacct |
- | # /etc/fstab | + | Created symlink |
- | # Created by anaconda on Wed Jun 16 06:21:32 2021 | + | |
- | # | + | [root@centos8 ~]# systemctl start psacct |
- | # Accessible filesystems, | + | |
- | # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. | + | [root@centos8 ~]# systemctl |
- | # | + | ● psacct.service |
- | # After editing this file, run 'systemctl | + | Loaded: loaded (/ |
- | # units generated from this file. | + | Active: active (exited) since Sun 2022-11-13 09:35:16 CET; 4s ago |
- | # | + | |
- | /dev/mapper/cl_centos8-root | + | |
- | UUID=1c04981e-5317-4b73-9695-3ce25246835d | + | Main PID: 39765 (code=exited, status=0/SUCCESS) |
- | /dev/mapper/cl_centos8-swap swap swap defaults | + | |
- | UUID=f76d6b66-985b-4a91-af9c-4987e8c1443c | + | Nov 13 09:35:16 centos8.ittraining.loc systemd[1]: Starting Kernel process accounting> |
+ | Nov 13 09:35:16 centos8.ittraining.loc accton[39765]: | ||
+ | Nov 13 09:35:16 centos8.ittraining.loc systemd[1]: Started Kernel process accounting. | ||
</ | </ | ||
- | Créez | + | Par contre |
< | < | ||
- | [root@centos8 ~]# mkdir /home | + | [root@centos8 ~]# cat /var/ |
+ | #pcKaccton pcEusleep%$pcu, | ||
</ | </ | ||
- | Montez / | + | La commande **dump-acct** permet de voir son contenu mais pas de l' |
< | < | ||
- | [root@centos8 ~]# mount -a | + | [root@centos8 ~]# dump-acct /var/account/pacct |
- | [root@centos8 ~]# mount | + | accton |
- | sysfs on /sys type sysfs (rw, | + | sleep |
- | proc on /proc type proc (rw, | + | awk |
- | devtmpfs on /dev type devtmpfs (rw, | + | ksmtuned |
- | securityfs on / | + | pgrep |
- | tmpfs on /dev/shm type tmpfs (rw, | + | ksmtuned |
- | devpts on /dev/pts type devpts (rw, | + | ksmtuned |
- | tmpfs on /run type tmpfs (rw, | + | awk |
- | tmpfs on / | + | ksmtuned |
- | cgroup on / | + | less |v3| |
- | pstore on / | + | systemctl |
- | bpf on /sys/fs/bpf type bpf (rw, | + | sleep |
- | cgroup on / | + | awk |
- | cgroup on / | + | ksmtuned |
- | cgroup on / | + | pgrep |
- | cgroup on / | + | ksmtuned |
- | cgroup on / | + | ksmtuned |
- | cgroup on /sys/fs/ | + | awk |
- | cgroup on / | + | ksmtuned |
- | cgroup on / | + | rpc-pipefs-gene |v3| 0.00| |
- | cgroup on / | + | nfs-server-gene |v3| |
- | cgroup on / | + | systemd-cryptse |v3| 0.00| |
- | cgroup on / | + | systemd-system- |v3| 0.00| |
- | none on / | + | systemd-hiberna |v3| 0.00| |
- | configfs on / | + | ... |
- | / | + | |
- | selinuxfs on / | + | |
- | mqueue on /dev/mqueue type mqueue (rw, | + | |
- | hugetlbfs on / | + | |
- | debugfs on / | + | |
- | systemd-1 on / | + | |
- | fusectl on / | + | |
- | /dev/sda1 on /boot type ext4 (rw, | + | |
- | sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw, | + | |
- | tmpfs on / | + | |
- | tmpfs on / | + | |
- | gvfsd-fuse on / | + | |
- | tmpfs on /run/user/0 type tmpfs (rw, | + | |
- | gvfsd-fuse on /run/user/0/gvfs type fuse.gvfsd-fuse (rw, | + | |
- | /dev/sdc1 on /home type ext4 (rw, | + | |
</ | </ | ||
- | Notez la taille | + | ===Options de la commande=== |
+ | |||
+ | Les options | ||
< | < | ||
- | [root@centos8 ~]# df -h | + | [root@centos8 ~]# dump-acct --help |
- | Filesystem | + | Usage: dump-acct [-hrR] [-n < |
- | devtmpfs | + | |
- | tmpfs 1.9G | + | |
- | tmpfs 1.9G 9.4M 1.9G 1% /run | + | [--ahz < |
- | tmpfs 1.9G | + | |
- | / | + | The system' |
- | / | + | |
- | tmpfs 374M | + | |
- | tmpfs 374M 1.2M 373M 1% / | + | |
- | / | + | |
</ | </ | ||
- | <WRAP center round todo 60%> | + | ====1.10 - La Commande lastcomm==== |
- | **A faire** - **Déconnectez-vous** de votre session **CentOS8_ROOT_10.0.2.45** et re-connectez-vous à la VM en tant que trainee en utilisant la connexion **CentOS8_SSH_10.0.2.45**. | + | |
- | </ | + | |
- | ====2.2 - Préparer | + | Cette commande vous renseigne sur l'historique et les statistiques des commandes par utilisateur : |
- | Pour créer l' | + | < |
+ | [root@centos8 ~]# lastcomm | ||
+ | bash F root pts/0 0.00 secs Sun Nov 13 09:41 | ||
+ | gdbus X root pts/0 0.00 secs Sun Nov 13 09:41 | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | kworker/ | ||
+ | ksmtuned | ||
+ | ksmtuned | ||
+ | pgrep root | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | sleep root | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | kworker/ | ||
+ | dump-acct | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | ksmtuned | ||
+ | ksmtuned | ||
+ | pgrep root | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | sleep root | ||
+ | dump-acct | ||
+ | man root | ||
+ | less | ||
+ | kworker/ | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | ksmtuned | ||
+ | ksmtuned | ||
+ | pgrep root | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | sleep root | ||
+ | man | ||
+ | nroff root | ||
+ | groff root | ||
+ | grotty | ||
+ | troff root | ||
+ | nroff | ||
+ | locale | ||
+ | tbl root | ||
+ | preconv | ||
+ | man | ||
+ | man | ||
+ | man | ||
+ | man | ||
+ | man | ||
+ | man | ||
+ | man | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | ksmtuned | ||
+ | ksmtuned | ||
+ | pgrep root | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | sleep root | ||
+ | dump-acct | ||
+ | kworker/ | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | ksmtuned | ||
+ | ksmtuned | ||
+ | pgrep root | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | sleep root | ||
+ | cat root | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | ksmtuned | ||
+ | ksmtuned | ||
+ | pgrep root | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | sleep root | ||
+ | kworker/ | ||
+ | systemctl | ||
+ | less | ||
+ | systemd-cgroups | ||
+ | systemd-cgroups | ||
+ | systemctl | ||
+ | systemd-tty-ask | ||
+ | accton | ||
+ | accton | ||
+ | accton-create | ||
+ | systemctl | ||
+ | (sd-executor) | ||
+ | systemd-gpt-aut | ||
+ | systemd-getty-g | ||
+ | systemd-veritys | ||
+ | systemd-sysv-ge | ||
+ | systemd-debug-g | ||
+ | selinux-autorel | ||
+ | grep | ||
+ | ostree-system-g | ||
+ | systemd-rc-loca | ||
+ | anaconda-genera | ||
+ | lvm2-activation | ||
+ | kdump-dep-gener | ||
+ | selinuxenabled | ||
+ | lvmconfig | ||
+ | grep | ||
+ | readlink | ||
+ | systemd-fstab-g | ||
+ | systemd-hiberna | ||
+ | systemd-system- | ||
+ | systemd-cryptse | ||
+ | nfs-server-gene | ||
+ | rpc-pipefs-gene | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | ksmtuned | ||
+ | ksmtuned | ||
+ | pgrep root | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | sleep root | ||
+ | systemctl | ||
+ | less | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | ksmtuned | ||
+ | ksmtuned | ||
+ | pgrep root | ||
+ | ksmtuned | ||
+ | awk root | ||
+ | sleep root | ||
+ | accton | ||
+ | |||
+ | [root@centos8 ~]# lastcomm grep | ||
+ | grep | ||
+ | grep | ||
+ | grep | ||
+ | grep | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
< | < | ||
- | [trainee@centos8 ~]$ rpmdev-setuptree | + | [root@centos8 ~]# lastcomm |
- | ...> | + | Usage: lastcomm [-hpV] [-f file] [command] |
- | [trainee@centos8 ~]$ ls -laR rpmbuild/ | + | [--forwards] [--file < |
- | rpmbuild/: | + | [--user < |
- | total 28 | + | [--show-paging] [--pid] [--ahz < |
- | 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 | + | |
- | rpmbuild/BUILD: | + | The system' |
- | total 8 | + | </ |
- | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | |
- | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | |
- | rpmbuild/ | + | ====1.11 - La Commande sa==== |
- | total 8 | + | |
- | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | |
- | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | |
- | rpmbuild/ | + | Cette commande vous renseigne sur les statistiques sur les processus lancés et leurs ressources systèmes: |
- | total 8 | + | |
- | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | |
- | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | |
- | rpmbuild/SPECS: | + | < |
- | total 8 | + | [root@centos8 ~]# sa -u | egrep " |
- | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | root 0.00 cpu 1090k mem 0 io accton |
- | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | root 0.00 cpu 1827k mem 0 io sleep |
+ | root 0.00 cpu 6378k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 11276k mem 0 io pgrep | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6528k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6344k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 2426k mem 0 io less | ||
+ | root 0.00 cpu 23376k mem 0 io systemctl | ||
+ | root 0.00 cpu 1827k mem 0 io sleep | ||
+ | root 0.00 cpu 6378k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 11276k mem 0 io pgrep | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6528k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6344k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 9688k mem 0 io rpc-pipefs-gene | ||
+ | root 0.00 cpu 9720k mem 0 io nfs-server-gene | ||
+ | root 0.00 cpu 22592k mem 0 io systemd-cryptse | ||
+ | root 0.00 cpu 22592k mem 0 io systemd-system- | ||
+ | root 0.00 cpu 22592k mem 0 io systemd-hiberna | ||
+ | root 0.00 cpu 22592k mem 0 io systemd-fstab-g | ||
+ | root 0.00 cpu 1098k mem 0 io readlink | ||
+ | root 0.00 cpu 2302k mem 0 io grep | ||
+ | root 0.00 cpu 16260k mem 0 io lvmconfig | ||
+ | root 0.00 cpu 3350k mem 0 io selinuxenabled | ||
+ | root 0.00 cpu 5862k mem 0 io kdump-dep-gener | ||
+ | root 0.00 cpu 8406k mem 0 io lvm2-activation | ||
+ | root 0.00 cpu 5764k mem 0 io anaconda-genera | ||
+ | root 0.00 cpu 22592k mem 0 io systemd-rc-loca | ||
+ | root 0.01 cpu 38192k mem 0 io ostree-system-g | ||
+ | root 0.00 cpu 2302k mem 0 io grep | ||
+ | root 0.00 cpu 5764k mem 0 io selinux-autorel | ||
+ | root 0.00 cpu 22592k mem 0 io systemd-debug-g | ||
+ | root 0.00 cpu 22592k mem 0 io systemd-sysv-ge | ||
+ | root 0.00 cpu 22592k mem 0 io systemd-veritys | ||
+ | root 0.00 cpu 22592k mem 0 io systemd-getty-g | ||
+ | root 0.00 cpu 22592k mem 0 io systemd-gpt-aut | ||
+ | root 0.00 cpu 63728k mem 0 io (sd-executor) | ||
+ | root 0.00 cpu 23632k mem 0 io systemctl | ||
+ | root 0.00 cpu 6496k mem 0 io accton-create | ||
+ | root 0.00 cpu 0k mem 0 io accton | ||
+ | root 0.00 cpu 1090k mem 0 io accton | ||
+ | root 0.00 cpu 22592k mem 0 io systemd-tty-ask | ||
+ | root 0.00 cpu 23376k mem 0 io systemctl | ||
+ | root 0.00 cpu 22592k mem 0 io systemd-cgroups | ||
+ | root 0.00 cpu 22592k mem 0 io systemd-cgroups | ||
+ | root 0.00 cpu 2426k mem 0 io less | ||
+ | root 0.00 cpu 23376k mem 0 io systemctl | ||
+ | root 0.00 cpu 0k mem 0 io kworker/dying * | ||
+ | root 0.00 cpu 1827k mem 0 io sleep | ||
+ | root 0.00 cpu 6378k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 11276k mem 0 io pgrep | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6528k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6344k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 1828k mem 0 io cat | ||
+ | root 0.00 cpu 1827k mem 0 io sleep | ||
+ | root 0.00 cpu 6378k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 11276k mem 0 io pgrep | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6528k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6344k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 0k mem 0 io kworker/ | ||
+ | root 0.00 cpu 1994k mem 0 io dump-acct | ||
+ | root 0.00 cpu 1827k mem 0 io sleep | ||
+ | root 0.00 cpu 6378k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 11276k mem 0 io pgrep | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6528k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6344k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 4582k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4844k mem 0 io man * | ||
+ | root 0.00 cpu 4186k mem 0 io preconv | ||
+ | root 0.00 cpu 3476k mem 0 io tbl | ||
+ | root 0.00 cpu 1831k mem 0 io locale | ||
+ | root 0.00 cpu 3182k mem 0 io nroff * | ||
+ | root 0.00 cpu 4186k mem 0 io troff | ||
+ | root 0.00 cpu 3674k mem 0 io grotty | ||
+ | root 0.00 cpu 3496k mem 0 io groff | ||
+ | root 0.00 cpu 3182k mem 0 io nroff | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 1827k mem 0 io sleep | ||
+ | root 0.00 cpu 6378k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 11276k mem 0 io pgrep | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6528k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6344k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 0k mem 0 io kworker/ | ||
+ | root 0.00 cpu 2426k mem 0 io less | ||
+ | root 0.01 cpu 4770k mem 0 io man | ||
+ | root 0.00 cpu 1994k mem 0 io dump-acct | ||
+ | root 0.00 cpu 1827k mem 0 io sleep | ||
+ | root 0.00 cpu 6378k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 11276k mem 0 io pgrep | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6528k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6344k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 2094k mem 0 io dump-acct | ||
+ | root 0.00 cpu 0k mem 0 io kworker/ | ||
+ | root 0.00 cpu 0k mem 0 io kworker/ | ||
+ | root 0.00 cpu 0k mem 0 io kworker/ | ||
+ | root 0.00 cpu 1827k mem 0 io sleep | ||
+ | root 0.00 cpu 6378k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 11276k mem 0 io pgrep | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6528k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 0k mem 0 io kworker/ | ||
+ | root 0.00 cpu 6344k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 93648k mem 0 io gdbus | ||
+ | root 0.00 cpu 6888k mem 0 io bash * | ||
+ | root 0.00 cpu 5410k mem 0 io lastcomm | ||
+ | root 0.00 cpu 1827k mem 0 io sleep | ||
+ | root 0.00 cpu 6378k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 11276k mem 0 io pgrep | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6528k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6344k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 4570k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4844k mem 0 io man * | ||
+ | root 0.00 cpu 4186k mem 0 io preconv | ||
+ | root 0.00 cpu 3476k mem 0 io tbl | ||
+ | root 0.00 cpu 1831k mem 0 io locale | ||
+ | root 0.00 cpu 3182k mem 0 io nroff * | ||
+ | root 0.00 cpu 4186k mem 0 io troff | ||
+ | root 0.00 cpu 3706k mem 0 io grotty | ||
+ | root 0.00 cpu 3496k mem 0 io groff | ||
+ | root 0.00 cpu 3182k mem 0 io nroff | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 1827k mem 0 io sleep | ||
+ | root 0.00 cpu 6378k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 11276k mem 0 io pgrep | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6528k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6344k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 2426k mem 0 io less | ||
+ | root 0.00 cpu 4770k mem 0 io man | ||
+ | root 0.00 cpu 4604k mem 0 io man * | ||
+ | root 0.00 cpu 4760k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 4844k mem 0 io man * | ||
+ | root 0.00 cpu 4186k mem 0 io preconv | ||
+ | root 0.00 cpu 3476k mem 0 io tbl | ||
+ | root 0.00 cpu 1831k mem 0 io locale | ||
+ | root 0.00 cpu 3182k mem 0 io nroff * | ||
+ | root 0.00 cpu 4186k mem 0 io troff | ||
+ | root 0.00 cpu 3700k mem 0 io grotty | ||
+ | root 0.00 cpu 3496k mem 0 io groff | ||
+ | root 0.00 cpu 3182k mem 0 io nroff | ||
+ | root 0.00 cpu 4804k mem 0 io man * | ||
+ | root 0.00 cpu 1827k mem 0 io sleep | ||
+ | root 0.00 cpu 6378k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 11276k mem 0 io pgrep | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6528k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6344k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 1827k mem 0 io sleep | ||
+ | root 0.00 cpu 6378k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 11276k mem 0 io pgrep | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6528k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6344k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 0k mem 0 io kworker/ | ||
+ | root 0.00 cpu 2426k mem 0 io less | ||
+ | root 0.00 cpu 4770k mem 0 io man | ||
+ | root 0.00 cpu 5312k mem 0 io sa | ||
+ | root 0.00 cpu 3034k mem 0 io grep | ||
+ | root 0.00 cpu 5312k mem 0 io sa | ||
+ | root 0.00 cpu 1827k mem 0 io sleep | ||
+ | root 0.00 cpu 6378k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 11276k mem 0 io pgrep | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6528k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 6344k mem 0 io awk | ||
+ | root 0.00 cpu 6658k mem 0 io ksmtuned | ||
+ | root 0.00 cpu 0k mem 0 io kworker/ | ||
+ | </ | ||
- | rpmbuild/ | + | ===Options de la commande=== |
- | total 8 | + | |
- | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | Les options de cette commande sont : |
- | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | |
+ | < | ||
+ | [root@centos8 ~]# sa --help | ||
+ | |||
+ | Usage: sa [ options ] [ file ] | ||
+ | |||
+ | options: [-abcdfiljkmnprstuDKP] [-v < | ||
+ | [--other-acct-file < | ||
+ | [--print-seconds] [--dont-read-summary-files] [--debug] | ||
+ | | ||
+ | | ||
+ | [--list-all-names] [--not-interactive] [--threshold < | ||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | The system' | ||
+ | |||
+ | raw process accounting data: / | ||
+ | summary by command name: / | ||
+ | summary by username: / | ||
</ | </ | ||
- | Téléchargez le rpm source du noyau : | + | ====1.12 - La Commande ac==== |
+ | |||
+ | Cette commande vous renseigne sur les statistiques des temps de connexion des utilisateurs | ||
< | < | ||
- | [trainee@centos8 ~]$ uname -a | + | [root@centos8 ~]# ac -p |
- | 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 | + | |
+ | total 247.51 | ||
- | [trainee@centos8 ~]$ cat /etc/centos-release | + | [root@centos8 ~]# ac -d |
- | CentOS Linux release 8.4.2105 | + | Jun 16 total 6.41 |
+ | Jun 17 total | ||
+ | Jul 19 total 6.94 | ||
+ | Jul 20 total | ||
+ | Sep 2 total 0.03 | ||
+ | Sep 3 total 0.01 | ||
+ | Sep 5 total | ||
+ | Oct 9 total 0.92 | ||
+ | Oct 11 total | ||
+ | Oct 12 total 5.45 | ||
+ | Nov 7 total | ||
+ | Nov 8 total | ||
+ | Nov 9 total | ||
+ | Nov 10 total 8.48 | ||
+ | Nov 11 total 3.01 | ||
+ | Today | ||
+ | </ | ||
+ | |||
+ | ===Options de la commande=== | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# ac --help | ||
- | [trainee@centos8 ~]$ wget https:// | + | Usage: ac [OPTION] ... |
- | --2021-07-14 02: | + | |
- | Resolving vault.centos.org (vault.centos.org)... 81.171.33.194, | + | |
- | Connecting to vault.centos.org (vault.centos.org)|81.171.33.194|: | + | |
- | HTTP request sent, awaiting response... 200 OK | + | |
- | Length: 123000617 (117M) | + | |
- | Saving to: ‘kernel-4.18.0-305.7.1.el8_4.src.rpm’ | + | |
- | kernel-4.18.0-305.7.1. 100%[===========================>] 117.30M | + | OPTIONS: |
+ | | ||
+ | -p, --individual-totals | ||
+ | -f, --file <file> Read from < | ||
+ | --complain | ||
+ | --reboots | ||
+ | --supplants | ||
+ | --timewarps | ||
+ | --compatibility | ||
+ | -a, --all-days | ||
+ | --tw-leniency < | ||
+ | --tw-suspicious < | ||
+ | --print-year | ||
+ | --print-zeros | ||
+ | --debug | ||
+ | -V, --version | ||
+ | -h, --help | ||
- | 2021-07-14 02:55:33 (1.49 MB/s) - ‘kernel-4.18.0-305.7.1.el8_4.src.rpm’ saved [123000617/ | + | The system' |
</ | </ | ||
- | Installez maintenant les dépendances pour le rpm source en tant que root : | + | =====LAB #2 - La commande sysctl===== |
+ | |||
+ | ====2.1 - Répertoire /proc==== | ||
+ | |||
+ | Le répertoire /proc contient des fichiers et des répertoires virtuels. Le contenu de ces fichiers est créé dynamiquement lors de la consultation. Seul root peut consulter la totalité des informations dans le répertoire /proc. | ||
< | < | ||
- | [trainee@centos8 ~]$ su - | + | [root@centos8 ~]# ls /proc |
- | Mot de passe : fenestros | + | 1 16391 19 2212 2427 2622 431 |
+ | 10 | ||
+ | 1007 | ||
+ | 11 | ||
+ | 11805 16593 2 | ||
+ | 12 | ||
+ | 1219 | ||
+ | 1228 | ||
+ | 1232 | ||
+ | 1234 | ||
+ | 1235 | ||
+ | 1247 | ||
+ | 13 | ||
+ | 1307 | ||
+ | 1339 | ||
+ | 1356 | ||
+ | 14 | ||
+ | 1441 | ||
+ | 1443 | ||
+ | 1444 | ||
+ | 1446 | ||
+ | 14977 1828 | ||
+ | 15 | ||
+ | 15067 183 2167 2330 2571 422 | ||
+ | 1536 | ||
+ | 1553 | ||
+ | 15594 186 2187 2358 259 | ||
+ | 15735 187 2190 2373 2593 427 | ||
+ | 16 | ||
+ | 16165 1883 | ||
+ | 16167 1888 | ||
+ | </ | ||
- | [root@centos8 ~]# dnf install yum-utils | + | ===Fichiers=== |
- | ... | + | |
- | [root@centos8 ~]# yum-builddep | + | ==Processeur== |
- | ... | + | |
+ | < | ||
+ | [root@centos8 ~]# cat /proc/cpuinfo | ||
+ | processor | ||
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 6 | ||
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 0 | ||
+ | siblings | ||
+ | core id : 0 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
+ | |||
+ | processor | ||
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 6 | ||
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : | ||
+ | siblings | ||
+ | core id : 1 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
+ | |||
+ | processor | ||
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 6 | ||
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 0 | ||
+ | siblings | ||
+ | core id : 2 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
+ | |||
+ | processor | ||
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 6 | ||
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 0 | ||
+ | siblings | ||
+ | core id : 3 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
+ | |||
+ | processor | ||
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 6 | ||
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 1 | ||
+ | siblings | ||
+ | core id : 0 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
+ | |||
+ | processor | ||
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 6 | ||
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 1 | ||
+ | siblings | ||
+ | core id : 1 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
+ | |||
+ | processor | ||
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 6 | ||
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 1 | ||
+ | siblings | ||
+ | core id : 2 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
+ | |||
+ | processor | ||
+ | vendor_id | ||
+ | cpu family | ||
+ | model : 6 | ||
+ | model name : Common KVM processor | ||
+ | stepping | ||
+ | microcode | ||
+ | cpu MHz : 1999.987 | ||
+ | cache size : 16384 KB | ||
+ | physical id : 1 | ||
+ | siblings | ||
+ | core id : 3 | ||
+ | cpu cores : 4 | ||
+ | apicid | ||
+ | initial apicid | ||
+ | fpu : yes | ||
+ | fpu_exception | ||
+ | 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 | ||
+ | clflush size : 64 | ||
+ | cache_alignment : 128 | ||
+ | address sizes : 40 bits physical, 48 bits virtual | ||
+ | power management: | ||
</ | </ | ||
- | Installez maintenant le paquet **kernel-4.18.0-305.7.1.el8_4.src.rpm** : | + | ==Interruptions système== |
< | < | ||
- | [root@centos8 ~]# exit | + | [root@centos8 ~]# cat / |
- | logout | + | CPU0 |
- | [trainee@centos8 ~]$ rpm -Uvh kernel-4.18.0-305.7.1.el8_4.src.rpm | + | 0: 109 0 0 0 0 0 0 0 IO-APIC |
- | Updating / installing... | + | |
- | 1:kernel-4.18.0-305.7.1.el8_4 | + | 8: |
- | warning: group mockbuild does not exist - using root | + | 9: |
- | warning: user mockbuild does not exist - using root | + | 10: |
- | warning: group mockbuild does not exist - using root | + | 11: |
- | warning: user mockbuild does not exist - using root | + | 12: |
- | warning: group mockbuild does not exist - using root | + | 14: |
- | warning: user mockbuild does not exist - using root | + | 15: 7376 0 144 0 0 0 0 84588 IO-APIC 15-edge ata_piix |
- | warning: group mockbuild does not exist - using root | + | 24: |
- | warning: user mockbuild does not exist - using root | + | 25: |
- | warning: group mockbuild does not exist - using root | + | 26: 36 0 0 |
- | warning: user mockbuild does not exist - using root | + | 27: |
- | warning: group mockbuild does not exist - using root | + | NMI: |
- | warning: user mockbuild does not exist - using root | + | LOC: 870537 |
- | warning: group mockbuild does not exist - using root | + | SPU: |
- | warning: user mockbuild does not exist - using root | + | PMI: |
- | warning: group mockbuild does not exist - using root | + | IWI: |
- | warning: user mockbuild does not exist - using root | + | RTR: |
- | warning: group mockbuild does not exist - using root | + | RES: 178171 |
- | warning: user mockbuild does not exist - using root | + | CAL: |
- | warning: group mockbuild does not exist - using root | + | TLB: 2295 |
- | warning: user mockbuild does not exist - using root | + | TRM: |
- | warning: group mockbuild does not exist - using root | + | THR: |
- | warning: user mockbuild does not exist - using root | + | DFR: |
- | warning: group mockbuild does not exist - using root | + | MCE: |
- | warning: user mockbuild does not exist - using root | + | MCP: |
- | warning: group mockbuild does not exist - using root | + | HYP: |
- | warning: user mockbuild does not exist - using root | + | HRE: |
- | warning: group mockbuild does not exist - using root | + | HVS: |
- | warning: user mockbuild does not exist - using root | + | ERR: 0 |
- | warning: group mockbuild does not exist - using root | + | MIS: 0 |
- | warning: user mockbuild does not exist - using root | + | PIN: |
- | warning: group mockbuild does not exist - using root | + | NPI: |
- | warning: user mockbuild does not exist - using root | + | PIW: |
- | 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 | + | |
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** - Les erreurs sont sans importance. | + | **Important** |
+ | </ | ||
+ | |||
+ | ==Canaux DMA== | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# cat /proc/dma | ||
+ | 4: cascade | ||
+ | </ | ||
+ | |||
+ | ==Plages d' | ||
+ | |||
+ | < | ||
+ | root@centos8 ~]# cat / | ||
+ | 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: | ||
+ | 0170-0177 : ata_piix | ||
+ | 01f0-01f7 : 0000: | ||
+ | 01f0-01f7 : ata_piix | ||
+ | 0376-0376 : 0000: | ||
+ | 0376-0376 : ata_piix | ||
+ | 03c0-03df : vga+ | ||
+ | 03f6-03f6 : 0000: | ||
+ | 03f6-03f6 : ata_piix | ||
+ | --More-- | ||
+ | </ | ||
+ | |||
+ | <WRAP center round alert 60%> | ||
+ | **Important** - Si deux périphériques ont le même port, les **deux** périphériques seront inutilisables. | ||
</ | </ | ||
- | ====2.3 - Préparer l' | + | ==Périphériques== |
- | Naviguez vers le repertoire **~/rpmbuild/SPECS** et utilisez la commande **rpmbuild** pour préparer l' | + | < |
+ | [root@centos8 | ||
+ | Character devices: | ||
+ | 1 mem | ||
+ | 4 /dev/vc/0 | ||
+ | 4 tty | ||
+ | 4 ttyS | ||
+ | 5 /dev/tty | ||
+ | 5 / | ||
+ | 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 | ||
+ | </ | ||
+ | |||
+ | ==Modules== | ||
< | < | ||
- | [trainee@centos7 | + | [root@centos8 |
- | [trainee@centos7 SPECS]$ rpmbuild | + | xt_CHECKSUM 16384 1 - Live 0xffffffffc09a8000 |
- | ... | + | 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, | ||
+ | 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, | ||
+ | nft_fib_ipv6 16384 1 nft_fib_inet, | ||
+ | nft_fib 16384 3 nft_fib_inet, | ||
+ | nft_reject_inet 16384 5 - Live 0xffffffffc08de000 | ||
+ | nf_reject_ipv4 16384 2 ipt_REJECT, | ||
+ | nf_reject_ipv6 16384 1 nft_reject_inet, | ||
+ | nft_reject 16384 1 nft_reject_inet, | ||
+ | --More-- | ||
</ | </ | ||
- | A l'issu du processus, examinez l' | + | ==Statistiques de l'utilisation |
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
- | total 812 | + | |
- | drwxr-xr-x. | + | 8 1 sda1 402 3 66754 13349 31 18 392 4632 0 2824 17981 0 0 0 0 |
- | drwxr-xr-x. | + | 8 2 sda2 14915 109 1375516 140528 8450 2359 277138 869788 0 225416 1010316 0 0 0 0 |
- | drwxr-xr-x. | + | 8 16 sdb 230 0 5991 36 0 0 0 0 0 110 36 0 0 0 0 |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | 253 0 dm-0 11651 0 1364532 72138 12121 0 288727 1208138 0 227630 1280276 0 0 0 0 |
- | -rw-r--r--. | + | 253 1 dm-1 104 0 4440 79 0 0 0 0 0 71 79 0 0 0 0 |
- | -rw-r--r--. | + | |
- | drwxr-xr-x. | + | |
- | -rw-r--r--. | + | |
- | -rw-r--r--. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. 119 trainee trainee | + | |
- | drwxr-xr-x. 137 trainee trainee | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | -rw-r--r--. | + | |
- | -rw-r--r--. | + | |
- | -rw-r--r--. | + | |
- | -rw-r--r--. | + | |
- | -rw-r--r--. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. 2 trainee trainee | + | |
- | -rw-r--r--. | + | |
- | -rw-r--r--. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | -rw-r--r--. | + | |
- | -rw-r--r--. | + | |
- | -rw-r--r--. | + | |
- | -rw-r--r--. | + | |
- | -rw-r--r--. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | -rw-r--r--. | + | |
- | drwxr-xr-x. 28 trainee trainee | + | |
- | -rw-r--r--. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
</ | </ | ||
- | ===Le Fichier .config=== | + | ==Partitions== |
+ | |||
+ | < | ||
+ | [root@centos8 ~]# cat / | ||
+ | major minor # | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | 11 0 1048575 sr0 | ||
+ | | ||
+ | | ||
+ | </ | ||
- | Changez | + | ==Espaces |
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
+ | Filename | ||
+ | /dev/dm-1 | ||
</ | </ | ||
- | Copiez le fichier **configs/ | + | ==Statistiques d' |
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
+ | 0.00 0.00 0.00 1/697 16936 | ||
</ | </ | ||
- | Mettez à jour le fichier .config par rapport à la configuration actuelle du noyau : | + | ==Statistiques d' |
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
- | scripts/kconfig/conf --oldconfig Kconfig | + | MemTotal: |
- | # | + | MemFree: |
- | # configuration written to .config | + | MemAvailable: |
- | # | + | Buffers: |
+ | Cached: | ||
+ | SwapCached: | ||
+ | Active: | ||
+ | Inactive: | ||
+ | Active(anon): | ||
+ | Inactive(anon): | ||
+ | Active(file): | ||
+ | Inactive(file): | ||
+ | Unevictable: | ||
+ | Mlocked: | ||
+ | SwapTotal: | ||
+ | SwapFree: | ||
+ | Dirty: | ||
+ | Writeback: | ||
+ | AnonPages: | ||
+ | Mapped: | ||
+ | Shmem: | ||
+ | KReclaimable: | ||
+ | Slab: | ||
+ | SReclaimable: | ||
+ | SUnreclaim: | ||
+ | KernelStack: | ||
+ | PageTables: | ||
+ | NFS_Unstable: | ||
+ | Bounce: | ||
+ | WritebackTmp: | ||
+ | CommitLimit: | ||
+ | Committed_AS: | ||
+ | VmallocTotal: | ||
+ | VmallocUsed: | ||
+ | VmallocChunk: | ||
+ | Percpu: | ||
+ | HardwareCorrupted: | ||
+ | AnonHugePages: | ||
+ | ShmemHugePages: | ||
+ | ShmemPmdMapped: | ||
+ | FileHugePages: | ||
+ | FilePmdMapped: | ||
+ | HugePages_Total: | ||
+ | HugePages_Free: | ||
+ | HugePages_Rsvd: | ||
+ | HugePages_Surp: | ||
+ | Hugepagesize: | ||
+ | Hugetlb: | ||
+ | DirectMap4k: | ||
+ | DirectMap2M: | ||
</ | </ | ||
- | <WRAP center round important 60%> | + | ==Version |
- | **Important** - Cette commande lit le fichier .config | + | |
- | </ | + | |
- | La configuration du noyau se trouve dans un fichier dénommé **.config**. Le fichier **.config** est généré par une des trois commandes suivantes et ne doit **pas** être édité manuellement | + | < |
+ | [root@centos8 ~]# cat / | ||
+ | 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 | ||
+ | </ | ||
- | * make config | + | ===Répertoires=== |
- | * make menuconfig | + | |
- | * make xconfig | + | ==ide/ |
- | + | ||
- | Exécutez | + | Ce répertoire contient des répertoires dans lesquels se trouvent des informations sur la capacité, le type et la géométrie des disques. |
+ | |||
+ | ==acpi== | ||
+ | |||
+ | Ce répertoire contient des informations sur la gestion de l' | ||
+ | |||
+ | ==bus== | ||
+ | |||
+ | Ce répertoire contient un sous-répertoire par bus. | ||
+ | |||
+ | ==net== | ||
+ | |||
+ | Ce répertoire contient des informations sur le réseau. | ||
+ | |||
+ | ==sys== | ||
+ | |||
+ | Ce répertoire contient des paramètres du noyau. Certains des fichiers dans ce répertoire sont accessibles en écriture par root en temps réel. Par exemple pour éviter des attaques réseau | ||
+ | |||
+ | | ||
+ | |||
+ | Cette commande a pour résultat d' | ||
+ | |||
+ | ====2.2 - Utilisation de la Commande sysctl==== | ||
+ | |||
+ | Les fichiers dans le répertoire **/ | ||
+ | |||
+ | La commande **sysctl** applique les règles consignés dans le fichier **/ | ||
+ | |||
+ | Saisissez la commande | ||
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
- | UPD | + | # sysctl settings are defined through files in |
- | | + | # /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/. |
- | | + | |
- | HOSTCC | + | |
- | HOSTCC | + | |
- | HOSTCC | + | |
- | HOSTCC | + | |
- | HOSTCC | + | |
- | HOSTLD | + | |
- | scripts/ | + | |
# | # | ||
- | # using defaults found in /boot/config-4.18.0-305.7.1.el8_4.x86_64 | + | # 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, | ||
+ | |||
+ | [root@centos8 ~]# ls -l / | ||
+ | total 0 | ||
+ | lrwxrwxrwx. 1 root root 14 Mar 16 15:42 99-sysctl.conf -> ../ | ||
+ | [root@centos8 ~]# ls -l / | ||
+ | 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 / | ||
+ | # This file is part of systemd. | ||
+ | # | ||
+ | # 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. | ||
+ | |||
+ | # To override settings in this file, create a local file in /etc | ||
+ | # (e.g. / | ||
+ | # there. | ||
+ | |||
+ | # System Request functionality of the kernel (SYNC) | ||
+ | # | ||
+ | # Use kernel.sysrq = 1 to allow all keys. | ||
+ | # See https:// | ||
+ | # of values and keys. | ||
+ | kernel.sysrq = 16 | ||
+ | |||
+ | # Append the PID to the core filename | ||
+ | kernel.core_uses_pid = 1 | ||
+ | |||
+ | # https:// | ||
+ | kernel.kptr_restrict = 1 | ||
+ | |||
+ | # Source route verification | ||
+ | net.ipv4.conf.all.rp_filter = 1 | ||
+ | |||
+ | # Do not accept source routing | ||
+ | net.ipv4.conf.all.accept_source_route = 0 | ||
+ | |||
+ | # 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 | ||
</ | </ | ||
- | Dans l' | + | Les options |
- | * **y**, | + | < |
- | * la fonctionalité est incluse dans le noyau monolithique ou dans le cas d'une dépendance d'un module, dans le module concerné, | + | [root@centos8 ~]# sysctl --help |
- | | + | |
- | * la fonctionalité est incluse en tant que module, | + | Usage: |
- | | + | |
- | * la fonctionalité n'est pas incluse. | + | |
+ | Options: | ||
+ | -a, --all display all variables | ||
+ | | ||
+ | -X alias of -a | ||
+ | --deprecated | ||
+ | -b, --binary | ||
+ | | ||
+ | -N, --names | ||
+ | | ||
+ | -p, --load[=< | ||
+ | -f alias of -p | ||
+ | --system | ||
+ | -r, --pattern < | ||
+ | | ||
+ | -q, --quiet | ||
+ | -w, --write | ||
+ | -o does nothing | ||
+ | -x does nothing | ||
+ | -d alias of -h | ||
+ | |||
+ | -h, --help | ||
+ | -V, --version | ||
+ | |||
+ | For more details see sysctl(8). | ||
+ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** | + | **Important** |
</ | </ | ||
- | + | ||
- | Sauvegardez simplement la configuration actuelle | + | =====LAB#3 - Interprétation des informations dans / |
+ | |||
+ | Les informations brutes stockées dans /proc peuvent être interprétées grâce à l' | ||
+ | |||
+ | * free, | ||
+ | * uptime | ||
+ | * iostat, | ||
+ | * hdparm, | ||
+ | * vmstat, | ||
+ | * mpstat, | ||
+ | * sar. | ||
+ | |||
+ | ====3.1 - La Commande free==== | ||
+ | |||
+ | La commande **free** permet | ||
< | < | ||
- | *** End of the configuration. | + | [root@centos8 ~]# free -m |
- | *** Execute ' | + | |
+ | Mem: | ||
+ | Swap: 3279 | ||
</ | </ | ||
- | Vérifiez que le fichier | + | Dans le cas de cet exemple, nous pouvons constater que l’affichage montre : |
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | |||
+ | Les options | ||
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
- | . certs configs | + | |
- | .. | + | Usage: |
- | arch | + | free [options] |
- | block .config | + | |
+ | Options: | ||
+ | -b, --bytes | ||
+ | --kilo | ||
+ | --mega show output in megabytes | ||
+ | | ||
+ | --tera show output in terabytes | ||
+ | | ||
+ | -k, --kibi | ||
+ | -m, --mebi | ||
+ | -g, --gibi | ||
+ | | ||
+ | | ||
+ | -h, --human | ||
+ | | ||
+ | -l, --lohi | ||
+ | -t, --total | ||
+ | -s N, --seconds N | ||
+ | -c N, --count N | ||
+ | -w, --wide | ||
+ | |||
+ | --help | ||
+ | -V, --version | ||
+ | |||
+ | For more details see free(1). | ||
</ | </ | ||
- | Consultez ce fichier | + | ====3.2 - Les Commandes uptime et w==== |
+ | |||
+ | Chacune des ces commandes indique la charge moyenne du ou des processeurs depuis 1 minute, 5 minutes et 15 minutes | ||
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
- | # | + | |
- | # Automatically generated file; DO NOT EDIT. | + | |
- | # Linux/x86 4.18.0 Kernel Configuration | + | [root@centos8 ~]# w |
- | # | + | |
+ | USER | ||
+ | trainee | ||
+ | </ | ||
- | # | + | Les valeurs **load average** ou //charge moyenne// indiquent le nombre moyen de processus en cours de traitement ou en attente pour la période concernée. |
- | # Compiler: gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) | + | |
- | # | + | Par exemple si les valeurs sur un système muni d'un seul processeur étaient **3, |
- | CONFIG_64BIT=y | + | |
- | CONFIG_X86_64=y | + | * 2,48 processus en attente dans la dernière minute, |
- | CONFIG_X86=y | + | * 3,00 processus en attente dans les dernières 5 minutes, |
- | CONFIG_INSTRUCTION_DECODER=y | + | * 2,85 processus en attente dans les dernières 15 minutes. |
- | CONFIG_OUTPUT_FORMAT=" | + | |
- | CONFIG_ARCH_DEFCONFIG=" | + | Les options de ces commandes sont : |
- | CONFIG_LOCKDEP_SUPPORT=y | + | |
- | CONFIG_STACKTRACE_SUPPORT=y | + | < |
- | CONFIG_MMU=y | + | [root@centos8 ~]# uptime --help |
- | CONFIG_ARCH_MMAP_RND_BITS_MIN=28 | + | |
- | CONFIG_ARCH_MMAP_RND_BITS_MAX=32 | + | Usage: |
- | CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 | + | uptime [options] |
- | CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 | + | |
- | CONFIG_GENERIC_ISA_DMA=y | + | Options: |
- | CONFIG_GENERIC_BUG=y | + | -p, --pretty |
- | CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y | + | -h, --help |
- | CONFIG_GENERIC_HWEIGHT=y | + | -s, --since |
- | CONFIG_ARCH_MAY_HAVE_PC_FDC=y | + | -V, --version |
- | CONFIG_GENERIC_CALIBRATE_DELAY=y | + | |
- | CONFIG_ARCH_HAS_CPU_RELAX=y | + | For more details see uptime(1). |
- | CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y | + | |
- | CONFIG_ARCH_HAS_FILTER_PGPROT=y | + | [root@centos8 ~]# w --help |
- | CONFIG_HAVE_SETUP_PER_CPU_AREA=y | + | |
- | CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y | + | Usage: |
- | CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y | + | w [options] |
- | CONFIG_ARCH_HIBERNATION_POSSIBLE=y | + | |
- | CONFIG_ARCH_SUSPEND_POSSIBLE=y | + | Options: |
- | CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y | + | -h, --no-header |
- | CONFIG_ARCH_WANT_GENERAL_HUGETLB=y | + | -u, --no-current |
- | CONFIG_ZONE_DMA32=y | + | -s, --short |
- | CONFIG_AUDIT_ARCH=y | + | -f, --from |
- | CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y | + | -o, --old-style |
- | CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y | + | -i, --ip-addr |
- | CONFIG_HAVE_INTEL_TXT=y | + | |
- | CONFIG_X86_64_SMP=y | + | |
- | --More--(0%) | + | -V, --version |
+ | |||
+ | For more details see w(1). | ||
</ | </ | ||
- | ===Le Fichier Makefile=== | + | ====3.3 - La Commande iostat==== |
- | Le fichier | + | La commande |
- | * VERSION, | + | < |
- | * PATCHLEVEL, | + | [root@centos8 ~]# iostat |
- | * SUBLEVEL, | + | bash: iostat: command not found... |
- | * EXTRAVERSION. | + | Install package ' |
- | Les trois premières informations sont gérées par **kernel.org** et Linus Torvalds | + | |
+ | * Waiting in queue... | ||
+ | The following packages have to be installed: | ||
+ | | ||
+ | | ||
+ | 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) | ||
+ | |||
+ | avg-cpu: | ||
+ | | ||
+ | |||
+ | Device | ||
+ | sda | ||
+ | sdb | ||
+ | scd0 0.00 | ||
+ | dm-0 0.26 | ||
+ | dm-1 0.00 | ||
+ | </ | ||
+ | |||
+ | Au-dessous de la première ligne indiquant la version du noyau du système | ||
+ | |||
+ | * **%user** - Pourcentage de temps passé | ||
+ | * **%nice** - Pourcentage de temps passé en mode utilisateur (pour les processus qui ont modifié leur priorité de programmation à l'aide de la commande nice) | ||
+ | * **%system** - Pourcentage de temps passé en mode noyau | ||
+ | * **%steal** - Pourcentage du temps passé par des CPU virtuels en attendant | ||
+ | * **%iowait** - Pourcentage du temps passé à attendre les entrées et les sorties des disques. | ||
+ | * **%idle** - Pourcentage de temps passé en inactivité | ||
+ | |||
+ | Notez la valeur de **%iowait**. Dans le cas où ce pourcentage | ||
+ | |||
+ | Au-dessous du rapport d' | ||
+ | |||
+ | * La spécification du périphérique. | ||
+ | * Le nombre de transferts (ou opérations d' | ||
+ | * Le nombre de blocs de KB lus par seconde. | ||
+ | * Le nombre de blocs de KB écrits par seconde. | ||
+ | * Le nombre total de KB lus. | ||
+ | * Le nombre total de KB écrits. | ||
+ | |||
+ | Dernièrement, | ||
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
- | # SPDX-License-Identifier: | + | Linux 4.18.0-305.3.1.el8.x86_64 |
- | VERSION = 4 | + | |
- | PATCHLEVEL = 18 | + | |
- | SUBLEVEL = 0 | + | |
- | EXTRAVERSION = | + | |
- | NAME = Merciless Moray | + | |
- | # | + | Device |
- | # DRM backport version | + | sda 0.20 0.16 |
- | # | + | sdb 0.00 0.00 0.02 0.00 |
- | RHEL_DRM_VERSION = 5 | + | scd0 |
- | RHEL_DRM_PATCHLEVEL = 9 | + | dm-0 |
- | RHEL_DRM_SUBLEVEL = 14 | + | dm-1 |
+ | </ | ||
- | # *DOCUMENTATION* | + | Les options de cette commande sont : |
- | # 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. | + | |
- | # That's our default target when none is given on the command line | + | < |
- | PHONY := _all | + | [root@centos8 ~]# iostat --help |
- | _all: | + | Usage: iostat [ options ] [ < |
+ | Options are: | ||
+ | [ -c ] [ -d ] [ -h ] [ -k | -m ] [ -N ] [ -s ] [ -t ] [ -V ] [ -x ] [ -y ] [ -z ] | ||
+ | [ -j { ID | LABEL | PATH | UUID | ... } ] [ --human ] [ -o JSON ] | ||
+ | [ [ -H ] -g < | ||
+ | [ < | ||
+ | </ | ||
- | # o Do not use make's built-in rules and variables | + | ====3.4 |
- | # (this increases performance and avoids hard-to-debug behaviour); | + | |
- | # o Look for make include files relative to root of kernel src | + | |
- | MAKEFLAGS += -rR --include-dir=$(CURDIR) | + | |
- | # Avoid funny character set dependencies | + | Pour surveiller la vitesse des entrées et des sorties du disque, vous pouvez utiliser la commande **hdparm** : |
- | unexport LC_ALL | + | |
- | LC_COLLATE=C | + | |
- | LC_NUMERIC=C | + | |
- | export LC_COLLATE LC_NUMERIC | + | |
- | # Avoid interference with shell env settings | + | < |
- | unexport GREP_OPTIONS | + | [root@centos8 ~]# hdparm -t /dev/sda |
- | # Set RHEL variables | + | /dev/sda: |
- | # Use this spot to avoid future merge conflicts | + | |
- | include Makefile.rhelver | + | </ |
+ | |||
+ | ====3.5 - La Commande vmstat==== | ||
+ | |||
+ | La commande **vmstat** affiche des statistiques sur la mémoire, la pagination et la charge ponctuelle du processeur : | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# vmstat 1 10 | ||
+ | procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu----- | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | La première ligne subdivise le champ en six catégories à savoir : processus, mémoire, swap, E/S, système et CPU sur lesquelles elle donne des statistiques. La seconde ligne identifie de manière encore plus détaillée chacun des champs, permettant ainsi de parcourir simplement et rapidement l' | ||
+ | |||
+ | Les champs relatifs aux processus sont les suivants : | ||
+ | |||
+ | * r — Le nombre de processus exécutables attendant d' | ||
+ | * b — Le nombre de processus exécutables dans un état de veille qui ne peut être interrompu | ||
+ | |||
+ | Les champs relatifs à la mémoire sont les suivants : | ||
+ | |||
+ | * swpd — La quantité de mémoire virtuelle utilisée | ||
+ | * free — La quantité de mémoire libre | ||
+ | * buff — La quantité de mémoire utilisée par les tampons (ou buffers) | ||
+ | * cache — La quantité de mémoire utilisée comme cache de pages | ||
+ | |||
+ | Les champs relatifs au swap sont les suivants : | ||
+ | |||
+ | * si — La quantité de mémoire chargée depuis le disque | ||
+ | * so — La quantité de mémoire déchargée sur le disque | ||
+ | |||
+ | Les champs relatifs aux Entrées/ | ||
+ | |||
+ | * bi — Blocs envoyés vers un périphérique blocs | ||
+ | * bo— Blocs reçus d'un périphérique blocs | ||
+ | |||
+ | Les champs relatifs au système sont les suivants : | ||
+ | |||
+ | * in — Nombre d' | ||
+ | * cs — Nombre de changements de contexte par seconde | ||
+ | |||
+ | Les champs relatifs au CPU sont les suivants : | ||
+ | |||
+ | * us — Le pourcentage de temps pendant lequel le CPU exécute un code de niveau utilisateur | ||
+ | * sy — Le pourcentage de temps pendant lequel le CPU exécute un code de niveau système | ||
+ | * id — Le pourcentage de temps pendant lequel le CPU était inoccupé | ||
+ | * wa — Attente d' | ||
+ | |||
+ | Les options de cette commande sont : | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# vmstat --help | ||
+ | |||
+ | Usage: | ||
+ | | ||
+ | |||
+ | Options: | ||
+ | -a, --active | ||
+ | -f, --forks | ||
+ | -m, --slabs | ||
+ | -n, --one-header | ||
+ | -s, --stats | ||
+ | -d, --disk | ||
+ | -D, --disk-sum | ||
+ | -p, --partition < | ||
+ | -S, --unit < | ||
+ | -w, --wide | ||
+ | -t, --timestamp | ||
+ | |||
+ | -h, --help | ||
+ | -V, --version | ||
- | # We are using a recursive build, so we need to do a little thinking | + | For more details see vmstat(8). |
- | --Plus--(2%) | + | |
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** | + | **Important** |
</ | </ | ||
- | ====2.4 - Paramétrage du noyau==== | + | ====3.6 - La Commande mpstat==== |
- | Insérez la sortie de la commande **uname -i** sur la première ligne du fichier .config | + | La commande **mpstat** affiche des statistiques détaillées |
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
- | x86_64 | + | Linux 4.18.0-305.3.1.el8.x86_64 |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ vi .config | + | |
- | [trainee@centos8 | + | |
- | # x86_64 | + | |
- | # | + | |
- | # Automatically generated file; DO NOT EDIT. | + | |
- | # Linux/x86 4.18.0 Kernel Configuration | + | |
- | # | + | |
- | # | + | 04: |
- | # Compiler: gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) | + | 04:53:22 |
- | # | + | |
- | CONFIG_64BIT=y | + | |
</ | </ | ||
- | Renommez | + | Dans le cas où vous avez plusieurs processeurs ou coeurs, vous pouvez visualiser ces mêmes informations par unité de traitement |
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ ls ~/ | + | Linux 4.18.0-305.3.1.el8.x86_64 |
- | centos-ca-secureboot.der cpupower.config | + | |
- | centos-dup.x509 | + | 04: |
- | centos-kpatch.x509 debrand-rh-i686-cpu.patch generate_bls_conf.sh | + | 04: |
- | centos.pem debrand-rh_taint.patch | + | 04: |
- | centossecureboot001.der | + | 04: |
- | centossecureboot201.der | + | 04: |
- | centossecurebootca2.der | + | 04: |
- | check-kabi | + | 04: |
- | config-x86_64-generic | + | 04: |
+ | 04: | ||
+ | 04: | ||
</ | </ | ||
- | Copiez le contenu du répertoire **configs** vers le répertoire **~/ | + | Pour afficher 5 jeux de statistiques à des intervales de 2 secondes pour tous les unités de traitement, il convient d' |
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
+ | Linux 4.18.0-305.3.1.el8.x86_64 | ||
+ | |||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | |||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | |||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | |||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | |||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | 04: | ||
+ | |||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
</ | </ | ||
- | Editez la directive **buildid** dans le fichier **~/ | + | Les options de cette commande sont : |
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
+ | Usage: mpstat [ options | ||
+ | Options are: | ||
+ | [ -A ] [ -n ] [ -u ] [ -V ] [ -I { SUM | CPU | SCPU | ALL } ] | ||
+ | [ -N { < | ||
+ | </code> | ||
- | [trainee@centos8 SPECS]$ vi kernel.spec | + | ====3.7 - La Commande sar==== |
- | [trainee@centos8 SPECS]$ head -n 50 kernel.spec | + | La commande **sar** (**S**ystem **A**ctivity **R**eporter) permet de surveiller toutes les ressources du système selon l' |
- | # We have to override the new %%install behavior because, well... the kernel is special. | + | |
- | %global __spec_install_pre %{___build_pre} | + | |
- | # At the time of this writing (2019-03), RHEL8 packages use w2.xzdio | + | Sous RHEL/CentOS 8 la commande **/usr/lib64/sa/sadc** permet de collecter les informations |
- | # compression for rpms (xz, level 2). | + | |
- | # Kernel has several large (hundreds of mbytes) rpms, they take ~5 mins | + | |
- | # to compress by single-threaded xz. Switch to threaded compression, | + | |
- | # and from level 2 to 3 to keep compressed sizes close to " | + | |
- | # | + | |
- | # NB: if default compression in /usr/lib/rpm/redhat/macros ever changes, | + | |
- | # this one might need tweaking (e.g. if default changes to w3.xzdio, | + | |
- | # change below to w4T.xzdio): | + | |
- | %define _binary_payload w3T.xzdio | + | |
- | # For a kernel released for public testing, released_kernel should be 1. | + | < |
- | # For internal testing builds during development, | + | [root@centos8 ~]# ls / |
- | %global released_kernel 1 | + | sa1 sa2 sadc |
+ | </ | ||
- | %global distro_build 305 | + | Le script **/ |
- | # Sign the x86_64 kernel for secure boot authentication | + | ^ Option ^ Description ^ |
- | %ifarch x86_64 aarch64 | + | | -t | L' |
- | %global signkernel 1 | + | | -n | Nombre de collectes | |
- | %else | + | |
- | %global signkernel 0 | + | |
- | %endif | + | |
- | # Sign modules on all arches | + | Le script **/ |
- | %global signmodules 1 | + | |
- | # Compress modules only for architectures that build modules | + | < |
- | %ifarch noarch | + | [root@centos8 ~]# ls / |
- | %global zipmodules 0 | + | sa29 s |
- | %else | + | |
- | %global zipmodules 1 | + | |
- | %endif | + | |
- | %if %{zipmodules} | ||
- | %global zipsed -e ' | ||
- | %endif | ||
- | %define buildid | + | ar29 |
+ | </ | ||
+ | |||
+ | Sous CentOS / RHEL 8, l' | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# cat / | ||
+ | # / | ||
+ | # (C) 2014 Tomasz Torcz < | ||
+ | # | ||
+ | # sysstat-11.7.3 systemd unit file: | ||
+ | # Activates activity collector every 10 minutes | ||
- | %define rpmversion 4.18.0 | + | [Unit] |
- | %define pkgrelease 305.7.1.el8_4 | + | Description=Run system activity accounting tool every 10 minutes |
- | # allow pkg_release to have configurable %%{?dist} tag | + | [Timer] |
- | %define specrelease 305.7.1%{? | + | OnCalendar=*: |
- | %define pkg_release %{specrelease}%{? | + | [Install] |
+ | WantedBy=sysstat.service | ||
</ | </ | ||
- | ====2.5 - Compiler le Noyau==== | + | La valeur de **OnCalendar** indique un collecte toutes les dix minutes. |
- | La compilation du noyau peut prendre beaucoup de temps (~5 heures). La commande utilisée est la suivante | + | Pour modifier l' |
< | < | ||
- | [trainee@centos7 SPECS]$ rpmbuild | + | [root@centos8 ~]# systemctl edit sysstat-collect.timer |
+ | [root@centos8 ~]# cat / | ||
+ | [Unit] | ||
+ | Description=Run system activity accounting tool every 2 minutes | ||
+ | |||
+ | [Timer] | ||
+ | OnCalendar= | ||
+ | OnCalendar=*: | ||
+ | AccuracySec=0 | ||
</ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** | + | **Important** |
</ | </ | ||
- | A l'issu du processus, les RPMs se trouvent dans le répertoire **/ | + | Vérifiez ensuite la prise en compte de la configuration |
< | < | ||
- | ... | + | [root@centos8 ~]# systemctl status sysstat-collect.timer |
- | Wrote: / | + | ● sysstat-collect.timer - Run system activity accounting tool every 2 minutes |
- | Wrote: / | + | Loaded: loaded (/usr/lib/systemd/system/sysstat-collect.timer; enabled; vendor preset: disabled) |
- | Wrote: /home/trainee/rpmbuild/RPMS/x86_64/ | + | Drop-In: /etc/systemd/system/sysstat-collect.timer.d |
- | Wrote: / | + | └─override.conf |
- | Wrote: / | + | Active: active (waiting) since Tue 2021-06-29 06:16:04 EDT; 3h 2min ago |
- | Wrote: /home/trainee/rpmbuild/RPMS/ | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Executing(%clean): | + | |
- | [1]+ Done rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log | + | Jun 29 06:16:04 centos8.ittraining.loc systemd[1]: Started Run system activity accounting tool every 10 minutes. |
</ | </ | ||
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
- | [trainee@centos8 RPMS]$ ls | + | -- Logs begin at Mon 2021-06-28 02:04:10 EDT, end at Tue 2021-06-29 09:18:00 EDT. -- |
- | x86_64 | + | Jun 29 06:20:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. |
- | [trainee@centos8 RPMS]$ cd x86_64/ | + | Jun 29 06:26:29 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. |
- | [trainee@centos8 x86_64]$ ls | + | Jun 29 06:30:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. |
- | bpftool-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | Jun 29 06:40:33 centos8.ittraining.loc systemd[1]: sysstat-collect.service: Succeeded. |
- | bpftool-debuginfo-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. |
- | kernel-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-core-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-cross-headers-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-debug-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-core-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-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-devel-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-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. |
+ | 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. | ||
+ | ... | ||
</ | </ | ||
- | Notez que la génération du nouveau noyau peut consommer jusqu' | + | Saisissez |
< | < | ||
- | [trainee@centos8 | + | [root@centos8 |
- | Filesystem | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) |
- | devtmpfs | + | |
- | tmpfs 1.9G 0 1.9G 0% /dev/shm | + | 06: |
- | tmpfs 1.9G 9.4M 1.9G | + | |
- | tmpfs 1.9G 0 1.9G 0% / | + | 06: |
- | / | + | 06: |
- | / | + | 06: |
- | tmpfs 374M | + | 06: |
- | tmpfs 374M 1.2M 373M 1% /run/user/42 | + | 06: |
- | / | + | 07: |
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | Average: | ||
+ | |||
+ | 07: | ||
+ | |||
+ | 07: | ||
+ | 07: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08:20:00 all 0.02 0.00 0.04 0.00 0.00 99.94 | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08:32:00 all 0.02 0.00 0.04 0.00 0.00 99.94 | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08:42:00 all 0.02 0.00 0.03 0.00 0.00 99.94 | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 08: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | |||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | Average: | ||
</ | </ | ||
- | ====2.6 - Installer le Nouveau Noyau==== | + | ===Statistiques d' |
- | Installez | + | Visualisez |
< | < | ||
- | [root@centos8 | + | [root@centos8 |
- | Last metadata expiration check: 2:25:32 ago on Tue 20 Jul 2021 08:37:00 EDT. | + | Linux 4.18.0-305.3.1.el8.x86_64 |
- | Dependencies resolved. | + | |
- | =============================================================================================================================================================================================================== | + | |
- | | + | |
- | =============================================================================================================================================================================================================== | + | |
- | Installing: | + | |
- | | + | |
- | kernel-core | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | Downgrading: | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | Transaction Summary | + | |
- | =============================================================================================================================================================================================================== | + | |
- | Install | + | |
- | Downgrade | + | |
- | Total size: 1.6 G | + | 09:22:52 CPU |
- | Is this ok [y/N]: y | + | 09: |
+ | 09:23:02 all 0.03 0.00 0.03 0.00 0.00 | ||
+ | 09: | ||
+ | Average: | ||
</ | </ | ||
- | A l'issu de l'installation, | + | D'avantage |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
+ | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | ||
+ | |||
+ | 01: | ||
+ | 01: | ||
+ | 01: | ||
+ | 01: | ||
+ | Average: | ||
</ | </ | ||
- | Connectez-vous en tant que trainee et devenez root. Listez ensuite | + | Pour consulter |
< | < | ||
- | [root@centos8 ~]# rpm -qa | grep kernel | + | [root@centos8 ~]# sar -u -P 1 5 3 |
- | kernel-modules-4.18.0-305.3.1.el8.x86_64 | + | Linux 4.18.0-305.3.1.el8.x86_64 |
- | kernel-tools-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-headers-4.18.0-305.7.1.el8.i2tch.x86_64 | + | 01: |
- | kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 | + | 01: |
- | kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64 | + | 01: |
- | kernel-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64 | + | 01: |
- | kernel-modules-4.18.0-305.7.1.el8_4.x86_64 | + | Average: |
- | kernel-debug-modules-4.18.0-305.7.1.el8.i2tch.x86_64 | + | [root@centos8 ~]# sar -u -P 5 5 3 |
- | kernel-devel-4.18.0-305.7.1.el8.i2tch.x86_64 | + | Linux 4.18.0-305.3.1.el8.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 | + | 01: |
- | kernel-debug-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64 | + | 01: |
- | kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64 | + | 01: |
- | kernel-core-4.18.0-305.7.1.el8_4.x86_64 | + | 01: |
- | kernel-devel-4.18.0-305.7.1.el8_4.x86_64 | + | Average: |
- | 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 | + | |
</ | </ | ||
- | Constatez | + | ===Statistiques d' |
+ | |||
+ | Utilisez | ||
< | < | ||
- | [root@centos8 ~]# grep i2tch / | + | [root@centos8 ~]# sar -r 5 3 |
- | saved_entry=95bd69e34a7444a7b58cb74fbfb86df2-4.18.0-305.7.1.el8.i2tch.x86_64 | + | Linux 4.18.0-305.3.1.el8.x86_64 |
+ | |||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | Average: | ||
</ | </ | ||
- | Dernièrement, | + | Utilisez |
< | < | ||
- | [root@centos8 ~]# uname -r | + | [root@centos8 ~]# sar -S 5 3 |
- | 4.18.0-305.7.1.el8.i2tch.x86_64 | + | Linux 4.18.0-305.3.1.el8.x86_64 |
+ | |||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | Average: | ||
</ | </ | ||
- | =====LAB #3 - Gestion | + | ===Statistiques |
- | Sous Linux il est possible de mettre en place des quotas par utilisateur et par groupe. Ceci étant, Linux ne sait pas gérer des quotas par répertoire, | + | Utilisez |
- | quotas par partition. L' | + | |
- | Déconnectez-vous et reconnectez-vous **directement** en tant que root : | + | < |
+ | [root@centos8 ~]# sar -b 5 3 | ||
+ | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) | ||
+ | |||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | Average: | ||
+ | </ | ||
+ | |||
+ | ===Statistiques des E/S par Disque=== | ||
+ | |||
+ | Utilisez l' | ||
< | < | ||
- | root@computeXX:~# ssh -l root 10.0.2.45 | + | [root@centos8 |
- | root@10.0.2.45's password: fenestros | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) 29/ |
- | Activate the web console with: systemctl enable --now cockpit.socket | + | |
- | Last login: Wed Jul 21 11:14:31 2021 | + | 09:25:45 DEV |
- | [root@centos8 ~]# | + | 09:25:50 |
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | |||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | |||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | 09: | ||
+ | |||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
</ | </ | ||
- | Avant de mettre en place des quotas, configurer SELINUX en mode **permissive** afin de ne pas avoir d' | + | La colonne **DEV** indentifie les disques par leurs majeurs et mineurs. Pour voir les informations avec les noms des disques, ajoutez l' |
< | < | ||
- | [root@centos8 ~]# getenforce | + | [root@centos8 ~]# sar -p -d 5 3 |
- | Enforcing | + | Linux 4.18.0-305.3.1.el8.x86_64 (centos8.ittraining.loc) |
- | [root@centos8 ~]# setenforce permissive | + | |
- | [root@centos8 ~]# getenforce | + | 07: |
- | Permissive | + | 07: |
- | [root@centos8 ~]# | + | 07: |
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | |||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | |||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | 07: | ||
+ | |||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
+ | Average: | ||
</ | </ | ||
- | Editez ensuite le fichier / | + | Les options de la commande sar sont : |
< | < | ||
- | [root@centos8 ~]# vi / | + | [root@centos8 ~]# sar --help |
- | [root@centos8 ~]# cat /etc/ | + | Usage: sar [ options |
+ | 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 { < | ||
+ | Interrupts statistics [A_IRQ] | ||
+ | -m { < | ||
+ | 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 { < | ||
+ | Network statistics [A_NET_...] | ||
+ | Keywords are: | ||
+ | DEV | ||
+ | EDEV Network interfaces (errors) | ||
+ | NFS NFS client | ||
+ | NFSD NFS server | ||
+ | SOCK Sockets (v4) | ||
+ | IP IP traffic | ||
+ | EIP IP traffic | ||
+ | ICMP ICMP traffic | ||
+ | EICMP ICMP traffic | ||
+ | TCP TCP traffic | ||
+ | ETCP TCP traffic | ||
+ | UDP UDP traffic | ||
+ | SOCK6 | ||
+ | IP6 IP traffic | ||
+ | EIP6 IP traffic | ||
+ | ICMP6 ICMP traffic | ||
+ | EICMP6 | ||
+ | UDP6 UDP traffic | ||
+ | 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> | ||
- | # This file controls the state of SELinux on the system. | + | =====Modules usb===== |
- | # SELINUX= can take one of these three values: | + | |
- | # | + | |
- | # | + | |
- | # | + | |
- | SELINUX=permissive | + | |
- | # SELINUXTYPE= can take one of these three values: | + | |
- | # | + | |
- | # | + | |
- | # mls - Multi Level Security protection. | + | |
- | SELINUXTYPE=targeted | + | |
+ | L' | ||
+ | |||
+ | ^ Version USB ^ Module ^ Nom Complet ^ | ||
+ | | 1.0\1.1 | ||
+ | | ::: | **OHCI** | //Open Controller Host Interface// | | ||
+ | | 2.0 | **EHCI** | //Enhanced Host Controller Interface// | | ||
+ | | 3.0 | **XHCI** | // | ||
+ | |||
+ | Le tableau suivant liste les modules courrament chargés en fonction du périphérique utilisé : | ||
+ | |||
+ | ^ Module ^ Type de Périphérique ^ | ||
+ | | **usb_storage** | ||
+ | | **usbhid** | ||
+ | | **snd-usb-audio** | ||
+ | | **usbvidéo** | ||
+ | | **irda-usb** | ||
+ | | **usbnet** | ||
+ | |||
+ | Les modules peuvent être chargés par un des moyens suivants : | ||
+ | |||
+ | * INITrd, | ||
+ | * Le processus init (systemd), | ||
+ | * kmod, d'une manière dynamique et transparente lors du branchement du périphérique, | ||
+ | * udev, | ||
+ | * manuellement. | ||
+ | |||
+ | =====udev===== | ||
+ | |||
+ | Depuis le noyau Linux 2.6 Linux est capable de détecter des périphériques branchés à chaud. Cette technologie s' | ||
+ | |||
+ | * Udev, | ||
+ | * HAL, | ||
+ | * Dbus. | ||
+ | |||
+ | Les rôles de chaque composant sont les suivants : | ||
+ | |||
+ | * Udev se charge de créer et supprimer d'une manière dynamique les nœuds dans le répertoire **/dev**, | ||
+ | * HAL obtient des informations à partir d'Udev et créé un fichier au format XML représentant le périphérique branché. Il informe ensuite Nautilus en utilisant le Dbus, | ||
+ | * Dbus joue le rôle d'un bus système qui est utilisé pour la communication inter-processus. | ||
+ | |||
+ | Lors de démarrage de Linux, Udev joue un rôle important : | ||
+ | |||
+ | * Au démarrage **tmpfs** est monté sur /dev, | ||
+ | * Udev copie les éventuels nœuds statiques de **/ | ||
+ | * le démon **udevd** collecte des données appelées **uevents** du noyau et cherche une règle correspondante dans le répertoire **/ | ||
+ | * Udev crée les nœuds et liens symboliques spécifiés dans la règle identifiée, | ||
+ | * Udev stocke les règles contenues dans **/ | ||
+ | * En cas de modification des ces règles, Udev met à jour la mémoire. | ||
+ | |||
+ | Udev repose sur le filesystem **sysfs** monté sur /sys qui permet de rendre les périphériques visibles à Udev dans l'// | ||
+ | |||
+ | Le fichier de configuration principal d'Udev est **/ | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# cat / | ||
+ | # see udev.conf(5) for details | ||
+ | # | ||
+ | # udevd is also started in the initrd. | ||
+ | # also want to rebuild the initrd, so that it will include the modified configuration. | ||
+ | |||
+ | # | ||
</ | </ | ||
- | Commencez par vérifiez que le paquet | + | Les fichiers de règles se trouvent dans **/ |
< | < | ||
- | [root@centos8 ~]# rpm -qa | grep quota | + | [root@centos8 ~]# ls / |
- | quota-4.04-12.el8.x86_64 | + | 01-md-raid-creating.rules |
- | quota-nls-4.04-12.el8.noarch | + | 10-dm.rules 70-wacom.rules |
+ | 11-dm-lvm.rules 71-biosdevname.rules | ||
+ | 11-dm-mpath.rules 71-nvmf-iopolicy-netapp.rules | ||
+ | 11-dm-parts.rules | ||
+ | 13-dm-disk.rules | ||
+ | 39-usbmuxd.rules | ||
+ | 40-elevator.rules | ||
+ | 40-libgphoto2.rules | ||
+ | 40-redhat.rules | ||
+ | 40-usb-blacklist.rules | ||
+ | 40-usb_modeswitch.rules | ||
+ | 50-udev-default.rules | ||
+ | 60-alias-kmsg.rules | ||
+ | 60-block.rules | ||
+ | 60-cdrom_id.rules | ||
+ | 60-drm.rules | ||
+ | 60-evdev.rules | ||
+ | 60-fido-id.rules | ||
+ | 60-input-id.rules | ||
+ | 60-libfprint-2-autosuspend.rules | ||
+ | 60-net.rules | ||
+ | 60-persistent-alsa.rules | ||
+ | 60-persistent-input.rules | ||
+ | 60-persistent-storage.rules | ||
+ | 60-persistent-storage-tape.rules | ||
+ | 60-persistent-v4l.rules | ||
+ | 60-raw.rules | ||
+ | 60-rdma-ndd.rules | ||
+ | 60-rdma-persistent-naming.rules | ||
+ | 60-sensor.rules | ||
+ | 60-serial.rules | ||
+ | 60-tpm-udev.rules | ||
+ | 61-gdm.rules | ||
+ | 61-gnome-bluetooth-rfkill.rules | ||
+ | 61-gnome-settings-daemon-rfkill.rules | ||
+ | 61-scsi-sg3_id.rules | ||
+ | 62-multipath.rules | ||
+ | 63-fc-wwpn-id.rules | ||
+ | 63-md-raid-arrays.rules | ||
+ | 63-scsi-sg3_symlink.rules | ||
+ | 64-btrfs.rules | ||
+ | 64-md-raid-assembly.rules | ||
+ | 65-libwacom.rules | ||
+ | 65-md-incremental.rules | ||
+ | 65-sane-backends.rules | ||
+ | 66-kpartx.rules | ||
+ | 68-del-part-nodes.rules | ||
+ | 69-btattach-bcm.rules | ||
+ | 69-cd-sensors.rules | ||
+ | 69-dm-lvm-metad.rules | ||
+ | 69-libmtp.rules | ||
+ | 69-md-clustered-confirm-device.rules | ||
+ | 70-hypervfcopy.rules | ||
+ | 70-hypervkvp.rules | ||
+ | 70-hypervvss.rules | ||
+ | 70-joystick.rules | ||
+ | 70-mouse.rules | ||
+ | 70-nvmf-autoconnect.rules | ||
+ | 70-power-switch.rules | ||
+ | 70-printers.rules | ||
+ | 70-spice-vdagentd.rules | ||
+ | 70-touchpad.rules | ||
</ | </ | ||
- | Editez le fichier | + | <WRAP center round important 60%> |
+ | **Important** : Il vous est possible d' | ||
+ | </ | ||
+ | |||
+ | Comme indique le nom de chaque fichier, le contenu est composé de règles | ||
< | < | ||
- | [root@centos8 ~]# vi /etc/fstab | + | [root@centos8 ~]# cat /lib/udev/rules.d/50-udev-default.rules | more |
- | [root@centos8 ~]# cat /etc/fstab | + | # do not edit this file, it will be overwritten on update |
- | # | + | # run a command on remove events |
- | # /etc/fstab | + | ACTION==" |
- | # Created by anaconda on Wed Jun 16 06:21:32 2021 | + | ACTION==" |
- | # | + | |
- | # Accessible filesystems, by reference, are maintained under '/ | + | SUBSYSTEM==" |
- | # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. | + | |
- | # | + | # select " |
- | # After editing this file, run ' | + | SUBSYSTEM==" |
- | # units generated from this file. | + | SUBSYSTEM==" |
- | # | + | |
- | / | + | SUBSYSTEM==" |
- | UUID=1c04981e-5317-4b73-9695-3ce25246835d /boot | + | ENV{MODALIAS}!="", |
- | / | + | |
- | UUID=f76d6b66-985b-4a91-af9c-4987e8c1443c /home | + | ACTION!=" |
+ | |||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | KERNEL==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | SUBSYSTEM==" | ||
+ | |||
+ | SUBSYSTEM==" | ||
+ | OPTIONS+=" | ||
+ | --More-- | ||
</ | </ | ||
- | Redémarrez | + | Chaque règle prend la forme suivante : |
+ | |||
+ | KEY, [KEY, ...] NAME [, SYMLINK] | ||
+ | |||
+ | Chaque KEY est un champ au format **type=valeur** qui doit correspondre à un périphérique unique. La valeur de type peut prendre plusieurs formes : | ||
+ | |||
+ | ^ Type ^ Description ^ Exemples ^ | ||
+ | | BUS | Type de bus | usb, scsi, ide | | ||
+ | | KERNEL | Le nom par défault du périphérique donné par le noyau | hda, ttyUSB0, lp0 | | ||
+ | | SUBSYSTEM | Le nom noyau du sous-système, | ||
+ | | DRIVER | Le nom du pilote qui contrôle le périphérique | usb-storage | | ||
+ | | ID | Le numéro du périphérique sur son bus | PCI bus id, USB id | | ||
+ | | PLACE | Ne concerne que les périphériques USB et donne la position topologique du périphérique sur son bus | S/O | | ||
+ | | SYSFS{filename} | Le nom du fichier dans /sys pour le périphérique. Ce fichier contient le fabricant, le label, le numéro de série et UUID du périphérique. La vérification de jusqu' | ||
+ | | PROGRAM | Ceci permet à Udev d' | ||
+ | | RESULT | Valeur à comparer au résultat de PROGRAM | S/O | | ||
+ | |||
+ | NAME et SYMLINK sont utilisées pour stipuler ce que Udev doit faire avec le périphérique : | ||
+ | |||
+ | ^ Type ^ Description ^ Exemples ^ | ||
+ | | NAME | Le nome du nœud dans /dev | S/O | | ||
+ | | SYMLINK | Le ou les lien(s) symbolique(s) qui pointe(nt) vers le NAME | S/O | | ||
+ | |||
+ | ====La commande udevadm==== | ||
+ | |||
+ | Pour obtenir de l' | ||
< | < | ||
- | [root@centos8 ~]# reboot | + | [root@centos8 ~]# udevadm info --query=all -n /dev/sda |
+ | P: / | ||
+ | N: sda | ||
+ | S: disk/ | ||
+ | S: disk/ | ||
+ | S: disk/ | ||
+ | S: disk/ | ||
+ | S: disk/ | ||
+ | E: DEVLINKS=/ | ||
+ | E: DEVNAME=/ | ||
+ | E: DEVPATH=/ | ||
+ | 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: | ||
+ | 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=: | ||
+ | E: USEC_INITIALIZED=8735808 | ||
</ | </ | ||
- | Reconnectez-vous **directement** en tant que root : | + | ===Les options de la commande=== |
+ | |||
+ | Les options de la commande udevadm sont : | ||
< | < | ||
- | root@computeXX:~# ssh -l root 10.0.2.45 | + | [root@centos8 |
- | root@10.0.2.45' | + | udevadm [--help] [--version] [--debug] COMMAND [COMMAND OPTIONS] |
- | Activate the web console with: systemctl enable | + | |
- | Last login: Wed Jul 21 11:19:46 2021 | + | Send control commands or test the device manager. |
- | [root@centos8 ~]# | + | |
+ | Commands: | ||
+ | info Query sysfs or the udev database | ||
+ | trigger | ||
+ | settle | ||
+ | control | ||
+ | monitor | ||
+ | test Test an event run | ||
+ | test-builtin | ||
+ | |||
+ | [root@centos8 ~]# udevadm info --help | ||
+ | udevadm info [OPTIONS] [DEVPATH|FILE] | ||
+ | |||
+ | Query sysfs or the udev database. | ||
+ | |||
+ | -h --help | ||
+ | -V --version | ||
+ | -q --query=TYPE | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | -p --path=SYSPATH | ||
+ | -n --name=NAME | ||
+ | -r --root | ||
+ | -a --attribute-walk | ||
+ | of parent devices | ||
+ | -d --device-id-of-file=FILE Print major:minor of device containing this file | ||
+ | -x --export | ||
+ | -P --export-prefix | ||
+ | -e --export-db | ||
+ | -c --cleanup-db | ||
</ | </ | ||
- | Vérifiez ensuite que les options | + | =====Système de fichiers /sys===== |
+ | |||
+ | Le système de fichiers virtuel | ||
+ | |||
+ | Saisissez la commande suivante | ||
< | < | ||
- | [root@centos8 ~]# cat /etc/mtab | grep /home | + | [root@centos8 ~]# ls -l /sys |
- | /dev/sdc1 /home ext4 rw, | + | total 0 |
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. | ||
+ | drwxr-xr-x. 153 root root 0 Jul 12 08:15 module | ||
+ | drwxr-xr-x. | ||
</ | </ | ||
- | ====3.1 - La Commande quotacheck==== | + | Chaque répertoire contient des informations : |
- | Pour activer | + | * **block** |
+ | * contient des informations sur les périphériques bloc | ||
+ | * **bus** | ||
+ | * contient des informations | ||
+ | * **class** | ||
+ | * contient des informations sur des classes de matériel | ||
+ | * **devices** | ||
+ | * contient des informations sur la position des périphériques sur les bus | ||
+ | * **firmware** | ||
+ | * contient, entre autre, des informations sur l'ACPI | ||
+ | * **module** | ||
+ | * contient des informations sur les modules du noyau | ||
+ | * **power** | ||
+ | * contient des informations sur la gestion de l' | ||
+ | | ||
+ | * contient des informations sur les systèmes de fichiers | ||
+ | |||
+ | Pour illustrer ceci, saisissez la commande suivante | ||
< | < | ||
- | [root@centos8 ~]# quotacheck -cugvm -f /dev/sdc1 | + | [root@centos8 ~]# cat /sys/block/sda/sda1/size |
- | 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. | + | 2097152 |
- | quotacheck: Scanning | + | |
- | quotacheck: Cannot stat old user quota file / | + | |
- | quotacheck: Cannot stat old group quota file / | + | |
- | quotacheck: Cannot stat old user quota file / | + | |
- | quotacheck: Cannot stat old group quota file / | + | |
- | quotacheck: Checked 6763 directories and 129772 files | + | |
- | quotacheck: Old file not found. | + | |
- | quotacheck: Old file not found. | + | |
</ | </ | ||
- | Les options | + | Ce chiffre correspond aux nombre de secteurs. |
+ | |||
+ | =====LAB #4 - Limitation des ressources===== | ||
+ | |||
+ | ====4.1 - ulimit==== | ||
+ | |||
+ | Les ressources disponibles aux utilisateurs peuvent être limitées par l' | ||
+ | |||
+ | La commande **ulimit** gère deux types de limite, la limite //hard// en utilisant l' | ||
+ | |||
+ | La limite //soft// est la limite imposée à l' | ||
+ | |||
+ | L' | ||
< | < | ||
- | [root@centos8 ~]# quotacheck --help | + | [root@centos8 ~]# cat / |
- | Utility | + | # / |
- | quotacheck [-gucbfinvdmMR] [-F <quota-format>] filesystem|-a | + | # |
+ | #This file sets the resource limits | ||
+ | #It does not affect resource limits of the system services. | ||
+ | # | ||
+ | #Also note that configuration | ||
+ | #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 | ||
+ | # | ||
+ | #with a user specific setting in the subdirectory. | ||
+ | # | ||
+ | #Each line describes a limit for a user in the form: | ||
+ | # | ||
+ | #< | ||
+ | # | ||
+ | #Where: | ||
+ | #< | ||
+ | # | ||
+ | # | ||
+ | # - the wildcard *, for default entry | ||
+ | # - the wildcard %, can be also used with %group syntax, | ||
+ | # for maxlogin limit | ||
+ | # | ||
+ | #<type> can have the two values: | ||
+ | # | ||
+ | # - " | ||
+ | # | ||
+ | #<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] | ||
+ | # | ||
+ | # | ||
+ | #< | ||
+ | # | ||
- | -u, --user | + | #* |
- | -g, --group | + | #* |
- | -c, --create-files | + | # |
- | -b, --backup | + | # |
- | -f, --force | + | # |
- | -i, --interactive | + | #ftp |
- | -n, --use-first-dquot | + | # |
- | -v, --verbose | + | |
- | -d, --debug | + | |
- | -m, --no-remount | + | |
- | -M, --try-remount | + | |
- | continue even if it fails | + | |
- | -R, --exclude-root | + | |
- | -F, --format=formatname | + | |
- | -a, --all check all filesystems | + | |
- | -h, --help | + | |
- | -V, --version | + | |
- | Bugs to jack@suse.cz | + | # End of file |
+ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | **Important** : La valeur de la limite peut être un **nombre** ou le mot **unlimited**. | ||
+ | </ | ||
+ | |||
+ | Par exemple, si root inscrit les deux ligne suivantes dans le fichier / | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | trainee | ||
+ | trainee | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | la limite du nombre de fichiers ouverts simultanément par trainee est de 1 024. Par contre, trainee a la possibilité d' | ||
+ | |||
+ | < | ||
+ | $ ulimit -n 4096 | ||
</ | </ | ||
- | Les quotas ont été activés et les fichier | + | Pour consulter la liste des limites actuelles, il convient d' |
< | < | ||
- | [root@centos8 ~]# ls -la /home | + | [root@centos8 ~]# ulimit |
- | total 40 | + | core file size (blocks, -c) unlimited |
- | drwxr-xr-x. 4 root root 4096 Jul 21 11:27 . | + | data seg size |
- | dr-xr-xr-x. 17 root root 224 Jul 19 12:05 .. | + | scheduling priority |
- | -rw-------. 1 root root 7168 Jul 21 11:27 aquota.group | + | file size |
- | -rw-------. | + | pending signals |
- | drwx------. | + | max locked memory |
- | drwxr-xr-x. 17 trainee trainee | + | max memory size |
+ | open files (-n) 1024 | ||
+ | pipe size (512 bytes, | ||
+ | POSIX message queues | ||
+ | real-time priority | ||
+ | stack size (kbytes, | ||
+ | cpu time | ||
+ | max user processes | ||
+ | virtual memory | ||
+ | file locks (-x) unlimited | ||
</ | </ | ||
- | Créez maintenant un utilisateur **fenestros** avec le mot de passe **fenestros** : | + | ====Options de la commande==== |
+ | |||
+ | Les options | ||
< | < | ||
- | [root@centos8 ~]# groupadd fenestros && useradd fenestros | + | [root@centos8 ~]# help ulimit |
- | [root@centos8 ~]# passwd fenestros | + | ulimit: ulimit [-SHabcdefiklmnpqrstuvxPT] [limit] |
- | Changing password | + | Modify shell resource limits. |
- | New password: | + | |
- | BAD PASSWORD: The password contains | + | Provides control over the resources available to the shell and processes |
- | Retype new password: | + | it creates, on systems that allow such control. |
- | passwd: all authentication tokens updated successfully. | + | |
+ | Options: | ||
+ | -S use the `soft' resource limit | ||
+ | -H use the `hard' resource limit | ||
+ | -a all current limits are reported | ||
+ | -b the socket buffer size | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | -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', | ||
+ | current soft limit, the current hard limit, and no limit, respectively. | ||
+ | Otherwise, the current value of the specified resource is printed. | ||
+ | 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 | ||
+ | | ||
+ | |||
+ | Exit Status: | ||
+ | Returns success unless an invalid option is supplied or an error occurs. | ||
</ | </ | ||
- | ====3.2 - La Commande edquota==== | + | ====4.2 - Groupes de Contrôle==== |
- | Mettez en place maintenant | + | Les **Groupes de Contrôles** (//Control Groups//) aussi appelés **CGroups**, |
+ | |||
+ | Les groupes | ||
+ | |||
+ | Ces hiérarchies multiples et séparés sont necéssaires parce que chaque hiérarchie est attaché à un ou plusieurs **sous-système(s)** aussi appelés des **Contrôleurs de Ressources** ou simplement des **Contrôleurs**. Les contrôleurs disponibles sous RHEl/CentOS 7 sont : | ||
+ | |||
+ | * **blkio** - utilisé | ||
+ | * **cpu** - utilisé pour fournir aux tâches des groupes de contrôle accès au CPU grâce au planificateur, | ||
+ | * **cpuacct** - utilisé pour produire des rapports automatiques sur les ressources CPU utilisées par les tâches dans un groupe de contrôle, | ||
+ | * **cpuset** - utilisé pour assigner des CPU individuels sur un système multicoeur et des noeuds de mémoire à des tâches dans un groupe de contrôle, | ||
+ | * **devices** - utilisé pour autoriser ou pour refuser l' | ||
+ | * **freezer** - utilisé pour suspendre ou pour réactiver les tâches dans un groupe de contrôle, | ||
+ | * **memory** - utilisé pour établir les limites d' | ||
+ | * **net_cls** - utilisé pour repèrer les paquets réseau avec un identifiant de classe (// | ||
+ | * **perf_event** | ||
+ | * **hugetlb** - utilisé pour limiter des ressources sur des pages de mémoire virtuelle de grande taille. | ||
+ | |||
+ | Pour visualiser les hiérarchies, | ||
< | < | ||
- | [root@centos8 ~]# edquota | + | [root@centos8 ~]# lssubsys |
+ | bash: lssubsys: command not found... | ||
+ | Install package ' | ||
+ | |||
+ | |||
+ | * Waiting in queue... | ||
+ | The following packages have to be installed: | ||
+ | | ||
+ | | ||
+ | Proceed with changes? [N/y] y | ||
+ | |||
+ | |||
+ | * Waiting in queue... | ||
+ | * Waiting for authentication... | ||
+ | * Waiting in queue... | ||
+ | * Downloading packages... | ||
+ | * Requesting data... | ||
+ | * Testing changes... | ||
+ | * Installing packages... | ||
+ | cpuset / | ||
+ | cpu,cpuacct / | ||
+ | blkio / | ||
+ | memory / | ||
+ | devices / | ||
+ | freezer / | ||
+ | net_cls, | ||
+ | perf_event / | ||
+ | hugetlb / | ||
+ | pids / | ||
+ | rdma / | ||
</ | </ | ||
- | L' | + | < |
+ | [root@centos8 ~]# lssubsys | ||
+ | cpuset / | ||
+ | cpu,cpuacct / | ||
+ | blkio / | ||
+ | memory / | ||
+ | devices / | ||
+ | freezer / | ||
+ | net_cls, | ||
+ | perf_event / | ||
+ | hugetlb / | ||
+ | pids / | ||
+ | rdma / | ||
+ | </ | ||
- | < | + | Sous RHEL/CentOS 8, **Systemd** organise les processus dans chaque CGroup. Par exemple tous les processus démarrés par le serveur Apache se trouveront dans le même CGroup, y compris les scripts CGI. Ceci implique que la gestion des ressources en utilisant des hiérarchies est couplé avec l' |
- | Disk quotas for user fenestros (uid 1001): | + | |
- | Filesystem | + | |
- | | + | |
- | </ | + | |
- | Modifiez ce fichier ainsi : | + | En haut de l' |
- | < | + | * le **system.slice** - l' |
- | Disk quotas for user fenestros (uid 1001): | + | * le **user.slice** - l' |
- | | + | |
- | / | + | |
- | </ | + | |
- | Sauvegardez et quittez le fichier. | + | En dessous des tranches peuvent se trouver : |
- | Les options de la commande | + | |
+ | * des **services** - des processus créés par une **Unité**. | ||
+ | |||
+ | Les slices peuvent être visualisés avec la commande suivante | ||
< | < | ||
- | [root@centos8 ~]# edquota | + | [root@centos8 ~]# systemctl list-units --type=slice |
- | edquota: Usage: | + | UNIT LOAD |
- | | + | -.slice |
- | | + | machine.slice |
- | edquota [-rm] -P [-F formatname] [-p projectname] [-f filesystem] projectname ... | + | system-getty.slice |
- | | + | system-lvm2\x2dpvscan.slice |
- | | + | system-sshd\x2dkeygen.slice |
+ | system-systemd\x2dfsck.slice | ||
+ | system-systemd\x2dhibernate\x2dresume.slice loaded active active system-systemd\x2dhibernate\x2dresume.slice | ||
+ | system-user\x2druntime\x2ddir.slice | ||
+ | system-vncserver.slice | ||
+ | system.slice loaded active active System Slice | ||
+ | user-1000.slice | ||
+ | user-42.slice | ||
+ | user.slice loaded active active User and Session Slice | ||
- | -u, --user | + | LOAD = Reflects whether the unit definition was properly loaded. |
- | -g, --group | + | ACTIVE |
- | -P, --project | + | SUB = The low-level unit activation state, values depend |
- | -r, --remote | + | |
- | -m, --no-mixed-pathnames | + | |
- | -F, --format=formatname | + | |
- | -p, --prototype=name copy data from a prototype user/ | + | |
- | | + | |
- | composed only of digits | + | |
- | -f, --filesystem=filesystem | + | |
- | -t, --edit-period | + | |
- | -T, --edit-times | + | |
- | -h, --help | + | |
- | -V, --version | + | |
- | Bugs to: jack@suse.cz | + | 13 loaded units listed. Pass --all to see loaded but inactive units, too. |
+ | To show all installed unit files use ' | ||
</ | </ | ||
+ | |||
+ | L' | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# systemd-cgls | ||
+ | Control group /: | ||
+ | -.slice | ||
+ | ├─user.slice | ||
+ | │ ├─user-42.slice | ||
+ | │ │ ├─session-c1.scope | ||
+ | │ │ │ ├─1317 gdm-session-worker [pam/ | ||
+ | │ │ │ ├─1459 / | ||
+ | │ │ │ ├─1856 / | ||
+ | │ │ │ ├─1882 / | ||
+ | │ │ │ ├─2059 / | ||
+ | │ │ │ ├─2132 ibus-daemon --xim --panel disable | ||
+ | │ │ │ ├─2135 / | ||
+ | │ │ │ ├─2138 / | ||
+ | │ │ │ ├─2251 / | ||
+ | │ │ │ ├─2261 / | ||
+ | │ │ │ ├─2268 / | ||
+ | │ │ │ ├─2271 / | ||
+ | │ │ │ ├─2272 / | ||
+ | │ │ │ ├─2273 / | ||
+ | │ │ │ ├─2274 / | ||
+ | │ │ │ ├─2275 / | ||
+ | │ │ │ ├─2280 / | ||
+ | │ │ │ ├─2281 / | ||
+ | │ │ │ ├─2283 / | ||
+ | │ │ │ ├─2284 / | ||
+ | │ │ │ ├─2285 / | ||
+ | │ │ │ ├─2290 / | ||
+ | │ │ │ ├─2321 / | ||
+ | │ │ │ ├─2328 / | ||
+ | │ │ │ ├─2333 / | ||
+ | │ │ │ └─2432 / | ||
+ | │ │ └─user@42.service | ||
+ | │ │ | ||
+ | │ │ │ └─2170 / | ||
+ | │ │ | ||
+ | │ │ │ └─1455 / | ||
+ | │ │ | ||
+ | │ │ │ ├─1357 / | ||
+ | │ │ │ └─1377 (sd-pam) | ||
+ | │ │ | ||
+ | │ │ │ ├─2090 / | ||
+ | │ │ │ ├─2095 / | ||
+ | │ │ │ └─2098 / | ||
+ | │ │ | ||
+ | │ │ | ||
+ | │ │ | ||
+ | │ └─user-1000.slice | ||
+ | │ | ||
+ | │ │ ├─gvfs-goa-volume-monitor.service | ||
+ | │ │ │ └─2369 / | ||
+ | │ │ ├─xdg-permission-store.service | ||
+ | │ │ │ └─2191 / | ||
+ | │ │ ├─tracker-store.service | ||
+ | │ │ │ └─2653 / | ||
+ | │ │ ├─evolution-calendar-factory.service | ||
+ | │ │ │ ├─2605 / | ||
+ | │ │ │ └─2706 / | ||
+ | │ │ ├─pulseaudio.service | ||
+ | │ │ │ └─1456 / | ||
+ | │ │ ├─gvfs-daemon.service | ||
+ | │ │ │ ├─1896 / | ||
+ | │ │ │ └─1901 / | ||
+ | │ │ ├─evolution-source-registry.service | ||
+ | │ │ │ └─2206 / | ||
+ | │ │ ├─gvfs-udisks2-volume-monitor.service | ||
+ | │ │ │ └─2243 / | ||
+ | │ │ ├─init.scope | ||
+ | │ │ │ ├─1239 / | ||
+ | │ │ │ └─1318 (sd-pam) | ||
+ | │ │ ├─gvfs-gphoto2-volume-monitor.service | ||
+ | │ │ │ └─2269 / | ||
+ | │ │ ├─at-spi-dbus-bus.service | ||
+ | │ │ │ ├─1964 / | ||
+ | │ │ │ ├─1969 / | ||
+ | │ │ │ └─1972 / | ||
+ | │ │ ├─dbus.service | ||
+ | │ │ │ ├─1786 / | ||
+ | │ │ │ ├─2183 / | ||
+ | │ │ │ ├─2201 / | ||
+ | │ │ │ ├─2225 / | ||
+ | │ │ │ ├─2397 / | ||
+ | │ │ │ └─2721 / | ||
+ | │ │ ├─evolution-addressbook-factory.service | ||
+ | │ │ │ ├─2727 / | ||
+ | │ │ │ └─2771 / | ||
+ | │ │ ├─gvfs-mtp-volume-monitor.service | ||
+ | lines 44-86 | ||
+ | </ | ||
+ | |||
+ | En utilisant Systemd, plusieurs ressources peuvent être limitées : | ||
+ | |||
+ | * **CPUShares** - par défault 1024, | ||
+ | * **MemoryLimit** - limite exprimée en Mo ou en Go. Pas de valeur par défaut, | ||
+ | * **BlockIOWeight** - valeur entre 10 et 1000. Pas de valeur par défaut, | ||
+ | * **StartupCPUShares** - comme CPUShares mais uniquement appliqué pendant le démarrage, | ||
+ | * **StartupBlockIOWeight** - comme BlockIOWeight mais uniquement appliqué pendant le démarrage, | ||
+ | * **CPUQuota** - utilisé pour limiter le temps CPU, même quand le système ne fait rien. | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **Important** | + | **Important** |
</ | </ | ||
- | ====3.3 - La Commande quotaon==== | + | ===Limitation de la Mémoire=== |
- | Appliquez maintenant | + | Commencez par créer le script **hello-world.sh** qui servira à générer un processus pour travailler avec les CGroups |
< | < | ||
- | [root@centos8 ~]# quotaon | + | [root@centos8 ~]# vi hello-world.sh |
+ | [root@centos8 ~]# cat hello-world.sh | ||
+ | # | ||
+ | while [ 1 ]; do | ||
+ | echo "hello world" | ||
+ | sleep 360 | ||
+ | done | ||
</ | </ | ||
- | Les options de la commande **quotaon** sont : | + | Rendez le script exécutable et testez-le |
< | < | ||
- | [root@centos8 ~]# quotaon --help | + | [root@centos8 ~]# chmod u+x hello-world.sh |
- | quotaon: Usage: | + | [root@centos8 ~]# ./hello-world.sh |
- | quotaon [-guPvp] [-F quotaformat] [-x state] | + | hello world |
- | | + | ^C |
- | + | ||
- | -a, --all turn quotas on for all filesystems | + | |
- | -f, --off turn quotas off | + | |
- | -u, --user | + | |
- | -g, --group | + | |
- | -P, --project | + | |
- | -p, --print-state | + | |
- | -x, --xfs-command=cmd | + | |
- | -F, --format=formatname | + | |
- | -v, --verbose | + | |
- | -h, --help | + | |
- | -V, --version | + | |
</ | </ | ||
- | De cette manière vous avez mis en place un quota **souple** pour fenestros de 8 000 Ko et un quota **stricte** de 10 000 Ko. | + | Créez maintenant |
- | Quand l' | + | < |
+ | [root@centos8 ~]# mkdir /sys/ | ||
+ | </ | ||
- | Il est à noter que vous pouvez soit mettre en place un quota en taille, soit mettre en place un quota basé sur le nombre d' | + | Par défaut, ce CGroup héritera de l'ensemble de la mémoire disponible. Pour éviter cela, créez maintenant une limite de **40000000** octets pour ce CGroup : |
+ | |||
+ | < | ||
+ | [root@centos8 ~]# echo 40000000 > / | ||
+ | [root@centos8 ~]# cat / | ||
+ | 39997440 | ||
+ | </ | ||
<WRAP center round important 60%> | <WRAP center round important 60%> | ||
- | **important** - La commande pour désactivez | + | **Important** - Notez que les 40 000 000 demandés sont devenus 39 997 440 ce qui correspond à un nombre entier de pages mémoire du noyau de 4Ko. ( 39 997 440 / 4096 = 9 765 ). |
</ | </ | ||
- | ====3.4 - La Commande repquota==== | + | Lancez maintenant le script **helloworld.sh** : |
- | Pour visualiser les quotas utilisez | + | < |
+ | [root@centos8 ~]# ./ | ||
+ | [1] 35148 | ||
+ | |||
+ | [root@centos8 ~]# hello world | ||
+ | [Entrée] | ||
+ | |||
+ | [root@centos8 ~]# ps aux | grep hello-world | ||
+ | root | ||
+ | root | ||
+ | </ | ||
+ | |||
+ | Notez qu'il n'y a pas de limite de la mémoire, ce qui implique l' | ||
< | < | ||
- | [root@centos8 ~]# repquota | + | [root@centos8 ~]# ps -ww -o cgroup 35148 |
- | *** Report for user quotas on device | + | CGROUP |
- | Block grace time: 7days; Inode grace time: 7days | + | 12:memory:/user.slice/user-1000.slice/session-7.scope, |
- | Block limits | + | |
- | User used soft hard grace used soft hard grace | + | |
- | ---------------------------------------------------------------------- | + | |
- | root -- 20 | + | |
- | trainee | + | |
- | + | ||
</ | </ | ||
- | <WRAP center round important 60%> | + | Insérer le PID de notre script dans le CGroup |
- | **Important** - Notez que l' | + | |
- | </WRAP> | + | < |
+ | [root@centos8 ~]# echo 35148 > /sys/ | ||
+ | </code> | ||
- | Les options | + | Notez maintenant l' |
< | < | ||
- | [root@centos8 ~]# repquota | + | [root@centos8 ~]# ps -ww -o cgroup 35148 |
- | repquota: Utility for reporting quotas. | + | CGROUP |
- | Usage: | + | 12: |
- | repquota [-vugsi] [-c|C] [-t|n] [-F quotaformat] [-O (default | xml | csv)] (-a | mntpoint) | + | </ |
- | -v, --verbose | + | Constatez ensuite l' |
- | -u, --user | + | |
- | -g, --group | + | |
- | -P, --project | + | |
- | -s, --human-readable | + | |
- | -t, --truncate-names | + | |
- | -p, --raw-grace | + | |
- | -n, --no-names | + | |
- | -i, --no-autofs | + | |
- | -c, --cache | + | |
- | -C, --no-cache | + | |
- | -F, --format=formatname | + | |
- | -O, --output=format | + | |
- | -a, --all | + | |
- | -h, --help | + | |
- | -V, --version | + | |
- | Bugs to jack@suse.cz | + | < |
+ | [root@centos8 ~]# cat / | ||
+ | 274432 | ||
</ | </ | ||
- | ====3.5 | + | Tuez le script **hello-world.sh** : |
- | Pour visualiser les quotas d'un utilisateur spécifique, | + | < |
+ | [root@centos8 ~]# kill 35148 | ||
+ | [root@centos8 ~]# ps aux | grep hello-world | ||
+ | root | ||
+ | [1]+ Terminated | ||
+ | </ | ||
+ | |||
+ | Créez | ||
< | < | ||
- | [root@centos8 ~]# quota fenestros | + | [root@centos8 ~]# mkdir / |
- | Disk quotas for user fenestros (uid 1001): no limited resources used | + | [root@centos8 ~]# echo 6000 > / |
- | [root@centos8 ~]# su - fenestros | + | [root@centos8 ~]# cat /sys/fs/cgroup/ |
- | [fenestros@centos8 ~]$ touch test | + | 4096 |
- | [fenestros@centos8 ~]$ exit | + | |
- | logout | + | |
- | [root@centos8 ~]# quota fenestros | + | |
- | Disk quotas for user fenestros (uid 1001): | + | |
- | | + | |
- | | + | |
</ | </ | ||
- | Les options de la commande | + | Relancez le script |
< | < | ||
- | [root@centos8 ~]# quota --help | + | [root@centos8 ~]# ./hello-world.sh & |
- | quota: Usage: quota [-guPqvswim] [-l | [-Q | -A]] [-F quotaformat] | + | [1] 35389 |
- | quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -u username | + | |
- | quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -g groupname ... | + | |
- | | + | |
- | -u, --user | + | [root@centos8 ~]# hello world |
- | -g, --group | + | [Entrée] |
- | -P, --project | + | |
- | -q, --quiet | + | |
- | -v, --verbose | + | |
- | -s, --human-readable | + | |
- | --always-resolve | + | |
- | composed of only digits | + | |
- | -w, --no-wrap | + | |
- | -p, --raw-grace | + | |
- | -l, --local-only | + | |
- | -Q, --quiet-refuse | + | |
- | not respond | + | |
- | -i, --no-autofs | + | |
- | -F, --format=formatname | + | |
- | -f, --filesystem-list | + | |
- | -A, --all-nfs | + | |
- | -m, --no-mixed-pathnames | + | |
- | --show-mntpoint | + | |
- | --hide-device | + | |
- | -h, --help | + | |
- | -V, --version | + | |
- | Bugs to: jack@suse.cz | + | [root@centos8 ~]# echo 35389 > / |
</ | </ | ||
- | ====3.6 - La Commande warnquota==== | + | Attendez la prochaine sortie de **hello world** sur le canal standard puis constatez que le script s' |
- | La commande **warnquota** vérifie le ou les disques et envoie un message par mail à tout utilisateur qui a dépassé la limite soft. Elle est enrègle générale appelée par un job cron. Cependant elle peut aussi est appelée d'une manière intéractive. | + | < |
+ | [root@centos8 ~]# hello world | ||
+ | [Entrée] | ||
+ | [1]+ Killed | ||
+ | </ | ||
- | Sous RHEL/ | + | ===La Commande cgcreate=== |
+ | |||
+ | Cette commande permet la création d'un CGroup | ||
< | < | ||
- | [root@centos8 ~]# which warnquota | + | [root@centos8 ~]# cgcreate -g memory: |
- | /usr/bin/which: no warnquota in (/usr/local/sbin:/ | + | [root@centos8 ~]# ls -l /sys/fs/cgroup/memory/helloworld2/ |
+ | total 0 | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 cgroup.clone_children | ||
+ | --w--w----. 1 root root 0 Jul 13 10:39 cgroup.event_control | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 cgroup.procs | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.failcnt | ||
+ | --w--w----. 1 root root 0 Jul 13 10:39 memory.force_empty | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.failcnt | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.max_usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.slabinfo | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.failcnt | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.max_usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.tcp.usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.kmem.usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.max_usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.failcnt | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.memsw.max_usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.memsw.usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.move_charge_at_immigrate | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.numa_stat | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.oom_control | ||
+ | ----------. 1 root root 0 Jul 13 10:39 memory.pressure_level | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.soft_limit_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.stat | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.swappiness | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:39 memory.usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 memory.use_hierarchy | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 notify_on_release | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:39 tasks | ||
</ | </ | ||
- | Installez donc le paquet **quota-warnquota** | + | Il n' |
< | < | ||
- | [root@centos7 | + | [root@centos8 |
- | ... | + | |
</ | </ | ||
- | Les options de la commande **warnquota** sont : | + | ==La Commande cgexec== |
+ | |||
+ | Cette commande | ||
< | < | ||
- | [root@centos8 ~]# warnquota | + | [root@centos8 ~]# cgexec |
- | warnquota: Usage: | + | [1] 37670 |
- | warnquota | + | |
- | -u, --user | + | [root@centos8 ~]# hello world |
- | -g, --group | + | [Entrée] |
- | -s, --human-readable | + | |
- | -i, --no-autofs | + | |
- | -d, --no-details | + | |
- | -F, --format=formatname | + | |
- | -c, --config=config-file | + | |
- | -q, --quota-tab=quotatab-file | + | |
- | -a, --admins-file=admins-file | + | |
- | -h, --help | + | |
- | -v, --version | + | |
- | warnquota: Bugs to jack@suse.cz | + | [root@centos8 ~]# |
+ | </ | ||
+ | |||
+ | ==La Commande cgdelete== | ||
+ | |||
+ | Une fois le script terminé, cette commande permet de supprimer le cgroup | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# ps aux | grep *.sh | ||
+ | root | ||
+ | root | ||
+ | |||
+ | [root@centos8 ~]# kill 37670 | ||
+ | |||
+ | root@centos8 ~]# ps aux | grep *.sh | ||
+ | root | ||
+ | [1]+ Terminated | ||
+ | |||
+ | [root@centos8 ~]# cgdelete memory: | ||
+ | |||
+ | [root@centos8 ~]# ls -l / | ||
+ | ls: cannot access '/ | ||
+ | </ | ||
+ | |||
+ | ==Le Fichier / | ||
+ | |||
+ | Afin de les rendre persistants, | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# vi / | ||
+ | [root@centos8 ~]# cat / | ||
+ | # | ||
+ | # Copyright IBM Corporation. 2007 | ||
+ | # | ||
+ | # Authors: | ||
+ | # This program is free software; you can redistribute it and/or modify it | ||
+ | # under the terms of version 2.1 of the GNU Lesser General Public License | ||
+ | # as published by the Free Software Foundation. | ||
+ | # | ||
+ | # This program is distributed in the hope that it would be useful, but | ||
+ | # WITHOUT ANY WARRANTY; without even the implied warranty of | ||
+ | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
+ | # | ||
+ | # | ||
+ | # By default, we expect systemd mounts everything on boot, | ||
+ | # so there is not much to do. | ||
+ | # See man cgconfig.conf for further details, how to create groups | ||
+ | # on system boot using this file. | ||
+ | group helloworld2 { | ||
+ | cpu { | ||
+ | cpu.shares = 100; | ||
+ | } | ||
+ | memory { | ||
+ | memory.limit_in_bytes = 40000; | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | <WRAP center round important 60%> | ||
+ | **Important** - Notez la création de **deux** limitations, | ||
+ | </ | ||
+ | |||
+ | Créez donc les deux CGroups concernés : | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# cgcreate -g memory: | ||
+ | [root@centos8 ~]# ls -l / | ||
+ | total 0 | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 cgroup.clone_children | ||
+ | --w--w----. 1 root root 0 Jul 13 10:46 cgroup.event_control | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 cgroup.procs | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.failcnt | ||
+ | --w--w----. 1 root root 0 Jul 13 10:46 memory.force_empty | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.failcnt | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.max_usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.slabinfo | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.failcnt | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.max_usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.tcp.usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.kmem.usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.max_usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.failcnt | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.limit_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.memsw.max_usage_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.memsw.usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.move_charge_at_immigrate | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.numa_stat | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.oom_control | ||
+ | ----------. 1 root root 0 Jul 13 10:46 memory.pressure_level | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.soft_limit_in_bytes | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.stat | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.swappiness | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:46 memory.usage_in_bytes | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 memory.use_hierarchy | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 notify_on_release | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:46 tasks | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# cgcreate -g cpu: | ||
+ | [root@centos8 ~]# ls -l / | ||
+ | total 0 | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cgroup.clone_children | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cgroup.procs | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.stat | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpuacct.usage | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_all | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu_sys | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_percpu_user | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_sys | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpuacct.usage_user | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.cfs_period_us | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.cfs_quota_us | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.rt_period_us | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.rt_runtime_us | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 cpu.shares | ||
+ | -r--r--r--. 1 root root 0 Jul 13 10:47 cpu.stat | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 notify_on_release | ||
+ | -rw-rw-r--. 1 root root 0 Jul 13 10:47 tasks | ||
+ | </ | ||
+ | |||
+ | ==La Commande cgconfigparser== | ||
+ | |||
+ | Appliquez le contenu du fichier **/ | ||
+ | |||
+ | < | ||
+ | [root@centos8 ~]# cgconfigparser -l / | ||
+ | [root@centos8 ~]# cat / | ||
+ | 36864 | ||
+ | [root@centos8 ~]# cat / | ||
+ | 100 | ||
</ | </ | ||
----- | ----- | ||
- | Copyright © 2023 Hugh Norris. | + | Copyright © 2024 Hugh Norris. |