加入收藏 | 设为首页 | 会员中心 | 我要投稿 应用网_丽江站长网 (http://www.0888zz.com/)- 科技、建站、数据工具、云上网络、机器学习!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

centos 6如何恢复被删除了的boot分区

发布时间:2016-05-27 02:55:43 所属栏目:Linux 来源:网络整理
导读:Centos6系统/boot分区被删除了,但是又不想重新安装系统,下面介绍一种快速的方法恢复boot分区。 1.首先利用centos6镜像进入linux rescue救援模式。 2.启动sshd
副标题[/!--empirenews.page--]

Centos6系统/boot分区被删除了,但是又不想重新安装系统,下面介绍一种快速的方法恢复boot分区。

1.首先利用centos6镜像进入linux rescue救援模式。

centos 6如何恢复被删除了的boot分区

2.启动sshd服务,查看eth0获取的ip地址,然后用ssh secure shell 连接。

SSH Secure Shell 3.2.9 (Build 283)

Copyright (c) 2000-2003 SSH Communications Security Corp - http://www.ssh.com/

This copy of SSH Secure Shell is a non-commercial version.

This version does not include PKI and PKCS #11 functionality.

[root@localhost ~]# cd /boot //进入/boot分区

[root@localhost boot]# ls //查看boot分区的内容

config-2.6.32-71.el6.i686         symvers-2.6.32-71.el6.i686.gz

grub                              System.map-2.6.32-71.el6.i686

initramfs-2.6.32-71.el6.i686.img  vmlinuz-2.6.32-71.el6.i686

[root@localhost boot]# cd ..//返回上层目录

[root@localhost /]# rm -rf /boot/*//删除/boot分区所有内容

[root@localhost /]# ls /boot//查看/boot分区内容为空

[root@localhost /]# mount /dev/sr0 /mnt//挂载cdrom设备到/mnt目录下

mount: block device /dev/sr0 is write-protected, mounting read-only

[root@localhost /]# rpm -ivh /mnt/Packages/kernel-2.6.32-71.el6.i686.rpm --root=/ --force //安装光盘的kernel软件包

Preparing...                ########################################### [100%]

1:kernel                 ########################################### [100%]

[root@localhost /]# ls /boot //查看/boot分区内容

config-2.6.32-71.el6.i686         System.map-2.6.32-71.el6.i686

initramfs-2.6.32-71.el6.i686.img  vmlinuz-2.6.32-71.el6.i686

symvers-2.6.32-71.el6.i686.gz

[root@localhost /]# mkdir /boot/grub//在/boot目录新建一个grub目录

[root@localhost /]# touch /boot/grub/grub.conf//新建一个grub.conf配置文件

[root@localhost /]# cp -rf /usr/share/grub/i386-pc/* /boot/grub/ //把/usr/share/grub/i386-pc的所有内容拷贝到/boot/grub中。

[root@localhost /]# ls /boot//查看/boot分区内容

config-2.6.32-71.el6.i686         symvers-2.6.32-71.el6.i686.gz

grub                              System.map-2.6.32-71.el6.i686

initramfs-2.6.32-71.el6.i686.img  vmlinuz-2.6.32-71.el6.i686

[root@localhost /]# ls /boot/grub/ //查看/boot/grub目录内容

e2fs_stage1_5  iso9660_stage1_5   stage1           vstafs_stage1_5

fat_stage1_5   jfs_stage1_5       stage2           xfs_stage1_5

ffs_stage1_5   minix_stage1_5     stage2_eltorito

grub.conf      reiserfs_stage1_5  ufs2_stage1_5

(编辑:应用网_丽江站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读