• Welcome to LiuJason's Blog!

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

Linux笔记 Jason 3 months ago (10-23) 165 Views 0 Comments QR code of this page

懒….

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


This article is under CC BY-NC-SA 4.0 license.
Please quote the original link:https://www.liujason.com/article/324.html
Like (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址