在使用 fdisk
对磁盘进行分区时,LVM(逻辑卷管理)分区的类型通常表示为 8e
。以下是对 LVM 分区类型及其相关基础概念的详细解释:
LVM(Logical Volume Management) 是一种用于管理磁盘存储空间的技术。它允许将多个物理磁盘或磁盘分区组合成一个或多个逻辑卷,从而提供更大的灵活性和可扩展性。
8e
在 fdisk
中,LVM 分区的类型代码是 8e
。这个代码表示该分区是一个 LVM 分区,操作系统会将其识别为 LVM 使用。
LVM 主要用于以下场景:
以下是使用 fdisk
创建 LVM 分区的基本步骤:
fdisk
:fdisk
:n
创建新分区。t
更改分区类型。8e
设置为 LVM 分区类型。w
保存分区表并退出 fdisk
。假设我们要在 /dev/sdb
上创建一个 LVM 分区:
sudo fdisk /dev/sdb
在 fdisk
提示符下:
Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-20971519, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-20971519, default 20971519):
Command (m for help): t
Selected partition 1
Hex code (type L to list all codes): 8e
Changed type of partition 'Linux' to 'Linux LVM'
Command (m for help): w
The partition table has been altered!
Calling ioctl() to re-read partition table.
Syncing disks.
问题:创建 LVM 分区后无法识别
原因:
解决方法:
通过以上步骤,您可以成功创建并使用 LVM 分区。
领取专属 10元无门槛券
手把手带您无忧上云