スキャン装置

スキャン装置

CentOS仮想サーバー用のvSphereで、厚い仮想ハードディスクを80 GBに拡張しました。

論理ボリュームを最大許容サイズまで拡張する必要があります。実際のsda2は現在63.25GBしか認識していません。

LV       VG          Attr       LSize  Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
LogVol00 vg_cpanel02 -wi-ao----  4.00g
LogVol01 vg_cpanel02 -wi-ao---- 59.25g


PV         VG          Fmt  Attr PSize  PFree
/dev/sda2  vg_cpanel02 lvm2 a--u 63.25g    0

ベストアンサー1

簡単に言えば、ステップは次のとおりです。

scsi バスを再起動または再検索します。

echo '1' > /sys/class/scsi_disk/0\:0\:0\:0/device/rescan

正しいディスクを識別します。

fdisk -l

これは/dev/sdaまたは/dev/vdaに似ています。

fdiskを使用して新しいパーティションを作成し、LVMでラベルを付けます(sdxを正しいディスクに置き換えます)。

fdisk /dev/[sdx]
Press p to print the partition table to identify the number of partitions.
Press n to create a new primary partition.
Press p for primary.
Press a number for the partition number, depending on the output of the partition table print.
Press Enter two times.
Press t to change the system's partition ID.
Press the number of the just created partition.
Type 8e to change the Hex Code of the partition for Linux LVM.
Press w to write the changes to the partition table.

新しいPVを作成します(sdxと0を正しいディスクとパーティションに置き換えます)。

pvcreate /dev/[sdx][0]

新しいPVにVGを拡張:

vgextend vg_cpanel02 /dev/[sdx][0]

利用可能なすべてのサイズに正しいLVを拡張します(これが正しいLVであることを確認してください!)。

lvextend -l +100%FREE /dev/vg_cpanel02/LogVol00

今LVのサイズが変更され、残っているのはファイルシステムのサイズを変更するだけです。使用しているファイルシステムに応じて、xfs_growまたはresize2fsを使用してこれを実行できます。

ディスク拡張については、VMWareのマニュアルで簡単に説明しています。

https://kb.vmware.com/selfservice/microsites/search.do?言語=en_US&cmd=displayKC&externalId=1006371

CentOSのLVMに関する完全なドキュメントは次のとおりです。

https://www.centos.org/docs/5/html/Cluster_Logical_Volume_Manager/index.html

注意してください。正しいことをしているかどうかわからない場合は、コマンドをもう一度読み、Enterを押す前にテスト環境でテストしてください。

おすすめ記事