Proxmox Backup Server extend disk

Problem

Proxmox Backup Server 4.2.0 (Linux pbs 7.0.0-3-pve) has a disk which is 100GB big. The disk should be extended to 250GB (add 150GB).
 

Solution 

  1. Extend the Proxmox Backup Server virtual machines disk in the hypervisor (Proxmox, ESXi, KVM,..)
  2. Check pvs, vgs, lvs and fdisk -l
  3. mv /etc/apt/sources.list.d/pbs-enterprise.sources /etc/apt/sources.list.d/pbs-enterprise.sources.disabled
  4. vi /etc/apt/sources.list.d/pbs-no-subscription.list

    Add: 
    deb http://download.proxmox.com/debian/pbs trixie pbs-no-subscription

    Like this:
    root@pbs:~#
    root@pbs:~# cat /etc/apt/sources.list.d/pbs-no-subscription.list
    deb http://download.proxmox.com/debian/pbs trixie pbs-no-subscription
    root@pbs:~# 

  5. apt update && apt install -y cloud-guest-utils
  6. growpart /dev/sda 3
  7. lvextend -r -l +100%FREE /dev/pbs/root
  8. Check pvs, vgs, lvs and fdisk -l

Example

root@pbs:~#
root@pbs:~#
root@pbs:~# pvs
  PV         VG  Fmt  Attr PSize   PFree  
  /dev/sda3  pbs lvm2 a--  <99.50g <12.38g
root@pbs:~# vgs
  VG  #PV #LV #SN Attr   VSize   VFree  
  pbs   1   2   0 wz--n- <99.50g <12.38g
root@pbs:~# lvs
  LV   VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root pbs -wi-ao---- <79.37g                                                    
  swap pbs -wi-ao----   7.75g                                                    
root@pbs:~# 
root@pbs:~# fdisk -l
GPT PMBR size mismatch (209715199 != 524287999) will be corrected by write.
The backup GPT table is not on the end of the device.
Disk /dev/sda: 250 GiB, 268435456000 bytes, 524288000 sectors
Disk model: Virtual disk    
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: AAAAABBA-D00A-11DD-1A1A-AAAB00000000

Device       Start       End   Sectors  Size Type
/dev/sda1       34      2047      2014 1007K BIOS boot
/dev/sda2     2048   1050623   1048576  512M EFI System
/dev/sda3  1050624 209715166 208664543 99.5G Linux LVM


Disk /dev/mapper/pbs-swap: 7.75 GiB, 8325693440 bytes, 16261120 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


Disk /dev/mapper/pbs-root: 79.37 GiB, 85219868672 bytes, 166445056 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
root@pbs:~# 
root@pbs:~# 
root@pbs:~# apt update && apt install -y cloud-guest-utils
Hit:1 http://deb.debian.org/debian trixie InRelease
Hit:2 http://security.debian.org/debian-security trixie-security InRelease
Hit:3 http://deb.debian.org/debian trixie-updates InRelease
Err:4 https://enterprise.proxmox.com/debian/pbs trixie InRelease
  401  Unauthorized [IP: 1.2.3.4 443]
