Linux LVM.. Grub not loading from replaced disk

Hi,

a little while ago, one of the GPT Partitioned hard disk had gone faulty in a Mirror RAID and is now successfully replaced.

here is how I did that.

1) created identical partition table on the new disk.
2) attached the mirrors using md commands.

The whole procedure is given below:

/dev/sda is replaced here

New Disk is replicated using sgdisk

sgdisk --replicate=/dev/sda /dev/sdb
sgdisk --randomize-guids --move-second-header /dev/sd

Created and Attached the mirrors to the raid system.

mdadm --manage /dev/md1 --add /dev/sda2
mdadm --manage /dev/md2 --add /dev/sda3
mdadm --manage /dev/md3 --add /dev/sda4

Now I have a good mirror in place. Now the question is that when I try to boot the system using the New Hard disk /dev/sda from the BIOS, it comes to halt and nothing shows up except blinking cursor on blank screen and I have to reboot the system to select the /dev/sdb disk to boot from. This is happening for the normal reboot as well, in such a way that i have to select the disk manually everytime the system is rebooted.

Can someone please guide how the other disk can be grub-recorgnized and how I can make a seamless reboot..

Below is the output from mdadmin --detail command

 mdadm --detail /dev/md{1..3}
/dev/md1:
        Version : 1.2
  Creation Time : Wed Jun  5 19:02:13 2013
     Raid Level : raid1
     Array Size : 19514240 (18.61 GiB 19.98 GB)
  Used Dev Size : 19514240 (18.61 GiB 19.98 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Sun Oct  6 01:00:02 2013
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : busyboy:1  (local to host busyboy)
           UUID : 24d0bec2:c86a4b42:2551491c:ce21cac7
         Events : 50

    Number   Major   Minor   RaidDevice State
       0       8       18        0      active sync   /dev/sdb2
       2       8        2        1      active sync   /dev/sda2
/dev/md2:
        Version : 1.2
  Creation Time : Wed Jun  5 19:20:37 2013
     Raid Level : raid1
     Array Size : 488149824 (465.54 GiB 499.87 GB)
  Used Dev Size : 488149824 (465.54 GiB 499.87 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Thu Oct 10 13:47:44 2013
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : busyboy:2  (local to host busyboy)
           UUID : ab235953:879428e8:d46af252:13ed66d3
         Events : 399197

    Number   Major   Minor   RaidDevice State
       0       8       19        0      active sync   /dev/sdb3
       2       8        3        1      active sync   /dev/sda3
/dev/md3:
        Version : 1.2
  Creation Time : Wed Jun  5 19:20:48 2013
     Raid Level : raid1
     Array Size : 2422320960 (2310.11 GiB 2480.46 GB)
  Used Dev Size : 2422320960 (2310.11 GiB 2480.46 GB)
   Raid Devices : 2
  Total Devices : 2
    Persistence : Superblock is persistent

    Update Time : Thu Oct 10 13:47:46 2013
          State : clean
 Active Devices : 2
Working Devices : 2
 Failed Devices : 0
  Spare Devices : 0

           Name : busyboy:3  (local to host busyboy)
           UUID : 2a22160c:72b4f201:de0acb10:79566f08
         Events : 717493

    Number   Major   Minor   RaidDevice State
       0       8       20        0      active sync   /dev/sdb4
       2       8        4        1      active sync   /dev/sda4

Just guessing if this is sda, that perhaps it also holds the boot block? You'll need to copy that via some other mechanism. Again... just guessing...

Assuming you are using GRUB2, pre-EFI firmware, i.e. a BIOS, and a GPT disk, do you see any sign of a BIOS Boot Partition Table? Partition type should be EF02.

Hi,

i have created a Grub Partition on the disk drive as it recommended in a Guide

I have two 3 TB disks with mirroring. Is there anything related to creating the disk replication and then attaching it or something else?

Regards,
NMR

Did you populate the BIOS Boot Partition Table? Mirroring/replication is not going to do that for you.

hi,

Can you please suggest what that means to Populate the BIOS Partition. I'm not aware of this mechanism.

Regards,
Nasir

---------- Post updated Oct 22nd, 2013 at 01:52 PM ---------- Previous update was Oct 21st, 2013 at 06:37 PM ----------

Hi fpmurphy,

I have below given output from the gdisk command for the disk being replaced here.. both replaced and the good disk ( the disk which replicated its data to replaced one )

Disk /dev/sda: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 5B747213-253B-4BCD-9022-AC20F6A3EB6C
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2925 sectors (1.4 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            4095   1024.0 KiB  EF02  
   2            4096        39065599   18.6 GiB    FD00  
   3        39065600      1015627775   465.7 GiB   FD00  
   4      1015627776      5860532223   2.3 TiB     FD00  

Command (? for help): i
Partition number (1-4): 1
Partition GUID code: 21686148-6449-6E6F-744E-656564454649 (BIOS boot partition)
Partition unique GUID: 2B25F37D-4DCC-4D62-842A-322176A30AD9
First sector: 2048 (at 1024.0 KiB)
Last sector: 4095 (at 2.0 MiB)
Partition size: 2048 sectors (1024.0 KiB)
Attribute flags: 0000000000000000
Partition name: ' '

and below is the output for the disk ( which is intact till now and I replicated this disk to /dev/sda above )

Disk /dev/sdb: 5860533168 sectors, 2.7 TiB
Logical sector size: 512 bytes
Disk identifier (GUID): 52E97A2C-D5CE-4FBE-8853-9A17F86DC779
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 5860533134
Partitions will be aligned on 2048-sector boundaries
Total free space is 2925 sectors (1.4 MiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048            4095   1024.0 KiB  EF02
   2            4096        39065599   18.6 GiB    FD00
   3        39065600      1015627775   465.7 GiB   FD00
   4      1015627776      5860532223   2.3 TiB     FD00

Command (? for help): i
Partition number (1-4): 1
Partition GUID code: 21686148-6449-6E6F-744E-656564454649 (BIOS boot partition)
Partition unique GUID: 95307A72-04D0-48A8-B676-FD04F74E1F62
First sector: 2048 (at 1024.0 KiB)
Last sector: 4095 (at 2.0 MiB)
Partition size: 2048 sectors (1024.0 KiB)
Attribute flags: 0000000000000000
Partition name: ' '