LVM 在 RHEL6 中显示为单独的分区

LVM 在 RHEL6 中显示为单独的分区

当我在硬盘上创建逻辑卷时,新分区显示在 fdisk -l 输出中。

[root@linux1 ~]# fdisk -l

Disk /dev/sda: 21.5 GB, 21474836480 bytes
255 heads, 63 sectors/track, 2610 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000bbaa3

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          64      512000   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              64        2611    20458496   8e  Linux LVM

Disk /dev/mapper/vg_linux1-lv_root: 18.8 GB, 18832424960 bytes
255 heads, 63 sectors/track, 2289 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Disk /dev/mapper/vg_linux1-lv_root doesn't contain a valid partition table

Disk /dev/mapper/vg_linux1-lv_swap: 2113 MB, 2113929216 bytes
255 heads, 63 sectors/track, 257 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

[root@linux1 ~]# pvs
  PV         VG        Fmt  Attr PSize  PFree
  /dev/sda2  vg_linux1 lvm2 a--  19.51g    0
[root@linux1 ~]# vgs
  VG        #PV #LV #SN Attr   VSize  VFree
  vg_linux1   1   2   0 wz--n- 19.51g    0
[root@linux1 ~]# lvs
  LV      VG        Attr   LSize  Origin Snap%  Move Log Copy%  Convert
  lv_root vg_linux1 -wi-ao 17.54g
  lv_swap vg_linux1 -wi-ao  1.97g

请帮我如何禁止将逻辑卷显示为单独的硬盘,否则如果我们有更多的硬盘和更多的 LVM,就会产生混乱。

我不想"/dev/mapper/vg_linux1-lv_root"在 fdisk -l 输出中看到 LV 磁盘。如果有任何配置更改可以实现这一点,请告诉我。

答案1

fdisk按照设计运行,即使设计明显有问题。

从手册页中:

       -l     List the partition tables for the  specified  devices  and  then
              exit.   If no devices are given, those mentioned in /proc/parti‐
              tions (if that exists) are used.

要解决此问题,请明确指定要使用的磁盘。例如:

fdisk -l /dev/sd?

相关内容