Fedora 18 使用 LVM 分区添加新硬盘

Fedora 18 使用 LVM 分区添加新硬盘

我最近组装了我的第一台计算机,今天我意识到尽管有多个硬盘,但由于我没有正确设置分区,所以我没有足够的空间。

我正在尝试将我的两个硬盘(不是启动盘)添加到我的 LVM 组。

首先,我按照以下示例在两个驱动器中创建了 LVM 分区: http://www.server-world.info/en/note?os=Fedora_18&p=add_hd

现在,输出fdisk -l显示:

[root@localhost lvm]# fdisk -l

Disk /dev/sda: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0x1d04f8ff

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1            2048  3907029167  1953513560   8e  Linux LVM

Disk /dev/sdb: 256.1 GB, 256060514304 bytes, 500118192 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: 0x000988f9

   Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *        2048     1026047      512000   83  Linux
/dev/sdb2         1026048   500117503   249545728   8e  Linux LVM

Disk /dev/sdc: 500.1 GB, 500107862016 bytes, 976773168 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: 0x00000081

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1   *          63   976768064   488384001   83  Linux

Disk /dev/sdd: 2000.4 GB, 2000398934016 bytes, 3907029168 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: 0xa2da0487

   Device Boot      Start         End      Blocks   Id  System
/dev/sdd1            2048  3907029167  1953513560   8e  Linux LVM

Disk /dev/mapper/fedora-swap: 8338 MB, 8338276352 bytes, 16285696 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 /dev/mapper/fedora-root: 53.7 GB, 53687091200 bytes, 104857600 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 /dev/mapper/fedora-home: 193.5 GB, 193508409344 bytes, 377946112 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

现在,要将新创建的分区添加到 LVM 组,我按照此处提供的说明进行操作: http://www.techotopia.com/index.php/Adding_a_New_Disk_to_a_Fedora_Volume_Group_and_Logical_Volume 我应该运行pvcreate sda,这会给我:

[root@localhost namu]# pvcreate /dev/sda
  Device /dev/sda not found (or ignored by filtering).

\etc\lvm\lvm.conf,我将过滤器设置为

filter = [ "a/.*/" ]

我删除/etc/lvm/cache并重新启动了系统但pvcreate sda仍然返回相同的消息。

我运行了下面的一组命令来查看我的计算机是否正确检测这些分区:

[root@localhost namu]# cat /proc/mdstat
Personalities : 
unused devices: <none>
[root@localhost namu]# pvscan
  PV /dev/sdb2   VG fedora   lvm2 [237.98 GiB / 0    free]
  Total: 1 [237.98 GiB] / in use: 1 [237.98 GiB] / in no VG: 0 [0   ]
[root@localhost namu]#  lvscan
  ACTIVE            '/dev/fedora/swap' [7.77 GiB] inherit
  ACTIVE            '/dev/fedora/home' [180.22 GiB] inherit
  ACTIVE            '/dev/fedora/root' [50.00 GiB] inherit

但似乎不是。有人能帮忙吗?谢谢。

答案1

我终于明白了。

问题是,通过将驱动器格式更改为 LVM,我实际上是在创建硬盘的一个分区(几乎是整个硬盘)。该分区是 /dev/sda1。因此,我必须使用命令

pvcreate /dev/sda1

如果将来有人在将硬盘添加到现有 LVM 组时遇到问题,我建议按照以下说明进行操作

http://www.server-world.info/en/note?os=Fedora_18&p=add_hd

创建 LVM 分区,然后

http://www.techotopia.com/index.php/Adding_a_New_Disk_to_a_Fedora_Volume_Group_and_Logical_Volume

将这个新分区添加到卷组。

相关内容