Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

grub - software raid1- check if both disks are bootable

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
iampy
Posts: 2
Joined: 2017-06-23 10:33

grub - software raid1- check if both disks are bootable

#1 Post by iampy »

I'd like to know if there is a way to check if my two disks on a server Debian 7.1 with software Raid1 are both bootable.
Maybe by examining the grub configuration file or by executing a ssh command?

Thanks in advance

iampy
Posts: 2
Joined: 2017-06-23 10:33

Re: grub - software raid1- check if both disks are bootable

#2 Post by iampy »

Maybe I can add some other information to my question.

I've a problem with one of my two disks of a raid1 software (ovh dedicated server with O.S. Debian 7.1). It will be replaced in a few days.
My question is how to check with Grub if both disks are bootable. I'd like to be sure that after software rebuilding of raid1 by mdadm, the server will boot without problems.

For a better understanding of the problem, I add the following points:

1) I have Bios and not Uefi

2) This is the text of the grub configuration file "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) By the execution of a script I downloaded (bootscriptinfo) I had these output:
============================= 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) By examining the file grub.cfg I remarked these two lines that by the uuid identify before the partitions sda2 and sdb2 and after (in the second line) md2.
set root='(mduuid/9bad0377260a5b69a4d2adc226fd5302)'

search --no-floppy --fs-uuid --set=root adcd0e04-e6ee-4a7d-abd2-a8880e6ba90d
5) By examing the output of bootscriptinfo I remarked two details:

The first one:
=> No boot loader is installed in the MBR of /dev/sda.
=> No boot loader is installed in the MBR of /dev/sdb.
The second one:
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?
I hope that this information will be enough in order to have some answers to my questions.

Thanks in advance for your help.

Post Reply