Tag Archives: linux

Error when creating partitions in Linux: no free sectors available solution

When creating a partition with Linux, an error is reported:

no free sectors available

Chinese translation

No free partitions available

reason:

No free sectors available: your disk space is insufficient and there is no extra space for you to allocate; Sometimes, using various translation tools is not necessarily accurate; Everyone can understand vernacular;

The Linux partition also needs space. If you don’t even have excess disk space, of course, you can’t divide the partition;

Combined with the above figure:

Let’s take a look at all the information on the disk; With command:

fdisk -l

As a result, it is found that VDB already has a partition, which is/dev/vdb1; It happens to be the size of the whole disk, because we can’t partition again; As shown below:

  Therefore, we need to delete the partition first and then re partition it! The entire command is as follows:

fdisk /dev/vdb

d

(select the partition number. Bloggers only have one partition on this disk, and do not need to select. For multiple partitions, you need to select the partition number; if you do not understand the partition number of the disk)

Linux environment setup – Update https://apt.repos.intel.com report errors

Linux environment setup – Update https://apt.repos.intel.com report errors

Problem description and solution

Problem description

After sudo apt get update, the https://apt.repos.intel.com Error message

Hit https://mirrors.tuna.tsinghua.edu.cn focal-security/multiverse Translation-en
Hit https://mirrors.tuna.tsinghua.edu.cn focal-security/restricted Translation-en
Hit https://mirrors.tuna.tsinghua.edu.cn focal-security/universe Translation-en
Err https://apt.repos.intel.com all/main amd64 Packages
  gnutls_handshake() failed: Handshake failed
Err https://apt.repos.intel.com all/main i386 Packages
  gnutls_handshake() failed: Handshake failed
Ign https://apt.repos.intel.com all/main Translation-en_US
Ign https://apt.repos.intel.com all/main Translation-en
Err https://apt.repos.intel.com binary/ Packages
  gnutls_handshake() failed: Handshake failed
Ign https://apt.repos.intel.com binary/ Translation-en_US
Ign https://apt.repos.intel.com binary/ Translation-en
Err https://apt.repos.intel.com all/main amd64 Packages
  gnutls_handshake() failed: Handshake failed
Err https://apt.repos.intel.com all/main i386 Packages
  gnutls_handshake() failed: Handshake failed
Ign https://apt.repos.intel.com all/main Translation-en_US
Ign https://apt.repos.intel.com all/main Translation-en
Err https://apt.repos.intel.com all/main amd64 Packages
  gnutls_handshake() failed: Handshake failed
Err https://apt.repos.intel.com all/main i386 Packages
  gnutls_handshake() failed: Handshake failed
Ign https://apt.repos.intel.com all/main Translation-en_US
Ign https://apt.repos.intel.com all/main Translation-en
Err https://apt.repos.intel.com all/main amd64 Packages
  gnutls_handshake() failed: Handshake failed
Err https://apt.repos.intel.com all/main i386 Packages
  gnutls_handshake() failed: Handshake failed
Ign https://apt.repos.intel.com all/main Translation-en_US
Ign https://apt.repos.intel.com all/main Translation-en
Err https://apt.repos.intel.com all/main amd64 Packages
  gnutls_handshake() failed: Handshake failed
Err https://apt.repos.intel.com all/main i386 Packages
  gnutls_handshake() failed: Handshake failed
Ign https://apt.repos.intel.com all/main Translation-en_US
Ign https://apt.repos.intel.com all/main Translation-en
W: There is no public key available for the following key IDs:
871920D1991BC93C
W: There is no public key available for the following key IDs:
871920D1991BC93C
W: There is no public key available for the following key IDs:
871920D1991BC93C
W: There is no public key available for the following key IDs:
871920D1991BC93C
W: Failed to fetch https://apt.repos.intel.com/mkl/dists/all/main/binary-amd64/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/mkl/dists/all/main/binary-i386/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/intelpython/binary/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/ipp/dists/all/main/binary-amd64/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/ipp/dists/all/main/binary-i386/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/tbb/dists/all/main/binary-amd64/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/tbb/dists/all/main/binary-i386/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/daal/dists/all/main/binary-amd64/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/daal/dists/all/main/binary-i386/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/mpi/dists/all/main/binary-amd64/Packages  gnutls_handshake() failed: Handshake failed

