当前位置:首页>网络学院>服务器>Mail服务器教程>文章内容

Grub on a mirrored boot partition

[ 来源: | 作者: | 时间:2007-07-21 | 收藏 | 推荐 ] 【

Grub on a mirrored boot partition

Grub on a mirrored boot partition

Authors: Michael Young and Andrew Stribblehill

Revision: 1.0 (2003-05-08) vd;k;l www.it55.com rdfg

Reference: dcl0adsdit0maymirrgrub-20030508 sflj www.it55.com kg^&fgd

The purpose of this document is to suggest a way of configuring grub on a system where the operating system is mirrored between two disks, so that if the first disk fails completely, the system will boot automatically from the second disk. www.it55.com在线教程

Whether this actually works depends on how precisely the system fails, so there are also instructions on how to get the system up if it still isn't booting. Note that not everything in this document has been fully tested, and the grub documentation suggests there are machines on which they definitely won't work.

vd;k;l www.it55.com rdfg

Setup

The assumption is that we have two identically partitioned disks, containing a mirrored boot partition [1], and we will be booting from the master boot record on each disk [2]. The examples assume that the first partition on each disk make up the mirrored disk mounted at /boot, and that grub numbers these disks (hd0) and (hd1). Grub numbers disks in order of detection by the bios. The order is probably the same as the operating system, but in some cases the ordering may not be obvious, for example if you have a mixture of IDE and SCSI disks.

免费资源www.it55.com

First make sure that the BIOS setup of your machine will attempt to boot from the second disk if it can't find a valid boot sector on the first disk. Run the grub command from your root prompt and within the grub shell type the following (Note that the install commands may be broken for legibility but should be entered as one long line):

it55.com

install --stage2=/boot/grub/stage2 (hd0,0)/grub/stage1 (hd0) (hd0,0)/grub/stage2 p /grub/grub.conf install --stage2=/boot/grub/stage2 (hd1,0)/grub/stage1 (hd1) (hd1,0)/grub/stage2 p /grub/grub.conf quit

Here the --stage2 value is the location of the grub stage2 file within the operating system, which means it writes the changes to the mirrored partition, rather than one or the other raw disk, and hence avoids corrupting the mirror. The other file references are in grub format, ie. a partition reference followed by the location of the file within that partition. We don't specify an explicit partition for the grub.conf file as the "p" flag tells grub to remember which partition it found the stage2 file on and make it the default, and we therefore avoid setting the disk explicitly and use the current disk, whic http://www.it55.com/

(编辑:IT资讯之家 www.it55.com

返回顶部
共3页: 上一页 1 [2] [3] 下一页  

网友评论

[以下评论为网友观点,不代表本站。请自觉遵守互联网相关政策法规,所有连带责任均有评论者自负。]
[不超过250字]