가상 서버 Ubuntu 18.04 OS 운영 체체를 운영하다 디스크 확장하는 사양 변경후 디스크 확장은 이루어지지 않고 fdisk 정보로 확인시 GPT PMBR size mismatch 출력되는 현상이 있습니다.
해당 문제 발생하는 부분은 쉽게 parted 명령어로 해결될수 있습니다.
parted로 픽스한 후에 확장한 파티션은 제거후 다시 사이즈 설정후 resize2fs로 확장하는 작업을 해야 최종적으로 디스크 확장이 됩니다.
문제 발생시 참고 하시면 됩니다.
- df 명령어로 확인시
# df -Th Filesystem Type Size Used Avail Use% Mounted on udev devtmpfs 7.9G 0 7.9G 0% /dev tmpfs tmpfs 1.6G 6.6M 1.6G 1% /run /dev/vda1 ext4 25G 4.6G 20G 20% / tmpfs tmpfs 7.9G 0 7.9G 0% /dev/shm tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup /dev/vda15 vfat 105M 8.8M 96M 9% /boot/efi tmpfs tmpfs 1.6G 0 1.6G 0% /run/user/1002 # fdisk /dev/vda Welcome to fdisk (util-linux 2.31.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. GPT PMBR size mismatch (52428799 != 104857599) will be corrected by w(rite). GPT PMBR size mismatch (52428799 != 104857599) will be corrected by w(rite).
- parted 명령어로 픽스
# parted /dev/vda GNU Parted 3.2 Using /dev/vda Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) p Warning: Not all of the space available to /dev/vda appears to be used, you can fix the GPT to use all of the space (an extra 52428800 blocks) or continue with the current setting? Fix/Ignore? F Model: Virtio Block Device (virtblk) Disk /dev/vda: 53.7GB Sector size (logical/physical): 512B/512B Partition Table: gpt Disk Flags: Number Start End Size File system Name Flags 14 1049kB 5243kB 4194kB bios_grub 15 5243kB 116MB 111MB fat32 boot, esp 1 116MB 26.8GB 26.7GB ext4 (parted)
- fdisk로 파티션 재설정
# fdisk /dev/vda Welcome to fdisk (util-linux 2.31.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command. Command (m for help): p Disk /dev/vda: 50 GiB, 53687091200 bytes, 104857600 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 Disklabel type: gpt Disk identifier: 5D3036B0-DA35-4E51-9DB7-95BCBB8EC576 Device Start End Sectors Size Type /dev/vda1 227328 52428766 52201439 24.9G Linux filesystem /dev/vda14 2048 10239 8192 4M BIOS boot /dev/vda15 10240 227327 217088 106M EFI System Partition table entries are not in disk order. Command (m for help): d Partition number (1,14,15, default 15): 1 Partition 1 has been deleted. Command (m for help): n Partition number (1-13,16-128, default 1): First sector (34-104857566, default 227328): Last sector, +sectors or +size{K,M,G,T,P} (227328-104857566, default 104857566): Created a new partition 1 of type 'Linux filesystem' and of size 49.9 GiB. Partition #1 contains a ext4 signature. Do you want to remove the signature? [Y]es/[N]o: y The signature will be removed by a write command. Command (m for help): p Disk /dev/vda: 50 GiB, 53687091200 bytes, 104857600 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 Disklabel type: gpt Disk identifier: 5D3036B0-DA35-4E51-9DB7-95BCBB8EC576 Device Start End Sectors Size Type /dev/vda1 227328 104857566 104630239 49.9G Linux filesystem /dev/vda14 2048 10239 8192 4M BIOS boot /dev/vda15 10240 227327 217088 106M EFI System Filesystem/RAID signature on partition 1 will be wiped. Partition table entries are not in disk order. Command (m for help): w The partition table has been altered. Syncing disks.
- resize2fs로 확장
# resize2fs /dev/vda12 resize2fs 1.44.1 (24-Mar-2018) open: No such file or directory while opening /dev/vda12 root@iwinv6-mrtg:~# resize2fs /dev/vda1 resize2fs 1.44.1 (24-Mar-2018) Filesystem at /dev/vda1 is mounted on /; on-line resizing required old_desc_blocks = 4, new_desc_blocks = 7 The filesystem on /dev/vda1 is now 13078779 (4k) blocks long. # df -Th Filesystem Type Size Used Avail Use% Mounted on udev devtmpfs 7.9G 0 7.9G 0% /dev tmpfs tmpfs 1.6G 6.6M 1.6G 1% /run /dev/vda1 ext4 49G 4.6G 44G 10% / tmpfs tmpfs 7.9G 0 7.9G 0% /dev/shm tmpfs tmpfs 5.0M 0 5.0M 0% /run/lock tmpfs tmpfs 7.9G 0 7.9G 0% /sys/fs/cgroup /dev/vda15 vfat 105M 8.8M 96M 9% /boot/efi tmpfs tmpfs 1.6G 0 1.6G 0% /run/user/1002