\section{Resizing Logical Volumes}

\begin{frame}
   {Resizing Logical Volumes}

   \begin{itemize}
      \item Much easier than resizing a physical partition
      \item Extents can come from anywhere in the volume group
      \item Filesystem can be shrunk or extended while still
      online
      \item Can change size either by number of extents or
      size in bytes (M,G, etc)
      \item Best done with \textbf{lvresize} as in:
      \begin{cmd}
$ sudo lvresize  -r -L 20 GB  /dev/VG/mylvm
      \end{cmd}
      where the \verb?-r? option causes resizing the filesystem
      at same time as changing volume size
      \item
      Can also use \textbf{lvextend}, \textbf{lvreduce} with
      \textbf{resize2fs}
      \item Resizing utilities are filesystem-specific
   \end{itemize}

\end{frame}

\cprotect\note{

   To grow a logical volume with an \textbf{ext4}
   filesystem:
   \begin{cmd}
$ sudo lvresize -r -L +100M /dev/vg/mylvm
   \end{cmd}
   where the plus sign indicates adding space. Note that one
   need not unmount the filesystem to grow it.

   To shrink the filesystem:
   \begin{cmd}
$ sudo lvresize -r -L 200M /dev/vg/mylvm
   \end{cmd}
   You can also reduce a volume group as in:
   \begin{cmd}
$ sudo pvmove /dev/sdc1
$ sudo vgreduce vg /dev/sdc1
   \end{cmd}
}