W: Failed to fetch https://apt.repos.intel.com/mpi/dists/all/main/binary-i386/Packages  gnutls_handshake() failed: Handshake failed

E: Some index files failed to download. They have been ignored, or old ones used instead.

Solution

sudo rm intelproducts.list -rf
sudo rm intel-mkl.list intel-mkl.list.save -rf

UOS LTP compilation ustat test item error

environmental information

$ dpkg -l|grep libc6-dev
ii  libc6-dev:mips64el  2.28.12-1+eagle    mips64el  GNU C Library: Development Libraries and Header Files

Error message

~ltp/testcases/kernel/syscalls/ustat$ make
In file included from ../../../../include/tst_test.h:14,
                 from ustat01.c:9:
/usr/include/mips64el-linux-gnuabi64/bits/ustat.h:24:8: error: redefinition of ‘struct statfs’
 struct ustat
        ^~~~~

It shows that the struct ustat is repeatedly defined.

analysis

In the normal environment, the struct ustat structure is not defined. If you want to use this structure, you need to define it yourself. LTP also provides a custom struct ustat structure
where lapi/ustat. H is defined as follows:

//SPDX-License-Identifier: GPL-2.0-or-later

#ifndef LAPI_USTAT_H__
#define LAPI_USTAT_H__

#include "config.h"
#include <sys/types.h>
#ifdef HAVE_SYS_USTAT_H
# include <sys/ustat.h>
#elif HAVE_LINUX_TYPES_H
# include <linux/types.h>
struct ustat {
        __kernel_daddr_t f_tfree;
        ino_t f_tinode;
        char f_fname[6];
        char f_fpack[6];
};
#endif

#endif /* LAPI_USTAT_H__ */

The header file in the test code contains lapi/ustat. H, so the test code is OK.

#include "config.h"
#include "tst_test.h"

#if defined(HAVE_SYS_USTAT_H) || defined(HAVE_LINUX_TYPES_H)
#include <unistd.h>
#include <errno.h>
#include <sys/types.h>
#include <sys/stat.h>

#include "lapi/syscalls.h"
#include "lapi/ustat.h"

According to the error message, it is displayed in… /… /… /…/include/TST_ Test. H: line 14 of 14.

	...
 14 #include <unistd.h>
	 ...

Line 14 is the header file unistd. H, which is the file of libc6 dev package
file content:

...
/* Move FD's file position to OFFSET bytes from the
   beginning of the file (if WHENCE is SEEK_SET),
   the current position (if WHENCE is SEEK_CUR),
   or the end of the file (if WHENCE is SEEK_END).
   Return the new file position.  */


#define llseek lseek     
#define ustat statfs
#ifndef __USE_FILE_OFFSET64
extern __off_t lseek (int __fd, __off_t __offset, int __whence) __THROW;
#else
...

There are macro definitions

#define ustat statfs

Simply replacing statfs with ustat leads to the problem of repeatedly defining struct ustat.

Conclusion

After investigation, unistd. H belongs to libc6 dev. the version installed in the current environment is 2.28.12-1 + eagle. These two macros are not added to unistd. H in 2.28.10 and 2.28.14.

#define llseek lseek     
#define ustat statfs

It is speculated that UOS may have modified the source code of glibc. The record of adding these two macros in unistd. H was not found in the public glibc.

How to Solve Azkaban startup error

Environment.
One virtual machine (web and exector both on one machine)
MySQL 8.x (most of the later problems are due to him)
Hive-3.1.2
Azkaban-exec-server-3.84.4
Azkaban-web-server-3.84.4
1. SLF4J problems:
ERROR [StdOutErrRedirect] [Azkaban] SLF4J: Class path contains multiple SLF4J bindings.

2021/09/30 10:02:31.820 +0800 ERROR [StdOutErrRedirect] [Azkaban] SLF4J: Class path contains multiple SLF4J bindings.
2021/09/30 10:02:31.820 +0800 ERROR [StdOutErrRedirect] [Azkaban] SLF4J: Found binding in [jar:file:/opt/module/azkaban/azkaban-exec/lib/slf4j-log4j12-1.7.21.jar!/org/slf4j/impl/StaticLoggerBinder.class]
2021/09/30 10:02:31.820 +0800 ERROR [StdOutErrRedirect] [Azkaban] SLF4J: Found binding in [jar:file:/data/soft/apache-hive-3.1.2-bin/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
2021/09/30 10:02:31.820 +0800 ERROR [StdOutErrRedirect] [Azkaban] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
2021/09/30 10:02:31.823 +0800 ERROR [StdOutErrRedirect] [Azkaban] SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]

