LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-19-2016, 06:06 PM   #1
Clovis_Sangrail
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Rep: Reputation: Disabled
Centos 7.2 Convert single LVM to RAID Mirror Reinstall BootLoader


Hello,
I am trying to convert a single-drive Centos 7.2 installation with LVM into a two-disk mdadm mirror with mrrored LVM. I was able to follow the excellent instructions at:

http://www.dgoradia.com/creating-a-r...centos-on-lvm/

and did create a two-disk mirror of both the original boot partition and the LVM partition. When I boot off a live Centos 7.2 DVD with the mirrored drives installed it does find the mirrors, and I can fsck and mount the boot and LVM filesystems in it.

Code:
[root@new-host-4 ~]# lsblk
NAME              MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda                 8:0    0 465.8G  0 disk  
├─sda1              8:1    0     1G  0 part  
│ └─md126           9:126  0  1024M  0 raid1
└─sda2              8:2    0   115G  0 part  
  └─md127           9:127  0   115G  0 raid1
    ├─centos-root 253:3    0    40G  0 lvm  
    ├─centos-swap 253:4    0     9G  0 lvm  
    ├─centos-home 253:5    0    25G  0 lvm  
    └─centos-var  253:6    0    40G  0 lvm  
sdb                 8:16   0 465.8G  0 disk  
├─sdb1              8:17   0     1G  0 part  
│ └─md126           9:126  0  1024M  0 raid1
└─sdb2              8:18   0   115G  0 part  
  └─md127           9:127  0   115G  0 raid1
    ├─centos-root 253:3    0    40G  0 lvm  
    ├─centos-swap 253:4    0     9G  0 lvm  
    ├─centos-home 253:5    0    25G  0 lvm  
    └─centos-var  253:6    0    40G  0 lvm  
sr0                11:0    1   4.4G  0 rom   /run/initramfs/live
loop0               7:0    0    20K  1 loop  
loop1               7:1    0   4.3M  1 loop  
└─live-osimg-min  253:2    0     8G  1 dm    
loop2               7:2    0     1G  1 loop  
loop3               7:3    0     8G  1 loop  
├─live-rw         253:0    0     8G  0 dm    /
├─live-base       253:1    0     8G  1 dm    
└─live-osimg-min  253:2    0     8G  1 dm    
loop4               7:4    0   512M  0 loop  
└─live-rw         253:0    0     8G  0 dm    /
[root@new-host-4 ~]#
However these instructions are specific to Centos 6, and the section for installing a bootloader on the new mirror completely does not apply in Centos 7. In Centos 7.2 there does not seem to be any commandline utility that provides a "grub>" command prompt, ant the grub binary itself is replaced by a bunch of "grub2-*" executables.

Can anyone explain how to reinstall the bootloader on the new mirror? The Centos 6 instructions say it must be installed separately on sda1 and sdb1.
 
Old 04-20-2016, 05:03 PM   #2
frostschutz
Member
 
Registered: Apr 2004
Distribution: Gentoo
Posts: 95

Rep: Reputation: 28
You have to chroot into the installed system, make sure everything relevant is mounted (/ obviously, /boot, as well as bind-mounts for /proc /sys /dev /run ...)

Within the proper chroot environment, it should be a simple matter of updating the grub config and grub2-install /dev/sda, grub2-install /dev/sdb.

If that fails you will hopefully get an error message that will give some clue as to what else has to be done.

Quote:
The Centos 6 instructions say it must be installed separately on sda1 and sdb1.
should be sda and sdb, you install bootloaders to disks, not individual partitions (even if the bootloader may use partitions in the end, but ...)

You should also show your partition table (parted /dev/disk unit s print free), /proc/mdstat (and perhaps mdadm --detail /dev/md*, mdadm --examine /dev/sd*), and tell us whether your system should boot UEFI or traditional BIOS style...?
 
1 members found this post helpful.
Old 04-26-2016, 08:18 PM   #3
Clovis_Sangrail
LQ Newbie
 
Registered: Mar 2012
Posts: 13

Original Poster
Rep: Reputation: Disabled
Quote:
You have to chroot into the installed system, make sure everything relevant is mounted (/ obviously, /boot, as well as bind-mounts for /proc /sys /dev /run ...)
Hello frostshutz, thanks for your reply. I did not even know what a bind-mount was.

Unfortunately I had to use that machine on a higher-priority project, and while I was able to save that pair of hard drives I haven't even had a chance to put them in the machine and boot off the DVD since last week.

When I can I will try to set up the chroot environment that you describe, though at this point I don't know what I have to do to the grub configuration. I suppose reading the Redhat grub2 docs should be on my list of things to do.

The bios is set to boot traditionally rather than UEFI. I can set it either way, but the production machine which I need to upgrade to a mirror is traditional and not UEFI.
 
  


Reply

Tags
bootloader, centos7, lvm, mdadm, mirror



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
which drives mirror raid 10 software raid centos 6.x jmc1987 Linux - Server 0 04-01-2014 12:45 AM
Convert single hard drive to 3+ disk RAID 5? orangesky Linux - Server 5 09-19-2012 10:46 AM
[SOLVED] Rebuilding Mirror for Software Raid 0 on CentOS box? tgaler1 Linux - Software 1 09-06-2012 07:25 PM
convert single drive Ubuntu server to RAID 0 Ipolit Linux - Server 4 05-29-2010 04:40 PM
Migrating single drive to RAID / LVM? joadoor Linux - Hardware 3 10-14-2005 07:01 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 12:50 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration