mirror of https://github.com/tLDP/LDP
Editing of new "Linux-Networking" guide. This copy is not to be distributed. Its just a draft to give people an idea as to the format of the new document and a backup just in case my laptop dies.
Binh.
This commit is contained in:
parent
9cb82915f3
commit
bb9e45bd49
File diff suppressed because it is too large
Load Diff
|
@ -273,8 +273,6 @@
|
|||
This feature is desirable in some cases, but not in others. So the
|
||||
sending process can turn it on and off at wish.
|
||||
|
||||
|
||||
|
||||
2.3.3. Interface selection.
|
||||
|
||||
Hosts attached to more than one network should provide a way for
|
||||
|
@ -282,8 +280,6 @@
|
|||
the transmissions. If not specified, the kernel chooses a default one
|
||||
based on system administrator's configuration.
|
||||
|
||||
|
||||
|
||||
2.4. Receiving Multicast Datagrams.
|
||||
|
||||
2.4.1. Joining a Multicast Group.
|
||||
|
@ -326,8 +322,6 @@
|
|||
address and port to demultiplex the packets and decide which socket(s)
|
||||
deliver them to.
|
||||
|
||||
|
||||
|
||||
2.4.2. Leaving a Multicast Group.
|
||||
|
||||
When a process is no longer interested in a multicast group, it
|
||||
|
@ -1430,8 +1424,6 @@
|
|||
o "Administratively Scoped IP Multicast". draft-ietf-mboned-admin-ip-
|
||||
space-03.txt. D. Meyer. June 10, 1997.
|
||||
|
||||
|
||||
|
||||
10.3. Web pages.
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -3,107 +3,58 @@
|
|||
<title>Network-Management</title>
|
||||
|
||||
<para>
|
||||
9.1. Network management applications
|
||||
|
||||
There is an impressive number of tools focused on network management
|
||||
and remote administration. Some interesting remote administration
|
||||
projects are linuxconf and webmin:
|
||||
|
||||
· Webmin <http://www.webmin.com/webmin/>
|
||||
|
||||
· Linuxconf <http://www.solucorp.qc.ca/linuxconf/>
|
||||
|
||||
Other tools include network traffic analysis tools, network security
|
||||
tools, monitoring tools, configuration tools, etc. An archive of many
|
||||
of these tools may be found at Metalab
|
||||
<http://www.metalab.unc.edu/pub/Linux/system/network/>
|
||||
|
||||
|
||||
9.2. SNMP
|
||||
|
||||
The Simple Network Management Protocol is a protocol for Internet
|
||||
network management services. It allows for remote monitoring and
|
||||
configuration of routers, bridges, network cards, switches, etc...
|
||||
There is a large amount of libraries, clients, daemons and SNMP based
|
||||
monitoring programs available for Linux. A good page dealing with SNMP
|
||||
and Linux software may be found at : http://linas.org/linux/NMS.html
|
||||
|
||||
10. Enterprise Linux Networking
|
||||
|
||||
In certain situations it is necessary for the networking
|
||||
infrastructure to have proper mechanisms to guarantee network
|
||||
availability nearly 100% of the time. Some related techniques are
|
||||
described in the following sections. Most of the following material
|
||||
can be found at the excellent Linas website:
|
||||
http://linas.org/linux/index.html and in the Linux High-Availability
|
||||
HOWTO <http://metalab.unc.edu/pub/Linux/ALPHA/linux-ha/High-
|
||||
Availability-HOWTO.html>
|
||||
|
||||
|
||||
10.1. High Availability
|
||||
|
||||
Redundancy is used to prevent the overall IT system from having single
|
||||
points of failure. A server with only one network card or a single
|
||||
SCSI disk has two single points of failure. The objective is to mask
|
||||
unplanned outages from users in a manner that lets users continue to
|
||||
work quickly. High availability software is a set of scripts and tools
|
||||
that automatically monitor and detect failures, taking the appropriate
|
||||
steps to restore normal operation and to notifying system
|
||||
administrators.
|
||||
|
||||
|
||||
10.2. RAID
|
||||
|
||||
RAID, short for Redundant Array of Inexpensive Disks, is a method
|
||||
whereby information is spread across several disks, using techniques
|
||||
such as disk striping (RAID Level 0) and disk mirroring (RAID level 1)
|
||||
to achieve redundancy, lower latency and/or higher bandwidth for
|
||||
reading and/or writing, and recoverability from hard-disk crashes.
|
||||
Over six different types of RAID configurations have been defined.
|
||||
There are three types of RAID solution options available to Linux
|
||||
users: software RAID, outboard DASD boxes, and RAID disk controllers.
|
||||
|
||||
|
||||
· Software RAID: Pure software RAID implements the various RAID
|
||||
levels in the kernel disk (block device) code.
|
||||
|
||||
· Outboard DASD Solutions: DASD (Direct Access Storage Device) are
|
||||
separate boxes that come with their own power supply, provide a
|
||||
cabinet/chassis for holding the hard drives, and appear to Linux as
|
||||
just another SCSI device. In many ways, these offer the most robust
|
||||
RAID solution.
|
||||
|
||||
· RAID Disk Controllers: Disk Controllers are adapter cards that plug
|
||||
into the ISA/EISA/PCI bus. Just like regular disk controller cards,
|
||||
a cable attaches them to the disk drives. Unlike regular disk
|
||||
controllers, the RAID controllers will implement RAID on the card
|
||||
itself, performing all necessary operations to provide various RAID
|
||||
levels.
|
||||
|
||||
Related HOWTOs:
|
||||
|
||||
· http://metalab.unc.edu/mdw/HOWTO/mini/DPT-Hardware-RAID.html
|
||||
|
||||
· http://metalab.unc.edu/mdw/HOWTO/Root-RAID-HOWTO.html
|
||||
|
||||
· http://metalab.unc.edu/mdw/HOWTO/Software-RAID-HOWTO.html
|
||||
|
||||
RAID at linas.org:
|
||||
|
||||
· http://linas.org/linux/raid.html
|
||||
|
||||
|
||||
10.3. Redundant networking
|
||||
|
||||
IP Address Takeover (IPAT). When a network adapter card fails, its IP
|
||||
address should be taken by a working network card in the same node or
|
||||
in another node. MAC Address Takeover: when an IP takeover occurs, it
|
||||
should be made sure that all the nodes in the network update their ARP
|
||||
caches (the mapping between IP and MAC addresses).
|
||||
|
||||
See the High-Availability HOWTO for more details:
|
||||
http://metalab.unc.edu/pub/Linux/ALPHA/linux-ha/High-Availability-
|
||||
HOWTO.html
|
||||
There is an impressive number of tools focused on network management
|
||||
and remote administration under Linux. Some interesting remote administration
|
||||
projects are linuxconf and webmin:
|
||||
</para>
|
||||
|
||||
</sect1>
|
||||
<para>
|
||||
· Webmin <http://www.webmin.com/webmin/>
|
||||
· Linuxconf <http://www.solucorp.qc.ca/linuxconf/>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Other tools include network traffic analysis tools, network security
|
||||
tools, monitoring tools, configuration tools, etc. An archive of many
|
||||
of these tools may be found at Metalab
|
||||
<http://www.metalab.unc.edu/pub/Linux/system/network/>
|
||||
</para>
|
||||
|
||||
9.2. SNMP
|
||||
|
||||
<para>
|
||||
The Simple Network Management Protocol is a protocol for Internet
|
||||
network management services. It allows for remote monitoring and
|
||||
configuration of routers, bridges, network cards, switches, etc...
|
||||
There is a large amount of libraries, clients, daemons and SNMP based
|
||||
monitoring programs available for Linux. A good page dealing with SNMP
|
||||
and Linux software may be found at : http://linas.org/linux/NMS.html
|
||||
</para>
|
||||
|
||||
10. Enterprise Linux Networking
|
||||
|
||||
<para>
|
||||
In certain situations it is necessary for the networking
|
||||
infrastructure to have proper mechanisms to guarantee network
|
||||
availability nearly 100% of the time. Some related techniques are
|
||||
described in the following sections. Most of the following material
|
||||
can be found at the excellent Linas website:
|
||||
http://linas.org/linux/index.html and in the Linux High-Availability
|
||||
HOWTO <http://metalab.unc.edu/pub/Linux/ALPHA/linux-ha/High-
|
||||
Availability-HOWTO.html>
|
||||
</para>
|
||||
|
||||
10.1. High Availability
|
||||
|
||||
<para>
|
||||
Redundancy is used to prevent the overall IT system from having single
|
||||
points of failure. A server with only one network card or a single
|
||||
SCSI disk has two single points of failure. The objective is to mask
|
||||
unplanned outages from users in a manner that lets users continue to
|
||||
work quickly. High availability software is a set of scripts and tools
|
||||
that automatically monitor and detect failures, taking the appropriate
|
||||
steps to restore normal operation and to notifying system
|
||||
administrators.
|
||||
</para>
|
||||
|
||||
</sect1>
|
||||
|
|
|
@ -3,305 +3,449 @@
|
|||
<title>Quota</title>
|
||||
|
||||
<para>
|
||||
This section describes how to enable file system quota on a Linux
|
||||
host, assigning quota for users and groups, as well as the usage of
|
||||
miscellaneous quota commands. It is intended for users running kernel
|
||||
2.x (recently tested on kernel 2.4.21).
|
||||
|
||||
1. What is quota?
|
||||
|
||||
1.1. What is quota for?
|
||||
|
||||
Quota allows you to specify limits on two aspects of disk storage: the
|
||||
number of inodes a user or a group of users may possess; and the
|
||||
number of disk blocks that may be allocated to a user or a group of
|
||||
users.
|
||||
|
||||
The idea behind quota is that users are forced to stay under their
|
||||
disk consumption limit, taking away their ability to consume unlimited
|
||||
disk space on a system. Quota is handled on a per user, per file
|
||||
system basis. If there is more than one file system which a user is
|
||||
expected to create files, then quota must be set for each file system
|
||||
separately. Various tools are available for you to administer and
|
||||
automate quota policies on your system.
|
||||
|
||||
1.2. Current Status of Quota on Linux
|
||||
|
||||
Currently, there are some major changes in the way quota works. There
|
||||
are two different setups. The tools works the same, but there's a
|
||||
difference in used files. This document describes the setup and
|
||||
operation of the _new_ quota setup. As the new setup of quota is not
|
||||
in the regular kernel source, this setup needs some patching. We will
|
||||
describe this patching and installation of the linuxquota package. If
|
||||
you already have the quota software installed on your system, you may
|
||||
or may not have to install this patch and package. You can email me if
|
||||
you have any questions about this. I'll try to include a overview of
|
||||
Linux distro's and it's implications in a later version of this
|
||||
document.
|
||||
|
||||
2. Requirements for quota
|
||||
|
||||
2.1. Kernel
|
||||
|
||||
The 2.x kernel source is available from http://www.kernel.org
|
||||
<http://www.kernel.org/> Please use an available mirror close to your
|
||||
location to save bandwidth. If you have a recent version of tar, you
|
||||
can download the .bz2 compressed file.
|
||||
|
||||
Untar the kernel:
|
||||
______________________________________________________________________
|
||||
cd /usr/src
|
||||
tar jxvf /path/to/linux-2.4.21-tar.bz2 - for bzip2 kernel -
|
||||
tar zxvf /path/to/linux-2.4.21-tar.gz - for gzip kernel -
|
||||
ln -s /usr/src/linux-2.4.21 /usr/src/linux
|
||||
______________________________________________________________________
|
||||
|
||||
2.2. Quota software
|
||||
|
||||
Depending on the Linux distribution you have, you may, or may not have
|
||||
the quota softwares installed on your system. The most recent version
|
||||
of quota is available through SourceForge and is in active
|
||||
development. You can reach the homepage of the quota-development at
|
||||
http://www.sourceforge.net/projects/linuxquota
|
||||
<http://www.sourceforge.net/project/linuxquota>.
|
||||
|
||||
3. Quota setup: installation and configuration
|
||||
|
||||
3.1. Patch the kernel
|
||||
|
||||
Download the patch for your kernel at:
|
||||
|
||||
ftp::/atrey.karlin.mff.cuni.cz/pub/local/jack/quota/
|
||||
<ftp://atrey.karlin.mff.cuni.cz/pub/local/jack/quota/>.
|
||||
|
||||
Choose your kernel version and download the patch(es). Patch your
|
||||
kernel with the 'patch' command. If there is more than 1 patch for
|
||||
your kernel version, be sure to apply the patches in the correct
|
||||
order.
|
||||
|
||||
You can use this script ( I assume the downloaded patches are in
|
||||
/tmp/quota/ and the kernel has been untarred to /usr/src/linux) :
|
||||
|
||||
______________________________________________________________________
|
||||
#!/bin/sh
|
||||
|
||||
gunzip /tmp/quota/*.gz
|
||||
cd /usr/src/linux
|
||||
COUNT=`ls -1 /tmp/quota/*.diff | wc -l`
|
||||
for I in `seq 1 $COUNT`
|
||||
do
|
||||
patch -p1 < /tmp/quota/quota-2.4.21-$I-*.diff
|
||||
done
|
||||
______________________________________________________________________
|
||||
|
||||
|
||||
3.2. Reconfigure your kernel
|
||||
|
||||
Reconfigure your kernel and add quota support.
|
||||
|
||||
Via `make menuconfig` or `make xconfig` you can find the option to
|
||||
support quota under the Filesystems-menu. You can specify extra
|
||||
options if you need them, like 32-bit UID support.
|
||||
|
||||
Save the configuration and compile the kernel. Make sure the new
|
||||
kernel will be used when rebooting the system.
|
||||
|
||||
3.3. Compile and install the quota softwares
|
||||
|
||||
To be able to use all the features of the new quota system, you'll
|
||||
probably need to download the new quota-package. Download the new
|
||||
quota software via the URL provided above.
|
||||
|
||||
When downloaded do:
|
||||
______________________________________________________________________
|
||||
$ gzip -dc <downloaded file> | tar xvf
|
||||
$ cd quota-tools (or whatever directory the software is put in)
|
||||
$ ./configure
|
||||
$ make
|
||||
$ su
|
||||
# make install
|
||||
______________________________________________________________________
|
||||
|
||||
|
||||
3.4. time Modify your system init script to check quota and turn
|
||||
quota on at boot
|
||||
|
||||
Here's an example:
|
||||
______________________________________________________________________
|
||||
# Check quota and then turn quota on.
|
||||
if [ -x /usr/sbin/quotacheck ]
|
||||
then
|
||||
echo "Checking quotas. This may take some time."
|
||||
/usr/sbin/quotacheck -avug
|
||||
echo " Done."
|
||||
fi
|
||||
if [ -x /usr/sbin/quotaon ]
|
||||
then
|
||||
echo "Turning on quota."
|
||||
/usr/sbin/quotaon -avug
|
||||
fi
|
||||
______________________________________________________________________
|
||||
|
||||
The golden rule is that always turn quota on after your file systems
|
||||
in /etc/fstab have been mounted, otherwise quota will fail to work. I
|
||||
recommend turning quota on right after the part where file systems are
|
||||
mounted in your system init script.
|
||||
|
||||
3.5. Modify /etc/fstab
|
||||
|
||||
Partitions that you have not yet enabled quota normally look something
|
||||
like:
|
||||
______________________________________________________________________
|
||||
/dev/hda1 / ext2 defaults 1 1
|
||||
/dev/hda2 /usr ext2 defaults 1 1
|
||||
______________________________________________________________________
|
||||
|
||||
To enable user quota support on a file system, add "usrquota" to the
|
||||
fourth field containing the word "defaults" (man fstab for details).
|
||||
______________________________________________________________________
|
||||
/dev/hda1 / ext2 defaults 1 1
|
||||
/dev/hda2 /usr ext2 defaults,usrquota 1 1
|
||||
______________________________________________________________________
|
||||
|
||||
Replace "usrquota" with "grpquota", should you need group quota
|
||||
support on a file system.
|
||||
______________________________________________________________________
|
||||
/dev/hda1 / ext2 defaults 1 1
|
||||
/dev/hda2 /usr ext2 defaults,grpquota 1 1
|
||||
______________________________________________________________________
|
||||
|
||||
Need both user quota and group quota support on a file system?
|
||||
______________________________________________________________________
|
||||
/dev/hda1 / ext2 defaults 1 1
|
||||
/dev/hda2 /usr ext2 defaults,usrquota,grpquota 1 1
|
||||
______________________________________________________________________
|
||||
|
||||
3.6. Activate the quota system
|
||||
|
||||
To activate the quota software you have to reboot the system for the
|
||||
changes you have made to take effect. The new kernel with quota
|
||||
support will be loaded and the startup scripts you've just created
|
||||
will be executed. At first run, quotacheck will generate the
|
||||
appropiate files to maintain the quota databases.
|
||||
|
||||
3.7. Add quotacheck to crontab
|
||||
|
||||
Although quota should work with periodical checks, it sometimes helps
|
||||
to run quotacheck periodically, e.g. weekly. Add the following line to
|
||||
your root's crontab:
|
||||
______________________________________________________________________
|
||||
0 3 * * 0 /sbin/quotacheck -avug
|
||||
______________________________________________________________________
|
||||
|
||||
4. Quota setup: tools
|
||||
|
||||
This operation is performed with the edquota command (`man edquota`
|
||||
for details).
|
||||
|
||||
4.1. Assigning quota for a particular user
|
||||
|
||||
Here's an example. I have a user with the login id bob on my system.
|
||||
The command "edquota -u bob" takes me into vi (or editor specified in
|
||||
my $EDITOR environment variable) to edit quota for user bob on each
|
||||
partition that has quota enabled:
|
||||
______________________________________________________________________
|
||||
Quotas for user bob:
|
||||
/dev/hda3: blocks in use: 2594, limits (soft = 5000, hard = 6500)
|
||||
inodes in use: 356, limits (soft = 1000, hard = 1500)
|
||||
______________________________________________________________________
|
||||
|
||||
"blocks in use" is the total number of blocks (in kilobytes) a user
|
||||
has consumed on a partition.
|
||||
|
||||
"inodes in use" is the total number of inodes a user has consumed on a
|
||||
partition.
|
||||
|
||||
4.2. Assigning quota for a particular group
|
||||
|
||||
Now I have a group games on my system. "edquota -g games" takes me
|
||||
into the vi editor again to edit quota for the group games:
|
||||
|
||||
______________________________________________________________________
|
||||
Quotas for group games:
|
||||
/dev/hda4: blocks in use: 5799, limits (soft = 8000, hard = 10000)
|
||||
inodes in use: 1454, limits (soft = 3000, hard = 4000)
|
||||
______________________________________________________________________
|
||||
|
||||
4.3. Assigning quota for a bunch of users with the same value
|
||||
|
||||
To rapidly set quotas for, say 100 users, on my system to the same
|
||||
value as my user bob, I would first edit bob's quota information by
|
||||
hand, then execute:
|
||||
______________________________________________________________________
|
||||
edquota -p bob `awk -F: '$3 > 499 {print $1}' /etc/passwd`
|
||||
______________________________________________________________________
|
||||
|
||||
assuming that you are using csh, and that you assign your user UID's
|
||||
starting with 500.
|
||||
|
||||
In addition to edquota, there are 3 terms which you should familiarize
|
||||
yourself with: Soft Limit, Hard Limit, and Grace Period.
|
||||
|
||||
4.4. Soft Limit
|
||||
|
||||
_Soft limit_ indicates the maximum amount of disk usage a quota user
|
||||
has on a partition. When combined with grace period, it acts as the
|
||||
border line, which a quota user is issued warnings about his impending
|
||||
quota violation when passed.
|
||||
|
||||
4.5. Hard Limit
|
||||
|
||||
Hard limit works only when grace period is set. It specifies the
|
||||
absolute limit on the disk usage, which a quota user can't go beyond
|
||||
his hard limit.
|
||||
|
||||
4.6. Grace Period
|
||||
|
||||
Executed with the command "edquota -t", grace period is a time limit
|
||||
before the soft limit is enforced for a file system with quota
|
||||
enabled. Time units of sec(onds), min(utes), hour(s), day(s), week(s),
|
||||
and month(s) can be used. This is what you'll see with the command
|
||||
"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
|
||||
______________________________________________________________________
|
||||
|
||||
Change the 0 days part to any length of time you feel reasonable. I
|
||||
personally would choose 7 days (or 1 week).
|
||||
|
||||
5. Miscellaneous Quota Commands
|
||||
|
||||
5.1. Quotacheck
|
||||
|
||||
Quotacheck is used to scan a file system for disk usages, and updates
|
||||
the quota record file "aquota.user" to the most recent state. I
|
||||
recommend running quotacheck at system bootup, and via cronjob
|
||||
periodically (say, every week?).
|
||||
|
||||
5.2. Repquota
|
||||
|
||||
Repquota produces a summarized quota information for a file system.
|
||||
Here is a sample output repquota gives:
|
||||
______________________________________________________________________
|
||||
# repquota -a
|
||||
Block limits File limits
|
||||
User used soft hard grace used soft hard grace
|
||||
root -- 175419 0 0 14679 0 0
|
||||
bin -- 18000 0 0 735 0 0
|
||||
uucp -- 729 0 0 23 0 0
|
||||
man -- 57 0 0 10 0 0
|
||||
user1 -- 13046 15360 19200 806 1500 2250
|
||||
user2 -- 2838 5120 6400 377 1000 1500
|
||||
______________________________________________________________________
|
||||
|
||||
5.3. Quotaon and Quotaoff
|
||||
|
||||
|
||||
Quotaon is used to turn on quota accounting; quotaoff to turn it off.
|
||||
Actually both files are similar. They are executed at system startup
|
||||
and shutdown.
|
||||
This section describes how to enable file system quota on a Linux
|
||||
host, assigning quota for users and groups, as well as the usage of
|
||||
miscellaneous quota commands. It is intended for users running kernel
|
||||
2.x (recently tested on kernel 2.4.21).
|
||||
</para>
|
||||
|
||||
1. What is quota?
|
||||
|
||||
1.1. What is quota for?
|
||||
|
||||
<para>
|
||||
Quota allows you to specify limits on two aspects of disk storage: the
|
||||
number of inodes a user or a group of users may possess; and the
|
||||
number of disk blocks that may be allocated to a user or a group of
|
||||
users.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The idea behind quota is that users are forced to stay under their
|
||||
disk consumption limit, taking away their ability to consume unlimited
|
||||
disk space on a system. Quota is handled on a per user, per file
|
||||
system basis. If there is more than one file system which a user is
|
||||
expected to create files, then quota must be set for each file system
|
||||
separately. Various tools are available for you to administer and
|
||||
automate quota policies on your system.
|
||||
</para>
|
||||
|
||||
1.2. Current Status of Quota on Linux
|
||||
|
||||
<para>
|
||||
Currently, there are some major changes in the way quota works. There
|
||||
are two different setups. The tools works the same, but there's a
|
||||
difference in used files. This document describes the setup and
|
||||
operation of the _new_ quota setup. As the new setup of quota is not
|
||||
in the regular kernel source, this setup needs some patching. We will
|
||||
describe this patching and installation of the linuxquota package. If
|
||||
you already have the quota software installed on your system, you may
|
||||
or may not have to install this patch and package. You can email me if
|
||||
you have any questions about this. I'll try to include a overview of
|
||||
Linux distro's and it's implications in a later version of this
|
||||
document.
|
||||
</para>
|
||||
|
||||
2. Requirements for quota
|
||||
|
||||
2.1. Kernel
|
||||
|
||||
<para>
|
||||
The 2.x kernel source is available from http://www.kernel.org
|
||||
<http://www.kernel.org/> Please use an available mirror close to your
|
||||
location to save bandwidth. If you have a recent version of tar, you
|
||||
can download the .bz2 compressed file.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Untar the kernel:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
cd /usr/src
|
||||
tar jxvf /path/to/linux-2.4.21-tar.bz2 - for bzip2 kernel -
|
||||
tar zxvf /path/to/linux-2.4.21-tar.gz - for gzip kernel -
|
||||
ln -s /usr/src/linux-2.4.21 /usr/src/linux
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
2.2. Quota software
|
||||
|
||||
<para>
|
||||
Depending on the Linux distribution you have, you may, or may not have
|
||||
the quota softwares installed on your system. The most recent version
|
||||
of quota is available through SourceForge and is in active
|
||||
development. You can reach the homepage of the quota-development at
|
||||
http://www.sourceforge.net/projects/linuxquota
|
||||
<http://www.sourceforge.net/project/linuxquota>.
|
||||
</para>
|
||||
|
||||
3. Quota setup: installation and configuration
|
||||
|
||||
3.1. Patch the kernel
|
||||
|
||||
<para>
|
||||
Download the patch for your kernel at:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
ftp::/atrey.karlin.mff.cuni.cz/pub/local/jack/quota/
|
||||
<ftp://atrey.karlin.mff.cuni.cz/pub/local/jack/quota/>.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Choose your kernel version and download the patch(es). Patch your
|
||||
kernel with the 'patch' command. If there is more than 1 patch for
|
||||
your kernel version, be sure to apply the patches in the correct
|
||||
order.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
You can use this script ( I assume the downloaded patches are in
|
||||
/tmp/quota/ and the kernel has been untarred to /usr/src/linux) :
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
#!/bin/sh
|
||||
|
||||
gunzip /tmp/quota/*.gz
|
||||
cd /usr/src/linux
|
||||
COUNT=`ls -1 /tmp/quota/*.diff | wc -l`
|
||||
for I in `seq 1 $COUNT`
|
||||
do
|
||||
patch -p1 < /tmp/quota/quota-2.4.21-$I-*.diff
|
||||
done
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
3.2. Reconfigure your kernel
|
||||
|
||||
<para>
|
||||
Reconfigure your kernel and add quota support.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Via `make menuconfig` or `make xconfig` you can find the option to
|
||||
support quota under the Filesystems-menu. You can specify extra
|
||||
options if you need them, like 32-bit UID support.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Save the configuration and compile the kernel. Make sure the new
|
||||
kernel will be used when rebooting the system.
|
||||
</para>
|
||||
|
||||
3.3. Compile and install the quota softwares
|
||||
|
||||
<para>
|
||||
To be able to use all the features of the new quota system, you'll
|
||||
probably need to download the new quota-package. Download the new
|
||||
quota software via the URL provided above.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
When downloaded do:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
$ gzip -dc <downloaded file> | tar xvf
|
||||
$ cd quota-tools (or whatever directory the software is put in)
|
||||
$ ./configure
|
||||
$ make
|
||||
$ su
|
||||
# make install
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
3.4. time Modify your system init script to check quota and turn
|
||||
quota on at boot
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Here's an example:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
# Check quota and then turn quota on.
|
||||
if [ -x /usr/sbin/quotacheck ]
|
||||
then
|
||||
echo "Checking quotas. This may take some time."
|
||||
/usr/sbin/quotacheck -avug
|
||||
echo " Done."
|
||||
fi
|
||||
if [ -x /usr/sbin/quotaon ]
|
||||
then
|
||||
echo "Turning on quota."
|
||||
/usr/sbin/quotaon -avug
|
||||
fi
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
The golden rule is that always turn quota on after your file systems
|
||||
in /etc/fstab have been mounted, otherwise quota will fail to work. I
|
||||
recommend turning quota on right after the part where file systems are
|
||||
mounted in your system init script.
|
||||
</para>
|
||||
|
||||
3.5. Modify /etc/fstab
|
||||
|
||||
<para>
|
||||
Partitions that you have not yet enabled quota normally look something
|
||||
like:
|
||||
</para>
|
||||
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
/dev/hda1 / ext2 defaults 1 1
|
||||
/dev/hda2 /usr ext2 defaults 1 1
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
To enable user quota support on a file system, add "usrquota" to the
|
||||
fourth field containing the word "defaults" (man fstab for details).
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
/dev/hda1 / ext2 defaults 1 1
|
||||
/dev/hda2 /usr ext2 defaults,usrquota 1 1
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Replace "usrquota" with "grpquota", should you need group quota
|
||||
support on a file system.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
/dev/hda1 / ext2 defaults 1 1
|
||||
/dev/hda2 /usr ext2 defaults,grpquota 1 1
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Need both user quota and group quota support on a file system?
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
/dev/hda1 / ext2 defaults 1 1
|
||||
/dev/hda2 /usr ext2 defaults,usrquota,grpquota 1 1
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
3.6. Activate the quota system
|
||||
|
||||
<para>
|
||||
To activate the quota software you have to reboot the system for the
|
||||
changes you have made to take effect. The new kernel with quota
|
||||
support will be loaded and the startup scripts you've just created
|
||||
will be executed. At first run, quotacheck will generate the
|
||||
appropiate files to maintain the quota databases.
|
||||
</para>
|
||||
|
||||
3.7. Add quotacheck to crontab
|
||||
|
||||
<para>
|
||||
Although quota should work with periodical checks, it sometimes helps
|
||||
to run quotacheck periodically, e.g. weekly. Add the following line to
|
||||
your root's crontab:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
0 3 * * 0 /sbin/quotacheck -avug
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
4. Quota setup: tools
|
||||
|
||||
<para>
|
||||
This operation is performed with the edquota command (`man edquota`
|
||||
for details).
|
||||
</para>
|
||||
|
||||
4.1. Assigning quota for a particular user
|
||||
|
||||
<para>
|
||||
Here's an example. I have a user with the login id bob on my system.
|
||||
The command "edquota -u bob" takes me into vi (or editor specified in
|
||||
my $EDITOR environment variable) to edit quota for user bob on each
|
||||
partition that has quota enabled:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
Quotas for user bob:
|
||||
/dev/hda3: blocks in use: 2594, limits (soft = 5000, hard = 6500)
|
||||
inodes in use: 356, limits (soft = 1000, hard = 1500)
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
"blocks in use" is the total number of blocks (in kilobytes) a user
|
||||
has consumed on a partition.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
"inodes in use" is the total number of inodes a user has consumed on a
|
||||
partition.
|
||||
</para>
|
||||
|
||||
4.2. Assigning quota for a particular group
|
||||
|
||||
<para>
|
||||
Now I have a group games on my system. "edquota -g games" takes me
|
||||
into the vi editor again to edit quota for the group games:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
Quotas for group games:
|
||||
/dev/hda4: blocks in use: 5799, limits (soft = 8000, hard = 10000)
|
||||
inodes in use: 1454, limits (soft = 3000, hard = 4000)
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
4.3. Assigning quota for a bunch of users with the same value
|
||||
|
||||
<para>
|
||||
To rapidly set quotas for, say 100 users, on my system to the same
|
||||
value as my user bob, I would first edit bob's quota information by
|
||||
hand, then execute:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
edquota -p bob `awk -F: '$3 > 499 {print $1}' /etc/passwd`
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
assuming that you are using csh, and that you assign your user UID's
|
||||
starting with 500.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
In addition to edquota, there are 3 terms which you should familiarize
|
||||
yourself with: Soft Limit, Hard Limit, and Grace Period.
|
||||
</para>
|
||||
|
||||
4.4. Soft Limit
|
||||
|
||||
<para>
|
||||
_Soft limit_ indicates the maximum amount of disk usage a quota user
|
||||
has on a partition. When combined with grace period, it acts as the
|
||||
border line, which a quota user is issued warnings about his impending
|
||||
quota violation when passed.
|
||||
</para>
|
||||
|
||||
4.5. Hard Limit
|
||||
|
||||
<para>
|
||||
Hard limit works only when grace period is set. It specifies the
|
||||
absolute limit on the disk usage, which a quota user can't go beyond
|
||||
his hard limit.
|
||||
</para>
|
||||
|
||||
4.6. Grace Period
|
||||
|
||||
<para>
|
||||
Executed with the command "edquota -t", grace period is a time limit
|
||||
before the soft limit is enforced for a file system with quota
|
||||
enabled. Time units of sec(onds), min(utes), hour(s), day(s), week(s),
|
||||
and month(s) can be used. This is what you'll see with the command
|
||||
"edquota -t":
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
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
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Change the 0 days part to any length of time you feel reasonable. I
|
||||
personally would choose 7 days (or 1 week).
|
||||
</para>
|
||||
|
||||
5. Miscellaneous Quota Commands
|
||||
|
||||
5.1. Quotacheck
|
||||
|
||||
<para>
|
||||
Quotacheck is used to scan a file system for disk usages, and updates
|
||||
the quota record file "aquota.user" to the most recent state. I
|
||||
recommend running quotacheck at system bootup, and via cronjob
|
||||
periodically (say, every week?).
|
||||
</para>
|
||||
|
||||
5.2. Repquota
|
||||
|
||||
<para>
|
||||
Repquota produces a summarized quota information for a file system.
|
||||
Here is a sample output repquota gives:
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<screen>
|
||||
______________________________________________________________________
|
||||
# repquota -a
|
||||
Block limits File limits
|
||||
User used soft hard grace used soft hard grace
|
||||
root -- 175419 0 0 14679 0 0
|
||||
bin -- 18000 0 0 735 0 0
|
||||
uucp -- 729 0 0 23 0 0
|
||||
man -- 57 0 0 10 0 0
|
||||
user1 -- 13046 15360 19200 806 1500 2250
|
||||
user2 -- 2838 5120 6400 377 1000 1500
|
||||
______________________________________________________________________
|
||||
</screen>
|
||||
</para>
|
||||
|
||||
5.3. Quotaon and Quotaoff
|
||||
|
||||
<para>
|
||||
Quotaon is used to turn on quota accounting; quotaoff to turn it off.
|
||||
Actually both files are similar. They are executed at system startup
|
||||
and shutdown.
|
||||
</para>
|
||||
|
||||
</sect1>
|
||||
|
|
|
@ -3,6 +3,43 @@
|
|||
<title>RAID</title>
|
||||
|
||||
<para>
|
||||
10.2. RAID
|
||||
|
||||
RAID, short for Redundant Array of Inexpensive Disks, is a method
|
||||
whereby information is spread across several disks, using techniques
|
||||
such as disk striping (RAID Level 0) and disk mirroring (RAID level 1)
|
||||
to achieve redundancy, lower latency and/or higher bandwidth for
|
||||
reading and/or writing, and recoverability from hard-disk crashes.
|
||||
Over six different types of RAID configurations have been defined.
|
||||
There are three types of RAID solution options available to Linux
|
||||
users: software RAID, outboard DASD boxes, and RAID disk controllers.
|
||||
|
||||
· Software RAID: Pure software RAID implements the various RAID
|
||||
levels in the kernel disk (block device) code.
|
||||
· Outboard DASD Solutions: DASD (Direct Access Storage Device) are
|
||||
separate boxes that come with their own power supply, provide a
|
||||
cabinet/chassis for holding the hard drives, and appear to Linux as
|
||||
just another SCSI device. In many ways, these offer the most robust
|
||||
RAID solution.
|
||||
· RAID Disk Controllers: Disk Controllers are adapter cards that plug
|
||||
into the ISA/EISA/PCI bus. Just like regular disk controller cards,
|
||||
a cable attaches them to the disk drives. Unlike regular disk
|
||||
controllers, the RAID controllers will implement RAID on the card
|
||||
itself, performing all necessary operations to provide various RAID
|
||||
levels.
|
||||
|
||||
Related HOWTOs:
|
||||
|
||||
· http://metalab.unc.edu/mdw/HOWTO/mini/DPT-Hardware-RAID.html
|
||||
· http://metalab.unc.edu/mdw/HOWTO/Root-RAID-HOWTO.html
|
||||
· http://metalab.unc.edu/mdw/HOWTO/Software-RAID-HOWTO.html
|
||||
|
||||
RAID at linas.org:
|
||||
|
||||
· http://linas.org/linux/raid.html
|
||||
|
||||
|
||||
|
||||
RAID, short for Redundant Array of Inexpensive Disks, is a method
|
||||
whereby information is spread across several disks, using techniques
|
||||
such as disk striping (RAID Level 0) and disk mirroring (RAID level 1)
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
<sect1 id="Satellite">
|
||||
|
||||
<title>Satellite</title>
|
||||
|
||||
Sat (Satellite Technology) HOWTO
|
||||
Roberto Arcomano berto@fatamorgana.com, Florindo Santoro
|
||||
flosan@hack-it.net
|
||||
|
@ -1474,5 +1478,4 @@
|
|||
|
||||
http://www.fatamorgana.com <http://www.fatamorgana.com>
|
||||
|
||||
|
||||
|
||||
</sect1>
|
||||
|
|
|
@ -1141,5 +1141,15 @@ who we should thank for writing the first versions of this document.
|
|||
output''.
|
||||
2002-10-08: Added section ``Actual configuration'' and hints about
|
||||
routing in ``Setting up the routing'', ``Ping it, Jim!'' , resp.
|
||||
|
||||
|
||||
The Clock Mini-HOWTO
|
||||
Ron Bean, rbean@execpc.com
|
||||
v2.1, November 2000
|
||||
1.3. Acknowledgements
|
||||
This mini-HOWTO has been greatly improved thanks to various people who
|
||||
have sent me email since the first version in 1996. In some cases
|
||||
they wrote with questions but ended up giving me as much information
|
||||
as I gave them. Unfortunately I haven't compiled a list of names
|
||||
(maybe next time). You know who you are :-).
|
||||
|
||||
</appendix>
|
||||
|
|
Loading…
Reference in New Issue