22-07-13 Initial installation [root@dbase03 ~]# yum install --nogpgcheck http://satellite6.it.ubc.ca/pub/katello-ca-consumer-latest.noarch.rpm Installed: katello-ca-consumer-satellite6.it.ubc.ca-1.0-7.noarch [root@dbase03 ~]# subscription-manager register --org=UBCITServices --activationkey=RHEL9 The system has been registered with ID: 779be8b2-89df-4968-bc17-c13f5d7f9052 The registered system name is: dbase03.phas.ubc.ca Installed Product Current Status: Product Name: Red Hat Enterprise Linux for x86_64 Status: Subscribed [root@dbase03 ~]# subscription-manager list +-------------------------------------------+ Installed Product Status +-------------------------------------------+ Product Name: Red Hat Enterprise Linux for x86_64 Product ID: 479 Version: 9.0 Arch: x86_64 Status: Subscribed Status Details: Starts: 04/29/2022 Ends: 04/29/2023 [root@dbase03 ~]# subscription-manager list --available +-------------------------------------------+ Available Subscriptions +-------------------------------------------+ Subscription Name: Red Hat JBoss Enterprise Application Platform, 64-Core Standard Provides: Red Hat Mobile Services dotNET on RHEL Beta (for RHEL Server) Red Hat CodeReady Linux Builder for x86_64 Red Hat Ansible Engine Red Hat Enterprise Linux Fast Datapath Red Hat JBoss Core Services JBoss Enterprise Application Platform Red Hat CodeReady Workspaces for OpenShift Red Hat Beta Red Hat OpenShift Enterprise JBoss EAP add-on Red Hat Openshift Application Runtimes for IBM Power LE Red Hat OpenShift Container Platform Red Hat Single Sign-On Red Hat JBoss Data Grid dotNET on RHEL (for RHEL Server) Red Hat CoreOS Red Hat Openshift Application Runtimes Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support Red Hat OpenShift Enterprise JBoss A-MQ add-on Red Hat OpenShift Application Runtimes Beta Red Hat OpenShift Enterprise Client Tools Red Hat CoreOS Beta Red Hat Openshift Serverless Oracle Java (for RHEL Server) Red Hat Software Collections (for RHEL Server) Red Hat JBoss Middleware JBoss Enterprise Web Platform Red Hat OpenShift Enterprise Application Node Red Hat OpenShift distributed tracing Red Hat Enterprise Linux Atomic Host OpenJDK Java (for Middleware) Red Hat JBoss AMQ Clients Red Hat Enterprise Linux Fast Datapath Beta for x86_64 Red Hat Enterprise MRG Messaging Red Hat Software Collections Beta (for RHEL Server) Red Hat Enterprise Linux Server Red Hat OpenShift Pipelines Red Hat Enterprise Linux for x86_64 Red Hat Enterprise Linux for x86_64 - Extended Update Support JBoss Enterprise Web Server Red Hat AMQ Interconnect Red Hat Container Native Virtualization Red Hat OpenShift Enterprise JBoss FUSE add-on OpenShift Developer Tools and Services Red Hat OpenShift Enterprise JBoss EAP add-on Beta SKU: MW0186831RN Contract: 12180383 Pool ID: 0ee7bd827f6aef6d01807733b4af6a53 Provides Management: No Available: 1 Suggested: 1 Service Type: L1-L3 Roles: Service Level: Standard Usage: Add-ons: Subscription Type: Stackable Starts: 04/30/2022 Ends: 04/30/2023 Entitlement Type: Physical Subscription Name: Red Hat Enterprise Linux Academic Site Subscription with Smart Management + Satellite, Standard (Server, Desktop, Workstation, POWER, HPC, Per FTE) Provides: dotNET on RHEL (for RHEL Workstation) Oracle Java (for RHEL Workstation) Red Hat Ansible Engine Red Hat CodeReady Linux Builder for Power, little endian Red Hat Software Collections Beta (for RHEL Server for IBM Power LE) Red Hat Enterprise Linux for Power, big endian - Extended Update Support Red Hat Beta dotNET on RHEL (for RHEL Server) Red Hat CodeReady Linux Builder for x86_64 - Extended Update Support Red Hat Software Collections Beta (for RHEL Server for IBM Power) Red Hat Enterprise Linux High Availability (for IBM Power LE) - Extended Update Support Oracle Java (for RHEL Server) Red Hat Software Collections (for RHEL Server) Red Hat Enterprise Linux for Power, little endian - Extended Update Support Red Hat Enterprise Linux for Power, little endian Red Hat Enterprise Linux for Power, big endian Oracle Java (for RHEL Compute Node) Red Hat Enterprise Linux for Scientific Computing Red Hat Enterprise Linux for Power 9 Red Hat Enterprise Linux for SAP Applications for Power BE Red Hat Developer Tools (for RHEL Server) Red Hat Software Collections Beta (for RHEL Workstation) Red Hat Enterprise Linux for SAP Applications for Power LE - Extended Update Support Red Hat Developer Tools Beta (for RHEL Server) Red Hat Enterprise Linux for x86_64 Red Hat Enterprise Linux for SAP Applications for Power BE - Extended Update Support Red Hat Software Collections (for RHEL Server for IBM Power) Red Hat S-JIS Support (for RHEL Server) - Extended Update Support dotNET on RHEL Beta (for RHEL Server) Red Hat CodeReady Linux Builder for x86_64 Red Hat Software Collections (for RHEL Workstation) Red Hat Enterprise Linux Resilient Storage for IBM Power LE - Extended Update Support Red Hat Enterprise Linux Scalable File System (for RHEL Server) - Extended Update Support Red Hat Container Images Beta Red Hat Software Collections (for RHEL Server for IBM Power LE) Red Hat Enterprise Linux Atomic Host Beta Red Hat Container Images Red Hat EUCJP Support (for RHEL Server) - Extended Update Support Red Hat Enterprise Linux Load Balancer (for RHEL Server) - Extended Update Support Red Hat Enterprise Linux Desktop Red Hat Enterprise Linux Workstation Red Hat Enterprise Linux Resilient Storage for x86_64 - Extended Update Support Red Hat Enterprise Linux High Availability for x86_64 - Extended Update Support Oracle Java (for RHEL Client) Red Hat Developer Toolset (for RHEL Workstation) Red Hat Enterprise Linux High Performance Networking (for RHEL Server) - Extended Update Support Red Hat Enterprise Linux Atomic Host Red Hat Software Collections Beta (for RHEL Server) Red Hat Enterprise Linux Server Red Hat Enterprise Linux for SAP Applications for x86_64 Red Hat Enterprise Linux for SAP Applications for Power LE Red Hat Enterprise Linux for x86_64 - Extended Update Support dotNET on RHEL Beta (for RHEL Workstation) dotNET on RHEL (for RHEL Compute Node) Red Hat Developer Toolset (for RHEL Server) dotNET on RHEL Beta (for RHEL Compute Node) Red Hat CodeReady Linux Builder for Power, little endian - Extended Update Support Red Hat Enterprise Linux for SAP Applications for x86_64 - Extended Update Support SKU: RH01157 Contract: 12196201 Pool ID: 0ee7bd827f6aef6d01807733b5666a5a Provides Management: Yes Available: 250000 Suggested: 1 Service Type: L1-L3 Roles: Service Level: Standard Usage: Production Add-ons: Subscription Type: Standard (Temporary) Starts: 04/29/2022 Ends: 04/29/2023 Entitlement Type: Virtual Subscription Name: Red Hat Ansible Automation Platform (Academic Edition), Standard (100 Managed Nodes) Provides: Red Hat Ansible Engine Red Hat Single Sign-On Red Hat Ansible Automation Platform JBoss Enterprise Application Platform SKU: MCT3319 Contract: 12934953 Pool ID: 0ee7bd827f6aef6d01801f1bb5164b4b Provides Management: No Available: 83 Suggested: 1 Service Type: L1-L3 Roles: Service Level: Standard Usage: Add-ons: Subscription Type: Stackable Starts: 03/31/2022 Ends: 03/31/2023 Entitlement Type: Physical Subscription Name: Red Hat Enterprise Linux Extended Life Cycle Support (Unlimited Guests) Provides: Red Hat Enterprise Linux Server - Extended Life Cycle Support SKU: RH00271RN Contract: 12538962 Pool ID: 0ee7bd827d0c2a7c017dc00edb6b7b3b Provides Management: No Available: Unlimited Suggested: 1 Service Type: L1-L3 Roles: Service Level: Layered Usage: Add-ons: Subscription Type: Stackable (Temporary) Starts: 12/10/2021 Ends: 12/10/2022 Entitlement Type: Virtual rap@spyder:~$ dbase03 Activate the web console with: systemctl enable --now cockpit.socket Register this system with Red Hat Insights: insights-client --register Create an account or view all your systems at https://red.ht/insights-dashboard Last login: Thu Jul 14 13:23:08 2022 from 142.103.235.1 [root@dbase03 ~]# yum repolist Updating Subscription Management repositories. repo id repo name epel Extra Packages for Enterprise Linux 9 - x86_64 rhel-9-for-x86_64-appstream-rpms Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs) rhel-9-for-x86_64-baseos-rpms Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs) [root@dbase03 ~]# dnf --disablerepo="*" --enablerepo="epel" list available | grep inxi inxi.noarch 3.3.19-1.el9 epel [root@dbase03 ~]# yum module list Updating Subscription Management repositories. Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs) 62 kB/s | 4.1 kB 00:00 Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs) 61 kB/s | 4.1 kB 00:00 [root@dbase03 ~]# yum repolist all Updating Subscription Management repositories. repo id repo name status epel Extra Packages for Enterprise Linux 9 - x86_64 enabled epel-debuginfo Extra Packages for Enterprise Linux 9 - x86_64 - Debug disabled epel-source Extra Packages for Enterprise Linux 9 - x86_64 - Source disabled epel-testing Extra Packages for Enterprise Linux 9 - Testing - x86_64 disabled epel-testing-debuginfo Extra Packages for Enterprise Linux 9 - Testing - x86_64 - Debug disabled epel-testing-source Extra Packages for Enterprise Linux 9 - Testing - x86_64 - Source disabled rhel-9-for-x86_64-appstream-rpms Red Hat Enterprise Linux 9 for x86_64 - AppStream (RPMs) enabled rhel-9-for-x86_64-baseos-rpms Red Hat Enterprise Linux 9 for x86_64 - BaseOS (RPMs) enabled rhel-9-for-x86_64-supplementary-rpms Red Hat Enterprise Linux 9 for x86_64 - Supplementary (RPMs) disabled [root@dbase03 ~]# [root@dbase03 sbin]# vim /etc/dnf/automatic.conf [root@dbase03 sbin]# systemctl enable dnf-automatic.timer Created symlink /etc/systemd/system/timers.target.wants/dnf-automatic.timer → /usr/lib/systemd/system/dnf-automatic.timer. [root@dbase03 sbin]# systemctl start dnf-automatic.timer [root@dbase03 sbin]# systemctl status dnf-automatic.timer ● dnf-automatic.timer - dnf-automatic timer Loaded: loaded (/usr/lib/systemd/system/dnf-automatic.timer; enabled; vendor preset: disabled) Active: active (waiting) since Thu 2022-07-14 14:53:38 PDT; 6s ago Until: Thu 2022-07-14 14:53:38 PDT; 6s ago Trigger: Fri 2022-07-15 06:32:09 PDT; 15h left Triggers: ● dnf-automatic.service Jul 14 14:53:38 dbase03.phas.ubc.ca systemd[1]: Started dnf-automatic timer. [root@dbase03 sbin]# systemctl list-timers NEXT LEFT LAST PASSED UNIT ACTIVATES Thu 2022-07-14 16:17:09 PDT 1h 22min left Wed 2022-07-13 16:17:09 PDT 22h ago systemd-tmpfiles-clean.timer systemd-tmpfiles-clean.service Thu 2022-07-14 16:17:52 PDT 1h 22min left Thu 2022-07-14 14:53:32 PDT 1min 26s ago dnf-makecache.timer dnf-makecache.service Fri 2022-07-15 00:00:00 PDT 9h left Thu 2022-07-14 00:00:09 PDT 14h ago logrotate.timer logrotate.service Fri 2022-07-15 00:00:00 PDT 9h left Thu 2022-07-14 00:00:09 PDT 14h ago mlocate-updatedb.timer mlocate-updatedb.service Fri 2022-07-15 06:32:09 PDT 15h left n/a n/a dnf-automatic.timer dnf-automatic.service 5 timers listed. Pass --all to see loaded but inactive timers, too. ================================================================================= 22-07-18 add 32GB disk for /var/lib/mysql and 64GB disk for /backups [root@dbase03 ~]# fdisk -l | grep sd Disk /dev/sda: 32 GiB, 34359738368 bytes, 67108864 sectors /dev/sda1 * 2048 2099199 2097152 1G 83 Linux /dev/sda2 2099200 67108863 65009664 31G 8e Linux LVM Disk /dev/sdb: 32 GiB, 34359738368 bytes, 67108864 sectors [root@dbase03 ~]# fdisk /dev/sdb Welcome to fdisk (util-linux 2.37.4). 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 0xfee0e630. Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): p Partition number (1-4, default 1): First sector (2048-67108863, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-67108863, default 67108863): Created a new partition 1 of type 'Linux' and of size 32 GiB. Command (m for help): t Selected partition 1 Hex code or alias (type L to list all): 8e Changed type of partition 'Linux' to 'Linux LVM'. Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. [root@dbase03 ~]# fdisk -l | grep sd Disk /dev/sda: 32 GiB, 34359738368 bytes, 67108864 sectors /dev/sda1 * 2048 2099199 2097152 1G 83 Linux /dev/sda2 2099200 67108863 65009664 31G 8e Linux LVM Disk /dev/sdb: 32 GiB, 34359738368 bytes, 67108864 sectors /dev/sdb1 2048 67108863 67106816 32G 8e Linux LVM [root@dbase03 ~]# pvcreate /dev/sdb1 Physical volume "/dev/sdb1" successfully created. [root@dbase03 ~]# pvs PV VG Fmt Attr PSize PFree /dev/sda2 rhel_dbase03 lvm2 a-- <31.00g 0 /dev/sdb1 lvm2 --- <32.00g <32.00g [root@dbase03 ~]# vgcreate VGmysql /dev/sdb1 Volume group "VGmysql" successfully created [root@dbase03 ~]# lvcreate --name LVmysql -l 100%FREE VGmysql Logical volume "LVmysql" created. [root@dbase03 ~]# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert LVmysql VGmysql -wi-a----- <32.00g root rhel_dbase03 -wi-ao---- <28.87g swap rhel_dbase03 -wi-ao---- <2.13g [root@dbase03 ~]# ls -l /dev/VGmysql/LVmysql lrwxrwxrwx. 1 root root 7 Jul 18 11:16 /dev/VGmysql/LVmysql -> ../dm-2 [root@dbase03 ~]# mkfs.xfs /dev/VGmysql/LVmysql meta-data=/dev/VGmysql/LVmysql isize=512 agcount=4, agsize=2096896 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=1, rmapbt=0 = reflink=1 bigtime=1 inobtcount=1 data = bsize=4096 blocks=8387584, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=4095, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 [root@dbase03 ~]# ls -ld /var/lib/mysql drwxr-xr-x. 4 mysql mysql 4096 Jul 14 13:36 /var/lib/mysql [root@dbase03 ~]# systemctl status mariadb [root@dbase03 ~]# systemctl stop mariadb.service [root@dbase03 ~]# cd /var/lib [root@dbase03 lib]# mv mysql mysql.hold [root@dbase03 lib]# mkdir mysql [root@dbase03 lib]# chown mysql:mysql mysql [root@dbase03 lib]# vim /etc/fstab [root@dbase03 lib]# mount /var/lib/mysql [root@dbase03 lib]# df -h | grep dev /dev/mapper/rhel_dbase03-root 29G 4.5G 25G 16% / /dev/sda1 1014M 298M 717M 30% /boot /dev/mapper/VGmysql-LVmysql 32G 261M 32G 1% /var/lib/mysql [root@dbase03 lib]# pwd /var/lib [root@dbase03 lib]# cd mysql [root@dbase03 mysql]# rpm -qa | grep -i maria mariadb-connector-c-config-3.2.6-1.el9_0.noarch mariadb-common-10.5.13-2.el9.x86_64 mariadb-connector-c-3.2.6-1.el9_0.x86_64 perl-DBD-MariaDB-1.21-16.el9_0.x86_64 mariadb-errmsg-10.5.13-2.el9.x86_64 mariadb-backup-10.5.13-2.el9.x86_64 mariadb-gssapi-server-10.5.13-2.el9.x86_64 mariadb-10.5.13-2.el9.x86_64 mariadb-server-utils-10.5.13-2.el9.x86_64 mariadb-server-10.5.13-2.el9.x86_64 [root@dbase03 mysql]# yum reinstall mariadb-server mariadb-server-utils mariadb mariadb-common mariadb-backup Reinstalled: mariadb-3:10.5.13-2.el9.x86_64 mariadb-backup-3:10.5.13-2.el9.x86_64 mariadb-common-3:10.5.13-2.el9.x86_64 mariadb-server-3:10.5.13-2.el9.x86_64 mariadb-server-utils-3:10.5.13-2.el9.x86_64 [root@dbase03 mysql]# systemctl status mariadb ○ mariadb.service - MariaDB 10.5 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Active: inactive (dead) since Mon 2022-07-18 11:18:57 PDT; 5min ago Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Main PID: 49472 (code=exited, status=0/SUCCESS) Status: "MariaDB server is down" CPU: 0 [root@dbase03 mysql]# systemctl start mariadb [root@dbase03 mysql]# systemctl status mariadb ● mariadb.service - MariaDB 10.5 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2022-07-18 11:25:14 PDT; 2s ago Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 541772 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS) Process: 541794 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status> Process: 541886 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS) Main PID: 541874 (mariadbd) Status: "Taking your SQL requests now..." Tasks: 11 (limit: 5760) Memory: 77.0M CPU: 424ms CGroup: /system.slice/mariadb.service └─541874 /usr/libexec/mariadbd --basedir=/usr Jul 18 11:25:14 dbase03.phas.ubc.ca mariadb-prepare-db-dir[541833]: See the MariaDB Knowledgebase at http> Jul 18 11:25:14 dbase03.phas.ubc.ca mariadb-prepare-db-dir[541833]: MySQL manual for more instructions. Jul 18 11:25:14 dbase03.phas.ubc.ca mariadb-prepare-db-dir[541833]: Please report any problems at https:/> Jul 18 11:25:14 dbase03.phas.ubc.ca mariadb-prepare-db-dir[541833]: The latest information about MariaDB > Jul 18 11:25:14 dbase03.phas.ubc.ca mariadb-prepare-db-dir[541833]: You can find additional information a> Jul 18 11:25:14 dbase03.phas.ubc.ca mariadb-prepare-db-dir[541833]: https://dev.mysql.com Jul 18 11:25:14 dbase03.phas.ubc.ca mariadb-prepare-db-dir[541833]: Consider joining MariaDB's strong and> Jul 18 11:25:14 dbase03.phas.ubc.ca mariadb-prepare-db-dir[541833]: https://mariadb.org/get-involved/ Jul 18 11:25:14 dbase03.phas.ubc.ca mariadbd[541874]: 2022-07-18 11:25:14 0 [Note] /usr/libexec/mariadbd > Jul 18 11:25:14 dbase03.phas.ubc.ca systemd[1]: Started MariaDB 10.5 database server. [root@dbase03 mysql]# /usr/bin/mysql_secure_installation NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY! In order to log into MariaDB to secure it, we'll need the current password for the root user. If you've just installed MariaDB, and haven't set the root password yet, you should just press enter here. Enter current password for root (enter for none): OK, successfully used password, moving on... Setting the root password or using the unix_socket ensures that nobody can log into the MariaDB root user without the proper authorisation. You already have your root account protected, so you can safely answer 'n'. Switch to unix_socket authentication [Y/n] n ... skipping. You already have your root account protected, so you can safely answer 'n'. Change the root password? [Y/n] y New password: Re-enter new password: Password updated successfully! Reloading privilege tables.. ... Success! By default, a MariaDB installation has an anonymous user, allowing anyone to log into MariaDB without having to have a user account created for them. This is intended only for testing, and to make the installation go a bit smoother. You should remove them before moving into a production environment. Remove anonymous users? [Y/n] y ... Success! Normally, root should only be allowed to connect from 'localhost'. This ensures that someone cannot guess at the root password from the network. Disallow root login remotely? [Y/n] y ... Success! By default, MariaDB comes with a database named 'test' that anyone can access. This is also intended only for testing, and should be removed before moving into a production environment. Remove test database and access to it? [Y/n] y - Dropping test database... ... Success! - Removing privileges on test database... ... Success! Reloading the privilege tables will ensure that all changes made so far will take effect immediately. Reload privilege tables now? [Y/n] y ... Success! Cleaning up... All done! If you've completed all of the above steps, your MariaDB installation should now be secure. Thanks for using MariaDB! [root@dbase03 mysql]# mysql -u root Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 13 Server version: 10.5.13-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> quit Bye -------------------------------------------------------------- https://mariadb.com/kb/en/security-of-mariadb-root-account/ Security of Mariadb root account Ran the mysql_secure_installation script to secure database, setting a root password, and 'Yes' to remainder of questions. At this stage, I assumed that the Mariadb root account was secured with the password, however... Using $ sudo mysql and without entering any password whatsoever, I get access to perform actions normally associated with the root account. How can that be?? and what was the purpose in adding a password, if root access can be so readily gained. Answer Answered by Brian Evans in this comment. This is a Debian decision to: Not require a password with sudo Utilize the unix_socket plugin by default The latter is set in the Debian install scripts. You can override this by removing the plugin for 'root'@'localhost' as long as you understand that Debian scripts may be looking for their default. -------------------------------------------------------------- [root@dbase03 mysql]# systemctl restart mariadb [root@dbase03 mysql]# mysql -u root Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 14 Server version: 10.5.13-MariaDB MariaDB Server Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> quit Bye [root@dbase03 mysql]# systemctl list-unit-files | grep mari mariadb.service enabled disabled mariadb@.service disabled disabled [root@dbase03 mysql]# systemctl list-unit-files | grep -i sql var-lib-mysql.mount generated - mysql.service alias - mysqld.service alias - [root@dbase03 mysql]# systemctl status mysql ● mariadb.service - MariaDB 10.5 database server Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) Active: active (running) since Mon 2022-07-18 11:27:46 PDT; 2min 34s ago Docs: man:mariadbd(8) https://mariadb.com/kb/en/library/systemd/ Process: 542076 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS) Process: 542098 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status> Process: 542145 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS) Main PID: 542133 (mariadbd) Status: "Taking your SQL requests now..." Tasks: 9 (limit: 5760) Memory: 65.8M CPU: 221ms CGroup: /system.slice/mariadb.service └─542133 /usr/libexec/mariadbd --basedir=/usr Jul 18 11:27:45 dbase03.phas.ubc.ca systemd[1]: Starting MariaDB 10.5 database server... Jul 18 11:27:46 dbase03.phas.ubc.ca mariadb-prepare-db-dir[542098]: Database MariaDB is probably initiali> Jul 18 11:27:46 dbase03.phas.ubc.ca mariadb-prepare-db-dir[542098]: If this is not the case, make sure th> Jul 18 11:27:46 dbase03.phas.ubc.ca mariadbd[542133]: 2022-07-18 11:27:46 0 [Note] /usr/libexec/mariadbd > Jul 18 11:27:46 dbase03.phas.ubc.ca systemd[1]: Started MariaDB 10.5 database server. lines 1-21/21 (END) ----------------------------------------------------------- [root@dbase03 ~]# fdisk -l | grep sd Disk /dev/sda: 32 GiB, 34359738368 bytes, 67108864 sectors /dev/sda1 * 2048 2099199 2097152 1G 83 Linux /dev/sda2 2099200 67108863 65009664 31G 8e Linux LVM Disk /dev/sdb: 32 GiB, 34359738368 bytes, 67108864 sectors /dev/sdb1 2048 67108863 67106816 32G 8e Linux LVM Disk /dev/sdc: 64 GiB, 68719476736 bytes, 134217728 sectors [root@dbase03 ~]# fdisk /dev/sdc Welcome to fdisk (util-linux 2.37.4). 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 0xe3c38c69. Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p): Using default response p. Partition number (1-4, default 1): First sector (2048-134217727, default 2048): Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-134217727, default 134217727): Created a new partition 1 of type 'Linux' and of size 64 GiB. Command (m for help): t Selected partition 1 Hex code or alias (type L to list all): 8e Changed type of partition 'Linux' to 'Linux LVM'. Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks. [root@dbase03 ~]# fdisk -l | grep sd Disk /dev/sda: 32 GiB, 34359738368 bytes, 67108864 sectors /dev/sda1 * 2048 2099199 2097152 1G 83 Linux /dev/sda2 2099200 67108863 65009664 31G 8e Linux LVM Disk /dev/sdb: 32 GiB, 34359738368 bytes, 67108864 sectors /dev/sdb1 2048 67108863 67106816 32G 8e Linux LVM Disk /dev/sdc: 64 GiB, 68719476736 bytes, 134217728 sectors /dev/sdc1 2048 134217727 134215680 64G 8e Linux LVM [root@dbase03 ~]# pvcreate /dev/sdc1 Physical volume "/dev/sdc1" successfully created. [root@dbase03 ~]# vgcreate VGbackup /dev/sdc1 Volume group "VGbackup" successfully created [root@dbase03 ~]# lvcreate --name LVbackup -l 100%FREE VGbackup Logical volume "LVbackup" created. [root@dbase03 ~]# lvs LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert LVbackup VGbackup -wi-a----- <64.00g LVmysql VGmysql -wi-ao---- <32.00g root rhel_dbase03 -wi-ao---- <28.87g swap rhel_dbase03 -wi-ao---- <2.13g [root@dbase03 ~]# vim /etc/fstab [root@dbase03 ~]# grep LV /etc/fstab /dev/mapper/VGmysql-LVmysql /var/lib/mysql xfs defaults 1 2 /dev/mapper/VGbackup-LVbackup /backups xfs defaults 1 2 [root@dbase03 ~]# mkdir /backups [root@dbase03 ~]# mount /backups mount: /backups: wrong fs type, bad option, bad superblock on /dev/mapper/VGbackup-LVbackup, missing codepage or helper program, or other error. [root@dbase03 ~]# mkfs.xfs /dev/VGbackup/LVbackup meta-data=/dev/VGbackup/LVbackup isize=512 agcount=4, agsize=4194048 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=1, rmapbt=0 = reflink=1 bigtime=1 inobtcount=1 data = bsize=4096 blocks=16776192, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=8191, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 [root@dbase03 ~]# mount /backups [root@dbase03 ~]# df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/rhel_dbase03-root 29G 4.5G 25G 16% / /dev/sda1 1014M 298M 717M 30% /boot /dev/mapper/VGmysql-LVmysql 32G 384M 32G 2% /var/lib/mysql /dev/mapper/VGbackup-LVbackup 64G 489M 64G 1% /backups =================================================================================