0
0

More than 5 years have passed since last update.

LVMパーティションを縮小(やらないほうがいい)

Last updated at Posted at 2015-09-03

参考

LVMパーティションを縮小したい

  • proxmox3.4をインストールしたDISK(80GB)のLVMが以下図上のようになった。
  • 図下のように設定できたのでメモ (少し未割り当てが残った・・・) LVM.jpg

設定

pvscan
# pvscan
PV /dev/sdc3 VG pve lvm2 [74.40 GiB / 48.15 GiB free]
Total: 1 [74.40 GiB] / in use: 1 [74.40 GiB] / in no VG: 0 [0 ]
  • 74.40 - 48.15 = 26.25
26.25GBを指定したら怒られた
# pvresize --setphysicalvolumesize 26.25G /dev/sdc3
/dev/sdc3: cannot resize to 6719 extents as 6720 are allocated.
0 physical volume(s) resized / 1 physical volume(s) not resized
27GBの指定で成功
# pvresize --setphysicalvolumesize 27G /dev/sdc3
Physical volume "/dev/sdc3" changed
1 physical volume(s) resized / 0 physical volume(s) not resized
# pvs
PV VG Fmt Attr PSize PFree
/dev/sdc3 pve lvm2 a-- 27.00g 764.00m
確認
# gdisk -l /dev/sdc
Number Start (sector) End (sector) Size Code Name
1 34 2047 1007.0 KiB EF02
2 2048 262143 127.0 MiB EF00
3 262144 156301454 74.4 GiB 8E00
gdiskでsdc3のサイズを変更
# gdisk /dev/sdc
Command (? for help): d
Partition number (1-3): 3
Command (? for help): n
Partition number (3-128, default 3):
First sector (262144-156301454, default = 262144) or {+-}size{KMGTP}:
Last sector (262144-156301454, default = 156301454) or {+-}size{KMGTP}: +27G
Current type is 'Linux filesystem'
Hex code or GUID (L to show codes, Enter = 8300): 8E00
Changed type of partition to 'Linux LVM'
Command (? for help): w
Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!
Do you want to proceed? (Y/N): y
  • 念のためOS再起動した。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0