DEV Community

Max
Max

Posted on

Debian/LVM increase disk size cheatsheet

Just a quick cheatsheet for increasing disk sizes for my TrueNAS scale VMs with debian os and lvm.

  1. Make sure you created a snapshot!
  2. Stop VM
  3. Increase ZVOL
  4. Start VM
  5. lsblk => Check new size of /dev/sda
  6. fdisk /dev/sda
    1. p (print)
    2. Copy partition row
    3. d (delete)
    4. n (new) -
    5. KEEP lvm signature!
    6. t (change type) => 30 for Linux LVM
    7. p (print again)
    8. Compare row (startbytes, size, type) with row from above
    9. w (write changes)
  7. Reboot VM
  8. pvresize /dev/sdaX (Replace X with actual number)
  9. pvs => Check
  10. lvs => Get VG and LV
  11. lvresize -l +100%FREE /dev/<VG>/<LV>
  12. resize2fs /dev/<VG>/<LV>
  13. Reboot VM

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Immerse yourself in a wealth of knowledge with this piece, supported by the inclusive DEV Community—every developer, no matter where they are in their journey, is invited to contribute to our collective wisdom.

A simple “thank you” goes a long way—express your gratitude below in the comments!

Gathering insights enriches our journey on DEV and fortifies our community ties. Did you find this article valuable? Taking a moment to thank the author can have a significant impact.

Okay