스캐닝 장치

스캐닝 장치

CentOS 가상 서버용 vSphere에서 두꺼운 가상 하드 디스크를 80GB로 확장했습니다.

논리 볼륨을 허용되는 최대 크기까지 확장해야 합니다. 실제 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를 누르기 전에 테스트 환경에서 테스트하십시오!

답변2

재부팅하지 않고 크기가 조정된 새로운 디스크를 감지하기 위해 다른 검사를 수행해야 하는 경우도 있습니다.

스캐닝 장치

#list devices
ls /sys/class/scsi_device/
#rescan device 
echo 1 > /sys/class/scsi_device/0\:0\:0\:0/device/rescan
#another type rescan device 
echo "- - -" > /sys/class/scsi_host/host#/scan

시스템을 재부팅할 수 있다면 ps rebbot이 가장 좋습니다.

학교를 스캔하면 dmesg변경 사항에 대한 정보가 표시됩니다.

디스크 크기 조정

PFree 열을 스캔하면 사용 가능한 공간이 표시됩니다.

# and you now schoul have option resize lvm 
 lvextend -l +100%FREE /dev/vg_cpanel02/LogVol01
#  and resize file system
 resize2fs /dev/vg_cpanel02/LogVol01

관련 정보