天天看点

关于系统重启后报错Give root password for maintenance

几台虚拟机需要重启,重启后连接不上,通过管理软件看到

Your system appears to have shut down uncleanly

press Y within 1 seconds to force file system integrity check...

checking root filesystem

/contains a file system with errors,check forced.

/:

Unattached inode 813065

/:UNEXPECTED INCONSISTENCY;RUN FSCK MANUALLY.

(i.e.,without -a or -p options)

[FAILED]

*** An error occurred during the file system check.

*** Dropping you to a shell; the system will reboot

*** when you leave the shell.

Give root password for maintenance

(or type Control-D to continue):

一开始按ctrl+d还是跳到这个页面,在就是输入root密码,能进入系统,开始使用网上的方法修复系统。

fsck -y /dev/vda1

fsck -y /dev/vda3

重启系统后发现还是原来的问题,用df -Th查看,/boot和新增的分区都没有挂在上

# df -Th

Filesystem     Type   Size  Used Avail Use% Mounted on

/dev/vda3      ext4    42G   13G   27G  32% /

tmpfs          tmpfs  1.9G     0  1.9G   0% /dev/shm

先把/重新挂载

mount -rw -o remount /

挂载boot

mount /dev/vda1 /boot

再去查看/etc/fstab以前挂载过硬盘,发现后来还添加了一块儿vdb

# cat /etc/fstab

UUID=fc9d60a8-e39b-4c20-8d24-8f7975e6f1d7 /                       ext4    defaults        1 1

UUID=e1de6afb-150c-407d-80ec-e2c03ebcd8dd /boot                   ext4    defaults        1 2

UUID=c6b62139-385b-4891-b9e2-15876655cce9 swap                    swap    defaults        0 0

tmpfs                   /dev/shm                tmpfs   defaults        0 0

devpts                  /dev/pts                devpts  gid=5,mode=620  0 0

sysfs                   /sys                    sysfs   defaults        0 0

proc                    /proc                   proc    defaults        0 0

/dev/vdb1       /hadoopWs       ext4    defaults,noatime        1 1

fdisk -l 发现并没有新增加的磁盘。

解决办法

chmod a+rw /etc/fstab

vim /etc/fstab

下面一行注释掉

#/dev/vdb1       /hadoopWs       ext4    defaults,noatime        1 1

继续阅读