Tag Archives: Centos

SSD [failed] failed to mount / sysRoot solution

[Failed] Failed to mount /sysroot [Failed] Failed to mount /sysroot

[  OK  ] Reached target Remote File Systems (Pre).
[  OK  ] Reached target Remote File Systems.
[8.901016] SGI XFS with ACLs, security attributes, no debug enabled
[8.912417] XFS (nvme0n1p3): Mounting V5 Filesystem
[8.960550] XFS (nvme0n1p3): Starting recovery (logdev: internal)
[8.973696] XFS (nvme0n1p3): Metadata corruption detected at __write_verify+0xfd/0x110 [xfs], xfs_dir3_leaf1 block 0x1900a00
[8.984887] XFS (nvme0n1p3): Unmount and run xfs_repair
[8.990104] XFS (nvme0n1p3): First 64 bytes of corrupted metadata buffer:
[8.996876] ffff9d79d0a6e000: 00 00 00 00 00 00 00 00 3d f1 00 00 17 bf 25 cb  ........=.....%.
[9.005544] ffff9d79d0a6e010: 00 00 00 00 01 90 0a 00 00 00 00 26 00 00 a2 aa  ...........&....
[9.014214] ffff9d79d0a6e020: 11 51 07 ca d1 a4 47 1a a2 a5 c6 99 86 e3 c6 6d  .Q....G........m
[9.022885] ffff9d79d0a6e030: 00 00 00 00 02 00 00 42 01 f0 00 2d 00 00 00 00  .......B...-....
[9.031560] XFS (nvme0n1p3): xfs_do_force_shutdown(0x8) called from line 1391 of file fs/xfs/xfs_buf.c.  Return address = 0xffffffffc063afb7
[9.044120] XFS (nvme0n1p3): Corruption of in-memory data detected.  Shutting down filesystem
[9.052618] XFS (nvme0n1p3): Please umount the filesystem and rectify the problem(s)
[9.060415] XFS (nvme0n1p3): log mount/recovery failed: error -117
[9.066595] XFS (nvme0n1p3): log mount failed
[FAILED] Failed to mount /sysroot.
See 'systemctl status sysroot.mo
Generating "/run/initramfs/rdsosreport.txt"

Baidu the online method under the
# code xfs_repair - v - L/dev/dm - 0
on failure, seemingly equipment is wrong, the dm to nvme0n1p3 0, perform OK, the following figure

:/# xfs_repair -v -L /dev/nvme0n1p3
Phase 1 - find and verify superblock...
        - block cache size set to 3003408 entries
Phase 2 - using internal log
        - zero log...
zero_log: head block 42497 tail block 42014
ALERT: The filesystem has valuable metadata changes in a log which is being
destroyed because the -L option was used.
        - scan filesystem freespace and inode maps...
out-of-order bno btree record 9 (289310 2) block 0/1
block (0,289310-289310) multiply claimed by bno space tree, state - 1
agi unlinked bucket 2 is 1214018 in ag 2 (inode=68322882)
agi unlinked bucket 10 is 1215178 in ag 2 (inode=68324042)
agi unlinked bucket 13 is 1140429 in ag 2 (inode=68249293)
agi unlinked bucket 14 is 1213902 in ag 2 (inode=68322766)
agi unlinked bucket 15 is 1215183 in ag 2 (inode=68324047)
agi unlinked bucket 17 is 1140433 in ag 2 (inode=68249297)
agi unlinked bucket 18 is 1215186 in ag 2 (inode=68324050)
agi unlinked bucket 20 is 1140436 in ag 2 (inode=68249300)
agi unlinked bucket 26 is 157018 in ag 2 (inode=67265882)
agi unlinked bucket 29 is 1214045 in ag 2 (inode=68322909)
agi unlinked bucket 30 is 1214430 in ag 2 (inode=68323294)
agi unlinked bucket 37 is 1213989 in ag 2 (inode=68322853)
agi unlinked bucket 39 is 1213991 in ag 2 (inode=68322855)
agi unlinked bucket 40 is 1213992 in ag 2 (inode=68322856)
agi unlinked bucket 41 is 1213993 in ag 2 (inode=68322857)
agi unlinked bucket 44 is 1213996 in ag 2 (inode=68322860)
agi unlinked bucket 49 is 1214001 in ag 2 (inode=68322865)
agi unlinked bucket 54 is 1214006 in ag 2 (inode=68322870)
sb_ifree 254, counted 228
sb_fdblocks 10399804, counted 10408087
        - found root inode chunk
