Implement software RAID at running live Linux sever
Linux - NewbieThis forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
// partition the 'second' disk to be the same as the 'first' (original). You can do that automatically with sfdisk or manually with fdisk.
// install mdadm
# apt-get install mdadm
// I had 9 partitions so I did:
# mkdir /dev/md
# for i in 1 2 3 5 6 7 8 9; do mknod /dev/md/$i b 9 $i; ln -s /dev/md/$i /dev/md$i; done
// Now you need to create a degraded RAID. BACKUP YOUR DATA AND CHECK IT BEFORE DOING THIS
# for i in 1 2 3 5 6 7 8 9; do mdadm --create /dev/md$i --level=1 --raid-devices=2 missing /dev/sdb$i; done
mdadm: array /dev/md1 started.
mdadm: array /dev/md2 started.
mdadm: array /dev/md3 started.
mdadm: array /dev/md5 started.
mdadm: array /dev/md6 started.
mdadm: array /dev/md7 started.
mdadm: array /dev/md8 started.
mdadm: array /dev/md9 started.
// check the status of the RAID creation
# watch cat /proc/mdstat
// for more detail
# mdadm --detail /dev/md1
/dev/md1:
Version : 00.90.01
Creation Time : Wed Jan 24 10:51:39 2007
Raid Level : raid1
Array Size : 104320 (101.88 MiB 106.82 MB)
Device Size : 104320 (101.88 MiB 106.82 MB)
Raid Devices : 2
Total Devices : 1
Preferred Minor : 1
Persistence : Superblock is persistent
Update Time : Wed Jan 24 10:51:39 2007
State : clean, degraded
Active Devices : 1
Working Devices : 1
Failed Devices : 0
Spare Devices : 0
//Now change your fstab to point to /dev/mdx rather than sdx, grub, ...
//When all of this is done, boot. If it boots, rebuild the RAID (look on how to do this in the manual of mdadm
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.