[ OK ] Started Show Plymouth Boot Screen. [ OK ] Reached target Paths. [ OK ] Reached target Basic System. [ 124.522110] dracut-initqueue[240]: Warning: dracut-initqueue timeout - starting timeout scripts [ 125.034736] dracut-initqueue[240]: Warning: dracut-initqueue timeout - starting timeout scripts [ 125.542788] dracut-initqueue[240]: Warning: dracut-initqueue timeout - starting timeout scripts [ 126.522110] dracut-initqueue[240]: Warning: dracut-initqueue timeout - starting timeout scripts [ 127.068643] dracut-initqueue[240]: Warning: dracut-initqueue timeout - starting timeout scripts [ 127.576830] dracut-initqueue[240]: Warning: dracut-initqueue timeout - starting timeout scripts ... [ 185.082387] dracut-initqueue[240]: Warning: Could not boot. [ 185.118736] dracut-initqueue[240]: Warning: /dev/centos/root does not exist [ 185.119239] dracut-initqueue[240]: Warning: /dev/mapper/centos-root does not exist Starting Dracut Emergency Shell... Warning: /dev/centos/root does not exist Warning: /dev/mapper/centos-root does not exist Generating "/run/initramfs/rdsosreport.txt"
Entering emergency mode. Exit the shell to continue. Type "journalctl" to view system logs. You might want to save "/run/initramfs/rdsosreport.txt" to a USB stack or /boot after mounting them and attach it to a bug report.
dracut:/#
处理
挂载iso进救援模式
找不到根分区,关闭虚机,后台拷贝下系统盘的卷先备份下。然后给虚机的IDE光驱挂载了个centos的iso,修改虚机启动顺序到ISO,进Troubleshooting –> Rescue a CentOS Linux system
1 2 3 4 5
1) Continue 2) Read-only mount 3) Skip to shell 3) Quit (Reboot) Please make a selection from the above: 1
选择了1后提示没有任何Linux分区
1 2 3 4 5 6
===================================================================================== ===================================================================================== Rescue Mount
You don't have any Linux partitions. The system will reboot automatically when you exit from the shell. Please press <return> to get a shell.
mkdir /mnt/sysimage vgchange -a y mount /dev/centos/root /mnt/sysimage ls -l /mnt/sysimage
发现根分区的文件还在
重做lvm为了去掉PTTYPE=”dos”
尝试着重做pv试试
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
sh-4.2# vgremove centos Do you really wanto ro remove volume group "centos" containing 1 logical volumes? [y/n]: y Logical volume "root" successfully removed Volume group "centos" successfully removed sh-4.2# pvremove /dev/vda3 Labels on physical volume "/dev/vda3" successfully wiped. sh-4.2# pvcreate /dev/vda3 WARNING: dos signature detected on /dev/vda3 at offset 510. Wipe it? [y/n]: y Wiping dos signature on /dev/vda3. Physical volume "/dev/vda3" successfully created. sh-4.2# vgcreate centos /dev/vda3 Volume group "centos" successfully created sh-4.2# lvcreate -n root -l 100%FREE centos Logical volume "root" created sh-4.2# mkdir /mnt/root sh-4.2# mount /dev/centos/root /mnt/root
被后面的xfs_repair输出滚动冲没了,大致就是lvcreate的时候提示有xfs标签,选择不擦除,最终得到了个残缺的的/dev/centos/root,然后xfs_repair它后重启也无法正常开机。再次进救援模式挂载了后,在chroot到故障的根进不去报错/bin/bash no such file,才意识到损坏了文件,很多so文件都丢了 最开始留有备份,打算在文件层面恢复
[root@fix-data ~]# lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sr0 11:0 1 1024M 0 rom sr1 11:1 1 464K 0 rom vda 253:0 0 40G 0 disk └─vda1 253:1 0 40G 0 part / vdb 253:16 0 50G 0 disk [root@fix-data ~]# parted /dev/vdb GNU Parted 3.1 Using /dev/vdb Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) mklabel gpt (parted) mkpart Partition name? []? 1 File system type? [ext2]? xfs Start? 1 End? 100% (parted) p Model: Virtio Block Device (virtblk) Disk /dev/vdb: 53.7GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags:
Number Start End Size File system Name Flags 1 1049kB 53.7GB 53.7GB 1
(parted) q Information: You may need to update /etc/fstab.