Phase 3 - for each AG...
        - scan and clear agi unlinked lists...
        - process known inodes and perform inode discovery...
        - agno = 0
data fork in ino 1797907 claims free block 238369
imap claims a free inode 2180228 is in use, correcting imap and clearing inode
cleared inode 2180228
        - agno = 1
imap claims in-use inode 33968729 is free, correcting imap
        - agno = 2
        - agno = 3
        - process newly discovered inodes...
Phase 4 - check for duplicate blocks...
        - setting up duplicate extent list...
        - check for inodes claiming duplicate blocks...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
entry "default.hostsfile" in shortform directory 565517 references free inode 2180236
junking entry "default.hostsfile" in directory inode 565517
Phase 5 - rebuild AG headers and trees...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
        - reset superblock...
Phase 6 - check inode connectivity...
        - resetting contents of realtime bitmap and summary inodes
        - traversing filesystem ...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
entry "tmp" in directory inode 100786852 not consistent with .. value (34441335) in inode 2180231,
junking entry
        - traversal finished ...
        - moving disconnected inodes to lost+found ...
disconnected dir inode 2180231, moving to lost+found
disconnected inode 67265882, moving to lost+found
disconnected inode 67313620, moving to lost+found
disconnected inode 68249293, moving to lost+found
disconnected inode 68249297, moving to lost+found
disconnected inode 68249300, moving to lost+found
disconnected inode 68322766, moving to lost+found
disconnected inode 68322853, moving to lost+found
disconnected inode 68322855, moving to lost+found
disconnected inode 68322856, moving to lost+found
disconnected inode 68322857, moving to lost+found
disconnected inode 68322860, moving to lost+found
disconnected inode 68322865, moving to lost+found
disconnected inode 68322870, moving to lost+found
disconnected inode 68322882, moving to lost+found
disconnected inode 68322909, moving to lost+found
disconnected inode 68322910, moving to lost+found
disconnected inode 68323294, moving to lost+found
disconnected inode 68324042, moving to lost+found
disconnected inode 68324047, moving to lost+found
disconnected inode 68324050, moving to lost+found
Phase 7 - verify and correct link counts...
resetting inode 33554498 nlinks from 451 to 452
resetting inode 100786852 nlinks from 3 to 2
resetting inode 2180228 nlinks from 2 to 3
resetting inode 2180237 nlinks from 1 to 2
Maximum metadata LSN (38:42014) is ahead of log (1:2).
Format log to cycle 41.

        XFS_REPAIR Summary    Thu Jan 19 06:06:46 2017

Phase		Start		End		Duration
Phase 1:	01/19 06:06:46	01/19 06:06:46	
Phase 2:	01/19 06:06:46	01/19 06:06:46	
Phase 3:	01/19 06:06:46	01/19 06:06:46	
Phase 4:	01/19 06:06:46	01/19 06:06:46	
Phase 5:	01/19 06:06:46	01/19 06:06:46	
Phase 6:	01/19 06:06:46	01/19 06:06:46	
Phase 7:	01/19 06:06:46	01/19 06:06:46	

Total run time: 
done
:/# 

Then perform

:/# xfs_repair dev/nvme0n1p3

The results are as follows

Phase 1 - find and verify superblock...
Phase 2 - using internal log
        - zero log...
        - scan filesystem freespace and inode maps...
        - found root inode chunk
Phase 3 - for each AG...
        - scan and clear agi unlinked lists...
        - process known inodes and perform inode discovery...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
        - process newly discovered inodes...
Phase 4 - check for duplicate blocks...
        - setting up duplicate extent list...
        - check for inodes claiming duplicate blocks...
        - agno = 0
        - agno = 1
        - agno = 2
        - agno = 3
Phase 5 - rebuild AG headers and trees...
        - reset superblock...
Phase 6 - check inode connectivity...
        - resetting contents of realtime bitmap and summary inodes
        - traversing filesystem ...
        - traversal finished ...
        - moving disconnected inodes to lost+found ...
Phase 7 - verify and correct link counts...
done
:/# 

Mount can succeed, too

:/# mount -o rw dev/nvme0n1p3 /data0
[  853.650067] XFS (nvme0n1p3): Mounting V5 Filesystem
[  853.777152] XFS (nvme0n1p3): Ending clean mount
:/# cd data0/
:/data0# ls
bin   compass  etc   lib    lost+found	mnt  proc  run	 srv  tmp   usr
boot  dev      home  lib64  media	opt  root  sbin  sys  upan  var
:/data0# 

