为LVM中的LV增加镜像(raid1)冗余-CentOS实操

懒….

hostnamectl set-hostname virt-us-
df -h
umount /home
lvremove /dev/mapper/centos_hostname-home -y
pvdisplay
vgreduce centos_hostname /dev/sd{b,c}1
pvremove /dev/sd{b,c}1
yum -y install mdadm
sfdisk -d /dev/sda | sfdisk /dev/sdb
pvcreate /dev/sdb2
vgextend centos_hostname /dev/sdb2
lvconvert -m1 centos_hostname/root /dev/sdb2 -y
lvconvert -m1 centos_hostname/swap /dev/sdb2 -y
sed ‘s/\/dev\/mapper\/centos_hostname-home/#\/dev\/mapper\/centos_hostname-home/g’ /etc/fstab
mkfs.ext4 /dev/sdc1
echo ‘/dev/sdc1 /home ext4 defaults 0 0’ >> /etc/fstab
mount -a
mkdir /vz
lvcreate -m1 -l 100%FREE -n vz centos_hostname
mkfs.ext4 /dev/mapper/centos_hostname-vz
echo ‘/dev/mapper/centos_hostname-vz /vz ext4 defaults 0 0’ >> /etc/fstab
mount -a
df -h

说点什么

Please Login to comment
avatar
  Subscribe  
提醒