I was testing the idea of extending the raid1 array ( and therefore the storage ) on a sme9_64;
The initial idea came from the post Nicola made for sme8 (
http://forums.contribs.org/index.php/topic,50996.msg257831.html#msg257831 THANKS.
These are the rough notes here ( so I dont forget / lose them ? );
Install your new hdds (2 existing drives - add 2 new drives - /dev/sdc - /dev/sdd). Start with partitioning:
# fdisk /dev/sdc
n (to add a new partition)
p (to make a primary partition)
1 (that's the number one, the number you want to assign to the partition)
Only if you will be adding this disk to to a RAID set, then you will also need to change the partition type.
t (to change partition type)
L (within t's prompt to list available partition type)
fd (normally the partition type is fd but verify from the L command and look for "Linux raid autodetect"
Accept the suggested first & last cylinder values
w (write and exit)
Repeat the same with /dev/sdd:
# fdisk /dev/sdd
Create a new array (say md2):
# mdadm --create /dev/md2 --level=1 --raid-devices=2 /dev/sdc1 /dev/sdd1
Wait for Raid Array rebuild.
Create Physical Extent for LVM :
# pvcreate /dev/md2
Resize the LVM:
# vgextend main /dev/md2
# lvresize -l +100%FREE /dev/main/root
# resize2fs /dev/main/root
Launch pvdisplay to check the result:
--- Physical volume ---
PV Name /dev/md1
VG Name main
PV Size 74.22 GiB / not usable 2.88 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 19000
Free PE 0
Allocated PE 19000
PV UUID gaeEeu-FMUO-CsmF-fXvZ-1Ra5-fP0p-7czCQP
--- Physical volume ---
PV Name /dev/md2
VG Name main
PV Size 74.47 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 19063
Free PE 0
Allocated PE 19063
PV UUID b65NFX-Kber-Xvbw-eQWQ-bDGq-NL0L-MN61f1
Detect /dev/md2 :
# mdadm --detail /dev/md2 | grep -i uuid
# UUID : fbc206ee:1e056a83:a5fc5f04:b4319c6e
# mdadm --detail /dev/md2 | grep -i uuid >> /etc/mdadm.conf ( this shows the UUID number (fbc206ee:1e056a83:a5fc5f04:b4319c6e
)needed in the mdadm.conf file )
Edit mdadm.conf file
Add the "Array /dev/md2 level=raid1 num-devices=2 uuid=( put in the uuid from above )
# nano /etc/mdadm.conf
# mdadm.conf written out by anaconda
MAILADDR root
AUTO +imsm +1.x -all
ARRAY /dev/md0 level=raid1 num-devices=2 UUID=fc0bb621:773363c6:4320223d:6827133b
ARRAY /dev/md1 level=raid1 num-devices=2 UUID=4d77fd8b:da09b2db:b3c3272c:5f3a039a
ARRAY /dev/md2 level=raid1 num-devices=2 UUID=fbc206ee:1e056a83:a5fc5f04:b4319c6e
Save the file :
Rebuilding the initramfs (RHEL 6) :
Create copy of initramfs first :
# cp /boot/initramfs-$(uname -r).img /boot/initramfs-$(uname -r).img.bak
Creat new initramfs :
# dracut -f -v
Modify /boot/grub.conf to use the new image :
# cd /boot/grub
# nano grub.conf
look for the part of the file "rd_MD_UUID=4d77fd8b:da09b2db:b3c3272c:5f3a039a "
Add a space straight after the section above ;
Add the following : rd_MD_UUID=fbc206ee:1e056a83:a5fc5f04:b4319c6e
Save file:
Reboot