%% $Header: /cvsroot/lcdp/lpic/general-linux-1/slides/104-4.tex,v 1.2 2003/05/30 04:51:59 waratah Exp $

\input{gl1.slide-header.tex}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%----10->|-----20->|-----30->|-----40->|-----50->|-----60->|-----70->|-----80->
\begin{slide} %================================================================
\begin{center} \Huge \textsf{-- General Linux 1 -- } \\[2mm]
\large  \textsf{(Linux Professional Institute Certification)}\\[5mm]
\Large \textsf{ 104-4 Managing disk quota [1]} \\
\normalsize\end{center}

\footnote{Copyright \copyright\ 2002 Geoffrey Robertson. Permission is granted to make and distribute verbatim copies or modified versions of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation---either version 2 of the License or (at your option) any later version.}
 
\scriptsize
\begin{verbatim} 
   .~.    
   /V\     by: geoffrey robertson        
  // \\        geoffrey@zip.com.au
  @._.@ 
\end{verbatim} 
\tiny
\begin{verbatim}
$Id: 104-4.tex,v 1.2 2003/05/30 04:51:59 waratah Exp $ 
\end{verbatim} 
\normalsize  
\vfill \end{slide} %-----------------------------------------------------------
%----10->|-----20->|-----30->|-----40->|-----50->|-----60->|-----70->|-----80->

%==============================================================================
\begin{slide} %ghr
  \listofslides
\vfill \end{slide}
%------------------------------------------------------------------------------

%==============================================================================
%==============================================================================
\begin{slide} %ghr
\slideheading{Objective---Managing disk quota} 

Candidates should be able to manage disk quotas for users. This
objective includes setting up a disk quota for a filesystem, editing,
checking, and generating user quota reports.


\vfill \end{slide} %-----------------------------------------------------------
%==============================================================================
\begin{slide} %ghr
  \slideheading{Key files, terms and utilities}

\begin{minipage}[t]{40mm}
  \begin{itemize}
  \item quota
  \item edquota
  \item repquota
  \item quotaon
  \end{itemize}
\end{minipage}
%
% \begin{minipage}[t]{40mm}
%   \begin{itemize}
%   %\item 
%   \end{itemize}
% \end{minipage}

\vfill \end{slide} %-----------------------------------------------------------

%==============================================================================
\begin{slide}{} %ghr
  \Slidecontents
\end{slide} %------------------------------------------------------------------

%==============================================================================
\begin{slide}{} %ghr
\slideheading{Disk Quotas}

Quotas are used to enforce a disk space limit or an inode maximum on 
individuals or groups.

%\overlay{1}
\slidesubheading{Types of quota limits:}
\begin{description}
\item[user hard:] The maximum size for a user.
\item[user soft:] A user's warning threshold.
\item[group hard:] The maximum size for a group.
\item[group soft:] A group's warning threshold.
\item[grace period:] A soft limit time restriction.
\end{description} 
\vfill \end{slide} %-----------------------------------------------------------

%==============================================================================
\begin{slide}{} %Stephen Shmitt
\slideheading{Setting Up Quotas}

You must configure your init script to check and turn on QUOTA at
boot time.

  The golden rule is turn on quota \textit{after} your /etc/fstab has been
mounted.

\small
\begin{verbatim}
#check quota and then turn quota on.
if [ -x /usr/sbin/quotacheck ]; then
    echo "Checking quotas. This may take sometime. "
    /usr/sbin/quotacheck -avug
    echo "Done."
fi
if [ -x /usr/sbin/quotaon ]; then
  echo "Turning on quota."
  /usr/sbin/quotaon -avug
fi
\end{verbatim}
\vfill \end{slide} %-----------------------------------------------------------
%==============================================================================
\begin{slide}{} %Stephen Shmitt
\slidesubheading{Entries in \texttt{/etc/fstab}}
  \begin{description}
    \item[No Quota]: 

     \begin{alltt}
 /dev/hda2  /home  ext2  default            1  1      
     \end{alltt}
     \item[User Quota Set]: 
     \begin{alltt}
 /dev/hda2  /home  ext2  default,usrquota   1  1      
     \end{alltt}
     \item[Group Quota Set]: 
     \begin{alltt}
 /dev/hda2  /home  ext2  default,grpquota   1  1      
     \end{alltt}
  \end{description}

\vfill \end{slide} %-----------------------------------------------------------

%==============================================================================
\begin{slide}{} %Stephen Shmitt
\slidesubheading{Create a Quota Record}

Go to the partition that you wish to restrict usage in and as root:

\begin{alltt}
# touch /partition/quota.user
# touch /partition/quota.group
# chmod 600 /partition/quota.user
# chmod 600 /partition/quota.group
\end{alltt}

Then reboot the system to take affect. (Remount the partition)

\vfill \end{slide} %-----------------------------------------------------------

%==============================================================================
\begin{slide}{} %Stephen Shmitt
\slideheading{Assigning quota for users and groups}

Setup quota for a user/group
\begin{alltt}
# edquota -u USER
\end{alltt}

This will bring you into vi:

\small
\begin{alltt}
-------------------------------------------------------
Quota for user USER:
(Quota for group GROUP:)
/dev/hda2: 
block in use: 2594, limits (soft = 5000, hard = 6500)         
inodes in use: 356, limits (soft = 1000, hard = 1500)
~
~
------------------------------------------------------
 \end{alltt}
\vfill \end{slide} %-----------------------------------------------------------

%==============================================================================
\begin{slide}{} %Stephen Shmitt
%\slideheading{}
  \begin{description}
    \item[block in use:] is the total number of block(in kilobytes).
    \item[inodes in use:] is the total of files.
    \item[limits (soft =   )] indicates the maximum amount of hdd usage
 combined with the GRACE PERIOD acts as the border. There is warning
 to tell you, that you are close to this limit
    \item[limits (hard =   )]only works when the GRACE PERIOD is set. This
 is the ABSOLUTE limit of disk usage 
  \end{description}

Grace period.

Setting the grace period is in the format
 sec(onds), min(utes), hour(s), day(s), week(s), and month(s).

\vfill \end{slide} %-----------------------------------------------------------

%==============================================================================
\begin{slide}{} %Stephen Shmitt
\slidesubheading{Setting a Grace Period}

Setting the grace period is in the format
 sec(onds), min(utes), hour(s), day(s), week(s), and month(s).

\small
\begin{alltt}
# edquota -t
--------------------------------------------------------
Time units may be: days, hours, minutes, or seconds
Grace period before enforcing soft limits for users:
/dev/hda2: block grace period: 0 days, 
file grace period: 0 days
~
~
~
--------------------------------------------------------
 \end{alltt}
\vfill \end{slide} %-----------------------------------------------------------

%==============================================================================
\begin{slide}{} %ghr
  \Slidecontents
\end{slide} %------------------------------------------------------------------

%==============================================================================
\begin{slide}{} %Stephen Shmitt
\slideheading{Quota Commands}
\slidesubheading{\texttt{quotacheck}}
 Quotacheck is used to scan the disk usage and update the "quota.user".
This should be automated as a cronjob periodically (weekly).

\begin{description}
  \item[\opt{-v}]this will produce some useful information about what
            it is doing. 
  \item[\opt{-d}] debug (very detail -v).
  \item[\opt{-u}] user (all files with uid). 
  \item[\opt{-g}] group (all file with gid).
  \item [\opt{-a} ]all.
  \item [\opt{-R}] except root (when used with -a).
\end{description}

\vfill \end{slide} %-----------------------------------------------------------

%==============================================================================
\begin{slide}{} %Stephen Shmitt
\slidesubheading{\texttt{repquota}}
Repquota produces a summarised report on the quotas on the system.

\begin{description}
  \item[\opt{-a}] all file system indicated in /etc/fstab.
  \item[\opt{-v}] report all quotas, even if there is no usage.
  \item[\opt{-g}] report group quotas.
  \item[\opt{-u}] report user quotas (default).
\end{description}

\vfill \end{slide} %-----------------------------------------------------------

%==============================================================================
\begin{slide}{} %Stephen Shmitt
\slidesubheading{\texttt{quotaon / quotaoff}}

Turn quota on.

\begin{description}
  \item[\opt{-a}] all (as in /etc/fstab).
  \item[\opt{-v}] display message for each file system.
  \item[\opt{-g}] manipulate user quotas.
  \item[\opt{-u}] manipulate group quotas.
\end{description}
\vfill \end{slide} %-----------------------------------------------------------


%==============================================================================
\begin{slide}{} %Ken Foskey
{\bf{\large MAKE}}

Make is a tool that is a very simply idea that allows large systems to
grow naturally.  Sounds like a lot of Unix tools.

The concept is simple,  you have a file that is built from another file
(or more files).  so for example our site has some latex code,  we want
to produce a pdf format however it takes a couple of steps to do this.
I will work backwards to show it a little clearer:
\vfill \end{slide} %-----------------------------------------------------------

%==============================================================================
\begin{slide}{} %Ken Foskey


The following will check the timestamp on the dvi and
if it is newer than the pdf file it will run the commands.
\begin{alltt}
notes.pdf:      notes.dvi
        dv12pdf notes.dvi
\end{alltt}
note that the indent MUST be a space.

Now we want to check that the dvi file is up to date.
\begin{alltt}
notes.dvi:      notes.tex
        latex notes.tex
\end{alltt}
the make program will work out all the timestamps and work
out that notes.dvi must be built first.

\vfill \end{slide} %-----------------------------------------------------------

%==============================================================================
\begin{slide}{} %Ken Foskey

This simple example shows that we can build up a number of parts to make
a program.

SO if we talk about programs we might have something like this:
\begin{alltt}
xyz.o:  xyz.c xyz.h common.h
        gcc xyz.c -o xyz.o
\end{alltt}
This will produce a new xyz.o if xyz.c or xyz.h or common.h changes.

\vfill \end{slide} %-----------------------------------------------------------

%==============================================================================
\begin{slide}{}
\slideheading{}
Finally make give us some built in processes so we can use shorthand
like:
\begin{alltt}
xyz.o:  xyz.c xyz.h common.h
\end{alltt}

The make process implies the compiler and option settings.  In fact this
is preferred and some features are built into make to allow you to
extend it, like macros called CFLAGS, etc.

It is outside the scope of the short talk to cover this in more detail.


\vfill \end{slide} %-----------------------------------------------------------

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\end{document} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%==============================================================================
\begin{slide}{}
\slideheading{}


\vfill \end{slide} %-----------------------------------------------------------

=============================================================================
\begin{slide}{}

\end{slide} %------------------------------------------------------------------