Let’s try that again

CentOS Linux 7 (Core)
Kernel 3.10.0-862.11.6.el7.x86_64 on an x86_64

localhost login: 

done

VMware virtual machine installation of vmware tools, VMware shared folder location

VMware Virtual Machine installs VMware Tools, VMware shared folder location
The default shared path for VMware ToolsvMware is at/MNT/HGFS

VMware Virtual Machine installs VMware Tools

yum -y Update
m -y Install Net-Tools perl GCC GCC C ++ kernel-headers kernel-devel
When the update is complete, restart the server
reboot
Click
virtual machine (M)-> on the virtual machine screen; Install the VMware Tools
mkdir -p /home
mkdir /mnt/cdrom
mount /dev/cdrom /mnt/cdrom
Cp/MNT/cdrom/VMwareTools – 10.3.2-9925305. The tar. Gz/home
CD /home
tar ZXVF vmwaretools-10.3.2-9925305.tar.gz
vmware-tools-distrib
CD vmware-tools-distrib
./vmware-install.pl
Just keep hitting enter,
Restart CentOS when done
Once installed, the HGFS directory is automatically created under/MNT
The default shared path for VMware is at/MNT/HGFS
If the shared/MNT/HGFS file is still not found, reinstall the VMware Tools

Centos8 solves the problem of “failed to set locale, defaulting to c.utf-8”

Problem description

>
>
>
>
>
>
>
>
>

systemctl status mysqld.service

journalctl -xe


Failed to set locale, defaulting to C.UTF-8
How to solve
To set the system locale, use the localectl command. For example, if you want to use UTF-8 encoded American English (US), run the following command.
download centos docker mirror system default is ISO/IEC 15897 character set
need to utf-8.
to install all of the first character set

dnf install langpacks-en glibc-all-langpacks -y

Set character set

localectl set-locale LANG=en_US.UTF-8

Restart the mysql
bingo!!!!!!
success

Plug in loaded: fastmirror, langpacks / var / run/ yum.pid Locked, another program with PID 2323 is running

Question:
The plugin is loaded: FastestMirror, Langpacks
/var/run/yum.pid is locked and another program with pid 2323 is running.
Another app is currently holding the yum lock; waiting for it to exit…
Another application: PackageKit
Memory: 155 MB RSS (574 MB VSZ)
Started: Mon Mar 23 14:13:26 2020-01:07 before
Status: Running, process ID: 2323
Solution:
[[email protected] ~]#

rm -f /var/run/yum.pid

 

Call to undefined function mysql_ Connect() solution summary

A:
Use the phpinfo() function in your PHP code to see PHP basics
Mysql_connect () has been deprecated since PHP5.0, and is deprecated in PHP7.0. Mysqli_connect () is used instead if PHP is 7.0 or higher
Method 2:
Missing MySQL module caused by PHP installation
Mysql> install mysql from CentOs
yum install php-mysql -y
If installed, report the following warning
Headers and client library minor version mismatch. Headers:
This is due to the higher version of MySQL, the lower version of the MySQL Client API
You can uninstall php-mysql first
yum remove php-mysql -y
then
yum install php-mysqlnd -y
Finally, restart Apache
systemctl restart httpd
Ubuntu install MySQL module:
Apt to get the install php5 – mysql
Sudo DPKG — reconfigure php5 – mysql
sudo /etc/init.d/mysql restart
sudo /etc/init.d/apache2 restart
Three:
If the first two methods fail, try opening the MySQL module extension in the php.ini configuration file
Php.ini = php.ini; Extension =” related MySQL module “; To get rid of
Then make sure that the dir of extension points to the directory where the extension resides
Windows is usually under Ext and CentOS is under /usr/lib64/php.modules
The above information can be found in the PHPINFO printed information
However, when I encountered this problem, I just needed to install the PHP-MySQL module, and I didn’t need to modify php.ini
My environment is Centos7 and PHP version is PHP5.4
 

A solution to the default invalid host only mode of CentOS virtual machine in VirtualBox

Because the network card is not activated at boot time.
Go to /etc/sysconfig/network-scripts/
Inside is the network card configuration file. Usually the hostonly configuration file name is: IFCFG-ENP0S8
If you open this file, you can see the ONBOOT=no line configuration. Change it to ONBOOT=yes and restart the virtual machine.

