您的位置:首页 > 其它

报错总结ing

2020-08-06 19:15 113 查看

文章目录

通过xshell/SecureCRT等软件远程连接不上服务器

ping 探测对方主机是否内容能通 IP地址
主机的ip地址是否存在或者正确,网络服务是否启动
查看远程连接服务是否启动,端口号是否是22
虚拟网络编辑器是否正确配置
查看VMware相关服务是否正常启动
查看VMnet8这个网卡是否启用
虚拟网络编辑器没有生效,重新配置一下

vim故障

E325: ATTENTION
Found a swap file by the name ".passwd.swp"
owned by: root   dated: Thu Jul 16 20:14:27 2020
file name: ~root/passwd
modified: YES
user name: root   host name: qls
process ID: 81955
While opening file "passwd"
dated: Thu Jul 16 19:11:50 2020

(1) Another program may be editing the same file.  If this is the case,
be careful not to end up with two different instances of the same
file when making changes.  Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r passwd"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file ".passwd.swp"
to avoid this message.

Swap file ".passwd.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:

#故障

vim非正常退出导致的

按照提示 进行恢复   保存退出之后

在手动的删除这个文件

[root@qls ~]# rm -f .passwd.swp

用户命令行故障

[root@CentOS7 ~]# passwd   test
Changing password for user test.
New password:
BAD PASSWORD: The password is a palindrome
Retype new password:
passwd: all authentication tokens updated successfully.
[root@CentOS7 ~]# rm  -f  /home/test/.bash*

#家目录里面的环境变量配置文件不存在
-bash-4.2$
-bash-4.2$

#解决

-bash-4.2$ pwd
/home/test
-bash-4.2$ cp -a  /etc/skel/.bash*  ./

Permission denied		#权限不足

[root@CentOS7 ~]# mkdir  -m  700  /home/test
[root@CentOS7 ~]# ll -d /home/test
drwx------ 2 root root 6 Jul 21 10:53 /home/test
[root@CentOS7 ~]# chown  -R  test.test /home/test

-bash-4.2$ cd /home/test
-bash-4.2$ pwd
/home/test
-bash-4.2$ cp -a  /etc/skel/.bash*  ./
-bash-4.2$ logout
#重新登陆生效

硬盘故障

[root@qls ~]# fdisk   /dev/sdb
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Command (m for help): n
Partition type:
p   primary (2 primary, 1 extended, 1 free)
l   logical (numbered from 5)
Select (default p):
Using default response p
Selected partition 4
First sector (127928320-209715199, default 127928320):
Using default value 127928320
Last sector, +sectors or +size{K,M,G} (127928320-209715199, default 209715199): +2G
Partition 4 of type Linux and of size 2 GiB is set

Command (m for help): p

Disk /dev/sdb: 107.4 GB, 107374182400 bytes, 209715200 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x5b8d3e75

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1            2048    20973567    10485760   83  Linux
/dev/sdb2        20973568   125831167    52428800    5  Extended
/dev/sdb3       125831168   127928319     1048576   83  Linux
/dev/sdb4       127928320   132122623     2097152   83  Linux
/dev/sdb5        20975616    62918655    20971520   83  Linux

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table. The new table will be used at
the next reboot or after you run partprobe(8) or kpartx(8)
Syncing disks.
[root@qls ~]#

#准备2G的分区
[root@qls ~]# dd  if=/dev/zero  of=/opt/test.log  bs=100M  count=21
dd: error writing ‘/opt/test.log’: No space left on device
21+0 records in
20+0 records out
2099183616 bytes (2.1 GB) copied, 3.34918 s, 627 MB/s

[root@qls ~]# echo  "123" >> /opt/file.txt
-bash: echo: write error: No space left on device		#磁盘空间不足

#解决:
检查磁盘空间

