最初からLVMパーティションのサイズを変更する方法

最初からLVMパーティションのサイズを変更する方法

過去にlvmパーティションのサイズを変更しましたが、サイズ変更後、パーティションの末尾にスペースがありました。私が達成したいのは、パーティションの先頭にスペースを予約することです。

その理由は、grub2を使用したいのですが、grubイメージのサイズがMBRのサイズよりも大きいため、パーティションを少し移動してより多くのスペースを確保したいからです。

私の設定は次のとおりです。

ディスクドライブ:

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 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: 0xa2f2ca9b

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1              63   125949599    62974768+  8e  Linux LVM
/dev/sda2   *   125949600   230436359    52243380    7  HPFS/NTFS/exFAT
/dev/sda3       230436360   234436544     2000092+  82  Linux swap / Solaris

ソーラーディスプレイ:

  --- Physical volume ---
  PV Name               /dev/sda1
  VG Name               vg1
  PV Size               60.00 GiB / not usable 832.00 KiB
  Allocatable           yes (but full)
  PE Size               4.00 MiB
  Total PE              15360
  Free PE               0
  Allocated PE          15360
  PV UUID               6O3e7e-0ofs-mqpW-QyKM-H8yL-CwFf-zBkNES

グラフィックディスプレイ:

  --- Volume group ---
  VG Name               vg1
  System ID             
  Format                lvm2
  Metadata Areas        1
  Metadata Sequence No  9
  VG Access             read/write
  VG Status             resizable
  MAX LV                0
  Cur LV                2
  Open LV               0
  Max PV                0
  Cur PV                1
  Act PV                1
  VG Size               60.00 GiB
  PE Size               4.00 MiB
  Total PE              15360
  Alloc PE / Size       15360 / 60.00 GiB
  Free  PE / Size       0 / 0   
  VG UUID               RhdcOf-b1xm-QNQT-7cou-ctNA-eO4b-5p2nmq

LVは以下を示しています:

  --- Logical volume ---
  LV Name                /dev/vg1/lvroot
  VG Name                vg1
  LV UUID                xKbY2T-kyat-Ane0-guYy-ub2a-i8Gh-cUdSgZ
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                20.00 GiB
  Current LE             5120
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:3

  --- Logical volume ---
  LV Name                /dev/vg1/lvhome
  VG Name                vg1
  LV UUID                3PPBuA-iCpW-BXVG-F00F-VO6P-oUOB-Nct4Sc
  LV Write Access        read/write
  LV Status              available
  # open                 0
  LV Size                40.00 GiB
  Current LE             10240
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           254:4

私がしたいのは、lvrootのサイズを少し調整することです。この場合、1MBで十分です。その後、最初に折りたたんでからpvを縮小し、パーティションを削除してから、同じ終わりの位置に新しい開始から再作成します。

ベストアンサー1

gparted0.14.0は、lvm物理ボリュームの移動/サイズ調整をサポートするようになりました。

おすすめ記事