On 12/18/2011 12:51 PM, Sam Varshavchik wrote:
Jeffrey Ross writes:
It finally happened I had a disk failure
in my RAID-1 system, I got a message from SMART telling me that
I had a drive failing and and checked the mdstat and sure
enough /dev/sda was missing/failed.
Ok, drive has been replaced and I did the following:
1) recreated the partition table with "sfdisk -d /dev/sdb |
sfdisk /dev/sda"
2) re-added the partitions back to the raid system (eg mdadm
--add /dev/md1 /dev/sda1 etc...)
3) recreated the boot sector on the new drive ***WAIT*** ran
into an issue....
The system was upgraded (via yum) from 14 to 15 to now 16 so I
had grub, not grub2 on the system, previously it was a simple
"grub-install /dev/sdX"
since grub has been replaced with grub2 I tried:
# grub2-install /dev/sda
/sbin/grub2-setup: warn: Your core.img is unusually large. It
won't fit in the embedding area..
/sbin/grub2-setup: error: embedding is not possible, but this is
required for cross-disk install.
so that didin't work, I'm doing something wrong, suggestions?
Carefully review the existing partition layout on what I presume
is your good disk, /dev/sdb, and compare it with your recreated
partition table on /dev/sda.
Hopefully, on /dev/sdb, your first partition starts on sector
2048, and not sector 63. You probably partitioned your new
/dev/sda with the first partition starting on sector 63, which
does not leave enough room to install grub. You'll have to start
over. Fail and drop all your sda partitions on of all your md
arrays. Create a new partition table on sda, recreating the
partitions exactly how they are on sdb, starting with sector 2048,
matching the start and the end of each partition, on sda, exactly
how they exist on sdb. Then you'll be able to install grub.
If your sdb partitions start on sector 63, and you have no room to
fit them on sda starting at sector 2048, you'll have to recreate
all but your smallest partition on sda, then add and sync them to
your array.
For the smallest partition, create it on sda making it as big as
it can be. Create a new md array for it on sda, with just one
unit. I believe you should be able to format it and mount it, even
though its degraded. Then you can manually copy over the contents
from sdb, then drop the array on sdb, and add its partition to the
replacement md array on sda.
Device Boot Start End Blocks Id System
/dev/sdb1 * 63 787184 393561 fd Linux raid
autodetect
/dev/sdb2 787185 16418429 7815622+ fd Linux raid
autodetect
/dev/sdb3 16418430 24418799 4000185 fd Linux raid
autodetect
/dev/sdb4 24418800 1953520064 964550632+ 5 Extended
/dev/sdb5 24418863 40050044 7815591 fd Linux raid
autodetect
/dev/sdb6 40050108 55665224 7807558+ fd Linux raid
autodetect
/dev/sdb7 55665288 1953520064 948927388+ fd Linux raid
autodetect
Bingo, mine start at 63, probably a hold over from previous
installs.
ok, sdb1 is /boot, and I'm currently using 81 meg out of 372 meg and
if I'm doing my math right I should be able to easily shrink /boot
by another 1985 blocks (roughly 1MB) or so.
Based upon what you've given me, I suspect I can simply fail
/dev/md1 (sda1 sdb1) resize it on the sda1 disk, copy everything
across via cpio, install the new bootloader on /dev/sda, once it
comes up I can then resize /dev/sdb1 re-add the partition to RAID
and run the grub2-install command.
Thanks,
Jeff
|