如何将 SSD 上的逻辑卷交换空间扩展到至少 64 GB

如何将 SSD 上的逻辑卷交换空间扩展到至少 64 GB

我当前的物理卷配置如下。

  --- Physical volume ---
  PV Name               /dev/sda5
  VG Name               vgssd
  PV Size               190.89 GiB / not usable 1.00 MiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              48867
  Free PE               0
  Allocated PE          48867
  PV UUID               SaJLLb-KpaE-ZeyS-k5HR-eNQ6-A1tp-zpZjUe

  --- Physical volume ---
  PV Name               /dev/sdb
  VG Name               vgssd
  PV Size               465.76 GiB / not usable 4.02 MiB
  Allocatable           yes 
  PE Size               4.00 MiB
  Total PE              119234
  Free PE               194
  Allocated PE          119040
  PV UUID               yekbZZ-guPE-6Gjh-qJux-MjMi-RHYx-YevZop

以下是我的逻辑卷的配置:

  --- Logical volume ---
  LV Name                /dev/vgssd/home
  VG Name                vgssd
  LV UUID                XozHK8-4dJ2-XfQE-7f2J-xGLB-2nVg-rO9yA3
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                4.66 GiB
  Current LE             1192
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:0

  --- Logical volume ---
  LV Name                /dev/vgssd/swp
  VG Name                vgssd
  LV UUID                CyYT1b-BQhM-vwQa-W8oU-0E8Y-OVYD-894T86
  LV Write Access        read/write
  LV Status              available
  # open                 2
  LV Size                1.86 GiB
  Current LE             476
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:1

  --- Logical volume ---
  LV Name                /dev/vgssd/srv
  VG Name                vgssd
  LV UUID                aIwCXs-ibKG-5IUl-rxI1-UZJT-fypS-xpHyKC
  LV Write Access        read/write
  LV Status              available
  # open                 1
  LV Size                649.37 GiB
  Current LE             166239
  Segments               2
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:2

目前,我想将交换空间 ( /dev/vgssd/swp) 从 ~2 GB 扩展到 64 GB。我认为我可以缩小/dev/vgssd/srv并节省 64 GB 作为交换空间。但是,我不确定在实际扩展 ( ) 时新交换空间会分配给哪些物理卷/dev/sda5( ) 。/dev/sdb/dev/vgssd/swp

我想确保交换空间处于打开状态(具有 PV 名称的 SSD /dev/sda5),以便可以高速写入和读取数据。

你知道我该怎么做吗?

答案1

lvextend命令接受物理设备作为参数:

lvextend -L 64000 /dev/vgssd/swp /dev/sda5  

将在 /dev/sda5 上分配所有新的扩展

相关内容