美文网首页wencentos
【LVM】LVM元数据丢失恢复

【LVM】LVM元数据丢失恢复

作者: Bogon | 来源:发表于2023-10-09 21:51 被阅读0次
# yum -y install  lvm2

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.cloud.aliyuncs.com
 * extras: mirrors.cloud.aliyuncs.com
 * updates: mirrors.cloud.aliyuncs.com
Package 7:lvm2-2.02.187-6.el7_9.5.x86_64 already installed and latest version

# yum info lvm2

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
 * base: mirrors.cloud.aliyuncs.com
 * extras: mirrors.cloud.aliyuncs.com
 * updates: mirrors.cloud.aliyuncs.com
Installed Packages
Name        : lvm2
Arch        : x86_64
Epoch       : 7
Version     : 2.02.187
Release     : 6.el7_9.5
Size        : 3.0 M
Repo        : installed
From repo   : updates
Summary     : Userland logical volume management tools
URL         : http://sources.redhat.com/lvm2
License     : GPLv2
Description : LVM2 includes all of the support for handling read/write operations on
            : physical volumes (hard disks, RAID-Systems, magneto optical, etc.,
            : multiple devices (MD), see mdadm(8) or even loop devices, see
            : losetup(8)), creating volume groups (kind of virtual disks) from one
            : or more physical volumes and creating one or more logical volumes
            : (kind of logical partitions) in volume groups.

# rpm -ql  lvm2 | grep -v share

/etc/lvm
/etc/lvm/archive
/etc/lvm/backup
/etc/lvm/cache
/etc/lvm/cache/.cache
/etc/lvm/lvm.conf
/etc/lvm/lvmlocal.conf
/etc/lvm/profile
/etc/lvm/profile/cache-mq.profile
/etc/lvm/profile/cache-smq.profile
/etc/lvm/profile/command_profile_template.profile
/etc/lvm/profile/lvmdbusd.profile
/etc/lvm/profile/metadata_profile_template.profile
/etc/lvm/profile/thin-generic.profile
/etc/lvm/profile/thin-performance.profile
/run/lock/lvm
/run/lvm
/usr/lib/systemd/system-generators/lvm2-activation-generator
/usr/lib/systemd/system/lvm2-lvmetad.service
/usr/lib/systemd/system/lvm2-lvmetad.socket
/usr/lib/systemd/system/lvm2-lvmpolld.service
/usr/lib/systemd/system/lvm2-lvmpolld.socket
/usr/lib/systemd/system/lvm2-monitor.service
/usr/lib/systemd/system/lvm2-pvscan@.service
/usr/lib/tmpfiles.d/lvm2.conf
/usr/lib/udev/rules.d/11-dm-lvm.rules
/usr/lib/udev/rules.d/69-dm-lvm-metad.rules
/usr/sbin/fsadm
/usr/sbin/lvchange
/usr/sbin/lvconvert
/usr/sbin/lvcreate
/usr/sbin/lvdisplay
/usr/sbin/lvextend
/usr/sbin/lvm
/usr/sbin/lvmconf
/usr/sbin/lvmconfig
/usr/sbin/lvmdiskscan
/usr/sbin/lvmdump
/usr/sbin/lvmetad
/usr/sbin/lvmpolld
/usr/sbin/lvmsadc
/usr/sbin/lvmsar
/usr/sbin/lvreduce
/usr/sbin/lvremove
/usr/sbin/lvrename
/usr/sbin/lvresize
/usr/sbin/lvs
/usr/sbin/lvscan
/usr/sbin/pvchange
/usr/sbin/pvck
/usr/sbin/pvcreate
/usr/sbin/pvdisplay
/usr/sbin/pvmove
/usr/sbin/pvremove
/usr/sbin/pvresize
/usr/sbin/pvs
/usr/sbin/pvscan
/usr/sbin/vgcfgbackup
/usr/sbin/vgcfgrestore
/usr/sbin/vgchange
/usr/sbin/vgck
/usr/sbin/vgconvert
/usr/sbin/vgcreate
/usr/sbin/vgdisplay
/usr/sbin/vgexport
/usr/sbin/vgextend
/usr/sbin/vgimport
/usr/sbin/vgimportclone
/usr/sbin/vgmerge
/usr/sbin/vgmknodes
/usr/sbin/vgreduce
/usr/sbin/vgremove
/usr/sbin/vgrename
/usr/sbin/vgs
/usr/sbin/vgscan
/usr/sbin/vgsplit
# rpm -ql  lvm2 | grep -v share | grep system

/usr/lib/systemd/system-generators/lvm2-activation-generator
/usr/lib/systemd/system/lvm2-lvmetad.service
/usr/lib/systemd/system/lvm2-lvmetad.socket
/usr/lib/systemd/system/lvm2-lvmpolld.service
/usr/lib/systemd/system/lvm2-lvmpolld.socket
/usr/lib/systemd/system/lvm2-monitor.service
/usr/lib/systemd/system/lvm2-pvscan@.service

