
CentOS6에서는 더 많은 여유 공간을 확보하기 위해 /dev/sdb1을 확장하고 싶습니다.
df -h Filesystem Size Used Avail Use% Mounted on /dev/mapper/vg_www-lv_root 18G 2.9G 14G 18% / tmpfs 3.9G 0 3.9G 0% /dev/shm /dev/sda1 477M 105M 347M 24% /boot /dev/sdb1 296G 233G 48G 84% /sqldata
VMWare에서는 물리적 하드디스크 SDB가 이미 600GB로 확장되었습니다. Fdisk /dev/sdb1은 다음과 같습니다.
Disk /dev/sda: 21.5 GB, 21474836480 bytes 255 heads, 63 sectors/track, 2610 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x000021cd
Device Boot Start End Blocks Id System /dev/sda1 * 1 64 512000 83 Linux Partition 1 does not end on cylinder boundary. /dev/sda2 64 2611 20458496 8e Linux LVM
Disk /dev/sdb: 644.2 GB, 644245094400 bytes 255 heads, 63 sectors/track, 78325 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x07acc91f
Device Boot Start End Blocks Id System /dev/sdb1 1 39162 314568733+ 83 Linux /dev/sdb2 39163 78325 314576797+ 8e Linux LVM
Disk /dev/mapper/vg_www-lv_root: 18.9 GB, 18865979392 bytes 255 heads, 63 sectors/track, 2293 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000
Disk /dev/mapper/vg_www-lv_swap: 2080 MB, 2080374784 bytes 255 heads, 63 sectors/track, 252 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000
보시다시피 /dev/sdb1은 볼륨 그룹의 일부가 아닙니다. 그래서 어떻게 진행해야할지 모르겠습니다.
나는 이미 Linux LVM으로 /dev/sdb2라는 새 파티션을 만들었습니다.
fdisk /dev/sdb
WARNING: DOS-compatible mode is deprecated. It's strongly recommended to switch off the mode (command 'c') and change display units to sectors (command 'u').
Command (m for help): p
Disk /dev/sdb: 644.2 GB, 644245094400 bytes 255 heads, 63 sectors/track, 78325 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Sector size (logical/physical): 512 bytes / 512 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x07acc91f
Device Boot Start End Blocks Id System /dev/sdb1 1 39162 314568733+ 83 Linux /dev/sdb2 39163 78325 314576797+ 8e Linux LVM
/dev/sdb2는 새로운 300GB의 디스크 공간을 포함하는 새로운(빈) 파티션입니다. 가동 중지 시간을 감당할 수 없기 때문에 sdb1과 sdb2를 "병합"하는 방법을 알고 싶습니다. 그러면 결국 약 600GB의 /sqldata가 됩니다.
감사해요!
답변1
단일 파티션인 이 환경에서는 가동 중지 시간이 필요할 가능성이 높습니다.
EL6 문서는 다음을 경고합니다.사용 중인 장치에서 크기 조정을 시도하지 않음. 이 파일 시스템을 사용하는 모든 것을 중지하고 마운트 해제한 후 파티션 테이블을 변경하십시오.
EL7은온라인으로 파티션 크기 조정 가능, 삭제, 재생성 및 partx --update
커널에 알려주는 트릭을 통해. 먼저 EL8로 업그레이드해야 합니다.
파티션 대신 LVM을 사용하면 이 작업이 더 쉬울 수 있습니다. 파티셔닝을 완전히 건너뜁니다. 와 같은 전체 장치에 물리적 볼륨을 생성합니다 /dev/sdb
. 디스크 크기를 조정한 다음 이를 사용하여 PV를pvresize
. LVM을 사용하지 않기 때문에 이는 새로운 LVM 저장소로의 마이그레이션이 됩니다.