proxmox os 파티션 용량 증가

2024. 11. 12. 01:30Proxmox

proxmox 의 OS disk 를 clonezilla 를 이용하여 1TB HDD에서 2TB HDD로 이동했다.

 

증가한 크기만큼 /dev/pve/root 파티션이 늘어나지 않는다.

 

proxmox 공식 가이드 문서 참고하여

  1. parted 설치
    1. resizsepart 명령어로 사용하지 않는 공간 /dev/sda3 (/dev/pve/root) 의 LVM 있는 부분의 용량 늘려줌
  2. lvresize 명령어 이용하여 lvm 파티션 크기 조정함
root@pve:~# apt install parted -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  proxmox-kernel-6.2 proxmox-kernel-6.2.16-15-pve proxmox-kernel-6.2.16-20-pve telnet
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libparted2
Suggested packages:
  libparted-dev libparted-i18n parted-doc
The following NEW packages will be installed:
  libparted2 parted
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 333 kB of archives.
After this operation, 662 kB of additional disk space will be used.
Get:1 http://ftp.kr.debian.org/debian bookworm/main amd64 libparted2 amd64 3.5-3 [294 kB]
Get:2 http://ftp.kr.debian.org/debian bookworm/main amd64 parted amd64 3.5-3 [39.1 kB]
Fetched 333 kB in 0s (1,077 kB/s) 
Selecting previously unselected package libparted2:amd64.
(Reading database ... 94297 files and directories currently installed.)
Preparing to unpack .../libparted2_3.5-3_amd64.deb ...
Unpacking libparted2:amd64 (3.5-3) ...
Selecting previously unselected package parted.
Preparing to unpack .../parted_3.5-3_amd64.deb ...
Unpacking parted (3.5-3) ...
Setting up libparted2:amd64 (3.5-3) ...
Setting up parted (3.5-3) ...
Processing triggers for libc-bin (2.36-9+deb12u9) ...
Processing triggers for man-db (2.11.2-2) ...
root@pve:~# parted /dev/sda
GNU Parted 3.5
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA TOSHIBA DT01ACA2 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      17.4kB  1049kB  1031kB                     bios_grub
 2      1049kB  538MB   537MB   fat32              boot, esp
 3      538MB   1000GB  1000GB                     lvm

(parted) resizepart 3 100%
(parted) quit
Information: You may need to update /etc/fstab.

root@pve:~# parted /dev/sda                                               
GNU Parted 3.5
Using /dev/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print                                                            
Model: ATA TOSHIBA DT01ACA2 (scsi)
Disk /dev/sda: 2000GB
Sector size (logical/physical): 512B/4096B
Partition Table: gpt
Disk Flags: 

Number  Start   End     Size    File system  Name  Flags
 1      17.4kB  1049kB  1031kB                     bios_grub
 2      1049kB  538MB   537MB   fat32              boot, esp
 3      538MB   2000GB  2000GB                     lvm

(parted) quit                                                             
root@pve:~# lvdisplay
  --- Logical volume ---
  LV Path                /dev/pve/swap
  LV Name                swap
  VG Name                pve
  LV UUID                i5oTEJ-0qyF-Qj8c-e2FX-P2Kx-9aWH-e4XghU
  LV Write Access        read/write
  LV Creation host, time proxmox, 2023-01-28 21:48:29 +0900
  LV Status              available
  # open                 2
  LV Size                8.00 GiB
  Current LE             2048
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:2
   
  --- Logical volume ---
  LV Path                /dev/pve/root
  LV Name                root
  VG Name                pve
  LV UUID                deAFzJ-0YZG-GPfc-oJv8-uZ7a-xypM-aqlOuu
  LV Write Access        read/write
  LV Creation host, time proxmox, 2023-01-28 21:48:29 +0900
  LV Status              available
  # open                 1
  LV Size                <923.01 GiB
  Current LE             236290
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:3
   
root@pve:~# pvresize /dev/sda3
  Physical volume "/dev/sda3" changed
  1 physical volume(s) resized or updated / 0 physical volume(s) not resized
root@pve:~# lvdisplay
  --- Logical volume ---
  LV Path                /dev/pve/swap
  LV Name                swap
  VG Name                pve
  LV UUID                i5oTEJ-0qyF-Qj8c-e2FX-P2Kx-9aWH-e4XghU
  LV Write Access        read/write
  LV Creation host, time proxmox, 2023-01-28 21:48:29 +0900
  LV Status              available
  # open                 2
  LV Size                8.00 GiB
  Current LE             2048
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:2
   
  --- Logical volume ---
  LV Path                /dev/pve/root
  LV Name                root
  VG Name                pve
  LV UUID                deAFzJ-0YZG-GPfc-oJv8-uZ7a-xypM-aqlOuu
  LV Write Access        read/write
  LV Creation host, time proxmox, 2023-01-28 21:48:29 +0900
  LV Status              available
  # open                 1
  LV Size                <923.01 GiB
  Current LE             236290
  Segments               1
  Allocation             inherit
  Read ahead sectors     auto
  - currently set to     256
  Block device           252:3
   
root@pve:~# lvresize --extents +100%FREE --resizefs /dev/pve/root
  Size of logical volume pve/root changed from <923.01 GiB (236290 extents) to 1.81 TiB (474755 extents).
  Logical volume pve/root successfully resized.
resize2fs 1.47.0 (5-Feb-2023)
Filesystem at /dev/mapper/pve-root is mounted on /; on-line resizing required
old_desc_blocks = 116, new_desc_blocks = 232
The filesystem on /dev/mapper/pve-root is now 486149120 (4k) blocks long.

root@pve:~# resize2fs /dev/sda3
resize2fs 1.47.0 (5-Feb-2023)
resize2fs: Device or resource busy while trying to open /dev/sda3
Couldn't find valid filesystem superblock.
root@pve:~# df -h
Filesystem            Size  Used Avail Use% Mounted on
udev                  252G     0  252G   0% /dev
tmpfs                  51G  2.9M   51G   1% /run
/dev/mapper/pve-root  1.8T  124G  1.6T   8% /
tmpfs                 252G   40M  252G   1% /dev/shm
tmpfs                 5.0M     0  5.0M   0% /run/lock
/dev/sda2             511M  336K  511M   1% /boot/efi
/dev/fuse             128M   28K  128M   1% /etc/pve
tmpfs                  51G     0   51G   0% /run/user/0
root@pve:~#

 

 

참고

https://pve.proxmox.com/wiki/Resize_disks#Example_with_EFI

 

Resize disks - Proxmox VE

1. Resizing guest disk General considerations When you resize the disk of a VM, to avoid confusion and disasters think the process like adding or removing a disk platter. If you enlarge the hard disk, once you have added the disk plate, your partition tabl

pve.proxmox.com