How can I create raid 1 - Centos 5.7 64 minimal installation
Hello,
I have a server working on centos 5.7-64 minimal installation. I have 3 separate physical drives: 120 gb ssd, 2x 3tb disks for storage. My linux installation is on ssd disk, and I want to make raid 1 for these two 3tb disks and store data, like under /mnt/data. Can you please tell me the path how this is possible? Sorry if this is dublicate but I couldn't find information on this using search. Here are some output of commands I ran for more data: Code:
[root@CentOS-57-64-minimal tmp]# fdisk -l | grep '^Disk' |
Its usually more flexible to build a RAID out of partitions than whole drives. So make sdb1 and sdc1 partitions using gparted, then use mdadm to make them a RAID 1. gparted is graphical and easy to use, but not included by default in most Redhat installations (I wonder why?) mdadm is command line and should be installed.
When I did this recently I did not use the whole disk. I created empty boot and OS partitions at the beginning of the drives in case I wanted to boot from the RAID in the future. So in my case the large RAID partitions were sdb3 and sdc3. I also didn't use all of the space. When you have to replace a drive, you will find out that the new drive will not have the exact same number of blocks as the old drive. If a partition is even 1 block smaller, it won't work as a replacement. Also, you may have a need for some free space, such as for swap. Also, unless something has changed, the max partition size is 2TB. You need to use larger block sizes than 512 bytes to go above that. Probably simpler to just make a couple of 2TB partitions. The command to make your RAID is now: Code:
mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1 Edit: The 2TB limit in fdisk, which some scripts used to check sizes. Most stuff should be using parted now, so it should not be a problem. |
Quote:
Code:
parted -s /dev/sdb mklabel gpt Code:
parted -s /dev/sdb mkpart "primary" "ext3" 0TB 2.9TB Code:
yes| mdadm -C /dev/md2 --level=raid1 --raid-devices=2 /dev/sdb1 /dev/sdc1 you will then be left with a the raid1 device /dev/md0 which you now create a filesystem on with Code:
mke2fs -j /dev/md0 Dave |
First of all, really appreciate the help, and the work you put into this. Thank you a lot.
I assume creating array for md2 is a typo, just to indicate for later usage of info. So far everything went like charm, i dont know if i need to creat a mdadm.conf file with Code:
# mdadm --detail --scan --verbose > /etc/mdadm.conf Code:
# echo '/dev/md0 /mnt/data ext3 noatime,rw 0 0' >> /etc/fstab Code:
(parted) print all |
Quote:
Quote:
"Yes" to the /etd/mdadm.conf. My only remaining thought... (Hmmmmmm) is the "physical/logical" sector sizes. Some newer large capacity drives are using larger physical sector sizes. The ST33000651AS uses 512byte sectors - so, in this case it is not an issue. But, something to think about - should you ever re-use this knowledge. Dave |
Code:
I should have checked the output at least :) So far everything works like charm, i marked the thread as solved, thanks^2 for help |
All times are GMT -5. The time now is 07:12 AM. |