# systemctl status  lvm2-lvmetad.service
● lvm2-lvmetad.service - LVM2 metadata daemon
   Loaded: loaded (/usr/lib/systemd/system/lvm2-lvmetad.service; static; vendor preset: enabled)
   Active: active (running) since Wed 2023-01-04 17:15:31 CST; 9 months 5 days ago
     Docs: man:lvmetad(8)
 Main PID: 10479 (lvmetad)
   CGroup: /system.slice/lvm2-lvmetad.service
           └─10479 /usr/sbin/lvmetad -f

Jan 04 17:15:31 bogon systemd[1]: Started LVM2 metadata daemon.


# cat /usr/lib/systemd/system/lvm2-lvmetad.service

[Unit]
Description=LVM2 metadata daemon
Documentation=man:lvmetad(8)
Requires=lvm2-lvmetad.socket
Before=shutdown.target
After=lvm2-lvmetad.socket
DefaultDependencies=no
Conflicts=shutdown.target

[Service]
Type=simple
NonBlocking=true
ExecStart=/usr/sbin/lvmetad -f
Environment=SD_ACTIVATION=1
Restart=on-abort
PIDFile=/run/lvmetad.pid
# systemctl status lvm2-lvmetad.socket
● lvm2-lvmetad.socket - LVM2 metadata daemon socket
   Loaded: loaded (/usr/lib/systemd/system/lvm2-lvmetad.socket; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2023-01-04 17:15:31 CST; 9 months 5 days ago
     Docs: man:lvmetad(8)
   Listen: /run/lvm/lvmetad.socket (Stream)


# cat /usr/lib/systemd/system/lvm2-lvmetad.socket
[Unit]
Description=LVM2 metadata daemon socket
Documentation=man:lvmetad(8)
DefaultDependencies=no
Conflicts=shutdown.target

[Socket]
ListenStream=/run/lvm/lvmetad.socket
SocketMode=0600
RemoveOnStop=true

[Install]
WantedBy=sysinit.target

参考

重启机器导致LVM莫名丢失
https://mp.weixin.qq.com/s/ytuuZXFT5ccY9nE8cdEzNw

记一次LVM元数据丢失的恢复过程
https://mp.weixin.qq.com/s/8dVRPWI_5G8LWL1XqorTvA

5 easy steps to recover LVM2 partition, PV, VG, LVM metdata in Linux
https://www.golinuxcloud.com/recover-lvm2-partition-restore-vg-pv-metadata

LVM恢复技术案例
https://www.cnblogs.com/zcyy/articles/16834848.html

(LVM) Cannot restore Volume Group with 1 PVs marked as missing. Couldn't find device with uuid, but the pv exists and blkid finds the same uuid
https://serverfault.com/questions/1016772/lvm-cannot-restore-volume-group-with-1-pvs-marked-as-missing-couldnt-find-de

相关文章

  • 基础篇

    Linux学习 一、LVM讲解 LVM有一定的局限性;数据恢复困难 物理分区==>物理卷==>卷组==>逻辑卷 准...

  • 数据库热备份神器 - XtraBackup

    常见的热备份方案 LVM方案 利用Linux的LVM技术来实现热备份,将MySQL的数据目录放到LVM逻辑卷上,然...

  • 存储管理Ⅱ-swap、逻辑卷

    一.存储管理Ⅱ 1.逻辑卷LVM 1.1.LVM管理 在线扩容 online 创建LVM VG的扩容 LVM的扩容...

  • mysql 备份、同步操作

    (第二十一周作业) 1、对数据库实现lvm2的备份和慢查询优化 1.1 LVM2备份操作 配合lvm2实现数据库备...

  • 三、RAID与LVM

    1、LVM介绍LVM的安装 采用yum install lvm2即可PV(Physical Volume)- ...

  • lvm讲解、磁盘故障小案例

    [TOC] 410 lvm讲解(上)(中)(下) LVM是一个复杂结构的软件,但是方便扩容和缩容。后期出现问题恢复...

  • Linux-8 存储管理-逻辑卷 交换分区 raid

    1.逻辑卷LVM 1.1.LVM管理 1.2.lvm的制作 实战 1.3.创建LVM 首先准备添加3块磁盘:可以是...

  • 九、LVM,swap,mount详解

    存储管理 二 1.逻辑卷LVM 1.1.LVM管理 1.2.lvm的制作 实战 1.3.创建LVM 首先准备添加1...

  • 磁盘扩容实战

    不损坏数据的情况下扩容非lvm磁盘 磁盘中有重要数据时请提前备份数据 扩容LVM类型磁盘 fstab 配置详解 第...

  • CentOS7 指定安装目录

    指定安装目录场景 系统盘 ssd raid 1 lvm 512G 数据盘 sas raid 5 lvm 12TB ...

网友评论

    本文标题:【LVM】LVM元数据丢失恢复

    本文链接:https://www.haomeiwen.com/subject/khxwbdtx.html