In this example, I'll replace out /dev/loop2 as the faulty member. So, mark it as faulty, and remove it from the array. I'll also delete the loopback device.
mdadm /dev/md0 --fail /dev/loop2Next, create a new disk, and add it to the array:
mdadm /dev/md0 --remove /dev/loop2
rm /var/tmp/hdc.img
losetup -d /dev/loop2
dd if=/dev/zero of=/var/tmp/hdc.img bs=1024 count=1048576And the rebuild will begin. Check its progress with:
losetup /dev/loop2 /var/tmp/hdc.img
fdisk /dev/loop2
partprobe
mdadm /dev/md0 --add /dev/loop2
mdadm --detail /dev/md0Now follow the steps in my previous post to build a second RAID5 array and call it md1; we'll be using using it to extend our original LVM volume group.
[root@canard ~]# vgscan
Reading all physical volumes. This may take a while...
Found volume group "vg_media" using metadata type lvm2
pvcreate /dev/md1Find the total number of extents you have available, resize the LV to that new number and grow the EXT3 filesystem for the free space on your device:
vgextend vg_media /dev/md1
[root@canard ~]# vgdisplay vg_media | grep "Total PE"So we'll extend to 1010 physical extents.
Total PE 1010
lvextend -l 1010 /dev/mapper/vg_media-lv_mediaIf all went according to plan, you should now have a ~4GB LV with no remounting required.
resize2fs /dev/mapper/vg_media-lv_media
[root@canard ~]# lvdisplay /dev/vg_media/lv_media
--- Logical volume ---
LV Name /dev/vg_media/lv_media
VG Name vg_media
LV UUID iS01Vt-Hyo7-GIiA-Sxlu-rc5J-bX5g-Trd9Ln
LV Write Access read/write
LV Status available
# open 1
LV Size 3.95 GB
Current LE 1010
Segments 2
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
0 comments:
Post a Comment