Last active
December 26, 2024 23:41
-
-
Save Marshall-Hallenbeck/057a8a8f26b8c3954e2145232a96050a to your computer and use it in GitHub Desktop.
Extend running Linux/Ubuntu LV
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# extends default Ubuntu LV - update it to whatever LV you are trying to extend, or just write the commands manually | |
# of course before this you need to increase the capacity of the VM (I use ESXi and just update the size) | |
# just a reminder for ESXi, if you have any snapshots, the edit size dropdown/entry will be greyed out, so delete any existing snapshots | |
sudo cfdisk # expand your partition here | |
# sudo lsblk # do this if you dont know your partition # | |
sudo pvresize /dev/sda3 # like all of my vms default to sda3 but YMMV | |
sudo lvextend -l +100%FREE /dev/ubuntu-vg/ubuntu-lv # extend the lv inside the pv (lsblk should be updated now) | |
# sudo xfs_growfs /dev/system/nsm # resize lvm if you made it an lvm (use this for security onion) | |
sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv # actually resize the ext partition (what you see via df -h) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment