Centos 5.7 內核升級--失敗

好景不長,筆記本升級失敗,今天打開虛擬機也出錯了,費解。都出現以下錯誤。html

 

【基於 Centos 5.7 i386 虛擬512內存】linux

內核升級,簡潔版,親測成功,網上有不少文章了。就不詳細描述了。sql

      上http://www.kernel.org/選擇一個穩定版ubuntu

#安裝依賴包vim

  
  
  
  
  1. #yum install gcc ncurses-devel  
  2. #tar -zxf linux-2.6.33.20.tar.gz -C /usr/src/  
  3. #cd /usr/src/linux-2.6.33.20  

#去除內核的依賴關係以及編譯後的垃圾信息ide

  
  
  
  
  1. #make mrproper  

#拷貝/boot/config-2.6.18-274.el5 爲/usr/src/linux-2.6.33.20/.config spa

  
  
  
  
  1. #cp /boot/config-2.6.18-274.el5 .config  

#進入菜單方式界面配置內核
xml

  
  
  
  
  1. # make menuconfig 

#選中倒數第二項,自動加載剛纔拷貝的文件.confightm

選中OK以後繼續配置,點開每項以後又詳細的,好比選擇ext4 支持等。注意:須要勾選上General Setup下面的「enable deprecated sysfs features to support old userspace tools」否則編譯安裝以後會找不到原來的掛載點。[參考] blog

#而後編譯內核、編譯模塊、安裝模塊、安裝內核,注意是在linux-2.6.33.20/

#這步編譯有點久,虛擬機用了接近一個小時。

  
  
  
  
  1. #make 
  2. #make modules && make modules_install && make install 

#完成以後,會提示成功。查看grub.cnf 已經添加了,把default=0 設爲0,重啓,默認加載新內核。不修改的話,仍是加載舊內核。

  
  
  
  
  1. #vim /boot/grub/grub.conf 

  2.     
        
        
        
    1. #boot=/dev/sda 
    2. default=0 
    3. timeout=5 
    4. splashp_w_picpath=(hd0,0)/grub/splash.xpm.gz 
    5. hiddenmenu 
    6. title CentOS (2.6.33.20) 
    7.     root (hd0,0) 
    8.     kernel /vmlinuz-2.6.33.20 ro root=/dev/VolGroup00/LogVol00 
    9.     initrd /initrd-2.6.33.20.img 
    10. title CentOS (2.6.18-274.el5) 
    11.     root (hd0,0) 
    12.     kernel /vmlinuz-2.6.18-274.el5 ro root=/dev/VolGroup00/LogVol00 
    13.     initrd /initrd-2.6.18-274.el5.img 

重啓系統,親測成功

參考: http://www.liusuping.com/ubuntu-linux/redhat-linux-kernel-update.html

http://xugang.blog.51cto.com/400032/95621

相關文章
相關標籤/搜索