LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices


Reply
  Search this Thread
Old 12-19-2005, 09:34 AM   #1
tobiasly
LQ Newbie
 
Registered: Mar 2004
Posts: 3

Rep: Reputation: 0
Replacing a drive in /boot, software RAID-1 + GRUB


I have a Linux (CentOS 4.2) file server for my home LAN on which the /boot partition is a software (mdadm) RAID-1 array using two equally-sized partitions on a couple SCSI drives.

I need to replace one of the drives, and want to make sure that both are capable of booting the OS with GRUB. So if this were just a regular RAID array, it'd be a simple matter of replacing the drive and reassembling the array. But how do I make sure that both have the correct boot info and initrd images?

I'm pretty comfortable with most Linux admin tasks but when I start reading up on GRUB and superblocks my head starts to spin... just when I think I've got it right, I end up b0rking my system and making it unbootable. Any help on the specific GRUB steps to take would be highly appreciated!
 
Old 12-21-2005, 12:08 AM   #2
WhatsHisName
Senior Member
 
Registered: Oct 2003
Location: /earth/usa/nj (UTC-5)
Distribution: RHEL, AltimaLinux, Rocky
Posts: 1,151

Rep: Reputation: 46
To make you feel better, make a backup copy (cp -a...) of /boot somewhere in the “/” partition/logical volume (e.g. /boot_backup) before you start. That way, if all else fails, you can always recreate the Raid1 and repopulate it from the backup.

You shouldn't need to do anything about grub or anything else, if you remove the “bad” drive in rescue mode (resulting in a “degraded” raid1), physically put in the new properly partitioned drive and then add the new partition to the Raid1 in rescue mode. The “degraded” Raid1 will be rebuilt within seconds of adding the new partition to the Raid1 and everything will be like new again.

From rescue mode, you can prove it to yourself by intentionally failing and removing one of the Raid1 partitions and then adding it back, something like this (using the correct raid and partitions. of course):

# mdadm /dev/md0 -f /dev/sdb2 -r /dev/sdb2
# mdadm --detail /dev/md0
# mdadm /dev/md0 -a /dev/sdb2
# mdadm --detail /dev/sdb2

where --detail will show you the status of the Raid1. If you run the second --detail quickly after adding the partition, you will catch it in the middle of rebuilding the Raid1.

If you are concerned about grub, then make a grub boot floppy as is described in the Grub Manual: http://www.gnu.org/software/grub/man...UB-boot-floppy

Then, if something goes wrong, you can reconfigure grub natively by following the instructions here: http://www.gnu.org/software/grub/man...-GRUB-natively
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Software RAID 1 setup on CentOS using Grub boot loader kumarsundaram Linux - Software 1 11-30-2005 12:57 PM
Software RAID 1 from Existing Boot Drive johnwyles Linux - General 1 08-05-2005 11:42 AM
Replacing floppy with flash drive for dual boot jogger Linux - General 1 03-22-2005 10:53 AM
Grub software raid problems syamajala Linux - Distributions 7 01-07-2005 07:10 PM
RH9 Software Raid 1 hard drive failure - GRUB loader errors Mynar Linux - Newbie 1 01-28-2004 10:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware

All times are GMT -5. The time now is 03:54 AM.

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