techne/lvm2.org

29 lines
626 B
Org Mode
Raw Permalink Normal View History

2024-09-21 04:17:26 +02:00
#+title: LVM2
#+setupfile: ../org-templates/page.org
** Add disk to LVM volume
Create a new physical volume on the new disk:
#+begin_src shell
sudo pvcreate /dev/vdb
sudo lvmdiskscan -l
#+end_src
Add the newly created physical volume (~/dev/vdb~) to an existing logical volume:
#+begin_src shell
sudo vgextend almalinux /dev/vdb
#+end_src
Extend the ~/dev/almalinux/root~ to create a total 1000GB:
#+begin_src shell
sudo lvm lvextend -l +100%FREE /dev/almalinux/root
#+end_src
Grow the filesystem of the root volume:
#+begin_src shell
# ext4
sudo resize2fs -p /dev/mapper/almalinux-root
# xfs
sudo xfs_growfs /
#+end_src