Skip to content

Instantly share code, notes, and snippets.

@schmonz
Created January 8, 2024 15:28
Show Gist options
  • Save schmonz/8db3780c6bac84fa270fb307009dd724 to your computer and use it in GitHub Desktop.
Save schmonz/8db3780c6bac84fa270fb307009dd724 to your computer and use it in GitHub Desktop.
Grow root filesystem on old Debian VMs
cp *.qcow2 qcow2.BACKUP

qemu-img resize *.qcow2 50G

./run

fdisk -l

swapoff -a

fdisk /dev/vda

p
(disk sectors: ~104857600, swap sectors: ~2093056)

d
5

d
2

n
e
2
$DISKSECTORS - $SWAPSECTORS
$LASTDISKSECTOR

t
2
82

w

mkswap /dev/vda2

vi /etc/fstab /etc/initramfs-tools/conf.d/resume

swapon /dev/vda2

update-initramfs -u

apt install cloud-guest-utils

growpart /dev/vda 1

reboot

resize2fs /dev/vda1

reboot

pkgsrc-shutdown vbox

rm qcow2.BACKUP
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment