vgdisplay 和 lvdisplay 未找到卷组

sen*_*ale 8 lvm ubuntu

root@ubuntu-server:~# pvdisplay
root@ubuntu-server:~# vgdisplay
  No volume groups found
root@ubuntu-server:~# lvdisplay
  No volume groups found
root@ubuntu-server:~#
Run Code Online (Sandbox Code Playgroud)

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

我尝试:

pvcreate /dev/sdb5
  Device /dev/sdb5 not found (or ignored by filtering).
Run Code Online (Sandbox Code Playgroud)

这是我的 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
Run Code Online (Sandbox Code Playgroud)

还有我的 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
Run Code Online (Sandbox Code Playgroud)

qua*_*gar 7

很多时候,新用户对逻辑卷即使在正确设置后也没有显示感到困惑。如果您是这种情况,您是否尝试过以下操作?

pvscan
Run Code Online (Sandbox Code Playgroud)

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

vgscan
Run Code Online (Sandbox Code Playgroud)

查找现有卷组。如果您之前正确设置了它,应该显示您的卷组。

vgchange -a y
Run Code Online (Sandbox Code Playgroud)

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


Gab*_*iel 6

lvmetad缓存后台进程是最近推出的,有时甚至打破了LVM的隐式扫描。

pvscan --cache
Run Code Online (Sandbox Code Playgroud)

应该强制 LVM 重新扫描。


小智 5

您必须使用以下命令创建卷

vgcreate "name" /dev/sdb5
Run Code Online (Sandbox Code Playgroud)