Cause: conflict with log4j package in hive
solution: delete Azkaban exec/lib/slf4j-log4j12-1.7.21.jar or add. Bak suffix
command:

cd /azkaban-exec/lib
mv slf4j-log4j12-1.7.21.jar slf4j-log4j12-1.7.21.jar.bak

2. DB connection problems(MySQL 8)
ERROR [MySQLDataSource] [Azkaban] Failed to find write-enabled DB connection.

2021/09/30 10:23:33.973 +0800 ERROR [MySQLDataSource] [Azkaban] Failed to find write-enabled DB connection. Wait 15 seconds and retry. No.Attempt = 1
java.sql.SQLException: Cannot create PoolableConnectionFactory (java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long)
        at org.apache.commons.dbcp2.BasicDataSource.createPoolableConnectionFactory(BasicDataSource.java:2294)

Reason: there is a problem with the MySQL driver package. The MySQL driver package provided by Azkaban cannot connect to MySQL 8. Just change to mysql-connector-java-5.1.47, and then a usessl error will be reported. This can be changed to MySQL. Database = Azkaban?Usessl = false in azkaban.properties. (both web and exector will report this error. Just modify it in turn)

3.
ERROR [PluginCheckerAndActionsLoader] [Azkaban] plugin path plugins/triggers doesn’t exist!
ERROR [ExecutorManager] [Azkaban] No active executors found

2021/09/30 10:47:52.799 +0800 ERROR [PluginCheckerAndActionsLoader] [Azkaban] plugin path plugins/triggers doesn't exist!
2021/09/30 10:47:52.838 +0800 INFO [AzkabanWebServer] [Azkaban] Setting timezone to Asia/Shanghai
2021/09/30 10:47:52.838 +0800 INFO [AzkabanWebServer] [Azkaban] Registering MBeans...
2021-09-30T10:47:52,869 INFO [main] azkaban.server.MBeanRegistrationManager - Bean azkaban.jmx.JmxJettyServer registered.
2021-09-30T10:47:52,871 INFO [main] azkaban.server.MBeanRegistrationManager - Bean azkaban.jmx.JmxTriggerManager registered.
2021-09-30T10:47:52,890 INFO [main] azkaban.server.MBeanRegistrationManager - Bean azkaban.jmx.JmxExecutorManager registered.
2021-09-30T10:47:52,915 INFO [main] azkaban.server.MBeanRegistrationManager - Bean org.apache.log4j.jmx.HierarchyDynamicMBean registered.
2021/09/30 10:47:52.915 +0800 INFO [AzkabanWebServer] [Azkaban] ************* loginLoggerObjName is null, make sure there is a logger with name azkaban.webapp.servlet.LoginAbstractAzkabanServlet
2021/09/30 10:47:52.916 +0800 INFO [ExecutorManager] [Azkaban] Initializing executors from database.
2021/09/30 10:47:52.941 +0800 ERROR [ExecutorManager] [Azkaban] No active executors found
2021/09/30 10:47:52.942 +0800 ERROR [StdOutErrRedirect] [Azkaban] Exception in thread "main"
2021/09/30 10:47:52.942 +0800 ERROR [StdOutErrRedirect] [Azkaban] azkaban.executor.ExecutorManagerException: No active executors found
2021/09/30 10:47:52.942 +0800 ERROR [StdOutErrRedirect] [Azkaban]       at azkaban.executor.ActiveExecutors.setupExecutors(ActiveExecutors.java:52)
2021/09/30 10:47:52.943 +0800 ERROR [StdOutErrRedirect] [Azkaban]       at azkaban.executor.ExecutorManager.setupExecutors(ExecutorManager.java:192)
2021/09/30 10:47:52.943 +0800 ERROR [StdOutErrRedirect] [Azkaban]       at azkaban.executor.ExecutorManager.initialize(ExecutorManager.java:127)
2021/09/30 10:47:52.943 +0800 ERROR [StdOutErrRedirect] [Azkaban]       at azkaban.executor.ExecutorManager.start(ExecutorManager.java:141)
2021/09/30 10:47:52.943 +0800 ERROR [StdOutErrRedirect] [Azkaban]       at azkaban.webapp.AzkabanWebServer.launch(AzkabanWebServer.java:234)
2021/09/30 10:47:52.943 +0800 ERROR [StdOutErrRedirect] [Azkaban]       at azkaban.webapp.AzkabanWebServer.main(AzkabanWebServer.java:227)

