麻豆小视频在线观看_中文黄色一级片_久久久成人精品_成片免费观看视频大全_午夜精品久久久久久久99热浪潮_成人一区二区三区四区

首頁 > 系統(tǒng) > CentOS > 正文

CentOS 6誤刪除的boot分區(qū)該如何還原恢復(fù)

2020-07-08 12:54:46
字體:
供稿:網(wǎng)友

  在CentOS 6系統(tǒng)中,因?yàn)椴恍⌒幕虿僮魇д`導(dǎo)致boot分區(qū)被刪除,遇到這種情況是否能夠恢復(fù)被刪除的boot分區(qū)呢?其實(shí)是可以的,下面隨小編一起來了解下吧。

  1.首先利用centos6鏡像進(jìn)入linux rescue救援模式。

CentOS 6刪除的boot分區(qū)如何還原

  2.啟動sshd服務(wù),查看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 //進(jìn)入/boot分區(qū)

  [root@localhost boot]# ls //查看boot分區(qū)的內(nèi)容

  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分區(qū)所有內(nèi)容

  [root@localhost /]# ls /boot//查看/boot分區(qū)內(nèi)容為空

  [root@localhost /]# mount /dev/sr0 /mnt//掛載cdrom設(shè)備到/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分區(qū)內(nèi)容

  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目錄新建一個(gè)grub目錄

  [root@localhost /]# touch /boot/grub/grub.conf//新建一個(gè)grub.conf配置文件

  [root@localhost /]# cp -rf /usr/share/grub/i386-pc/* /boot/grub/ //把/usr/share/grub/i386-pc的所有內(nèi)容拷貝到/boot/grub中。

  [root@localhost /]# ls /boot//查看/boot分區(qū)內(nèi)容

  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目錄內(nèi)容

  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

  [root@localhost /]# fdisk -l //查看分區(qū)

  Disk /dev/sda: 21.5 GB, 21474836480 bytes

  255 heads, 63 sectors/track, 2610 cylinders

  Units = cylinders of 16065 * 512 = 8225280 bytes

  Sector size (logical/physical): 512 bytes / 512 bytes

  I/O size (minimum/optimal): 512 bytes / 512 bytes

  Disk identifier: 0x000b1db4

  Device Boot Start End Blocks Id System

  /dev/sda1 * 1 13 102400 83 Linux//這個(gè)為/boot啟動分區(qū)

  Partition 1 does not end on cylinder boundary.

  /dev/sda2 13 144 1048576 82 Linux swap / Solaris

  Partition 2 does not end on cylinder boundary.

  /dev/sda3 144 2611 19819520 83 Linux //這個(gè)為/根分區(qū)

  [root@localhost /]# mount//查看所有掛載分區(qū)

  /dev/sda3 on / type ext4 (rw)//根分區(qū)

  /dev/sda1 on /boot type ext4 (rw)//boot分區(qū)為sda1

  devpts on /dev/pts type devpts (rw)

  tmpfs on /dev/shm type tmpfs (rw)

  proc on /proc type proc (rw)

  sysfs on /sys type sysfs (rw)

  /dev/sr0 on /mnt type iso9660 (ro)

  [root@localhost /]# grub//啟動grub

  Probing devices to guess BIOS drives. This may take a long time.

  GNU GRUB version 0.97 (640K lower / 3072K upper memory)

  [ Minimal BASH-like line editing is supported. For the first word, TAB

  lists possible command completions. Anywhere else TAB lists the possible

  completions of a device/filename.]

  grub》 root (hd0,0) //首先find /grub/stage1查看/boot分區(qū)為(hd0,0)

  root (hd0,0)//設(shè)置/boot分區(qū)為/dev/sda1

  Filesystem type is ext2fs, partition type 0x83

  grub》 setup (hd0)//重新安裝grub

  setup (hd0)

  Checking if “/boot/grub/stage1” exists.。。 no

  Checking if “/grub/stage1” exists.。。 yes

  Checking if “/grub/stage2” exists.。。 yes

  Checking if “/grub/e2fs_stage1_5” exists.。。 yes

  Running “embed /grub/e2fs_stage1_5 (hd0)”。。。 26 sectors are embedded.

  succeeded

  Running “install /grub/stage1 (hd0) (hd0)1+26 p (hd0,0)/grub/stage2 /grub/grub.conf”。。。 succeeded

  Done.

  grub》 quit//退出 

  3.重新reboot啟動系統(tǒng)進(jìn)入grub界面測試

CentOS 6刪除的boot分區(qū)如何還原

  4.查找find /grub/stage1然后找到/boot分區(qū)為(hd0,0),指定kernel,initrd, boot啟動系統(tǒng)成功。

CentOS 6刪除的boot分區(qū)如何還原

  5.系統(tǒng)啟動成功,然后進(jìn)入系統(tǒng)重新寫/boot/grub/grub.conf文件。

CentOS 6刪除的boot分區(qū)如何還原

  6.[root@localhost /]# vi /boot/grub/grub.conf配置文件如下:

  最后填寫grub.conf文件內(nèi)容

  default=0 //默認(rèn)菜單為第一個(gè)

  timeout=6//等待時(shí)間為6秒

  title mylinux //啟動標(biāo)題為mylinux

  root (hd0,0) //boot所在分區(qū)為/dev/sda1

  kernel /vmlinuz-2.6.32-71.el6.i686 ro root=/dev/sda3 rhgb quiet//kernel所在位置以只讀模式掛載/dev/sda3根分區(qū)rhgb quiet為安靜模式不顯示內(nèi)核信息。

  initrd /initramfs-2.6.32-71.el6.i686.img//加載initrd鏡像。

  7.最后進(jìn)入linux rescue重建一個(gè)grub

CentOS 6刪除的boot分區(qū)如何還原

  8.最后啟動界面如下

CentOS 6刪除的boot分區(qū)如何還原

  上面就是CentOS 6恢復(fù)被刪除boot分區(qū)的方法介紹了,步驟有些長,如果覺得麻煩的話可以重裝系統(tǒng),同樣能恢復(fù)boot分區(qū)。

發(fā)表評論 共有條評論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 久久国产免费 | 国产91在线播放九色 | 日韩毛片一区二区三区 | 亚洲一级片在线观看 | av不卡免费在线 | 黑人一区二区三区四区五区 | 色婷婷久久久 | 午夜色视频在线观看 | 狼人狠狠干 | 国产精品久久久久影院老司 | 奶子吧naiziba.cc免费午夜片在线观看 | 一级做受大片免费视频 | 成人免费看视频 | 欧美一级淫片免费视频黄 | 91成人午夜性a一级毛片 | 亚洲啪 | 国产人成精品综合欧美成人 | av国产在线被下药迷网站 | 一区二区三区手机在线观看 | 黄色片快播 | 久久视频精品 | 亚洲小视频在线 | 羞羞色网站| 九九热视频免费 | 精品国产观看 | 亚洲成人免费电影 | av成人免费观看 | 亚洲一区二区免费 | 黄色网址在线播放 | 毛片免费观看视频 | 久久久久久久91 | 久久精品一区二区三区四区五区 | 少妇色诱麻豆色哟哟 | 久久69精品久久久久久国产越南 | 久久精品片 | 羞羞的小视频 | 国产激情精品一区二区三区 | 伦一区二区三区中文字幕v亚洲 | 色网站综合 | 亚洲成人国产 | 美女很黄很黄免费的 |