centos无法进入系统之原因解决办法集合

前言

可爱的小伙伴们,由于精力有限,暂时整理了两类。如果没有你遇到的问题也没有关系,欢迎底下留言评论或私信,小编看到后第一时间帮助解决

一. Centos 7 LVM xfs文件系统修复

情况1:

powershell 复制代码
[sda] Assuming drive cache: write through

Internal error xfs XFS_WANT_CORRUPTED_GOTO at line 1662 of file fs/xfs/libxfs/xfs_alloc.c Caller xfs_free_extent+0x130 [xfs]

Internal error xfs_trans_cancel at line 990 of file fs/xfs/xfs_trans.c.Caller xlog_recover_process_efi +0x16b/0x190 [xfs]

Corruption of in-memory data detected. Shutting down filesystem

Please umount the filesystem and rectify the problem(s)

Failed to recover EFIs

 

Generating "/run/initramfs/rdsosreport.txt"

如果是LVM管理分区的

powershell 复制代码
ls -l /dev/mapper
powershell 复制代码
xfs_repair /dev/mapper/cl_muban-root

若提示

powershell 复制代码
xfs_repair -L /dev/mapper/cl_muban-root

最后重启

powershell 复制代码
init 6

情况2:

powershell 复制代码
[sda] Assuming drive cache: write through

Metadata corruption detected at xfs_agi_read_verify+0x5e/0x110 [xfs], xfs_agi block 0x2

Unmount and run xfs_repair

First 64 bytes of corrupted metadata buffer:

XFS (dm-0):metadata I/O error: block 0x2 ("xfs_trans_read_buf_map") error 117 numblks 1



修复步骤:

powershell 复制代码
ls -l /dev/mapper
powershell 复制代码
mkdir /mnt
powershell 复制代码
mount /dev/mapper/cl_muban-root /mnt   # 这里也可以操作 提示中的 dm-0 (即 /dev/dm-0,其实/dev/mapper/cl_muban-root是链接到 /dev/dm-0  )
powershell 复制代码
umount /mnt
powershell 复制代码
xfs_repair /dev/mapper/cl_muban-root   # 或 xfs_repair  /dev/dm-0
powershell 复制代码
init 6 (reboot重启系统)

xfs_repair使用方法:

powershell 复制代码
xfs_repair -h
xfs_repair: invalid option -- 'h'
Usage: xfs_repair [options] device

Options:
-f The device is a file
-L Force log zeroing. Do this as a last resort.
-l logdev Specifies the device where the external log resides.
-m maxmem Maximum amount of memory to be used in megabytes.
-n No modify mode, just checks the filesystem for damage.
-P Disables prefetching.
-r rtdev Specifies the device where the realtime section resides.
-v Verbose output.
-c subopts Change filesystem parameters - use xfs_admin.
-o subopts Override default behaviour, refer to man page.
-t interval Reporting interval in minutes.
-d Repair dangerously.
-V Reports version and exits.

二. Centos7终端显示-bash-4.2#解决方法

重启进入Linux系统后,发现显示的是-bash-4.2# 而不是root@主机名 + 路径的显示方式,发生这种情况的原因是根目录下缺失几个配置文件,从默认配置中拷贝过来就可以解决了:

powershell 复制代码
cp /etc/skel/.bashrc /root/ 
cp /etc/skel/.bash_profile /root/

\quad\quad如果为虚机且有快照的话,恢复快照有时也可以解决;


林肯公园

Centos 7 LVM xfs文件系统修复

wxq_Aurora

Centos7终端显示-bash-4.2#解决方法

相关推荐
johnny23325 分钟前
运维管理面板:AcePanel、OpenOcta、DeepSentry
运维
青梅橘子皮1 小时前
Linux---基本指令
linux·运维·服务器
REDcker1 小时前
Linux信号机制详解 POSIX语义与内核要点 sigaction与备用栈实践
linux·运维·php
cui_ruicheng2 小时前
Linux进程间通信(三):System V IPC与共享内存
linux·运维·服务器
蚰蜒螟2 小时前
深入 Linux 内核同步机制:从 futex 到 spinlock 的完整旅程
linux·windows·microsoft
运维全栈笔记3 小时前
Linux安装配置Tomcat保姆级教程:从部署到性能调优
linux·服务器·中间件·tomcat·apache·web
dllmayday4 小时前
Linux 上用终端连接 WiFi
linux·服务器·windows
ACP广源盛139246256734 小时前
IX8024与科学大模型的碰撞@ACP#筑牢科研 AI 算力高速枢纽分享
运维·服务器·网络·数据库·人工智能·嵌入式硬件·电脑
峥无5 小时前
Linux系统编程基石:静态库·动态库·ELF文件·进程地址空间全景图
linux·运维·服务器
用户2367829801685 小时前
从 chmod 755 说起:Unix 文件权限到底是怎么算的?
linux