Assumption: /dev/sdb has problem and need to replace it with a new drive. sdb has two partitions on raid-1 namely /dev/sdb1 = /boot and /dev/sdb3 = / .
1. cat /proc/mdstat to see the raid information.
2. Use mdadm to fail the drives partition(s) and remove it from the RAID array.
To fail the drive partitions:
mdadm /dev/md0 –fail /dev/sdb1
mdadm /dev/md1 –fail /dev/sdb3
To remove the failed partitions:
mdadm /dev/md0 –remove /dev/sdb1
mdadm /dev/md1 –remove /dev/sdb3
3. Power off the system and physically replace the hard drive
shutdown -h now
4. Create the same partitioning tables to the new drive.
sfdisk -d /dev/sda | sfdisk /dev/sdb
5. Add the drive partitions back into the RAID array.
mdadm /dev/md0 –add /dev/sdb1
mdadm /dev/md1 –add /dev/sdb3
6. Install Grub on both drives again and in case either one of the drive fails, the other can be boot in.
Issue grub command and key in the following :
device (hd0) /dev/sda
root (hd0,0)
setup (hd0)
device (hd1) /dev/sdb
root (hd1,0)
setup (hd1)
quit
Author
gene
Read more posts by this author.
Tags
- 30
- 43
- Add new tag
- BDE
- CentOS
- FreeNX
- Latex
- NAS4Free
- PostgreSQL
- Proxmox
- Remote Desktop
- Season's Greetings
- Software Raid-1
- Storage
- Tex
- Uncategorized
- Version Control
- Virtualization
- Zabbix
- Zend Server CE
- ZeosLib
- apache
- backup
- bash
- database
- delphi
- fat32
- file system
- icewm
- im
- inspiration
- mdadm
- network
- oracle
- programming
- rails
- rsync
- ruby
- security
- sfdisk
- software raid
- ssh
- svn
- tune2fs
- untangle
- vncserver
- xen