\section{LVM Snapshots **}

\begin{frame}
   {LVM Snapshots}

   \begin{itemize}
      \item Exact copy of an existing logical volume
      \item Useful for backups, application testing, and VMs
      \item Original state of snapshot is block map
      \item Only uses space for storing deltas
      \begin{itemize}
         \item When original logical volume changed,
         original data blocks copied to snapshot
         \item If data added to snapshot, stored only
         there
      \end{itemize}
   \end{itemize}

\end{frame}

\cprotect\note{

   \textbf{LVM Snapshots} create an exact copy of an
   existing logical volume.

   They are useful for backups, application testing, and
   deploying \textbf{VM}s (Virtual Machines).  The
   original state of the snapshot is kept as the block
   map.

   Snapshots only use space for storing deltas:
   \begin{itemize}
      \item When the original logical volume changes,
      original data blocks are copied to the snapshot.
      \item If data is added to snapshot, it is stored only
      there.
   \end{itemize}

   To create a snapshot of an existing logical volume:
   \begin{cmd}
$ sudo lvcreate -l 128 -s -n mysnap /dev/vg/mylvm
   \end{cmd}
   To then make a mount point and mount the snapshot:
   \begin{cmd}
$ mkdir /mysnap
$ mount -o ro /dev/vg/mysnap   /mysnap
   \end{cmd}

   To use the snapshot and to remove the snapshot:
   \begin{cmd}
$ sudo umount /mysnap
$ sudo lvremove /dev/vg/mysnap
   \end{cmd}

   Always be sure to remove the snapshot when you are
   through with it.  If you do not remove the snapshot and
   it fills up because of changes, it will be
   automatically disabled.  A snapshot with the size of
   the original will never overflow.

}


