天天看點

關于系統重新開機後報錯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

繼續閱讀