ERROR [PluginCheckerAndActionsLoader] [Azkaban] plugin path plugins/triggers doesn’t exist!
(you can refer to this.) https://blog.csdn.net/liumu243/article/details/81288884 )
this error can be ignored or run. The main problem here is that the exector is not activated

curl -G "localhsot:12321/executor?action=activate" && echo
//Appears to prove successful activation
{status:success}

Administrative Region:
https://192.168.xx.xx:8443
http://192.168.xx.xx:8081

[Solved] CentOS 6 yum update Error: Cannot find a valid baseurl for repo: base

Error Message:
Loaded plugins: fastestmirror, ovl
Setting up Update Process
Loading mirror speeds from cached hostfile
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot find a valid baseurl for repo: base

Solution:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.old  #Backup
vi /etc/yum.repos.d/CentOS-Base.repo   #New

/etc/yum.repos.d/centos-base.repo

[base]
name=CentOS-$releasever - Base
baseurl=https://vault.centos.org/6.10/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

[updates]
name=CentOS-$releasever - Updates
baseurl=https://vault.centos.org/6.10/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

[extras]
name=CentOS-$releasever - Extras
baseurl=https://vault.centos.org/6.10/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

[Solved] PHP -v Error: error while loading shared libraries: libonig.so.5:cannot open share directory

When upgrading from PHP 5.6 to PHP 7.4, you can directly replace the compiled installation package. When you enter PHP – V, you will report an error while loading shared libraries: libonig. So. 5: cannot open share directory

#php -v
#php: error while loading shared libraries: libonig.so.5:cannot open share directory

Solution:

Step 1

Modify /ect/ld.so.conf     Add the following line

