How To Set Up Software RAID1 On A Running System (Incl. GRUB Configuration) (CentOS 5.3) - Page 4
9 TestingNow let's simulate a hard drive failure. It doesn't matter if you select /dev/sda or /dev/sdb here. In this example I assume that /dev/sdb has failed. To simulate the hard drive failure, you can either shut down the system and remove /dev/sdb from the system, or you (soft-)remove it like this: mdadm --manage /dev/md0 --fail /dev/sdb1 mdadm --manage /dev/md0 --remove /dev/sdb1 Shut down the system: shutdown -h now Then put in a new /dev/sdb drive (if you simulate a failure of /dev/sda, you should now put /dev/sdb in /dev/sda's place and connect the new HDD as /dev/sdb!) and boot the system. It should still start without problems. Now run cat /proc/mdstat and you should see that we have a degraded array: [root@server1 ~]# cat /proc/mdstat The output of fdisk -l should look as follows: [root@server1 ~]# fdisk -l Now we copy the partition table of /dev/sda to /dev/sdb: sfdisk -d /dev/sda | sfdisk /dev/sdb (If you get an error, you can try the --force option: sfdisk -d /dev/sda | sfdisk --force /dev/sdb ) [root@server1 ~]# sfdisk -d /dev/sda | sfdisk /dev/sdb Afterwards we remove any remains of a previous RAID array from /dev/sdb... mdadm --zero-superblock /dev/sdb1 ... and add /dev/sdb to the RAID array: mdadm -a /dev/md0 /dev/sdb1 Now take a look at cat /proc/mdstat [root@server1 ~]# cat /proc/mdstat Wait until the synchronization has finished: [root@server1 ~]# cat /proc/mdstat Then run grub and install the bootloader on both HDDs: root (hd0,0) That's it. You've just replaced a failed hard drive in your RAID1 array.
10 Links
|
www.seamlessenterprise.com
One number. One voicemail. Seize the lead. Sprint Mobile Integration.
www.seamlessenterprise.com
One Number. One Voicemail.
Make it easier for clients to reach you. Turn your desk phone and mobile phone into one with Sprint Mobile Integration.
www.seamlessenterprise.com
One number. One voicemail. Sprint Mobile Integration.
www.seamlessenterprise.com
One number. one voicemail. Seize the lead with Sprint. Learn more
AT&T Synaptic Compute as a Service. Boost your power on demand.
Trial: IBM Cognos Express Reporting, Analysis & Planning
Learn benefits of Simpana software.
View the Gartner Video
Sprint 4G - The Ultimate Mobile Broadband
Click here
SAP-Business Objects Crystal Reports Server
Complete reporting without hidden costs. Free Trial




print: 

Recent comments
17 hours 31 min ago
19 hours 29 min ago
19 hours 47 min ago
1 day 10 hours ago
1 day 15 hours ago
2 days 3 hours ago
2 days 4 hours ago
2 days 8 hours ago
2 days 12 hours ago
2 days 12 hours ago