Skip to content

Instantly share code, notes, and snippets.

@zh4n7wm
Created November 18, 2020 08:03
Show Gist options
  • Save zh4n7wm/9c2d1da6c943f6c57a693682820cf680 to your computer and use it in GitHub Desktop.
Save zh4n7wm/9c2d1da6c943f6c57a693682820cf680 to your computer and use it in GitHub Desktop.
extend VirtualBox Disk

extend virtualbox disk

shutdown guest OS

show disk info

VBoxManage showhdinfo ~/VirtualBox\ VMs/Ubuntu/Ubuntu.vdi

extend disk size

VBoxManage modifymedium ~/VirtualBox\ VMs/Ubuntu/Ubuntu.vdi --resizebyte 21474836480

# 21474836480 (20G) = 20 * 1024 * 1024 * 1024

extend file system

login guest os*

extend partition in guest os

sudo growpart /dev/sda 3

show lvm info, then get logic volumn

sudo lvdisplay  # my logic volumn is: /dev/ubuntu-vg/ubuntu-lv

extend logic volumn

sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv

extend file system

sudo resize2fs /dev/ubuntu-vg/ubuntu-lv

check resized file system

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