ubuntu系统grub修复

    技术2025-07-29  29

            我的系统是ubuntu9.10,日常使用一直很不错,年前进行了一次系统更新,重启后,进入界面,很多功能按钮显示黑块儿,于是又重启,出现黑屏,报错信息如下:

    Gave up waiting for root device.Common programs:—Boot args(cat /proc cmdline)—Check rootdelay=(did the system wait long enough?)—Check root=(did the system wait for the right device?)—Missing modules (cat /proc/modules: ls /dev)ALERT!/dev/disk/by-uuid/118999fe-4e4b-4651-844d-a89edcf8df00 does not exist.Dropping to a shell!BusyBox v 1.13.3(Ubuntu 1:1.13.3-1ubuntu7)built-in shell(ash) Enter 'help' for a list of built-in commands.(initramfs)

     

    initramfs下很多命令诸如,sudo、vim等都无法使用,exit也无法进入到系统。于是上网搜索,大概是说系统分区出错,需要修复menu.lst或grub.cfg文件,但是我在initramfs命令下无法找到这两个文件,也找不到/boot目录。只好找到我安装系统时的ubuntu光盘,先进去系统再看。

     

    1、首先系统启动时会显示 118999fe-4e4b-4651-844d-a89edcf8df00 ,然而报错/dev/disk/by-uuid路径下根本没有此ID,该去哪里找这个ID?

    2、利用光盘进入系统后,blkid查看,1189 这个ID在分区/dev/sda1。

    3、先在桌面创建了一个文件夹做挂载点:sudo mkdir sda

         挂载我原来的系统到这个文件夹,mount /dev/sda1 sda

         于是,在这个文件夹中我可以找到 grub文件夹下的menu.lst文件。

    4、文件中有如下的几行

    title           Ubuntu 9.10, kernel 2.6.31-21-generic (recovery mode)uuid          118999fe-4e4b-4651-844d-a89edcf8df00kernel       /boot/vmlinuz-2.6.31-21-generic root=UUID=118999fe-4e4b-4651-844d-a89edcf8df00 ro locale=zh_CN $initrd         /boot/initrd.img-2.6.31-21-generic

        根据第一点看出,这个ID是到/dev/disk/by-uuid目录下寻找了,于是修改路径

        root=UUID=118999fe-4e4b-4651-844d-a89edcf8df00

        改为

        root=/dev/sda1

    5、重启,成功!

    最新回复(0)