文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>linux rescue 使用图解

linux rescue 使用图解

时间:2006-07-07  来源:x1276779

linux rescue 使用图解

linux rescue 使用图解
老是有人问怎么进rescue 模式,不知道怎么用rescue来挽救系统。
现在我来图解进入rescue (示例系统为RHEL 3)
1。用安装光盘或者硬盘安装的方式进入安装界面,在shell 中输入 linux rescue
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.linuxsky.net/down/ftproot/incoming/hew/img/re1.JPG');}" src="http://www.linuxsky.net/down/ftproot/incoming/hew/img/re1.JPG" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
2。然后根据提示选择语言和键盘格式
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.linuxsky.net/down/ftproot/incoming/hew/img/re2.JPG');}" src="http://www.linuxsky.net/down/ftproot/incoming/hew/img/re2.JPG" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.linuxsky.net/down/ftproot/incoming/hew/img/re3.JPG');}" src="http://www.linuxsky.net/down/ftproot/incoming/hew/img/re3.JPG" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
3。选择是否配置网卡一般系统到了要rescue了,网络也就不需要了,所以可以选择否跳过网卡配置,当然你如果需要也可以选择是,具体设置过程和安装时一样。
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.linuxsky.net/down/ftproot/incoming/hew/img/re4.JPG');}" src="http://www.linuxsky.net/down/ftproot/incoming/hew/img/re4.JPG" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
4。选择是否然让系统查找硬盘上的RHEL 系统,选择继续。
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.linuxsky.net/down/ftproot/incoming/hew/img/re5.JPG');}" src="http://www.linuxsky.net/down/ftproot/incoming/hew/img/re5.JPG" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
5。硬盘上的系统已经被找到并挂载在/mnt/sysimage 下
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.linuxsky.net/down/ftproot/incoming/hew/img/re6.JPG');}" src="http://www.linuxsky.net/down/ftproot/incoming/hew/img/re6.JPG" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
6。按提示chroot /mnt/sysimage
screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.style.cursor='hand'; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" onclick="if(!this.resized) {return true;} else {window.open('http://www.linuxsky.net/down/ftproot/incoming/hew/img/re7.JPG');}" src="http://www.linuxsky.net/down/ftproot/incoming/hew/img/re7.JPG" onload="if(this.width>screen.width*0.7) {this.resized=true; this.width=screen.width*0.7; this.alt='Click here to open new window\nCTRL+Mouse wheel to zoom in/out';}" border=0>
chroot 之后你就可以已经在你的要被拯救的系统下了。
grub挂了的,grub-install /dev/hdxx
配置文件改错的,vi /etc/fstab  vi /etc/inittab ..................
软件包被毁的 rpm  -F xxx.rpm
完成修复工作后,exit命令退出chroot,exit退出rescue shell 系统重启。
备注:
如果你硬盘上的系统是非rhel系统如debian的,那么在第4步时,rescue 程序会找步不到硬盘上的系统,所以我们这是选择"跳过",直接进入shell。假设现在硬盘上的有一个debian 系统 /dev/hda1 为/boot 分区 /dev/hda5 为 / 分区 /dev/hda6 为swap。那么我们现在这么做。

CODE:
[Copy to clipboard]
# fdisk -l (查看分区情况)
# mkdir /mnt/linux
# mkdir /mnt/linux/boot  (根据fdisk -l 得到的信息创建目录)
# mount -t ext3 /dev/hda5 /mnt/linux
# mount -t ext3 /dev/hda1 /mnt/linux/boot (挂载硬盘上的文件系统)
# chroot /mnt/linux (chroot 改变工作系统)
# 自此我们顺利进入硬盘上的debian系统,剩下来到就和先前一样了,有冤的报冤有仇的报仇。
另:
如果你的系统是文件系统损坏那么就不用挂载,chroot 系统了。
直接 fsck /dev/hdxx 即可。
其实我们仔细想想这个rescue会发现,所谓rescue 模式只是一个带shell 的linux 运行环境而已,然后通过mount 和 chroot进入要修复的系统的。
所以在没有rescue 盘的情况下我可以利用 Linux livecd 或 软盘版的linux 进入shell 环境然后重做

CODE:
[Copy to clipboard]
# fdisk -l (查看分区情况)
# mkdir /mnt/linux
# mkdir /mnt/linux/boot  (根据fdisk -l 得到的信息创建目录)
# mount -t ext3 /dev/hda5 /mnt/linux
# mount -t ext3 /dev/hda1 /mnt/linux/boot (挂载硬盘上的文件系统)
# chroot /mnt/linux (chroot 改变工作系统)
# 就可以简单的进入一个rescue 环境了.
排行榜 更多 +
PvZ戴夫的时空冒险重置

PvZ戴夫的时空冒险重置

策略塔防 下载
PVZTV雪版阳光加50

PVZTV雪版阳光加50

策略塔防 下载
双刃战士雪姐

双刃战士雪姐

冒险解谜 下载