我无法创建此分区,出现如下错误:
设备 /dev/mapper/vg_paperino-lv_rootp1 未找到(或被过滤忽略)
以下是我在 CentOS 上执行的步骤:
[root@pippo ~]# fdisk /dev/mapper/vg_paperino-lv_root
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to
switch off the mode (command 'c') and change display units to
sectors (command 'u').
Command (m for help): p
Disk /dev/mapper/vg_paperino-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: 0xdb344dbe
Device Boot Start End Blocks Id System
/dev/mapper/vg_paperino-lv_rootp1 1 3 24066 83 Linux
Command (m for help): q
[root@pippo ~]# pvcreate /dev/mapper/vg_paperino-lv_rootp1
Device /dev/mapper/vg_paperino-lv_rootp1 not found (or ignored by filtering).
答案1
是的,这不是一个普通的分区。它是在您将一些整个磁盘或磁盘分区分配给 LVM 中的逻辑卷后由 pvcreate 创建的。
假设您有 2 个分区:/dev/sda1 和 /dev/sdb1。
首先将它们标记为 LVM 分区:
pvcreate /dev/sda1 /dev/sdb1
然后将它们添加到卷组中:
vgcreate new_vol_group /dev/sda1 /dev/sdb1
您可以使用以下命令确认这一点vgs
:
# vgs
VG #PV #LV #SN Attr VSize VFree
new_vol_group 2 0 0 wz--n- 51.45G 51.45G
然后创建逻辑卷:
lvcreate -L2G -n new_logical_volume new_vol_group
Logical volume "new_logical_volume" created
然后在逻辑卷上创建文件系统:
mkfs -t ext4 /dev/new_vol_group/new_logical_volume
然后安装它:
mount /dev/new_vol_group/new_logical_volume /mnt