大网数据广告活动
服务器运维问答

How to recover from drive failure on lvm software raid 10 in Linux?

· 52CE 我爱测

Below is how I created lvm software raid10. Create Physical Volumes pvcreate /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 Create Volume Group vgcreate my_vol_grp /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1 Create a…

问题原文

原帖链接 · fcukinyahoo · CC BY-SA 4.0

Below is how I created lvm software raid10.

Create Physical Volumes
pvcreate /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1

Create Volume Group
vgcreate my_vol_grp /dev/nvme0n1 /dev/nvme1n1 /dev/nvme2n1 /dev/nvme3n1

Create a logical volume with RAID10 from the already created volume group
lvcreate --type raid10 -m 1 -i 2 -l 100%FREE -n lvm_raid10 my_vol_grp

Create ext4 filesystem on the logical volume that you have created
mkfs.ext4 /dev/my_vol_grp/lvm_raid10

Now the question is, how do I recover and re-establish raid10 after 1 drive failure on lvm raid10 configuration. I can find a lot of information online about how to create lvm raid10. However, I can not find much information about how to recover in case the drive fails.

Also my server supports hot-swap. Thanks in advance.

已采纳解答

原帖链接 · John Mahowald · CC BY-SA 4.0

Add the new disk to the VG. Your VG and disk names will vary.

vgextend vg /dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi-disk-1

Based on the lvmraid manual, regarding Replacing Devices, unavailable PVs call for a repair operation.

lvconvert --repair vg/lv

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2019-03-25)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。