Skip to content

Instantly share code, notes, and snippets.

@mjmenger
Last active December 27, 2022 21:29
Show Gist options
  • Select an option

  • Save mjmenger/f72e998fdcf9adb1998beab14d54a3bc to your computer and use it in GitHub Desktop.

Select an option

Save mjmenger/f72e998fdcf9adb1998beab14d54a3bc to your computer and use it in GitHub Desktop.
extend a partition on linux

using parted

parted
(parted) print
(parted) resizepart

partition number? probably get warned about the partition being used... be strong set the end to the biggest number you can think of

then quit out of parted

you'll probably need to use resize2fs to get the disk to recognize the new partition size

unless Ubuntu is using a logical volume manager

sudo fdisk -l

sudo pvresize /dev/sda3
sudo lvextend --size 54G /dev/mapper/ubuntu--vg-ubuntu--lv
sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv
sudo 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