Results 1 to 9 of 9
  1. #1
    Join Date
    Apr 2012
    Location
    India
    Posts
    59

    How to install GRUB in software raid 1 in Centos 6.4

    Hello friend...

    I have installed Centos with 2 HDD here is the details of it

    Code:
    login as: root
    [email protected]'s password:
    Last login: Tue Dec  3 03:53:47 2013 from 192.168.10.102
    [[email protected] ~]# fdisk -l
    
    Disk /dev/sda: 536.9 GB, 536870912000 bytes
    255 heads, 63 sectors/track, 65270 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x000f340f
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sda1   *           1       13054   104856223+  fd  Linux raid autodetect
    /dev/sda2           13055       13576     4192965   fd  Linux raid autodetect
    /dev/sda3           13577       13704     1024000   fd  Linux raid autodetect
    /dev/sda4           13704       65271   414214144    5  Extended
    /dev/sda5           13704       65271   414213120   fd  Linux raid autodetect
    
    Disk /dev/sdb: 536.9 GB, 536870912000 bytes
    255 heads, 63 sectors/track, 65270 cylinders
    Units = cylinders of 16065 * 512 = 8225280 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00024faf
    
       Device Boot      Start         End      Blocks   Id  System
    /dev/sdb1   *           1       13054   104856223+  fd  Linux raid autodetect
    /dev/sdb2           13055       13576     4192965   fd  Linux raid autodetect
    /dev/sdb3           13577       13704     1024000   fd  Linux raid autodetect
    /dev/sdb4           13704       65271   414214144    5  Extended
    /dev/sdb5           13704       65271   414213120   fd  Linux raid autodetect
    
    Disk /dev/md2: 4291 MB, 4291428352 bytes
    2 heads, 4 sectors/track, 1047712 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/md1: 107.3 GB, 107305566208 bytes
    2 heads, 4 sectors/track, 26197648 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/md127: 424.0 GB, 424019820544 bytes
    2 heads, 4 sectors/track, 103520464 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    
    Disk /dev/md0: 1048 MB, 1048510464 bytes
    2 heads, 4 sectors/track, 255984 cylinders
    Units = cylinders of 8 * 512 = 4096 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disk identifier: 0x00000000
    
    [[email protected] ~]#
    Now please tell me how to Install grub on both drives of a software RAID-1

    so that if one hard disk fail other can work

    thank you

  2. #2
    Join Date
    Nov 2013
    Posts
    97
    Hi,

    If the raid is configured you don't need to do anything the disk will get mirrored automatically. Just do a normal centos install.

  3. #3
    Join Date
    Oct 2004
    Location
    Ohio
    Posts
    1,641
    We have seen this before. Our techs have used the following to take care of this,

    ***Note, I have not tried this myself, user be warned.***

    Note: This assumes you've set up the first partition on both drives to be the /boot partition and that your software raid drives are /dev/sda and /dev/sdb

    Boot into rescue cd and run the following commands:

    # grub
    grub> root (hd0,0)
    grub> setup (hd0)
    grub> root (hd1,0)
    grub> setup (hd1)


    Naturally there will be some output from the console as you type these commands. As long as it doesn't spit out errors you should be good. This should make it so that grub installs to the MBR on both drives. Another thing the CentOS installer likes to do is only install to sda leaving sdb unbootable should the primary fail, so this should take care of two birds with one stone.

    Also note that this process is also useful if grub breaks for any reason and should apply to any other flavor of linux that uses grub and might experience this problem. It just only really seems to be a problem in CentOS.

  4. #4
    Join Date
    Nov 2013
    Posts
    97
    Let me ask first. Are you using soft or hard raid?

  5. #5
    Join Date
    Apr 2012
    Location
    India
    Posts
    59
    Quote Originally Posted by Natcoweb-Peter View Post
    Let me ask first. Are you using soft or hard raid?
    we are using software raid 1

  6. #6
    Join Date
    Nov 2013
    Posts
    97
    you might want to take a look into this

  7. #7
    Join Date
    Apr 2012
    Location
    India
    Posts
    59
    Hello All,

    problem solved

    I use CentOS CD and boot into Linuxrescue. From there i fixed master boot record.
    1. open grub
    2. grub> find /grub/grub.conf
    3. This provide some thing like:
    (hd0,2)
    (hd1,2)
    4. root (hd0,2)
    5. setup (hd0)
    6. root (hd1,2)
    7. setup (hd1)
    8. quit grub

  8. #8
    Join Date
    Oct 2010
    Location
    Cochin
    Posts
    7
    Hi,

    That means we need to install grub on both the drives, right?

  9. #9
    Join Date
    Apr 2012
    Location
    India
    Posts
    59
    Quote Originally Posted by navs View Post
    Hi,

    That means we need to install grub on both the drives, right?

    Yes you are right...

Similar Threads

  1. Unable to re-install grub in centos 6.4
    By redhat_boy in forum Hosting Security and Technology
    Replies: 4
    Last Post: 11-26-2013, 02:32 PM
  2. Install CentOS with Adaptec 6405 RAID
    By hectorros in forum Systems Management Requests
    Replies: 3
    Last Post: 08-20-2013, 04:16 PM
  3. Install centos on 12Tb raid drive
    By ramya in forum Hosting Security and Technology
    Replies: 2
    Last Post: 09-12-2011, 01:55 PM
  4. Need software install on CentOS
    By Joel Theodore in forum Systems Management Requests
    Replies: 3
    Last Post: 05-05-2009, 03:34 PM
  5. how do I Copy CentOS install to another RAID array
    By MGCJerry in forum Hosting Security and Technology
    Replies: 6
    Last Post: 05-03-2008, 07:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •