\begin{exe} {\texttt{udev}}

   \begin{enumerate}
      \item
      Create and implement a rule on your system that will
      create a symlink called \verb?myusb? when a
      \textbf{USB} device is plugged in.
      \item
      Plug in a \textbf{USB} device to your system.  It
      can be a pen drive, mouse, webcam, etc.

      Note: If you are running a virtual machine under a
      hypervisor, you will have to make sure the
      \textbf{USB} device is seen by the guest, which
      usually is just a mouse click which also
      disconnects it from the host.
      \item
      Get a listing of the \filelink{/dev} directory and
      see if your symlink was created.
      \item
      Remove the \textbf{USB} device. (If it is a drive
      you should always \textbf{umount} it first for
      safety.)
      \item
      See if your symbolic link still exists in
      \filelink{/dev}.
   \end{enumerate}
   \begin{sol}

      \begin{enumerate}
         \item
         Create a file named \filelink{/etc/udev/rules.d/75-myusb.rules}
         and have it include just one line of content:
         \begin{cmd}
$ cat /etc/udev/rules.d/75-myusb.rules
         \end{cmd}
         \begin{response}
SUBSYSTEM=="usb", SYMLINK+="myusb"
         \end{response}
         Do not use the deprecated key value \verb?BUS? in place
         of \verb?SUBSYSTEM?, as recent versions of \textbf{udev}
         have removed it.

         Note the name of this file really does not matter.
         If there was an \verb?ACTION? component to the rule
         the system would execute it; look at other rules
         for examples.
         \item
         Plug in a device.
         \item
         \begin{cmd}
$ ls -lF /dev | grep myusb
         \end{cmd}

         \item
         If the device has been mounted:
         \begin{cmd}
$ umount /media/whatever
         \end{cmd}
         where \filelink{/media/whatever} is the mount point.
         Safely remove the device.
         \item
         \begin{cmd}
$ ls -lF /dev | grep myusb
         \end{cmd}
      \end{enumerate}
   \end{sol}
\end{exe}

