help-grub
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to safely switch grub booting in-place from one drive to a replaceme


From: darrin . thomas
Subject: How to safely switch grub booting in-place from one drive to a replacement with RAID?
Date: Wed, 22 Feb 2017 18:59:16 -0800

Hi,

I have a linux machine running grub2.

It's got one drive, partitioned as

        fdisk -l /dev/sda
                ...
                Device     Boot   Start        End    Sectors   Size Id Type
                /dev/sda1  *       2048    2099199    2097152     1G 83 Linux
                /dev/sda2       2099200 1953525167 1951425968 930.5G 8e Linux 
LVM

I want to switch the system to a RAID-1 array.  Doing it as much as possible 
in-place.

I added two drives, partitioned them them same, and assembled them into a RAID 
ARRAY

        fdisk -l /dev/sd[bc]
                ...
                Device     Boot   Start        End    Sectors   Size Id Type
                /dev/sdb1  *       2048    2099199    2097152     1G 83 Linux
                /dev/sdb2       2099200 1953525167 1951425968 930.5G 8e Linux 
LVM
                ...
                Device     Boot   Start        End    Sectors   Size Id Type
                /dev/sdc1  *       2048    2099199    2097152     1G 83 Linux
                /dev/sdc2       2099200 1953525167 1951425968 930.5G 8e Linux 
LVM


        cat /proc/mdstat
                Personalities : [raid1] [linear] [multipath] [raid0] [raid6] 
[raid5] [raid4] [raid10]
                md0 : active raid1 sdc1[1] sdb1[0]
                      1047552 blocks super 1.2 [2/2] [UU]
                      bitmap: 0/1 pages [0KB], 65536KB chunk

                md1 : active raid1 sdb2[1] sda2[0]
                      975581888 blocks super 1.2 [2/2] [UU]
                      bitmap: 2/8 pages [8KB], 65536KB chunk

                unused devices: <none>.

Right now the system's booted from the 1st, single drive.

I rsynced over all my data from the single drive, to similar partitions on the 
array.

I know I need to set up grub2 correctly to boot from the array.

I built new systems before directly onto an array and grub just got taken care 
of by the installer.  But I never switched from one set of drives to another 
yet.

What commands do I need to run in grub2 to SWITCH from the single drive to the 
RAID array?

I want to be sure that when I reboot it reboots correcly from the new array 
only , and then I can unplug the first drive.  And I'd like to avoid getting 
stuck in the grub "shell" which gave me nightmares awhile go :-{.


Thanks,

Darrin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]