vgdisplay 和 lvdisplay 未找到卷组

vgdisplay 和 lvdisplay 未找到卷组
root@ubuntu-server:~# pvdisplay
root@ubuntu-server:~# vgdisplay
  No volume groups found
root@ubuntu-server:~# lvdisplay
  No volume groups found
root@ubuntu-server:~#

该怎么办?我在 Google 或其他地方找不到解决方案?

我尝试:

pvcreate /dev/sdb5
  Device /dev/sdb5 not found (or ignored by filtering).

这是我的 fdisk:

 fdisk -l

Disk /dev/sdb: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00050ccb

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048      499711      248832   83  Linux
/dev/sdb2          501758   488396799   243947521    5  Extended
/dev/sdb5          501760   488396799   243947520   8e  Linux LVM

Disk /dev/sda: 250.1 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00050ccb

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048      499711      248832   fd  Linux raid autodetect
/dev/sda2          501758   488396799   243947521    5  Extended
/dev/sda5          501760   488396799   243947520   fd  Linux raid autodetect

Disk /dev/mapper/ubuntu--server-root: 247.7 GB, 247652679680 bytes
255 heads, 63 sectors/track, 30108 cylinders, total 483696640 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/ubuntu--server-root doesn't contain a valid partition table

Disk /dev/mapper/ubuntu--server-swap_1: 2143 MB, 2143289344 bytes
255 heads, 63 sectors/track, 260 cylinders, total 4186112 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/ubuntu--server-swap_1 doesn't contain a valid partition table

和我的 df -h

df -h

Filesystem                       Size  Used Avail Use% Mounted on
/dev/mapper/ubuntu--server-root  231G  5,0G  214G   3% /
udev                             993M   12K  993M   1% /dev
tmpfs                            401M  356K  401M   1% /run
none                             5,0M     0  5,0M   0% /run/lock
none                            1002M     0 1002M   0% /run/shm
/dev/sdb1                        228M   25M  192M  12% /boot

答案1

新用户经常会因为逻辑卷未显示而感到困惑,即使已正确设置。如果您遇到这种情况,您是否尝试过以下操作?

pvscan

这将扫描物理卷。它应该会显示/dev/sdb5您是否之前将其设为 LVM 物理卷。

vgscan

查找现有卷组。如果您之前已正确设置卷组,则应该会显示该卷组。

vgchange -a y

激活所有可用卷组(将其“活动”状态更改为“是”)。现在您的逻辑卷应该显示在/dev/mapper/和 中/dev/VGNAME/LVNAME

答案2

缓存守护进程lvmetad是最近引入的,有时会破坏 LVM 的隐式扫描。

pvscan --cache

应该强制 LVM 重新扫描。

答案3

您必须使用以下方式创建卷

vgcreate "name" /dev/sdb5

相关内容