Skip to content

Instantly share code, notes, and snippets.

@Rooster212
Created July 4, 2023 08:51
Show Gist options
  • Save Rooster212/231d96291651e82220129ae0e8020bf7 to your computer and use it in GitHub Desktop.
Save Rooster212/231d96291651e82220129ae0e8020bf7 to your computer and use it in GitHub Desktop.
Resize Debian LVM

How to expand disk in TrueNAS Scale VM

This is not the only way to do this, however from researching and experimentation, I found that the easiest way to do this is to do these steps below.

  1. Shutdown VM
  2. Resize Disk in TrueNAS (edit the zvol and expand the size to desired)
  3. Add GParted ISO to boot order before HDD
  4. Boot into GParted live ISO and expand disk size to fill available space
  5. Remove ISO from boot order
  6. Boot machine
  7. Use root - sudo su -
  8. Resize the logical volume - lvextend -l +100%FREE /dev/mapper/diskname--vg-root
  9. Resize filesystem - resize2fs /dev/mapper/diskname--vg-root
  10. Verify using df -h

References

  1. https://www.golinuxcloud.com/how-to-extend-lvm-partition/
  2. https://www.2daygeek.com/extend-increase-resize-lvm-logical-volume-in-linux/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment