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:~#

該怎麼辦。我在谷歌或其他地方找不到解決方案?

我嘗試:

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

相關內容