#vim /etc/ld.so.conf
include ls.so.conf.d/*.conf
/usr/local/lib
/usr/local/x264/lib
/usr/local/openssl/lib
/usr/local/python3.7.1/lib

After saving   Execute ldconfig

#ldconfig

Step 2:

Install oniguruma library

Download Link:

https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-devel-6.8.2-1.el7.x86_64.rpm

https://download-ib01.fedoraproject.org/pub/epel/7/x86_64/Packages/o/oniguruma-6.8.2-1.el7.x86_64.rpm

oniguruma-6.8.2-1.el7.x86 64.rpm

oniguruma-devel-6.8.2-1.el7.x86 64.rpm

Use the follow commands to install:

#rpm -ivh oniguruma-devel-6.8.2-1.el7.x86_64
#rpm -ivh oniguruma-6.8.2-1.el7.x86_64

Then run the command PHP – V     Perfect display

If installation error

Generating autotools files.
./autogen.sh: line 6: autoreconf: command not found

Solution:

[root@yjweb oniguruma-6.9.4]# yum install autoconf automake libtool

[Solved] Error: no “print“ mailcap rules found for type “text/plain“

Blog background

The author has always wanted to understand how to use the Print command under Linux?

Direct Print hello. TXT will report an error

Error: no "print" mailcap rules found for type "text/plain"

Specific operation

ubuntu@139:~/temp $ cat /etc/mailcap | egrep print
application/x-troff-man; /usr/bin/nroff -mandoc -Tutf8; copiousoutput; print=/usr/bin/nroff -mandoc -Tutf8 | print text/plain:-
text/troff; /usr/bin/nroff -mandoc -Tutf8; copiousoutput; print=/usr/bin/nroff -mandoc -Tutf8 | print text/plain:-
text/plain; view %s; edit=vim %s; compose=vim %s; test=test -x /usr/bin/vim; print=cat %s; needsterminal
application/x-tar; /bin/tar tvf '%s'; print=/bin/tar tvf - | print text/plain:-; copiousoutput
application/x-gtar; /bin/tar tvf '%s'; print=/bin/tar tvf - | print text/plain:-; copiousoutput
application/x-ustar; /bin/tar tvf '%s'; print=/bin/tar tvf - | print text/plain:-; copiousoutput
ubuntu@139:~/temp $ ls
hello  hi.txt
ubuntu@139:~/temp $ cat hi.txt 
hello
ubuntu@139:~/temp $ print hi.txt 
hello

This is the situation after I edit the mailcap file. Pay attention to this line

text/plain; view %s; edit=vim %s; compose=vim %s; test=test -x /usr/bin/vim; print=cat %s; needsterminal

That is, just add a print command rule after text/plain, which is so simple.

How to Solve Docker Run Error: standard_init_linux.go:219: exec user process caused: exec format error

Use MAC M1 build image to run on Linux and report standard_ init_ linux.go:219: exec user process caused: exec format error

The main reason for this problem is that golang compilation cannot cross platform, that is, different systems or different CPU cores will cause this error. The golang code compiled under Linux arm cannot be run under Linux x86; Similarly, the image of a project with golang code cannot cross platform. The solution is very simple. When building, add the — platform Linux/AMD64 parameter

docker build --platform linux/amd64 -t tag .

Aliyunshield occupies port 80 error: Error starting userland proxy: listen tcp 0.0.0.0:80: bind: address already in use

Error starting userland proxy: listen TCP 0.0.0.0:80: bind: address already in use
today, it was found that port 80 was occupied on Ali’s server. The advantages are inexplicable. An investigation found that the process aliyundun occupied the port

tcp          100.100.100.200:80      TIME_WAIT   -                   
tcp          100.100.30.25:80        ESTABLISHED 1472/AliYunDun      
tcp          100.100.100.200:80      TIME_WAIT   -          

Displaying with kill is not allowed

[root@lingg ~]# kill 1472
-bash: kill: (1472) - Disallowed operations
[root@lingg ~]# kill -9 1472
-bash: kill: (1472) - Disallowed operations

Then I found the solution online as follows

sudo fuser -k 80/tcp

```bash
[root@lingg ~]# sudo fuser -k 80/tcp
80/tcp:               1267  1272  1273  1274

Done!

Kvm internal error: process exited :cannot set up guest memory ‘pc.ram‘:Cannot allocate memory

An error message indicates that the memory is insufficient and cannot be allocated. Check that the physical machine memory is used normally. After modifying the virtual machine memory, an error message is still reported when starting

report errors:

At this time, you need to see how much memory the host can allocate

sysctl -a | grep overcommit

Kernel parameter overcommit_ memory  

It is   Memory allocation strategy

Optional values: 0, 1, 2
0 indicates that the kernel will check whether there is enough available memory for processes to use; If there is enough available memory, the memory application is allowed; Otherwise, the memory request fails and the error is returned to the application process
1 indicates that the kernel is allowed to allocate all physical memory regardless of the current memory state
2 indicates that the kernel allows to allocate more memory than the sum of all physical memory and swap space

What are overcommit and oom

     Linux replies “yes” to most requests for memory so that it can run more and larger programs. Because after applying for memory, memory will not be used immediately. This technology is called overcommit. When Linux finds that there is insufficient memory, an oom killer (OOM = out of memory) occurs. It will choose to kill some processes (user state processes, not kernel threads) to free memory.

     When oom killer happens, which processes will Linux choose to kill?The function to select a process is oom_ Badness function (in mm/oom_kill. C), which calculates the number of points (0 ~ 1000) for each process. The higher the number of points, the more likely the process is to be killed. The number of points per process is the same as oom_ score_ Adj related, and OOM_ score_ Adj can be set (- 1000 min, 1000 max).

resolvent:

      Simply follow the prompts (set vm.overcommit_memory to 1):

      There are three ways to modify kernel parameters, but with root permission:

    (1) Edit/etc/sysctl.conf to vm.overcommit_ Memory = 1, then sysctl – P makes the configuration file effective

  (2)sysctl vm.overcommit_ memory=1

  (3)echo 1 >/proc/sys/vm/overcommit_ memory

Linunx—@ error/constitute.c/WriteImage/1037.

Learn ROS in linunx system. During the programming process of testing publisher publisher, execute ‘learn’ to be tested_ The following error occurred while publishing. Py ‘file:

resolvent:

In ‘learn_ Add code on the first line of the publish. Py ‘file: #/ Usr/bin/env python, click “save” in the upper right corner after adding.

The operation is as follows: