Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Created attachment 847153[details]
audit.log
Description of problem:
I am use Amazon EC2 VDS root partition have size 5Gb, so I add another disk for my data. This is disk mounted in /mnt
# mount
/dev/xvda1 on / type ext4 (rw)
none on /proc type proc (rw)
none on /sys type sysfs (rw)
none on /dev/pts type devpts (rw,gid=5,mode=620)
none on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/xvdb on /mnt type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
I am stop MariaDB and move /var/lib/mysql to /mnt/mysql and create symbolic link
# ln -s /mnt/mysql /var/lib/mysql
after it I run restorecon -vR /
But after moving mysql data folder SELinux interrupt running MariaDB
[root@ip-172-31-5-20 ~]# ls -Zla /mnt/
total 40
drwxr-xr-x. 7 system_u:object_r:mnt_t:s0 root root 4096 Янв 8 11:09 .
dr-xr-xr-x. 25 system_u:object_r:root_t:s0 root root 4096 Янв 8 12:36 ..
drwxr-xr-x. 2 system_u:object_r:mnt_t:s0 crmdev crmdev 4096 Янв 7 22:17 logs
drwx------. 2 system_u:object_r:mnt_t:s0 root root 16384 Янв 7 21:57 lost+found
drwxr-xr-x. 6 system_u:object_r:mnt_t:s0 mysql mysql 4096 Янв 8 12:35 mysql
drwxr-xr-x. 8 system_u:object_r:mnt_t:s0 crmdev crmdev 4096 Янв 7 19:56 rpmbuild
drwxr-xr-x. 3 system_u:object_r:mnt_t:s0 crmdev crmdev 4096 Янв 7 22:22 www
[root@ip-172-31-5-20 ~]# ls -Zlad /var/lib/mysql/
drwxr-xr-x. 6 system_u:object_r:mnt_t:s0 mysql mysql 4096 Янв 8 12:35 /var/lib/mysql/
[root@ip-172-31-5-20 ~]# setenforce 1
[root@ip-172-31-5-20 ~]# service mysql restart
MySQL server PID file could not be found! [FAILED]
Starting MySQL.The server quit without updating PID file (/[FAILED]mysql/ip-172-31-5-20.eu-west-1.compute.internal.pid).
[root@ip-172-31-5-20 ~]# setenforce 0
[root@ip-172-31-5-20 ~]# service mysql restart
MySQL server PID file could not be found! [FAILED]
Starting MySQL... [ OK ]
[root@ip-172-31-5-20 ~]# semodule -DB
[root@ip-172-31-5-20 ~]# service mysql restart
Shutting down MySQL. [ OK ]
Starting MySQL.. [ OK ]
[root@ip-172-31-5-20 ~]# ausearch -m avc,user_avc -ts recent > /tmp/audit.log
[root@ip-172-31-5-20 ~]# semodule -B
I am attach audit.log here
# ls -lZ /mnt/mysql
-rw-rw----. mysql mysql system_u:object_r:file_t:s0 aria_log.00000001
-rw-rw----. mysql mysql system_u:object_r:file_t:s0 aria_log_control
drwx------. mysql mysql system_u:object_r:file_t:s0 bankdev
-rw-rw----. mysql mysql system_u:object_r:file_t:s0 ibdata1
-rw-rw----. mysql mysql system_u:object_r:file_t:s0 ib_logfile0
-rw-rw----. mysql mysql system_u:object_r:file_t:s0 ib_logfile1
-rw-r-----. mysql root system_u:object_r:file_t:s0 ip-172-31-5-20.eu-west-1.compute.internal.err
-rw-rw----. mysql mysql unconfined_u:object_r:mnt_t:s0 ip-172-31-5-20.eu-west-1.compute.internal.pid
drwx--x--x. mysql mysql system_u:object_r:file_t:s0 mysql
srwxrwxrwx. mysql mysql unconfined_u:object_r:mnt_t:s0 mysql.sock
drwx------. mysql mysql system_u:object_r:file_t:s0 performance_schema
drwxr-xr-x. mysql mysql system_u:object_r:file_t:s0 test
(In reply to Daniel Walsh from comment #3)
> Why not mount the new disk right at /var/lib/mysql/
>
> ANd then run restorecon on it.
Because I needed move to another partition not only mysql data.
Also I move application and attachments which stored in file system and logs.
Then you could bind mount rather then symlink and run the restorecon.
mount -o bind /mnt/mysql /var/lib/mysql
restorecon -R -v /var/lib/mysql
Make sure you add a link in your fstab.
If you really want the current setup, you could setup alternate labeling.
# semanage fcontext -a -e -t /var/lib/mysql /mnt/mysql
# restorecon -R -v /var/lib/mysql
Created attachment 847153 [details] audit.log Description of problem: I am use Amazon EC2 VDS root partition have size 5Gb, so I add another disk for my data. This is disk mounted in /mnt # mount /dev/xvda1 on / type ext4 (rw) none on /proc type proc (rw) none on /sys type sysfs (rw) none on /dev/pts type devpts (rw,gid=5,mode=620) none on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0") /dev/xvdb on /mnt type ext4 (rw) none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw) I am stop MariaDB and move /var/lib/mysql to /mnt/mysql and create symbolic link # ln -s /mnt/mysql /var/lib/mysql after it I run restorecon -vR / But after moving mysql data folder SELinux interrupt running MariaDB [root@ip-172-31-5-20 ~]# ls -Zla /mnt/ total 40 drwxr-xr-x. 7 system_u:object_r:mnt_t:s0 root root 4096 Янв 8 11:09 . dr-xr-xr-x. 25 system_u:object_r:root_t:s0 root root 4096 Янв 8 12:36 .. drwxr-xr-x. 2 system_u:object_r:mnt_t:s0 crmdev crmdev 4096 Янв 7 22:17 logs drwx------. 2 system_u:object_r:mnt_t:s0 root root 16384 Янв 7 21:57 lost+found drwxr-xr-x. 6 system_u:object_r:mnt_t:s0 mysql mysql 4096 Янв 8 12:35 mysql drwxr-xr-x. 8 system_u:object_r:mnt_t:s0 crmdev crmdev 4096 Янв 7 19:56 rpmbuild drwxr-xr-x. 3 system_u:object_r:mnt_t:s0 crmdev crmdev 4096 Янв 7 22:22 www [root@ip-172-31-5-20 ~]# ls -Zlad /var/lib/mysql/ drwxr-xr-x. 6 system_u:object_r:mnt_t:s0 mysql mysql 4096 Янв 8 12:35 /var/lib/mysql/ [root@ip-172-31-5-20 ~]# setenforce 1 [root@ip-172-31-5-20 ~]# service mysql restart MySQL server PID file could not be found! [FAILED] Starting MySQL.The server quit without updating PID file (/[FAILED]mysql/ip-172-31-5-20.eu-west-1.compute.internal.pid). [root@ip-172-31-5-20 ~]# setenforce 0 [root@ip-172-31-5-20 ~]# service mysql restart MySQL server PID file could not be found! [FAILED] Starting MySQL... [ OK ] [root@ip-172-31-5-20 ~]# semodule -DB [root@ip-172-31-5-20 ~]# service mysql restart Shutting down MySQL. [ OK ] Starting MySQL.. [ OK ] [root@ip-172-31-5-20 ~]# ausearch -m avc,user_avc -ts recent > /tmp/audit.log [root@ip-172-31-5-20 ~]# semodule -B I am attach audit.log here