redhat raid and lvm

RAID : Like RAID 4, RAID 5 requires three or more disks
RAID 6 literally goes one better than RAID 5. In other words, while it requires four or more disks,
RAID mirrors RAID1: requires 2 disks
 
RAID 1 or RAID 1+0, which yield redundancy, give only s / 2 storage capacity, where s is the sum of the capacities of n drives used
 
Raid 5 useable capacity ( N - 1) * Smin where N is the total number of drives in the array and Smin is the capacity of the smallest drive in the array.
Raid 6 useable capacity (N -2 ) * Smin where N is the total number of drives in the array and Smin is the capacity of the smallest drive in the array.


mdadm -C /dev/md0 -l 4 -n 3 -x /dev/sda5 /dev/sda6 /dev/sda7 /dev/sda8

cat /proc/mdstat to check the status

mdadm /dev/md0 -f /dev/sda5

mdadm /dev/md0 -r /dev/sda5

mdadm /dev/md0 -a /dev/sda5

mknod /dev/md1 b 9 1 to make a new device 

mkfs -t ext3 /dev/md0
mount /dev/md0 /mnt/raid

to release the partition taken by raid

mdadm /dev/md0 -f /dev/sdb1 /dev/sdb2 /dev/sdb3
mdadm /dev/md0 -r /dev/sdb1 /dev/sdb2 /dev/sdb3



extend Lv
extend vol and bring online

lvresize -L 550M /dev/vg0/lv0
resize2fs /dev/vg0/lv0   

check online: df -h

reduce LV
umount /dev/vg0/lv0
fsck -f /dev/vg0/lv0
resize2fs /dev/vg0/lv0  200M
lvreduce /dev/vg0/lv0 -L 200M
mount /dev/vg0/lv0 /vol
df -h


#/boot can not put into LV as well.
# before make LV , ensure hard disk raided ,raid and add into VG
----------
sequence
linux block device ( partition or hard disk)--pvcreate--vgcreate--lvcreate
# create LV datalv  on vg0
lvcreate -L 5G -n datalv vg0
------------
suggest use GUI to reduce LV
------
#vgextend vg0 /dev/sda11  ---add one block to vg0
#pvmove  /dev/sda11 
#vgreduce  vg0 /dev/sda12







你可能感兴趣的:(redhat,生活,职场,休闲)