Error: Failed to fetch https://enterprise.proxmox.com/debian/pbs/dists/trixie/InRelease  401  Unauthorized [IP: 1.2.3.4 443]
Error: The repository 'https://enterprise.proxmox.com/debian/pbs trixie InRelease' is not signed.
Notice: Updating from such a repository can't be done securely, and is therefore disabled by default.
Notice: See apt-secure(8) manpage for repository creation and user configuration details.
root@pbs:~# 
root@pbs:~# 
root@pbs:~# mv /etc/apt/sources.list.d/pbs-enterprise.sources /etc/apt/sources.list.d/pbs-enterprise.sources.disabled
root@pbs:~# 
root@pbs:~# vi /etc/apt/sources.list.d/pbs-no-subscription.list
root@pbs:~# cat /etc/apt/sources.list.d/pbs-no-subscription.list
deb http://download.proxmox.com/debian/pbs trixie pbs-no-subscription
root@pbs:~# 
root@pbs:~# apt-get update
Get:1 http://download.proxmox.com/debian/pbs trixie InRelease [2,785 B]
Hit:2 http://deb.debian.org/debian trixie InRelease                              
Hit:3 http://security.debian.org/debian-security trixie-security InRelease
Hit:4 http://deb.debian.org/debian trixie-updates InRelease
Get:5 http://download.proxmox.com/debian/pbs trixie/pbs-no-subscription amd64 Packages [217 kB]
Fetched 220 kB in 0s (844 kB/s)   
Reading package lists... Done
root@pbs:~# 
root@pbs:~# 
root@pbs:~# apt update && apt install -y cloud-guest-utils
Hit:1 http://deb.debian.org/debian trixie InRelease
Hit:2 http://security.debian.org/debian-security trixie-security InRelease
Hit:3 http://download.proxmox.com/debian/pbs trixie InRelease
Hit:4 http://deb.debian.org/debian trixie-updates InRelease
2 packages can be upgraded. Run 'apt list --upgradable' to see them.
Installing:                     
  cloud-guest-utils

Suggested packages:
  cloud-init

Summary:
  Upgrading: 0, Installing: 1, Removing: 0, Not Upgrading: 2
  Download size: 27.9 kB
  Space needed: 72.7 kB / 57.0 GB available

Get:1 http://deb.debian.org/debian trixie/main amd64 cloud-guest-utils all 0.33-1 [27.9 kB]
Fetched 27.9 kB in 0s (454 kB/s)             
Selecting previously unselected package cloud-guest-utils.
(Reading database ... 42969 files and directories currently installed.)
Preparing to unpack .../cloud-guest-utils_0.33-1_all.deb ...
Unpacking cloud-guest-utils (0.33-1) ...
Setting up cloud-guest-utils (0.33-1) ...
Processing triggers for man-db (2.13.1-1) ...
root@pbs:~# 
root@pbs:~# 
root@pbs:~# growpart /dev/sda 3
CHANGED: partition=3 start=1050624 old: size=208664543 end=209715166 new: size=523237343 end=524287966
root@pbs:~# 
root@pbs:~# 
root@pbs:~# lvextend -r -l +100%FREE /dev/pbs/root
  File system ext4 found on pbs/root mounted at /.
  Size of logical volume pbs/root changed from <79.37 GiB (20318 extents) to 241.74 GiB (61886 extents).
  Extending file system ext4 to 241.74 GiB (259568697344 bytes) on pbs/root...
resize2fs /dev/pbs/root
resize2fs 1.47.2 (1-Jan-2025)
Filesystem at /dev/pbs/root is mounted on /; on-line resizing required
old_desc_blocks = 10, new_desc_blocks = 31
The filesystem on /dev/pbs/root is now 63371264 (4k) blocks long.

resize2fs done
  Extended file system ext4 on pbs/root.
  Logical volume pbs/root successfully resized.
root@pbs:~# 
root@pbs:~# 
root@pbs:~# vgs
  VG  #PV #LV #SN Attr   VSize    VFree   
  pbs   1   2   0 wz--n- <249.50g <162.38g
root@pbs:~# 
root@pbs:~# pvs
  PV         VG  Fmt  Attr PSize    PFree   
  /dev/sda3  pbs lvm2 a--  <249.50g <162.38g
root@pbs:~# 
root@pbs:~# lvs
  LV   VG  Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  root pbs -wi-ao---- 241.74g                                                    
  swap pbs -wi-ao----   7.75g                                                    
root@pbs:~#  


No comments:

Post a Comment

Proxmox Backup Server extend disk

Problem Proxmox Backup Server 4.2.0 (Linux pbs 7.0.0-3-pve) has a disk which is 100GB big. The disk should be extended to 250GB (add 150GB)....