LVM 未显示 LV,尽管它正在使用中

LVM 未显示 LV,尽管它正在使用中

我有一台机器,其中 RAID-1 (sda) 托管 Debian 10,RAID-5 用于存储 (sdb),两者都使用独立的 PG。最近 RAID-5 损坏了,所以我重新创建了它并再次设置了 LVM:

pvcreate /dev/sdb1
vgcreate "server-h01-space" /dev/sdb1
lvcreate -n "storage" -L 20.5T server-h01-space

在设置期间pvcreatevgcreate报告了现有的 XFS 签名并提出将其擦除。我拒绝了,希望文件系统能够恢复。但是,lvcreate由于找不到卷组,所以失败了。我重新启动了机器并再次运行命令,这次擦除了 XFS 签名。之后,我设置了文件系统/dev/mapper/server--h01--space-storage并挂载了它。

然而,虽然一切似乎都运行良好,但所有 LVM 命令仅显示在 sda 上创建的内容。即 *display 命令报告

# pvdisplay
  --- Physical volume ---
  PV Name               /dev/sda2
  VG Name               server-h01
  PV Size               134.75 GiB / not usable 0
  Allocatable           yes
  PE Size               4.00 MiB
  Total PE              34497
  Free PE               7873
  Allocated PE          26624
  PV UUID               aaaaa-bbbb-cccc-dddd-eeee-ffff-ggggg

# vgdisplay
  --- Volume group ---
  VG Name               server-h01
  System ID
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  23
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                4
  Open LV               4
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               134.75 GiB
  PE Size               4.00 MiB
  Total PE              34497
  Alloc PE / Size       26624 / 104.00 GiB
  Free  PE / Size       7873 / 30.75 GiB
  VG UUID               11111-2222-3333-4444-5555-6666-7777-88888

# lvdisplay
  --- Logical volume ---
  LV Path                /dev/server-h01/root
  LV Name                root
  VG Name                server-h01
  LV UUID                ***
  LV Write Access        read/write
  LV Creation host, time Microknoppix, 2019-10-09 10:48:26 +0200
  LV Status              available
  # open                 1
  LV Size                25.00 GiB
  Current LE             6400
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:0

  --- Logical volume ---
  LV Path                /dev/server-h01/tmp
  LV Name                tmp
  VG Name                server-h01
  LV UUID                ***
  LV Write Access        read/write
  LV Creation host, time Microknoppix, 2019-10-09 10:48:37 +0200
  LV Status              available
  # open                 1
  LV Size                7.00 GiB
  Current LE             1792
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:2

  --- Logical volume ---
  LV Path                /dev/server-h01/var
  LV Name                var
  VG Name                server-h01
  LV UUID                ***
  LV Write Access        read/write
  LV Creation host, time Microknoppix, 2019-10-09 10:48:53 +0200
  LV Status              available
  # open                 1
  LV Size                63.00 GiB
  Current LE             1280
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:3

  --- Logical volume ---
  LV Path                /dev/server-h01/log
  LV Name                log
  VG Name                server-h01
  LV UUID                ***
  LV Write Access        read/write
  LV Creation host, time server-h01, 2019-10-13 21:40:41 +0200
  LV Status              available
  # open                 1
  LV Size                9.00 GiB
  Current LE             2304
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:6

这与mount

# mount|grep -e "^\/dev"
/dev/mapper/server--h01-root on / type xfs (rw,relatime,attr2,inode64,noquota)
/dev/sda1 on /boot type xfs (rw,relatime,attr2,inode64,noquota)
/dev/mapper/server--h01-tmp on /tmp type xfs (rw,relatime,attr2,inode64,usrquota,grpquota)
/dev/mapper/server--h01-var on /var type xfs (rw,relatime,attr2,inode64,usrquota,grpquota)
/dev/mapper/server--h01-log on /var/log type xfs (rw,noexec,relatime,attr2,inode64,noquota)
/dev/mapper/server--h01--space-storage on /storage type xfs (rw,noexec,relatime,attr2,inode64,usrquota,grpquota)

我担心 LVM 不是持久的,下次重启后会丢失。不幸的是,我在 /storage 中填充了几 TB 的数据后才发现这个问题。

有什么想法为什么mount不同意pvdisplay

编辑:按要求输出*扫描命令:

# pvscan
  PV /dev/sda2   VG server-h01      lvm2 [134.75 GiB / 30.75 GiB free]
  Total: 1 [134.75 GiB] / in use: 1 [134.75 GiB] / in no VG: 0 [0   ]

# vgscan
  Reading all physical volumes.  This may take a while...
  Found volume group "server-h01" using metadata type lvm2

# lvscan
  ACTIVE            '/dev/server-h01/root' [25.00 GiB] inherit
  ACTIVE            '/dev/server-h01/tmp' [7.00 GiB] inherit
  ACTIVE            '/dev/server-h01/var' [63.00 GiB] inherit
  ACTIVE            '/dev/server-h01/log' [9.00 GiB] inherit

编辑:这些是来自 /etc/lvm/archive 的相关日志

# Generated by LVM2 version 2.03.02(2) (2018-12-18): Sun May 14 15:56:19 2023

contents = "Text Format Volume Group"
version = 1

description = "Created *before* executing 'vgcreate server-h01-space /dev/sdb1'"

creation_host = "server-h01"    # Linux server-h01 4.19.0-24-amd64 #1 SMP Debian 4.19.282-1 (2023-04-29) x86_6
4
creation_time = 1684072579      # Sun May 14 15:56:19 2023

server-h01-space {
        id = "***"
        seqno = 0
        format = "lvm2"                 # informational
        status = ["RESIZEABLE", "READ", "WRITE"]
        flags = []
        extent_size = 8192              # 4 Megabytes
        max_lv = 0
        max_pv = 0
        metadata_copies = 0

        physical_volumes {

                pv0 {
                        id = "***"
                        device = "/dev/sdb1"    # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 58599665664  # 27.2876 Terabytes
                        pe_start = 2048
                        pe_count = 7153279      # 27.2876 Terabytes
                }
        }


}


# Generated by LVM2 version 2.03.02(2) (2018-12-18): Sun May 14 15:56:43 2023

contents = "Text Format Volume Group"
version = 1

description = "Created *before* executing 'lvcreate -n server -L 20.5T server-h01-space'"

creation_host = "server-h01"    # Linux server-h01 4.19.0-24-amd64 #1 SMP Debian 4.19.282-1 (2023-04-29) x86_6
4
creation_time = 1684072603      # Sun May 14 15:56:43 2023

server-h01-space {
        id = "***"
        seqno = 1
        format = "lvm2"                 # informational
        status = ["RESIZEABLE", "READ", "WRITE"]
        flags = []
        extent_size = 8192              # 4 Megabytes
        max_lv = 0
        max_pv = 0
        metadata_copies = 0

        physical_volumes {

                pv0 {
                        id = "***"
                        device = "/dev/sdb1"    # Hint only

                        status = ["ALLOCATABLE"]
                        flags = []
                        dev_size = 58599665664  # 27.2876 Terabytes
                        pe_start = 2048
                        pe_count = 7153279      # 27.2876 Terabytes
                }
        }


}

相关内容