Grub - 两个磁盘都可以在我的带有 Debian 7.1 和软件 Raid1 的服务器中启动吗?

Grub - 两个磁盘都可以在我的带有 Debian 7.1 和软件 Raid1 的服务器中启动吗?

我的 raid1 软件(操作系统为 Debian 7.1 的 ovh 专用服务器)的两个磁盘之一有问题。几天后就会更换。我的问题是如何使用 Grub 检查两个磁盘是否可启动。我想知道通过 mdadm 对 raid1 进行软件重建后,服务器将正常启动。

我可以添加一些信息:

1)我有Bios,没有Uefi

2)这是grub配置文件“grub.cfg”的文本

if [ -s $prefix/grubenv ]; then   
load_env
fi
set default="0"
if [ "${prev_saved_entry}" ]; then

set saved_entry="${prev_saved_entry}"

save_env saved_entry

set prev_saved_entry=

save_env prev_saved_entry

set boot_once=true

fi

function savedefault {

if [ -z "${boot_once}" ]; then

saved_entry="${chosen}"

save_env saved_entry

fi

}

function load_video {

insmod vbe

insmod vga

insmod video_bochs

insmod video_cirrus

}

insmod raid

insmod mdraid09

insmod part_gpt

insmod part_gpt

insmod ext2

set root='(mduuid/9bad0377260a5b69a4d2adc226fd5302)'

search --no-floppy --fs-uuid --set=root adcd0e04-e6ee-4a7d-abd2-a8880e6ba90d

if loadfont /usr/share/grub/unicode.pf2 ; then

set gfxmode=640x480

load_video

insmod gfxterm

insmod raid

insmod mdraid09

insmod part_gpt

insmod part_gpt

insmod ext2

set root='(mduuid/9bad0377260a5b69a4d2adc226fd5302)'

search --no-floppy --fs-uuid --set=root adcd0e04-e6ee-4a7d-abd2-a8880e6ba90d

set locale_dir=($root)/boot/grub/locale

set lang=

insmod gettext

fi

terminal_output gfxterm

set timeout=5

set menu_color_normal=cyan/blue

set menu_color_highlight=white/blue

menuentry "Debian GNU/Linux, OVH kernel 3.8.13-xxxx-grs-ipv6-64" {

insmod raid

insmod mdraid09

insmod part_gpt

insmod part_gpt

insmod ext2

set root='(mduuid/9bad0377260a5b69a4d2adc226fd5302)'

search --no-floppy --fs-uuid --set=root adcd0e04-e6ee-4a7d-abd2-a8880e6ba90d

linux /boot/bzImage-3.8.13-xxxx-grs-ipv6-64 root=/dev/md2 ro quiet

}

if [ -f $prefix/custom.cfg ]; then

source $prefix/custom.cfg;

fi

3)通过执行我下载的脚本(bootscriptinfo),我得到了以下输出:

============================= Boot Info Summary: ===============================
=> No boot loader is installed in the MBR of /dev/sda.
 => No boot loader is installed in the MBR of /dev/sdb.


sda1: __________________________________________________________________________

    File system:       BIOS Boot partition
    Boot sector type:  -
    Boot sector info: 

sda2: __________________________________________________________________________

    File system:       linux_raid_member
    Boot sector type:  -
    Boot sector info: 

sda3: __________________________________________________________________________

    File system:       linux_raid_member
    Boot sector type:  -
    Boot sector info: 

sda4: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info: 

sdb1: __________________________________________________________________________

    File system:       BIOS Boot partition
    Boot sector type:  Grub2's core.img
    Boot sector info: 

sdb2: __________________________________________________________________________

    File system:       linux_raid_member
    Boot sector type:  -
    Boot sector info: 

sdb3: __________________________________________________________________________

    File system:       linux_raid_member
    Boot sector type:  -
    Boot sector info: 

sdb4: __________________________________________________________________________

    File system:       swap
    Boot sector type:  -
    Boot sector info: 

md3: ___________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Operating System:  
    Boot files:        

md2: ___________________________________________________________________________

    File system:       ext4
    Boot sector type:  -
    Boot sector info: 
    Mounting failed:   mount: /dev/md2 already mounted or MDRaid/md2 busy

============================ Drive/Partition Info: =============================

Drive: sda _____________________________________________________________________

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sda1                   1 3,907,029,167 3,907,029,167  ee GPT


GUID Partition Table detected.

Partition    Start Sector    End Sector  # of Sectors System
/dev/sda1              40         2,048         2,009 BIOS Boot partition
/dev/sda2           4,096   307,202,047   307,197,952 RAID partition (Linux)
/dev/sda3     307,202,048 3,845,582,847 3,538,380,800 RAID partition (Linux)
/dev/sda4   3,845,582,848 3,907,020,799    61,437,952 Swap partition (Linux)

Drive: sdb _____________________________________________________________________

Disk /dev/sdb: 2000.4 GB, 2000398934016 bytes
255 heads, 63 sectors/track, 243201 cylinders, total 3907029168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 4096 bytes

Partition  Boot  Start Sector    End Sector  # of Sectors  Id System

/dev/sdb1                   1 3,907,029,167 3,907,029,167  ee GPT


GUID Partition Table detected.

Partition    Start Sector    End Sector  # of Sectors System
/dev/sdb1              40         2,048         2,009 BIOS Boot partition
/dev/sdb2           4,096   307,202,047   307,197,952 RAID partition (Linux)
/dev/sdb3     307,202,048 3,845,582,847 3,538,380,800 RAID partition (Linux)
/dev/sdb4   3,845,582,848 3,907,020,799    61,437,952 Swap partition (Linux)

"blkid" output: ________________________________________________________________

Device           UUID                                   TYPE       LABEL

/dev/md2         adcd0e04-e6ee-4a7d-abd2-a8880e6ba90d   ext4       
/dev/md3         adfbad7d-c8c3-4b04-884a-87d2d35e3a62   ext4       
/dev/sda2        9bad0377-260a-5b69-a4d2-adc226fd5302   linux_raid_member 
/dev/sda3        cca07bac-0ea8-99e8-a4d2-adc226fd5302   linux_raid_member 
/dev/sda4        05de1987-d6cb-4baa-87f8-3b008e05de8e   swap       
/dev/sdb2        9bad0377-260a-5b69-a4d2-adc226fd5302   linux_raid_member 
/dev/sdb3        cca07bac-0ea8-99e8-a4d2-adc226fd5302   linux_raid_member 
/dev/sdb4        7b1315b8-dcf4-4bd6-9379-ffbcf3014aa6   swap       


=============================== StdErr Messages: ===============================

  No volume groups found

4) 通过检查文件 group.cfg,我在分区 sda2 和 sdb2 之前以及之后(第二行)md2 注释了由 uuid 标识的这两行。

set root='(mduuid/9bad0377260a5b69a4d2adc226fd5302)'
search --no-floppy --fs-uuid --set=root adcd0e04-e6ee-4a7d-abd2-a8880e6ba90d

5)通过检查 bootscriptinfo 的输出,我注意到两个细节:

第一个:

=> No boot loader is installed in the MBR of /dev/sda.
=> No boot loader is installed in the MBR of /dev/sdb.

第二个:

  The first parttion of both disks is dedicated to a Bios Boot Partition and only for sdb1 there is this value in Boot Sector type
    Boot sector type:  Grub2's core.img
Core.img is a file in the same folder of grub.cfg (\boot\grub). Why does it appear only in sdb1?

我希望这些信息足以回答我的问题。

相关内容