Skip to content

Instantly share code, notes, and snippets.

@acosonic
Last active June 7, 2023 12:28
Show Gist options
  • Save acosonic/fc24051aa0f4994473f24037f15b7580 to your computer and use it in GitHub Desktop.
Save acosonic/fc24051aa0f4994473f24037f15b7580 to your computer and use it in GitHub Desktop.
Ubuntu resize VM disk
#!/bin/bash
echo 1 > /sys/block/sda/device/rescan
cfdisk /dev/sda
pvresize /dev/sda3
lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv
@acosonic
Copy link
Author

pvresize /dev/sda3
pvdisplay
lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

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