Php7 compiles collect2: error: LD returned 1 exit status

Problem description
PHP7: PHP7: PHP7: PHP7: PHP7: PHP7: PHP7

/usr/bin/ld: ext/ldap/.libs/ldap.o: undefined reference to symbol ‘ber_strdup’
/usr/bin/ld:note: ‘ber_strdup’ is defined in DSO /lib64/liblber-2.4.so.2 so try adding it to the linker command line
/lib64/liblber-2.4.so.2:could not read symbols: Invalid operation
collect2:error: ld returned 1 exit status
make: *** [sapi/cli/php] Error 1

The solution
In the PHP source code directory vi Makefile open the file, find the EXTRA_LIBS line, line at the end of the add - llber save out of the again make

The solution of centos7 in VMware virtual machine unable to access after installing nginx

VMware virtual machine in Centos7 after installing NGINX is not native access solution
To install Nginx on Linux, see: Linux Centos7 to install Nginx
The firewall of CentOS is changed to “iptables”, which is no longer called “iptables”. The firewall of CentOS is changed to “iptables”, which is no longer called “iptables”. The firewall of CentOS is changed to “iptables”.

firewall-cmd --zone=public --add-port=80/tcp --permanent  

Command meaning:
— zone # scope
— add-port=80/ TCP # Add port in format: port/communication protocol
— permanent # is permanent and will fail if restarted without this parameter
Restart firewall:

systemctl stop firewalld.service  
systemctl start firewalld.service  

Refresh the access again, as shown in the figure below:

QT encountered in CentOS installation( qt.qpa.plugin : Could not load the Qt platform plugin “xcb” )

I don’t believe it. How hard is it to install Qt on Linux?I reinstalled the system several times and got drunk. Here are the problems I encountered:
Round1:
After installation, execute the QTCreator prompt:
Linux qt “qt.qpa.plugin: Could not load the Qt platform plugin “xcb” ”

sudo gedit ~/.bashrc
sudo gedit ~/.bashrc
sudo gedit ~/.bashrc

export QT_DEBUG_PLUGINS=1
export LD_LIBRARY_PATH=/opt/Qt5.13.1/5.13.1/gcc_64/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/opt/Qt5.13.1/Tools/QtCreator/lib:$LD_LIBRARY_PATH

The last two sentences are from the link library path added to the search path, do not know whether to work.
Emphasized in fact the first sentence here, and after the configuration items, QtCreator will output a lot of information, so we can be targeted, step by step to solve the problem/
the changes to take effect

sudo source  ~/.bashrc

round2:
Execute the QtCreator program again from the command line, and output a bunch of log information. Skip to the end to find a prompt:
always load the library/opt/Qt5.13.1/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb. So: (libxkbcommon – x11. So. 0: unable to open the Shared object file: Don’t have that file or directory)
QLibraryPrivate: : loadPlugin failed on “/ opt/Qt5.13.1/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb. So” : “Always load the library/opt/Qt5.13.1/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb. So: (libxkbcommon – x11. So. 0: unable to open the Shared object file: no files or directories)”

obviously failure load of dynamic link library, first check whether there is the file exists, then look at whether the dependent libraries are able to find success:

ldd  /opt/Qt5.13.1/Tools/QtCreator/lib/Qt/plugins/platforms/libqxcb.so

Libxkbcommon is not available, you need to install the library, use yum to install:

yum -y install libxkbcommon-x11-devel

Round 3 lacks DBUS
If you continue, there is still an error. If you skip to the last line, there is still an error
/ opt/Qt5.13.1/Tools/QtCreator/bin/QtCreator: relocation error:/opt/Qt5.13.1/Tools/QtCreator/lib/Qt/plugins/platforms /.. /.. /lib/ libqt5dbus.so.5: Symbol dbus_message_set_allow_interactive_authorization, version LIBDBUS_1_3 not defined in file libbus-1.so.3 with link time reference

yum -y install dbus-devel

round4
Continue with the following error
Opt/Qt5.13.1/Tools/QtCreator/bin/QtCreator: symbol lookup error:/opt/Qt5.13.1/Tools/QtCreator/lib/Qt/plugins/platforms /.. /.. /lib/ libqt5xcbqpa.so.5: undefined Symbol: FT_GET_FONT_FORMAT

yum -y install freetype-devel

Export QT_DEBUG_PLUGINS=1. You may not have the same problem as me, but with the output, you can solve it step by step.