[root@qls ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        98G  6.4G   92G   7% /
devtmpfs        980M     0  980M   0% /dev
tmpfs           991M     0  991M   0% /dev/shm
tmpfs           991M  9.6M  981M   1% /run
tmpfs           991M     0  991M   0% /sys/fs/cgroup
/dev/sda1       497M  120M  378M  25% /boot
tmpfs           199M     0  199M   0% /run/user/0
/dev/sdb1        10G  1.1G  9.0G  11% /fdisk01
/dev/sdb4       2.0G  2.0G   20K 100% /opt

#找到这个大文件  确认好之后在删
[root@qls ~]# du  -sh  /opt/*  | grep  'G'
2.0G	/opt/test.log

一级一级往下找

[root@qls ~]# echo  "123"  >>/opt/test.txt
-bash: /opt/test.txt: No space left on device
[root@qls ~]#

[root@qls ~]# df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda3        98G  6.4G   92G   7% /
devtmpfs        980M     0  980M   0% /dev
tmpfs           991M     0  991M   0% /dev/shm
tmpfs           991M  9.6M  981M   1% /run
tmpfs           991M     0  991M   0% /sys/fs/cgroup
/dev/sda1       497M  120M  378M  25% /boot
tmpfs           199M     0  199M   0% /run/user/0
/dev/sdb1        10G  1.1G  9.0G  11% /fdisk01
/dev/sdb4       2.0G  582M  1.5G  29% /opt

[root@qls ~]# df -i
Filesystem       Inodes   IUsed    IFree IUse% Mounted on
/dev/sda3      51123712   46093 51077619    1% /
devtmpfs         250786     417   250369    1% /dev
tmpfs            253511       1   253510    1% /dev/shm
tmpfs            253511     774   252737    1% /run
tmpfs            253511      16   253495    1% /sys/fs/cgroup
/dev/sda1        256000     326   255674    1% /boot
tmpfs            253511       1   253510    1% /run/user/0
/dev/sdb1       5242880       4  5242876    1% /fdisk01
/dev/sdb4       1048576 1048576        0  100% /opt

[root@qls ~]# find  /opt/ -type  d   -size  +2M  | xargs  ls -lhd
drwxr-xr-x 2 root root 3.8M Aug  3 12:27 /opt/test/test01
drwxr-xr-x 2 root root 3.8M Aug  3 12:27 /opt/test/test02
drwxr-xr-x 2 root root 3.8M Aug  3 12:27 /opt/test/test03
drwxr-xr-x 2 root root 3.8M Aug  3 12:27 /opt/test/test04
drwxr-xr-x 2 root root 3.7M Aug  3 12:27 /opt/test/test05

[root@qls ~]# find  /opt/ -type  d   -size  +1M  | xargs  ls -lhd
drwxr-xr-x 2 root root 1.2M Aug  3 12:25 /opt/test/data01
drwxr-xr-x 2 root root 1.2M Aug  3 12:25 /opt/test/data02
drwxr-xr-x 2 root root 1.2M Aug  3 12:25 /opt/test/data03
drwxr-xr-x 2 root root 1.2M Aug  3 12:25 /opt/test/data04
drwxr-xr-x 2 root root 1.2M Aug  3 12:25 /opt/test/data05
drwxr-xr-x 2 root root 3.8M Aug  3 12:27 /opt/test/test01
drwxr-xr-x 2 root root 3.8M Aug  3 12:27 /opt/test/test02
drwxr-xr-x 2 root root 3.8M Aug  3 12:27 /opt/test/test03
drwxr-xr-x 2 root root 3.8M Aug  3 12:27 /opt/test/test04
drwxr-xr-x 2 root root 3.7M Aug  3 12:27 /opt/test/test05

[root@qls ~]# ll /opt/test/data01  | wc -l
50001

#找到之后,确认在删除

[root@qls ~]# find  /opt/test/data01 -type  f  -delete

[root@qls ~]# rm -f  /opt/test/test01/*
-bash: /usr/bin/rm: Argument list too long

[root@qls ~]# ll  /opt/test/test01/ | wc -l
150001
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: