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:admin:l120 [2022/02/22 15:15] – admin | elearning:workbooks:centos:8:admin:l120 [2022/06/05 18:00] (Version actuelle) – admin | ||
---|---|---|---|
Ligne 5: | Ligne 5: | ||
Last updated : ~~LASTMOD~~ | Last updated : ~~LASTMOD~~ | ||
- | ======LCE602 | + | ======LCE514 |
=====Contents===== | =====Contents===== | ||
- | * **LCE602 | + | * **LCE514 |
* Contents | * Contents | ||
- | * The Linux Kernel | + | * Course Materials |
- | * LAB #1 - Modules | + | * Reminder of the Training Program |
- | * LAB #2 - Compiling and Installing a Kernel and Modules | + | * Training Evaluation |
- | * 2.1 - Move /home | + | * Exam - Acquired knowledge |
- | * 2.2 - Preparing the Environment | + | |
- | * 2.3 - Preparing the Kernel Source Tree | + | |
- | * The .config file | + | |
- | * The Makefile file | + | |
- | * 2.4 - Configuring the Kernel | + | |
- | * 2.5 - Compiling the Kernel | + | |
- | * 2.6 - Installing the Kernel | + | |
- | * LAB #3 - Managing Quotas | + | |
- | * 3.1 - The quotacheck Command | + | |
- | * 3.2 - The edquota Command | + | |
- | * 3.3 - The quotaon Command | + | |
- | * 3.4 - The repquota Command | + | |
- | * 3.5 - The quota Command | + | |
- | * 3.6 - The warnquota Command | + | |
- | =====The Linux Kernel===== | + | =====Course Materials===== |
- | The Kernel is the part of the OS that is responsible for managing peripherals' | + | Access to the course materials, LABS and tests requires a per trainee subscription |
- | | + | You have been given a **free** 365 day subscription to your Course Materials on our LMS. |
- | | + | |
- | | + | |
- | | + | |
- | * correcting bugs, | + | |
- | * using experimental functions. | + | |
- | + | ||
- | Start by updating CentOS 8: | + | |
- | < | + | =====Reminder of the Training Program===== |
- | [root@centos8 ~]# dnf update | + | |
- | ... | + | |
- | [root@centos8 ~]# reboot | + | |
- | </ | + | |
- | Now identifiy the current | + | * **LCE500 - CentOS 8 Linux (RHEL 8 / Oracle Linux 8) - System Administrator** |
+ | * Contents | ||
+ | * Prerequisites | ||
+ | * Hardware | ||
+ | * Software | ||
+ | * Internet | ||
+ | * Using our infrastructure | ||
+ | * Training Program | ||
+ | * Skills Assessment | ||
- | < | + | * **LCE501 - Managing Users and Groups** |
- | [root@centos8 ~]# uname -r | + | * Contents |
- | 4.18.0-305.7.1.el8_4.x86_64 | + | * Presentation |
- | </ | + | * / |
+ | * The getent Command | ||
+ | * The /etc/group and / | ||
+ | * The /etc/passwd and /etc/shadow files | ||
+ | * Commands | ||
+ | * Groups | ||
+ | * groupadd | ||
+ | * groupdel | ||
+ | * groupmod | ||
+ | * newgrp | ||
+ | * gpasswd | ||
+ | * Users | ||
+ | * useradd | ||
+ | * userdel | ||
+ | * usermod | ||
+ | * passwd | ||
+ | * chage | ||
+ | * Configuration | ||
+ | * LAB #1 - Managing Users and Groups | ||
+ | * LAB #2 - su and su - | ||
+ | * sudo | ||
- | =====LAB #1 - Modules===== | + | * **LCE502 - Package Management** |
+ | * Contents | ||
+ | * LAB #1 - Compiling Software | ||
+ | * 1.1 - ./ | ||
+ | * 1.2 - make | ||
+ | * 1.3 - make check | ||
+ | * 1.4 - make install | ||
+ | * LAB #2 - The rpm Command | ||
+ | * 2.1 - Configuration | ||
+ | * 2.2 - Usage | ||
+ | * LAB #3 - The dnf Command | ||
+ | * 3.1 - Presentation | ||
+ | * 3.2 - Configuration | ||
+ | * 3.3 - Repositories | ||
+ | * 3.4 - Searching for Packages | ||
+ | * 3.5 - Viewing Information on and Downloading a Package | ||
+ | * 3.6 - Installing a Package | ||
+ | * 3.7 - Updating Packages | ||
+ | * 3.8 - Deleting Packages | ||
+ | * Shared Libraries | ||
+ | * Presentation | ||
+ | * Introduction | ||
+ | * Shared Object Locations | ||
+ | * ld-linux.so.2 | ||
+ | * The ldd Command | ||
+ | * The / | ||
+ | * The ldconfig Command | ||
- | Under normal circumstances it is however preferable to make use of the Kernel modules as opposed to recompiling the Kernel. Kernel modules can be found in the **/lib/ | + | * **LCE503 - Managing File Permissions** |
+ | * Contents | ||
+ | * Presentation | ||
+ | * Preparation | ||
+ | * LAB #1 - Basic Unix File Permissions | ||
+ | * 1.1 - Changing Permissions with chmod | ||
+ | * Symbolic Mode | ||
+ | * Octal Mode | ||
+ | * The umask Command | ||
+ | * 1.2 - Changing the Owner or the Group with chown and chgrp | ||
+ | | ||
+ | | ||
+ | * LAB #2 - Advanced Unix Permissions | ||
+ | * 2.1 - SUID/SGID bit | ||
+ | * 2.2 - Inheritance Flag | ||
+ | | ||
+ | | ||
+ | * 3.1 - ACLs | ||
+ | * 3.2 - Attributes | ||
- | < | + | * **LCE504 - Managing Disks and Filesystems** |
- | [root@centos8 ~]# ls / | + | * Contents |
- | bls.conf | + | * Peripherals |
- | build modules.builtin.bin | + | * Partitions |
- | config | + | * Partitioning |
- | kernel | + | * LAB #1 - Partioning your Disk with the fdisk Command |
- | modules.alias | + | |
- | modules.alias.bin | + | * Logical Volume Manager (LVM) |
- | modules.block | + | * LAB #3 - Linear Logical Volumes |
- | </ | + | |
+ | * Volume Groups (VG) and Physical Extents (PE) | ||
+ | * Logical Volumes (LV) | ||
+ | | ||
+ | | ||
+ | * LAB #6 - Deleting Volumes | ||
+ | | ||
+ | * LAB #8 - Changing LVM Attributes | ||
+ | * LAB #9 - Striped Volumes | ||
+ | | ||
+ | * Journaled Filesystems | ||
+ | * Ext3 | ||
+ | * Managing Ext3 | ||
+ | * LAB #11 - Converting Ext3 to Ext2 | ||
+ | * LAB #12 - Converting Ext2 to Ext3 | ||
+ | * LAB #13 - Using another PArtition for the Journal | ||
+ | * LAB #14 - Changing the File System Check interval on an ext3 Filesystem | ||
+ | * Ext4 | ||
+ | * LAB #15 - Creating an Ext4 Filesystem | ||
+ | * LAB #16 - Adding a Label to an Ext4 Filesystem | ||
+ | * LAB #17 - Converting Ext3 to Ext4 | ||
+ | * XFS | ||
+ | * LAB #18 - Creating an XFS Filesystem | ||
+ | * LAB #19 - Adding a Label to an XFS Filesystem | ||
- | Commands used to manage modules are: | + | * **LCE505 - Process Scheduling** |
+ | * Contents | ||
+ | * cron | ||
+ | * The / | ||
+ | * Time Fields | ||
+ | * User Crontabs | ||
+ | * anacron | ||
+ | * at | ||
- | * insmod | + | * **LCE506 - Archiving and Compression** |
- | * rmmod | + | * Contents |
- | * lsmod | + | * Traditional Backup Tools |
- | * modprobe | + | * Preparation |
+ | * The tar Command | ||
+ | * Presentation | ||
+ | * LAB #1 - Working with the tar Command | ||
+ | * The GPL tar Commande and Compression | ||
+ | * The cpio Command | ||
+ | * Presentation | ||
+ | * LAB #2 - Working with the cpio Command | ||
+ | * The dd Command | ||
+ | * Presentation | ||
+ | * LAB #3 - Working with the dd Command | ||
+ | * The dump et restore Commands | ||
+ | * Presentation | ||
+ | * LAB #4 - System Backups | ||
+ | * Backing up the Installed Package List | ||
+ | * Backing up the Disk Structure | ||
+ | * Backing up Mount Points | ||
+ | * Backing up the Boot Loader | ||
+ | * GRUB Legacy | ||
+ | * GRUB 2 on BIOS | ||
+ | * GRUB 2 on EFI | ||
+ | * Backing up User Files | ||
+ | * Rsync | ||
+ | * Presentation | ||
+ | * LAB #5 - Working with the rsync Command | ||
+ | * Compression | ||
+ | * The gzip Command | ||
+ | * Presentation | ||
+ | * LAB #4 - Working with the gzip Command | ||
+ | * The bzip2 Command | ||
+ | * Presentation | ||
+ | * LAB #5 - Working with the bzip2 Command | ||
+ | * The xz Command | ||
+ | * Presentation | ||
+ | * LAB #6 - Working with the xz Command | ||
+ | * Other Compression Utilities | ||
- | For example : | + | * **LCE507 - Process Management** |
+ | * Contents | ||
+ | * Presentation | ||
+ | * Process Types | ||
+ | * Process Commands | ||
+ | * The ps Command | ||
+ | * The pgrep Command | ||
+ | * The pstree Command | ||
+ | * The top Command | ||
+ | * The fg, bg and jobs Commands | ||
+ | * The wait Command | ||
+ | * The nice Command | ||
+ | * The renice Command | ||
+ | * The nohup Command | ||
+ | * The kill Command | ||
+ | * The pkill Command | ||
- | < | + | * **LCE508 - Managing Logs** |
- | [root@centos8 ~]# lsmod | + | * Contents |
- | Module | + | * Presentation |
- | xt_CHECKSUM | + | * The dmesg Command |
- | ipt_MASQUERADE | + | * Security Logging |
- | xt_conntrack | + | * The last Command |
- | ipt_REJECT | + | * The lastlog Command |
- | nft_compat | + | * The lastb Command |
- | nf_nat_tftp | + | * The / |
- | nft_objref | + | * The / |
- | nf_conntrack_tftp | + | |
- | nft_counter | + | * auditd |
- | tun 53248 1 | + | * auditctl |
- | bridge | + | * Viewing Audit Events |
- | stp 16384 1 bridge | + | * The aureport Command |
- | llc 16384 2 bridge,stp | + | * The ausearch Command |
- | nft_fib_inet | + | * The / |
- | nft_fib_ipv4 | + | * Applications |
- | nft_fib_ipv6 | + | * rsyslog |
- | nft_fib | + | * Priorities |
- | nft_reject_inet | + | * Facilitiess |
- | nf_reject_ipv4 | + | * The / |
- | nf_reject_ipv6 | + | * Modules |
- | nft_reject | + | * Global Directives |
- | nft_ct | + | * Rules |
- | nf_tables_set | + | |
- | nft_chain_nat | + | |
- | nf_nat | + | * Facility=Priority |
- | nf_conntrack | + | |
- | nf_defrag_ipv6 | + | * n Facilities with Identical Priorities |
- | nf_defrag_ipv4 | + | * n Selectors with Identical Actions |
- | ip_set | + | * The logger Command |
- | nf_tables | + | * The logrotate Command |
- | nfnetlink | + | * journald |
- | sunrpc | + | * Using Journald |
- | ext4 761856 | + | * Application Specific Messages |
- | mbcache | + | * Boot Messages |
- | jbd2 131072 | + | * Priority Specific Messages |
- | virtio_balloon | + | * Messages from a Specific Date Range |
- | 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 | + | |
- | </ | + | |
- | To add a module, you can use either the **insmod** or the **modprobe** command. The latter also manages the dependencies of the to-be-installed module: | + | |
+ | | ||
+ | | ||
+ | | ||
+ | * Packages | ||
+ | * Daemon | ||
+ | * The / | ||
+ | * Filters | ||
+ | * Backends | ||
+ | * Logs | ||
+ | * Printers | ||
+ | * Administration | ||
+ | * The lpstat Command | ||
+ | * The lpadmin Command | ||
+ | * The accept et cupsenable Commands | ||
+ | * Classes | ||
+ | * The / | ||
+ | * The / | ||
+ | * The cancel Command | ||
+ | * The lpmove Command | ||
+ | * Web Interface | ||
- | < | + | |
- | [root@centos8 ~]# modprobe bonding | + | * Contents |
- | [root@centos8 ~]# lsmod | more | + | * System Startup |
- | Module | + | * Boot Loader |
- | bonding | + | * BIOS Systems |
- | xt_CHECKSUM | + | * EFI Systems |
- | ipt_MASQUERADE | + | * GRUB 2 |
- | xt_conntrack | + | * The /boot/grub/grub.cfg File |
- | ipt_REJECT | + | * The /etc/default/grub file |
- | nft_compat | + | * Files in the /etc/grub.d directory |
- | nf_nat_tftp | + | * Initramfs |
- | nft_objref | + | * The init Script |
- | nf_conntrack_tftp | + | * Kernel |
- | nft_counter | + | * Systemd |
- | tun 53248 1 | + | * LAB #1 - The systemctl Command |
- | bridge | + | * LAB #2 - Configuration Files |
- | stp 16384 1 bridge | + | * 2.1 - Default |
- | llc 16384 2 bridge, | + | * 2.1 - Overloading Default Configuration Files |
- | nft_fib_inet | + | * LAB #3 - The systemd-analyze Command |
- | nft_fib_ipv4 | + | |
- | nft_fib_ipv6 | + | |
- | nft_fib | + | * 4.2 - The Default Target |
- | nft_reject_inet | + | * Checking |
- | nf_reject_ipv4 | + | * Changing |
- | nf_reject_ipv6 | + | * Changing |
- | --More-- | + | * LAB #5 - Managing Services |
- | </ | + | * 5.1 - Single Service Instances |
- | + | * 5.2 - Multiple Instance Services | |
- | To delete a module, you can use either the **rmmod** command or the **modprobe | + | * 5.3 - Disallowing Modifications |
- | + | * LAB #6 - System Shutdown | |
- | < | + | * 6.1 - The shutdown |
- | [root@centos8 ~]# modprobe -r bonding | + | * 6.2 - The reboot |
- | [root@centos8 ~]# lsmod | more | + | * 6.3 - The halt Command |
- | Module | + | * 6.4 - The poweroff |
- | xt_CHECKSUM | + | |
- | ipt_MASQUERADE | + | |
- | xt_conntrack | + | |
- | ipt_REJECT | + | |
- | nft_compat | + | |
- | nf_nat_tftp | + | |
- | nft_objref | + | |
- | nf_conntrack_tftp | + | |
- | nft_counter | + | |
- | tun 53248 1 | + | |
- | bridge | + | |
- | stp 16384 1 bridge | + | |
- | llc 16384 2 bridge, | + | |
- | nft_fib_inet | + | |
- | nft_fib_ipv4 | + | |
- | nft_fib_ipv6 | + | |
- | nft_fib | + | |
- | nft_reject_inet | + | |
- | nf_reject_ipv4 | + | |
- | nf_reject_ipv6 | + | |
- | nft_reject | + | |
- | --More-- | + | |
- | </ | + | |
- | + | ||
- | Module dependencies are resolved by the modprobe command by using the **/ | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# more / | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | xz kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | kernel/ | + | |
- | _64.ko.xz | + | |
- | kernel/ | + | |
- | --More--(0%) | + | |
- | </ | + | |
- | + | ||
- | To see information about a specific module, use the **modinfo** command: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# modinfo bonding | + | |
- | filename: | + | |
- | author: | + | |
- | description: | + | |
- | license: | + | |
- | alias: | + | |
- | rhelversion: | + | |
- | srcversion: | + | |
- | depends: | + | |
- | intree: | + | |
- | name: | + | |
- | vermagic: | + | |
- | sig_id: | + | |
- | signer: | + | |
- | sig_key: | + | |
- | sig_hashalgo: | + | |
- | signature: | + | |
- | B7: | + | |
- | 3F: | + | |
- | BE: | + | |
- | 44: | + | |
- | DE: | + | |
- | 7F: | + | |
- | D8: | + | |
- | BA: | + | |
- | B8: | + | |
- | 8F: | + | |
- | 58: | + | |
- | 6E: | + | |
- | 50: | + | |
- | 2F: | + | |
- | CA: | + | |
- | 0C: | + | |
- | A6: | + | |
- | AE: | + | |
- | 59: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | parm: | + | |
- | </ | + | |
- | + | ||
- | Finally, files in the **/ | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# ls / | + | |
- | firewalld-sysctls.conf | + | |
- | kvm.conf | + | |
- | + | ||
- | [root@centos8 ~]# cat / | + | |
- | # Setting modprobe kvm_intel/ | + | |
- | # only enables Nested Virtualization until the next reboot or | + | |
- | # module reload. Uncomment the option applicable | + | |
- | # to your system below to enable the feature permanently. | + | |
- | # | + | |
- | # User changes in this file are preserved across upgrades. | + | |
- | # | + | |
- | # For Intel | + | |
- | #options kvm_intel nested=1 | + | |
- | # | + | |
- | # For AMD | + | |
- | #options kvm_amd nested=1 | + | |
- | </ | + | |
- | + | ||
- | =====LAB #2 - Compiling and Installing a Kernel and Modules===== | + | |
- | + | ||
- | Firstly, activate the **CentOS-Linux-PowerTools** repository by setting the **enabled** directive to **1**: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# vi / | + | |
- | [root@centos8 ~]# cat / | + | |
- | # CentOS-Linux-PowerTools.repo | + | |
- | # | + | |
- | # The mirrorlist system uses the connecting IP address of the client and the | + | |
- | # update status of each mirror to pick current mirrors that are geographically | + | |
- | # 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] | + | |
- | name=CentOS Linux $releasever - PowerTools | + | |
- | mirrorlist=http:// | + | |
- | # | + | |
- | gpgcheck=1 | + | |
- | enabled=1 | + | |
- | gpgkey=file:/// | + | |
- | </ | + | |
- | + | ||
- | Now install the package group " | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# dnf groupinstall " | + | |
- | ... | + | |
- | [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 | + | |
- | ... | + | |
- | </ | + | |
- | + | ||
- | ====2.1 - Move /home==== | + | |
- | + | ||
- | <WRAP center round alert 60%> | + | |
- | **Important** - You should not compile a Kernel as the root user for security reasons. To compile a Kernel a user requires **at least** 20 GB of free disk space in their home directory. | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | **To do** - **Log out** of your **CentOS8_SSH_10.0.2.45** session and open a new session using the **CentOS8_ROOT_10.0.2.45** connection. | + | |
- | </ | + | |
- | + | ||
- | Create a partition on **/dev/sdc** : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# fdisk /dev/sdc | + | |
- | + | ||
- | Welcome to fdisk (util-linux 2.32.1). | + | |
- | 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. | + | |
- | + | ||
- | Command (m for help): n | + | |
- | Partition type | + | |
- | | + | |
- | | + | |
- | Select (default p): | + | |
- | + | ||
- | Using default response p. | + | |
- | Partition number (1-4, default 1): | + | |
- | First sector (2048-41943039, | + | |
- | Last sector, +sectors or +size{K, | + | |
- | + | ||
- | Created a new partition 1 of type ' | + | |
- | + | ||
- | Command (m for help): w | + | |
- | The partition table has been altered. | + | |
- | Calling ioctl() to re-read partition table. | + | |
- | Syncing disks. | + | |
- | </code> | + | |
- | + | ||
- | Now create an ext4 filesystem on **/dev/sdc1** : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# mkfs.ext4 /dev/sdc1 | + | |
- | mke2fs 1.45.6 (20-Mar-2020) | + | |
- | Discarding device blocks: done | + | |
- | 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 | + | |
- | Writing inode tables: done | + | |
- | Creating journal (65536 blocks): done | + | |
- | Writing superblocks and filesystem accounting information: | + | |
- | </ | + | |
- | + | ||
- | Mount **/ | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# mount /dev/sdc1 /mnt | + | |
- | </ | + | |
- | + | ||
- | Copy the content of /home to /mnt : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# cp -a /home/* /mnt | + | |
- | </ | + | |
- | + | ||
- | Unmount /dev/sdc1 and move /home to /root : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# umount /mnt | + | |
- | [root@centos8 ~]# mv /home /root | + | |
- | </ | + | |
- | + | ||
- | Get the UUID of /dev/sdc1 : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# ls -l / | + | |
- | lrwxrwxrwx. 1 root root 10 Jul 19 12:02 f76d6b66-985b-4a91-af9c-4987e8c1443c -> ../../sdc | + | |
- | [root@centos8 ~]# | + | |
- | </ | + | |
- | + | ||
- | Edit the **/etc/fstab** file add a line for /dev/sdc1: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# vi / | + | |
- | [root@centos8 ~]# cat / | + | |
- | + | ||
- | # | + | |
- | # / | + | |
- | # Created by anaconda on Wed Jun 16 06:21:32 2021 | + | |
- | # | + | |
- | # Accessible filesystems, | + | |
- | # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. | + | |
- | # | + | |
- | # After editing this file, run ' | + | |
- | # units generated from this file. | + | |
- | # | + | |
- | / | + | |
- | UUID=1c04981e-5317-4b73-9695-3ce25246835d /boot | + | |
- | / | + | |
- | UUID=f76d6b66-985b-4a91-af9c-4987e8c1443c /home | + | |
- | </ | + | |
- | + | ||
- | Create a new mount point foe /home: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# mkdir /home | + | |
- | </ | + | |
- | + | ||
- | Mount /dev/sdc1 : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# mount -a | + | |
- | [root@centos8 ~]# mount | + | |
- | sysfs on /sys type sysfs (rw, | + | |
- | proc on /proc type proc (rw, | + | |
- | devtmpfs on /dev type devtmpfs (rw, | + | |
- | securityfs on / | + | |
- | tmpfs on /dev/shm type tmpfs (rw, | + | |
- | devpts on /dev/pts type devpts (rw, | + | |
- | tmpfs on /run type tmpfs (rw, | + | |
- | tmpfs on / | + | |
- | cgroup on / | + | |
- | pstore on / | + | |
- | bpf on /sys/fs/bpf type bpf (rw, | + | |
- | cgroup on / | + | |
- | cgroup on / | + | |
- | cgroup on / | + | |
- | cgroup on / | + | |
- | cgroup on / | + | |
- | cgroup on / | + | |
- | cgroup on / | + | |
- | cgroup on / | + | |
- | cgroup on / | + | |
- | cgroup on / | + | |
- | cgroup on / | + | |
- | none on / | + | |
- | 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 / | + | |
- | tmpfs on / | + | |
- | tmpfs on / | + | |
- | gvfsd-fuse on / | + | |
- | tmpfs on /run/user/0 type tmpfs (rw, | + | |
- | gvfsd-fuse on / | + | |
- | /dev/sdc1 on /home type ext4 (rw, | + | |
- | </ | + | |
- | + | ||
- | Check the current size of /home : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# df -h | + | |
- | Filesystem | + | |
- | devtmpfs | + | |
- | tmpfs 1.9G | + | |
- | tmpfs 1.9G 9.4M 1.9G 1% /run | + | |
- | tmpfs 1.9G | + | |
- | / | + | |
- | / | + | |
- | tmpfs 374M | + | |
- | tmpfs 374M 1.2M 373M 1% / | + | |
- | / | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | **To do** - **Log out** of your **CentOS8_ROOT_10.0.2.45** session and open a new session using the **CentOS8_SSH_10.0.2.45** connection. | + | |
- | </ | + | |
- | + | ||
- | ====2.2 - Preparing the Environment==== | + | |
- | + | ||
- | To create the Kernel Source Tree in / | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 ~]$ rpmdev-setuptree | + | |
- | ...> | + | |
- | [trainee@centos8 ~]$ ls -laR rpmbuild/ | + | |
- | rpmbuild/: | + | |
- | total 28 | + | |
- | drwxrwxr-x. | + | |
- | drwxr-xr-x. 17 trainee trainee 4096 Jul 19 12:10 .. | + | |
- | drwxrwxr-x. | + | |
- | drwxrwxr-x. | + | |
- | drwxrwxr-x. | + | |
- | drwxrwxr-x. | + | |
- | drwxrwxr-x. | + | |
- | + | ||
- | rpmbuild/ | + | |
- | total 8 | + | |
- | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | |
- | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | |
- | + | ||
- | rpmbuild/ | + | |
- | total 8 | + | |
- | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | |
- | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | |
- | + | ||
- | rpmbuild/ | + | |
- | total 8 | + | |
- | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | |
- | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | |
- | + | ||
- | rpmbuild/ | + | |
- | total 8 | + | |
- | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | |
- | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | |
- | + | ||
- | rpmbuild/ | + | |
- | total 8 | + | |
- | drwxrwxr-x. 2 trainee trainee 4096 Jul 19 12:10 . | + | |
- | drwxrwxr-x. 7 trainee trainee 4096 Jul 19 12:10 .. | + | |
- | </ | + | |
- | + | ||
- | Download the Kernel source RPM: | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 ~]$ uname -a | + | |
- | 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 | + | |
- | + | ||
- | [trainee@centos8 ~]$ cat /etc/centos-release | + | |
- | CentOS Linux release 8.4.2105 | + | |
- | + | ||
- | [trainee@centos8 ~]$ wget https:// | + | |
- | --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) [application/ | + | |
- | Saving to: ‘kernel-4.18.0-305.7.1.el8_4.src.rpm’ | + | |
- | + | ||
- | kernel-4.18.0-305.7.1. 100%[===========================> | + | |
- | + | ||
- | 2021-07-14 02:55:33 (1.49 MB/s) - ‘kernel-4.18.0-305.7.1.el8_4.src.rpm’ saved [123000617/ | + | |
- | </ | + | |
- | + | ||
- | Now install the required dependencies: | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 ~]$ su - | + | |
- | Mot de passe : fenestros | + | |
- | + | ||
- | [root@centos8 ~]# dnf install yum-utils | + | |
- | ... | + | |
- | + | ||
- | [root@centos8 ~]# yum-builddep / | + | |
- | ... | + | |
- | </ | + | |
- | + | ||
- | Install the **kernel-4.18.0-305.7.1.el8_4.src.rpm** package: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# exit | + | |
- | logout | + | |
- | [trainee@centos8 ~]$ rpm -Uvh kernel-4.18.0-305.7.1.el8_4.src.rpm | + | |
- | Updating / installing... | + | |
- | | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | warning: user mockbuild does not exist - using root | + | |
- | warning: group mockbuild does not exist - using root | + | |
- | ################################# | + | |
- | 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%> | + | |
- | **Important** - Note that the errors are not important. | + | |
- | </ | + | |
- | + | ||
- | ====2.3 - Preparing the Kernel Source Tree==== | + | |
- | + | ||
- | Move to the **~/ | + | |
- | + | ||
- | < | + | |
- | [trainee@centos7 ~]$ cd ~/ | + | |
- | [trainee@centos7 SPECS]$ rpmbuild -bp --target=$(uname -m) kernel.spec | + | |
- | ... | + | |
- | </ | + | |
- | + | ||
- | At the end of the process, check what has been created: | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 SPECS]$ ls -la ~/ | + | |
- | total 812 | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | -rw-r--r--. | + | |
- | -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. | + | |
- | -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. | + | |
- | -rw-r--r--. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | drwxr-xr-x. | + | |
- | </ | + | |
- | + | ||
- | ===The .config File=== | + | |
- | + | ||
- | Move to **~/ | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 SPECS]$ cd ~/ | + | |
- | </ | + | |
- | + | ||
- | Copy the **configs/ | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp configs/ | + | |
- | </ | + | |
- | + | ||
- | Update the .config file with the configuration | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ make oldconfig | + | |
- | scripts/ | + | |
- | # | + | |
- | # configuration written to .config | + | |
- | # | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** - The above command reads the .config file of the current Kernel and compares the contents with the new configuration. In the case where there are any new configurations that are required, the command asks for the relevant information. | + | |
- | </ | + | |
- | + | ||
- | The **.config** file is generated by one of three binaries and should not be edited manually: | + | |
- | + | ||
- | * make config | + | |
- | * make menuconfig | + | |
- | * make xconfig | + | |
- | + | ||
- | Run the **make menuconfig** command: | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ make menuconfig | + | |
- | UPD | + | |
- | HOSTCC | + | |
- | HOSTCC | + | |
- | HOSTCC | + | |
- | HOSTCC | + | |
- | HOSTCC | + | |
- | HOSTCC | + | |
- | HOSTCC | + | |
- | HOSTLD | + | |
- | scripts/ | + | |
- | # | + | |
- | # using defaults found in / | + | |
- | # | + | |
- | </ | + | |
- | + | ||
- | Looking at the interface, you will see lines used to configure the Kernel. In the case a letter is used, these are: | + | |
- | + | ||
- | * **y**, | + | |
- | * the configuration is included in the Kernel, | + | |
- | * **m**, | + | |
- | * the configuration is not included in the Kernel but in a Kernel module, | + | |
- | * **n**, | + | |
- | * the configuration is neither included in the Kernel nor in a Kernel module. | + | |
- | + | ||
- | At this stage, simply save the configuration and exit the interface: | + | |
- | + | ||
- | < | + | |
- | *** End of the configuration. | + | |
- | *** Execute ' | + | |
- | </ | + | |
- | + | ||
- | Check the presence of the **.config** file: | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ ls -a | + | |
- | . certs configs | + | |
- | .. | + | |
- | arch | + | |
- | block .config | + | |
- | </ | + | |
- | + | ||
- | Lokk at the contents of the .config file: | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ more .config | + | |
- | # | + | |
- | # Automatically generated file; DO NOT EDIT. | + | |
- | # Linux/x86 4.18.0 Kernel Configuration | + | |
- | # | + | |
- | + | ||
- | # | + | |
- | # Compiler: gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) | + | |
- | # | + | |
- | CONFIG_64BIT=y | + | |
- | CONFIG_X86_64=y | + | |
- | CONFIG_X86=y | + | |
- | CONFIG_INSTRUCTION_DECODER=y | + | |
- | CONFIG_OUTPUT_FORMAT=" | + | |
- | CONFIG_ARCH_DEFCONFIG=" | + | |
- | CONFIG_LOCKDEP_SUPPORT=y | + | |
- | CONFIG_STACKTRACE_SUPPORT=y | + | |
- | CONFIG_MMU=y | + | |
- | CONFIG_ARCH_MMAP_RND_BITS_MIN=28 | + | |
- | CONFIG_ARCH_MMAP_RND_BITS_MAX=32 | + | |
- | CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8 | + | |
- | CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16 | + | |
- | CONFIG_GENERIC_ISA_DMA=y | + | |
- | CONFIG_GENERIC_BUG=y | + | |
- | CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y | + | |
- | CONFIG_GENERIC_HWEIGHT=y | + | |
- | CONFIG_ARCH_MAY_HAVE_PC_FDC=y | + | |
- | CONFIG_GENERIC_CALIBRATE_DELAY=y | + | |
- | CONFIG_ARCH_HAS_CPU_RELAX=y | + | |
- | CONFIG_ARCH_HAS_CACHE_LINE_SIZE=y | + | |
- | CONFIG_ARCH_HAS_FILTER_PGPROT=y | + | |
- | CONFIG_HAVE_SETUP_PER_CPU_AREA=y | + | |
- | CONFIG_NEED_PER_CPU_EMBED_FIRST_CHUNK=y | + | |
- | CONFIG_NEED_PER_CPU_PAGE_FIRST_CHUNK=y | + | |
- | CONFIG_ARCH_HIBERNATION_POSSIBLE=y | + | |
- | CONFIG_ARCH_SUSPEND_POSSIBLE=y | + | |
- | CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y | + | |
- | CONFIG_ARCH_WANT_GENERAL_HUGETLB=y | + | |
- | CONFIG_ZONE_DMA32=y | + | |
- | CONFIG_AUDIT_ARCH=y | + | |
- | CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y | + | |
- | CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y | + | |
- | CONFIG_HAVE_INTEL_TXT=y | + | |
- | CONFIG_X86_64_SMP=y | + | |
- | --More--(0%) | + | |
- | </ | + | |
- | + | ||
- | ===The Makefile File=== | + | |
- | + | ||
- | The Makefile contains the Kernel name and the following information: | + | |
- | + | ||
- | | + | |
- | * PATCHLEVEL, | + | |
- | * SUBLEVEL, | + | |
- | * EXTRAVERSION. | + | |
- | + | ||
- | Values for the first three directives are managed directly by **kernel.org** and Linus Torvalds whilst the EXTRAVERSION is managed by Red Hat: | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ more Makefile | + | |
- | # SPDX-License-Identifier: | + | |
- | VERSION = 4 | + | |
- | PATCHLEVEL = 18 | + | |
- | SUBLEVEL = 0 | + | |
- | EXTRAVERSION = | + | |
- | NAME = Merciless Moray | + | |
- | + | ||
- | # | + | |
- | # DRM backport version | + | |
- | # | + | |
- | RHEL_DRM_VERSION = 5 | + | |
- | RHEL_DRM_PATCHLEVEL = 9 | + | |
- | RHEL_DRM_SUBLEVEL = 14 | + | |
- | + | ||
- | # *DOCUMENTATION* | + | |
- | # To see a list of typical targets execute "make help" | + | |
- | # More info can be located in ./README | + | |
- | # Comments in this file are targeted only to the developer, do not | + | |
- | # expect to learn how to build the kernel reading this file. | + | |
- | + | ||
- | # That's our default target when none is given on the command line | + | |
- | PHONY := _all | + | |
- | _all: | + | |
- | + | ||
- | # o Do not use make's built-in rules and variables | + | |
- | # (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 | + | |
- | unexport LC_ALL | + | |
- | LC_COLLATE=C | + | |
- | LC_NUMERIC=C | + | |
- | export LC_COLLATE LC_NUMERIC | + | |
- | + | ||
- | # Avoid interference with shell env settings | + | |
- | unexport GREP_OPTIONS | + | |
- | + | ||
- | # Set RHEL variables | + | |
- | # Use this spot to avoid future merge conflicts | + | |
- | include Makefile.rhelver | + | |
- | + | ||
- | # We are using a recursive build, so we need to do a little thinking | + | |
- | --Plus--(2%) | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** - The 2.6 version of the Linux Kernel came into being in **2003**. Version 3.0 came out on the 20th anniversary of the Linux Kernel. | + | |
- | </ | + | |
- | + | ||
- | ====2.4 - Configuring the Kernel==== | + | |
- | + | ||
- | Add the value shown by the **uname -i** command to the first line of the .config file: | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ uname -i | + | |
- | x86_64 | + | |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ vi .config | + | |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ head .config | + | |
- | # x86_64 | + | |
- | # | + | |
- | # Automatically generated file; DO NOT EDIT. | + | |
- | # Linux/x86 4.18.0 Kernel | + | |
- | # | + | |
- | + | ||
- | # | + | |
- | # Compiler: gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1) | + | |
- | # | + | |
- | CONFIG_64BIT=y | + | |
- | </ | + | |
- | + | ||
- | Rename the .config file and place it in the **~/ | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp .config ~/ | + | |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ ls ~/ | + | |
- | centos-ca-secureboot.der | + | |
- | centos-dup.x509 | + | |
- | centos-kpatch.x509 | + | |
- | centos.pem | + | |
- | centossecureboot001.der | + | |
- | centossecureboot201.der | + | |
- | centossecurebootca2.der | + | |
- | check-kabi | + | |
- | config-x86_64-generic | + | |
- | </ | + | |
- | + | ||
- | Copy the entire contents of the **configs** directory to the **~/ | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cp configs/* ~/ | + | |
- | </ | + | |
- | + | ||
- | Edit the **buildid** directive in the **~/ | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 linux-4.18.0-305.7.1.el8.x86_64]$ cd ~/ | + | |
- | + | ||
- | [trainee@centos8 SPECS]$ vi kernel.spec | + | |
- | + | ||
- | [trainee@centos8 SPECS]$ head -n 50 kernel.spec | + | |
- | # We have to override the new %%install behavior because, well... the kernel is special. | + | |
- | %global __spec_install_pre %{___build_pre} | + | |
- | + | ||
- | # At the time of this writing (2019-03), RHEL8 packages use w2.xzdio | + | |
- | # 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 / | + | |
- | # 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, | + | |
- | %global released_kernel 1 | + | |
- | + | ||
- | %global distro_build 305 | + | |
- | + | ||
- | # Sign the x86_64 kernel for secure boot authentication | + | |
- | %ifarch x86_64 aarch64 | + | |
- | %global signkernel 1 | + | |
- | %else | + | |
- | %global signkernel 0 | + | |
- | %endif | + | |
- | + | ||
- | # Sign modules on all arches | + | |
- | %global signmodules 1 | + | |
- | + | ||
- | # Compress modules only for architectures that build modules | + | |
- | %ifarch noarch | + | |
- | %global zipmodules 0 | + | |
- | %else | + | |
- | %global zipmodules 1 | + | |
- | %endif | + | |
- | + | ||
- | %if %{zipmodules} | + | |
- | %global zipsed | + | |
- | %endif | + | |
- | + | ||
- | %define buildid .i2tch | + | |
- | + | ||
- | %define rpmversion 4.18.0 | + | |
- | %define pkgrelease 305.7.1.el8_4 | + | |
- | + | ||
- | # allow pkg_release to have configurable %%{?dist} tag | + | |
- | %define specrelease 305.7.1%{? | + | |
- | + | ||
- | %define pkg_release %{specrelease}%{? | + | |
- | </ | + | |
- | + | ||
- | ====2.5 - Compiling the Kernel==== | + | |
- | + | ||
- | Compiling the Kernel can take a long time (~5 heures). Execute the following command: | + | |
- | + | ||
- | < | + | |
- | [trainee@centos7 SPECS]$ rpmbuild -bb --target=`uname -m` kernel.spec 2> build-err.log | tee build-out.log & | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** - Once you are sure that the compilation process has started without errors, stop it using ^C. Stop the virtual machine and ask the Instructor to start the virtual machine in which the Kernel has already been compiled. | + | |
- | </ | + | |
- | + | ||
- | When the compilation has finished, you would see the following output: | + | |
- | + | ||
- | < | + | |
- | ... | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | Wrote: / | + | |
- | 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 | + | |
- | </ | + | |
- | + | ||
- | The installable RPMs can be found in the **/ | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 SPECS]$ cd ../RPMS | + | |
- | [trainee@centos8 RPMS]$ ls | + | |
- | x86_64 | + | |
- | [trainee@centos8 RPMS]$ cd x86_64/ | + | |
- | [trainee@centos8 x86_64]$ ls | + | |
- | bpftool-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
- | bpftool-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
- | kernel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
- | kernel-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
- | kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
- | kernel-debug-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
- | kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
- | kernel-debug-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
- | kernel-debug-devel-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
- | kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64.rpm | + | |
- | </ | + | |
- | + | ||
- | Note that the compilation has consumed over 20 GB of disk space: | + | |
- | + | ||
- | < | + | |
- | [trainee@centos8 x86_64]$ df -h | + | |
- | Filesystem | + | |
- | devtmpfs | + | |
- | tmpfs 1.9G | + | |
- | tmpfs 1.9G 9.4M 1.9G 1% /run | + | |
- | tmpfs 1.9G | + | |
- | / | + | |
- | / | + | |
- | tmpfs 374M | + | |
- | tmpfs 374M 1.2M 373M 1% / | + | |
- | / | + | |
- | </ | + | |
- | + | ||
- | ====2.6 - Installing | + | |
- | + | ||
- | Now install the new Kernel. Installing the new Kernel can take a long time (~2 heures). Use the following command: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 x86_64]# dnf localinstall kernel-*.rpm | + | |
- | Last metadata expiration check: 2:25:32 ago on Tue 20 Jul 2021 08:37:00 EDT. | + | |
- | Dependencies resolved. | + | |
- | =============================================================================================================================================================================================================== | + | |
- | | + | |
- | =============================================================================================================================================================================================================== | + | |
- | Installing: | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | kernel-debuginfo | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | | + | |
- | Downgrading: | + | |
- | | + | |
- | | + | |
- | | + | |
- | + | ||
- | Transaction Summary | + | |
- | =============================================================================================================================================================================================================== | + | |
- | Install | + | |
- | Downgrade | + | |
- | + | ||
- | Total size: 1.6 G | + | |
- | Is this ok [y/N]: y | + | |
- | </ | + | |
- | + | ||
- | When all is installed, re-start | + | |
- | + | ||
- | < | + | |
- | [root@centos7 ~]# reboot | + | |
- | </ | + | |
- | + | ||
- | Open a session as trainee and become root. List the installed Kernels: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# rpm -qa | grep kernel | + | |
- | kernel-modules-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 | + | |
- | kernel-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-debug-core-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-modules-4.18.0-305.7.1.el8_4.x86_64 | + | |
- | kernel-debug-modules-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-devel-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-tools-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-tools-libs-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-debug-modules-internal-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-cross-headers-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-core-4.18.0-305.7.1.el8_4.x86_64 | + | |
- | kernel-devel-4.18.0-305.7.1.el8_4.x86_64 | + | |
- | kernel-debuginfo-common-x86_64-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-debug-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-debug-devel-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-tools-libs-devel-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-modules-extra-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-4.18.0-305.7.1.el8_4.x86_64 | + | |
- | kernel-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-core-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-selftests-internal-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-debug-debuginfo-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-debug-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-4.18.0-305.3.1.el8.x86_64 | + | |
- | kernel-core-4.18.0-305.3.1.el8.x86_64 | + | |
- | kernel-modules-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | kernel-ipaclones-internal-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | </ | + | |
- | + | ||
- | Check the **saved-entry** from the **/ | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# grep i2tch / | + | |
- | saved_entry=95bd69e34a7444a7b58cb74fbfb86df2-4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | </ | + | |
- | + | ||
- | Finally, check the output of the **uname -r** command: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# uname -r | + | |
- | 4.18.0-305.7.1.el8.i2tch.x86_64 | + | |
- | </ | + | |
- | + | ||
- | =====LAB #3 - Managing Quotas===== | + | |
- | + | ||
- | User and group disk quotas can be placed on partitions **only**. | + | |
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | **To do** - **Log out** of your **CentOS8_SSH_10.0.2.45** session and open a new session using the **CentOS8_ROOT_10.0.2.45** connection. | + | |
- | </ | + | |
- | + | ||
- | Before configuring the quotas, set SELINUX to **permissive** mode for the current session: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# getenforce | + | |
- | Enforcing | + | |
- | [root@centos8 ~]# setenforce permissive | + | |
- | [root@centos8 ~]# getenforce | + | |
- | Permissive | + | |
- | [root@centos8 ~]# | + | |
- | </ | + | |
- | + | ||
- | Edit the **/ | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# vi / | + | |
- | [root@centos8 ~]# cat / | + | |
- | + | ||
- | # This file controls the state of SELinux on the system. | + | |
- | # 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 | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | Now check that the **quota** package is installed: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# rpm -qa | grep quota | + | |
- | quota-4.04-12.el8.x86_64 | + | |
- | quota-nls-4.04-12.el8.noarch | + | |
- | </ | + | |
- | + | ||
- | Edit the **/ | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# vi / | + | |
- | [root@centos8 ~]# cat / | + | |
- | + | ||
- | # | + | |
- | # / | + | |
- | # Created by anaconda on Wed Jun 16 06:21:32 2021 | + | |
- | # | + | |
- | # Accessible filesystems, | + | |
- | # See man pages fstab(5), findfs(8), mount(8) and/or blkid(8) for more info. | + | |
- | # | + | |
- | # After editing this file, run ' | + | |
- | # units generated from this file. | + | |
- | # | + | |
- | / | + | |
- | UUID=1c04981e-5317-4b73-9695-3ce25246835d /boot | + | |
- | / | + | |
- | UUID=f76d6b66-985b-4a91-af9c-4987e8c1443c /home | + | |
- | </ | + | |
- | + | ||
- | Restart the virtual machine: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# reboot | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round todo 60%> | + | |
- | **To do** - Open a new session using the **CentOS8_ROOT_10.0.2.45** connection. | + | |
- | </ | + | |
- | + | ||
- | Check that the **usrquota** and **grpquota** options have been activated on /home: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# cat /etc/mtab | grep /home | + | |
- | /dev/sdc1 /home ext4 rw, | + | |
- | </ | + | |
- | + | ||
- | ====3.1 - The quotacheck Command==== | + | |
- | + | ||
- | To activate the quotas on /home, use the **quotacheck** command: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# quotacheck -cugvm -f /dev/sdc1 | + | |
- | quotacheck: Your kernel probably supports journaled quota but you are not using it. Consider switching to journaled quota to avoid running quotacheck after an unclean shutdown. | + | |
- | quotacheck: Scanning /dev/sdc1 [/home] done | + | |
- | quotacheck: Cannot stat old user quota file / | + | |
- | 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. | + | |
- | </ | + | |
- | + | ||
- | The command line switches of the **quotacheck** command are as follows: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# quotacheck --help | + | |
- | Utility for checking and repairing quota files. | + | |
- | quotacheck [-gucbfinvdmMR] [-F < | + | |
- | + | ||
- | -u, --user | + | |
- | -g, --group | + | |
- | -c, --create-files | + | |
- | -b, --backup | + | |
- | -f, --force | + | |
- | -i, --interactive | + | |
- | -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 | + | |
- | </ | + | |
- | + | ||
- | Two files, | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# ls -la /home | + | |
- | total 40 | + | |
- | drwxr-xr-x. | + | |
- | dr-xr-xr-x. 17 root root 224 Jul 19 12:05 .. | + | |
- | -rw-------. | + | |
- | -rw-------. | + | |
- | drwx------. | + | |
- | drwxr-xr-x. 17 trainee trainee | + | |
- | </ | + | |
- | + | ||
- | Now create a user called | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# groupadd fenestros && useradd fenestros -c FenestrOs -d / | + | |
- | [root@centos8 ~]# passwd fenestros | + | |
- | Changing password for user fenestros. | + | |
- | New password: | + | |
- | BAD PASSWORD: The password contains the user name in some form | + | |
- | Retype new password: | + | |
- | passwd: all authentication tokens updated successfully. | + | |
- | </ | + | |
- | + | ||
- | ====3.2 - The edquota Command==== | + | |
- | + | ||
- | Set a 10Mo quota for the fenestros user: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# edquota -u fenestros -f /home | + | |
- | </ | + | |
- | + | ||
- | The **vi** editor launches and you will see the following output: | + | |
- | + | ||
- | < | + | |
- | Disk quotas for user fenestros (uid 1001): | + | |
- | Filesystem | + | |
- | / | + | |
- | </ | + | |
- | + | ||
- | Change the file as follows: | + | |
- | + | ||
- | < | + | |
- | Disk quotas for user fenestros (uid 1001): | + | |
- | Filesystem | + | |
- | / | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** - This sets a **soft** quota of 8 000 KB and a **hard** quota of 10 000 KB for the fenestros user. When fenestros goes over the soft limit, he/she will recieve a warning message. Going over the hard limit means thet he/she can no longer save files to **/ | + | |
- | </ | + | |
- | + | ||
- | Save and quit the file. | + | |
- | + | ||
- | The command line switches of the **edquota** command are as follows: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# edquota | + | |
- | edquota: Usage: | + | |
- | edquota [-rm] [-u] [-F formatname] [-p username] [-f filesystem] username ... | + | |
- | edquota [-rm] -g [-F formatname] [-p groupname] [-f filesystem] groupname ... | + | |
- | edquota [-rm] -P [-F formatname] [-p projectname] [-f filesystem] projectname ... | + | |
- | edquota [-u|g|-P] [-F formatname] [-f filesystem] -t | + | |
- | edquota [-u|g|-P] [-F formatname] [-f filesystem] -T username|groupname|projectname ... | + | |
- | + | ||
- | -u, --user | + | |
- | -g, --group | + | |
- | -P, --project | + | |
- | -r, --remote | + | |
- | -m, --no-mixed-pathnames | + | |
- | -F, --format=formatname | + | |
- | -p, --prototype=name | + | |
- | --always-resolve | + | |
- | composed only of digits | + | |
- | -f, --filesystem=filesystem | + | |
- | -t, --edit-period | + | |
- | -T, --edit-times | + | |
- | -h, --help | + | |
- | -V, --version | + | |
- | + | ||
- | Bugs to: jack@suse.cz | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** - The procedure is similar in the case that you specify a group quota. In this case, use the **-g** switch of the edquota command. | + | |
- | </ | + | |
- | + | ||
- | ====3.3 | + | |
- | + | ||
- | Now apply the quotas : | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# quotaon -a | + | |
- | </ | + | |
- | + | ||
- | The command line switches of the **quotaon** command are as follows: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# quotaon --help | + | |
- | quotaon: Usage: | + | |
- | quotaon [-guPvp] [-F quotaformat] [-x state] -a | + | |
- | quotaon [-guPvp] [-F quotaformat] [-x state] filesys | + | |
- | + | ||
- | -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 | + | |
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **important** - To turn **off** quotas, use the **quotaoff** command. | + | |
- | </ | + | |
- | + | ||
- | ====3.4 | + | |
- | + | ||
- | To see quotas, use the **repquota** command: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# repquota /home | + | |
- | *** Report for user quotas on device /dev/sdc1 | + | |
- | Block grace time: 7days; Inode grace time: 7days | + | |
- | Block limits | + | |
- | User used soft hard grace used soft hard grace | + | |
- | ---------------------------------------------------------------------- | + | |
- | root -- 20 | + | |
- | trainee | + | |
- | + | ||
- | </ | + | |
- | + | ||
- | <WRAP center round important 60%> | + | |
- | **Important** - Note that fenestros is not visible in this list. With RHEL / CentOS, quotas are not visible until the user has connected for the first time. | + | |
- | </ | + | |
- | + | ||
- | The command line switches of the **repquota** command are as follows: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# repquota --help | + | |
- | repquota: Utility for reporting quotas. | + | |
- | Usage: | + | |
- | repquota [-vugsi] [-c|C] [-t|n] [-F quotaformat] [-O (default | xml | csv)] (-a | mntpoint) | + | |
- | + | ||
- | -v, --verbose | + | |
- | -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 | + | |
- | </ | + | |
- | + | ||
- | ====3.5 - The quota Command==== | + | |
- | + | ||
- | To see quotas for a specific user, use the **quota** command: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# quota fenestros | + | |
- | Disk quotas for user fenestros (uid 1001): no limited resources used | + | |
- | [root@centos8 ~]# su - fenestros | + | |
- | [fenestros@centos8 ~]$ touch test | + | |
- | [fenestros@centos8 ~]$ exit | + | |
- | logout | + | |
- | [root@centos8 ~]# quota fenestros | + | |
- | Disk quotas for user fenestros (uid 1001): | + | |
- | | + | |
- | | + | |
- | </ | + | |
- | + | ||
- | The command line switches of the **quota** command are as follows: | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# quota --help | + | |
- | quota: Usage: quota [-guPqvswim] [-l | [-Q | -A]] [-F quotaformat] | + | |
- | quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -u username | + | |
- | quota [-qvswim] [-l | [-Q | -A]] [-F quotaformat] -g groupname ... | + | |
- | quota [-qvswugPQm] [-F quotaformat] -f filesystem ... | + | |
- | + | ||
- | -u, --user | + | |
- | -g, --group | + | |
- | -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 | + | |
- | </ | + | |
- | + | ||
- | ====3.6 | + | |
- | + | ||
- | The **warnquota** command checks user and group disk usage and sends out messages when the **soft** limit is reached. This command is normally called by a cron job however it is possible to use it interactively. With RHEL/ | + | |
- | + | ||
- | < | + | |
- | [root@centos8 ~]# which warnquota | + | |
- | / | + | |
- | </ | + | |
- | + | ||
- | Install the **quota-warnquota** package: | + | |
- | < | + | * **LCE511 - Training Validation** |
- | [root@centos7 ~]# dnf install quota-warnquota | + | * Course Materials |
- | ... | + | * Reminder of the Training Program |
- | </ | + | * Day #1 |
+ | * Day #2 | ||
+ | * Day #3 | ||
+ | * Day #4 | ||
+ | * Training Evaluation | ||
+ | * Exam - Acquired knowledge | ||
- | The command line switches of the **warnquota** command are as follows: | + | =====Training Evaluation===== |
- | < | + | Please complete and submit the training evaluation form. |
- | [root@centos8 ~]# warnquota --help | + | |
- | warnquota: Usage: | + | |
- | warnquota [-ugsid] [-F quotaformat] [-c configfile] [-q quotatabfile] [-a adminsfile] [filesystem...] | + | |
- | -u, --user | + | =====Exam |
- | -g, --group | + | |
- | -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 | + | Please take the final examination. |
- | </ | + | |
----- | ----- | ||
- | Copyright © 2021 Hugh Norris. | + | Copyright © 2022 Hugh Norris |