Kernel panic – not syncing….. Xử lý như nào trên VPS Linux?



Lỗi kinh điển này một ngày đẹp trời mà xuất hiện thì thật là ác mộng cho bất cứ một system admin nào, nó có thể là lời kết thúc cho hệ thống khi hệ điều hành không thể start. Mình đã gặp trường hợp này khi phải thay disk controller, sau khi thay và cắm lại ổ cứng cũ như ban đầu, OS dở chứng và báo thông báo lỗi trên. Lý do là do initrd (một root filesystem được load vào RAM) không tìm được các module cho driver của thiết bị mới, do vậy kernel không thể access thiết bị và OS sẽ nằm ở trạng thái treo! (Tất nhiên nếu kernel đã có những module built in cho tất cả các thiết bị thì nó cũng chẳng cần tới initrd image này nữa.)

Lúc này ta cần 1 đĩa live CD để vào “giải cứu” Centos.

-  To install or upgrade in graphical mode, press the <ENTER> key.

         -  To install or upgrade in text mod, type: linux text <ENTER>.

         -  Use the function keys listed below for more information.

        [F1-Main] [F2-Options] [F3-General] [F4-Kernel] [F5-Rescue]
        boot: linux rescue

Sau khi vào được, ta có giao diện như sau:
https://1hosting.com.vn/category/thu-thuat-tips/page/3/
Your system is mounted under the /mnt/sysimage directory.
        When finished please exit from the shell and your system will reboot.
        sh-3.2#
Ta cần backup initrd file hiện tại và tạo cái mới, sao cho nó sẽ thấy được toàn bộ các module trong /lib/modules

      sh-3.2# /usr/sbin/chroot /mnt/sysimage
        sh-3.2# /bin/ls /boot/initrd*
        /boot/initrd-2.6.18-238.el5.img
        sh-3.2# /bin/mv /boot/initrd-2.6.18-238.el5.img /boot/old-initrd-2.6.18-238.el5.img-old
        sh-3.2# /sbin/mkinitrd /boot/initrd-2.6.18-238.el5.img 2.6.18-238.el5

Sau đó thoát ra và khởi động lại hệ thống
sh-3.2# /bin/ls /boot/*initrd*        /boot/initrd-2.6.18-238.el5.img  /boot/old-initrd-2.6.18-238.el5.img-oldsh-3.2# exit

Nhận xét

Bài đăng phổ biến từ blog này

Sự khác biệt giữa VPS, VDS và PDS là gì?

Cách khắc phục lỗi All in one wp migration không thể up file quá lớn - share All in one wp migration không giới hạn

Cpanel-based servers bị redirect về những trang web xấu