public inbox for gentoo-doc-cvs@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-doc-cvs] cvs commit: maximum-swappage.xml
@ 2005-08-18 12:59 Xavier Neys
  0 siblings, 0 replies; 3+ messages in thread
From: Xavier Neys @ 2005-08-18 12:59 UTC (permalink / raw
  To: gentoo-doc-cvs

neysx       05/08/18 12:59:17

  Added:       xml/htdocs/doc/en/articles maximum-swappage.xml
                        partition-planning-tips.xml partitioning-p1.xml
                        partitioning-p2.xml
  Log:
  New GuideXMLified articles from #100709, #102652 & #102666

Revision  Changes    Path
1.1                  xml/htdocs/doc/en/articles/maximum-swappage.xml

file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/maximum-swappage.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/maximum-swappage.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo

Index: maximum-swappage.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/maximum-swappage.xml,v 1.1 2005/08/18 12:59:17 neysx Exp $ -->

<guide link="/doc/en/articles/maximum-swappage.xml" lang="en">
<title>Maximum swappage</title>

<author title="Author">
  <mail link="drobbins@gentoo.org">Daniel Robbins</mail>
</author>
<author title="Editor">
  <mail link="jackdark@gmail.com">Joshua Saddler</mail>
</author>

<abstract>
Learn how to improve the swap performance on your Linux server by several
orders of magnitude. Author Daniel Robbins takes you through this quick tip on
getting the most from your server.
</abstract>

<!-- The original version of this article was first published on IBM
developerWorks, and is property of Westtech Information Services. This
document is an updated version of the original article, and contains
various improvements made by the Gentoo Linux Documentation team -->

<version>1.0</version>
<date>2005-08-15</date>

<chapter>
<title>Getting the most out of swap</title>
<section>
<body>

<note>
The original version of this article was first published on IBM developerWorks,
and is property of Westtech Information Services. This document is an updated
version of the original article, and contains various improvements made by the
Gentoo Linux Documentation team.
</note>

<p>
When you set up a brand new Linux server, do you create a single 128 MB swap
partition? If so, did you know that you are severely limiting swap performance?
Would you like to increase swap performance by several orders of magnitude, and
to create swap partitions larger than 1 GB? It's possible, requiring no kernel
patches or special hardware, just pure geek know-how!
</p>

<p>
Some of you may not really care about swap. After all, Linux systems are
typically very memory efficient, and swap is often barely touched. While often
true on desktop systems, servers are another story. Because servers may handle
unexpected stresses, such as runaway processes, denial of service attacks, or
even the Slashdot effect, they need to have adequate high-speed swap so that
they do not grind to a halt and possibly crash when all physical memory (and
then some) is exhausted.
</p>

<p>
Still not convinced that this is a big deal? I'll show you how easy it is to
bring down a server by launching a massive amount of new processes.
</p>

<warn>
Please, if you try this, do it only on a non-production server that you
actually administer!
</warn>

<p>
Let's say you have two customized <c>grep</c> commands in
<path>/usr/bin</path>, called <c>bobgrep</c> and <c>jimgrep</c>. Now, let's
assume that <c>bobgrep</c> is simply a shell script that calls the ELF
executable <c>jimgrep</c>, as follows:
</p>

<pre caption="The bobgrep script">
#!/bin/bash
jimgrep -r $*
</pre>

<p>
Everything looks good so far, but what happens if <c>jimgre</c>p gets
accidentally replaced with a symbolic link to <c>bobgrep?</c> Well, in that
case, calling <c>bobgrep</c> or <c>jimgrep</c> will cause an infinite loop,
causing hundreds of bash processes to be spawned in mere seconds. This actually
happened to me once, and believe me, it hurt!
</p>

<p>
If a server doesn't have adequate swap, a situation like this can cause the
machine to lock up in much less than a minute. How do we fix the problem? One
way is to increase the swap size beyond 128 MB. Fortunately for us, there is
absolutely no 128 MB limit on swap under Linux 2.2.x+ and later kernels, as
there was in the past. The current limits are approximately 2 GB on x86,
PowerPC, and MC680x0 systems, 512 MB on MIPS systems, 128 GB on Alpha, and a
whopping 3 terabytes on UltraSparc platforms!
</p>

<pre caption="Swap partition size limits under modern Linux kernels">
x86                 2 Gigabytes
PowerPC             2 Gigabytes
Motorola 680x0      2 Gigabytes
Sparc               1 Gigabyte
MIPS                512 Megabytes
Alpha               128 Gigabytes
UltraSparc          3 Terabytes
</pre>

<p>
While it's nice to be able to increase swap partition size to beyond 128 MB,
how about increasing performance? Ideally, it would be nice if we could set up
swap partitions in a RAID 0 stripe, so that reads and writes are equally
distributed between all partitions. If these partitions are on separate drives
and/or controllers, this will multiply swap file performance, allowing your
servers to handle temporary memory usage "spikes" without getting dramatically
bogged down.
</p>

<p>
Amazingly, all modern Linux kernels, by default (with no special kernel options
or patches) allow you to parallelize swap, just like a RAID 0 stripe. By using
the <c>pri</c> option in <path>/etc/fstab</path> to set multiple swap
partitions to the same priority, we tell Linux to use them in parallel:
</p>

<pre caption="Set multiple swap partitions to the same priority">
/dev/sda2       none    swap    sw,pri=3        0       0
/dev/sdb2       none    swap    sw,pri=3        0       0
/dev/sdc2       none    swap    sw,pri=3        0       0
/dev/sdd2       none    swap    sw,pri=1        0       0
</pre>

<p>
In the above example, Linux will use swap partitions sda2, sdb2, and sdc2 in
parallel. Since these partitions are on different drives, and possibly even
different SCSI controllers, read and write throughput will nearly triple. The
fourth swap partition, sdd2, will be used only after the first three partitions
have been exhausted.
</p>

<p>
The <c>pri</c> option is really easy to use. The priority must be a number
between 0 and 32767, with 32767 being the highest priority. The swap partitions
will be used from highest priority to lowest priority, meaning that a partition
with a priority of x will only be used only if all partitions with a priority
greater than x are already full. If several partitions have the same priority,
Linux will automatically parallelize access between them. This allows you to
not only parallelize swap, but also prioritize access so that the partitions on
the fastest drives (or regions of the drives) are used first. So, you can set
up an emergency swap partition on an old, slower drive that will be used only
if all high-speed swap is exhausted first.
</p>

<p>
Now it's time to put some of this swapping knowledge into action. To loosely
quote Mr. Miyagi of Karate Kid fame: "Swap on, swap off, geek-san!"
</p>

</body>
</section>
<section>
<title>Resources</title>
<body>

<ul>
  <li>
    In <uri link="/doc/en/articles/partitioning-p1.xml">Partitioning in action:
    Moving /home</uri>, I show you step-by-step how to move <path>/home</path>
    to a new partition.
  </li>
  <li>
    In <uri link="/doc/en/articles/partitioning-p2.xml">Partitioning in
    action</uri>, I show you step-by-step how to move <path>/var</path> and
    <path>/tmp</path> to a new partition.
  </li>
  <li>
    In my second tip, <uri
    link="/doc/en/articles/partition-planning-tips.xml">
    "Partition planning tips"</uri>, I share several ways of effectively
    organizing your partition layout.
  </li>
  <li>
    The <uri link="http://www.redhat.com/mirrors/LDP/LDP/sag/index.html"> Linux
    system administrator's guide</uri> mirrored on Red Hat's home page.
  </li>
  <li>
    A good high-level <uri link="http://www.gwdg.de/gs-2.0/chapter2_6.html">
    overview of Linux system administration</uri>.
  </li>
  <li>
    For more information on optimizing file system performance, take a look at
    Linas Vepstas' <uri link="http://www.tldp.org">Linux Software RAID
    HOWTO</uri>. Since the most recent software RAID code has been merged into
    the 2.3 series kernels, it is a viable option for further enhancing Linux
    disk performance.
  </li>
</ul>

</body>



1.1                  xml/htdocs/doc/en/articles/partition-planning-tips.xml

file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/partition-planning-tips.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/partition-planning-tips.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo

Index: partition-planning-tips.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/partition-planning-tips.xml,v 1.1 2005/08/18 12:59:17 neysx Exp $ -->

<guide link="/doc/en/articles/partition-planning-tips.xml" lang="en">
<title>Partition planning tips</title>

<author title="Author">
  <mail link="drobbins@gentoo.org">Daniel Robbins</mail>
</author>
<author title="Editor">
  <mail link="jackdark@gmail.com">Joshua Saddler</mail>
</author>

<abstract>
Organizing your partitions correctly can be fun and rewarding. This collection
of tips will help you to use those sectors wisely.
</abstract>

<!-- The original version of this article was first published on IBM
developerWorks, and is property of Westtech Information Services. This
document is an updated version of the original article, and contains
various improvements made by the Gentoo Linux Documentation team -->

<version>1.0</version>
<date>2005-08-15</date>

<chapter>
<title>How to keep things organized on disk</title>
<section>
<body>

<note>
The original version of this article was first published on IBM developerWorks,
and is property of Westtech Information Services. This document is an updated
version of the original article, and contains various improvements made by the
Gentoo Linux Documentation team.
</note>

<p>
Have you noticed how many new filesystems are now available for Linux these
days? Not only ReiserFS, but also SGI's XFS and IBM's own JFS (in source form)
are now available for Linux. What an incredible selection! And, of course, we
also have the Coda filesystem as well as good old ext2. As usual, choice is an
excellent thing. In this collection of tips, we'll be looking at another area
where we have lots of freedom -- how to organize partitions on disk. Regardless
of which new-fangled filesystem you are using, good partition layout is
essential. Here are three tips that will help to keep things organized.
</p>

</body>
</section>
<section>
<title>Don't partition the entire drive</title>
<body>

<p>
These days, new machines often have 20 or 34 gigabytes of storage on a single
drive. These drives are great, but they create a new problem: how exactly do
you partition these things? Many of us can only conceive of filling up 12 GB,
and that's if we actually tried to fill things up.
</p>

<p>
Instead of partitioning the entire drive during installation, you may want to
consider partitioning only the portion of the drive that you know you will
actually use. Later, when you've figured out how to use the 22 GB of free space
sitting at the end of your drive, you'll have a better idea of how to partition
it. Then, you can fire up <c>fdisk</c> or <c>cfdisk</c> and create a partition
that meets your exact needs. For now, create partitions that are large enough
to hold your current files, plus allow for future growth. Don't worry, the free
space at the end of your drive will still be there when you need it.
</p>

</body>
</section>
<section>
<title>Partition for backups</title>
<body>

<p>
My second organizational tip will help your backups go more smoothly. If you
are going to regularly back up a portion of your file system tree, it's a very
good idea to place this data on a separate partition. Why? Because many copying
and archiving tools have a special option for not crossing partition boundaries
(such as <c>cp</c>'s <c>-x</c> option), which will make it easy to select only
the files you want. Also, you can select a size for this partition so that it
is close to capacity of your backup media. That way, you'll never have to worry
about filling up a tape, and you can monitor how close you are to filling up
your backup media by using the <c>df</c> command to see how much space is left
on that particular partition. Then, you can track your storage and backup needs
and plan accordingly.
</p>

</body>
</section>
<section>
<title>Partition to reduce fragmentation</title>
<body>

<p>
At the beginning of this article, I mentioned all the fancy new journaled
filesystems now available for Linux. Amid all the excitement, it's easy to
forget our old friend, the ext2 filesystem. ext2 does have some drawbacks; it
is not extremely robust, for example. However, one thing it does excel at
(especially when compared to Microsoft's NTFS) is keeping fragmentation to a
minimum. If you don't know, file fragmentation occurs when there is not enough
contiguous space on a filesystem to store an entire file. The result? The file
is broken into non-contiguous "fragments," which are stored on disk. When this
file is accessed, the hard drive's head needs to jump all over the place to
read in the entire file. This slows down I/O, adding additional seeks to the
reading process.
</p>

<p>
OK, you may ask, what's the big deal? After all, ext2 filesystems take a long
time to exhibit signs of fragmentation. However, I would argue that
fragmentation is still a big problem, because although ext2 does not get
fragmented easily, fragmentation is a one-way, cumulative process. That is,
while ext2 fragments slowly, it cannot defragment itself. In other words, any
often-modified ext2 filesystem will gradually get more and more fragmented, and
thus slower. Even worse, there are no production-quality ext2 filesystem
defragmenting programs currently available. This means that fragmentation is
guaranteed to get worse over time, and the only way to fix it is to wipe the
filesystem clean, and restore all the original files from a backup. That's a
pretty involved and time-consuming process. So, how can the problem of
fragmentation be dramatically reduced and contained? I'll cover all the juicy
details in my next tip. See you then!
</p>

</body>
</section>
<section>
<title>Resources</title>
<body>

<ul>
  <li>
    In <uri link="/doc/en/articles/partitioning-p1.xml">Partitioning in action:
    Moving /home</uri>, I show you step-by-step how to move <path>/home</path>
    to a new partition.
  </li>
  <li>
    In <uri link="/doc/en/articles/partitioning-p2.xml">Partitioning in
    action</uri>, I show you step-by-step how to move <path>/var</path> and
    <path>/tmp</path> to a new partition.
  </li>
  <li>
    See <uri link="/doc/en/articles/maximum-swappage.xml">Maximum
    swappage</uri>, another tip by Daniel, where he shows how to dramatically
    increase swap performance under Linux.
  </li>
  <li>
    Check out the <uri link="http://tldp.org/docs.html#howto">howtos</uri> at
    the <uri link="http://tldp.org">Linux Documentation Project</uri>.
  </li>
</ul>

</body>
</section>
<section>
<title>About the author</title>
<body>

<p>
Daniel Robbins lives in Albuquerque, New Mexico. He was the President/CEO of
Gentoo Technologies Inc., the Chief Architect of the Gentoo Project and is a
contributing author of several books published by MacMillan: Caldera OpenLinux
Unleashed, SuSE Linux Unleashed, and Samba Unleashed. Daniel has been involved
with computers in some fashion since the second grade when he was first exposed
to the Logo programming language and a potentially lethal dose of Pac Man. This
probably explains why he has since served as a Lead Graphic Artist at SONY
Electronic Publishing/Psygnosis. Daniel enjoys spending time with his wife Mary
and his new baby daughter, Hadassah. You can contact Daniel at
<mail>drobbins@gentoo.org</mail>.
</p>

</body>
</section>
</chapter>
</guide>



1.1                  xml/htdocs/doc/en/articles/partitioning-p1.xml

file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/partitioning-p1.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/partitioning-p1.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo

Index: partitioning-p1.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/partitioning-p1.xml,v 1.1 2005/08/18 12:59:17 neysx Exp $ -->

<guide link="/doc/en/articles/partitioning-p1.xml" lang="en">
<title>Partitioning in action, Part 1</title>

<author title="Author">
  <mail link="drobbins@gentoo.org">Daniel Robbins</mail>
</author>
<author title="Editor">
  <mail link="jackdark@gmail.com">Joshua Saddler</mail>
</author>

<abstract>
In this new series of tips, Daniel Robbins shows you how to change partition
layout on a running system. He'll also cover several tricks of the trade to
minimize downtime and avoid making costly mistakes. In this particular tip,
he'll show you how to move /home to another partition.
</abstract>

<!-- The original version of this article was first published on IBM
developerWorks, and is property of Westtech Information Services. This
document is an updated version of the original article, and contains
various improvements made by the Gentoo Linux Documentation team -->

<version>1.0</version>
<date>2005-08-15</date>

<chapter>
<title>Moving /home</title>
<section>
<title>Introduction</title>
<body>

<note>
The original version of this article was first published on IBM developerWorks,
and is property of Westtech Information Services. This document is an updated
version of the original article, and contains various improvements made by the
Gentoo Linux Documentation team.
</note>

<p>
The partition <path>/home</path> is one of the most-often-moved partitions.
Sometimes, all the space in <path>/home</path> becomes exhausted, and an
additional hard drive is required. Other times, <path>/home</path> is set up as
part of the root partition, and it may need to be moved to improve performance
or facilitate backup. Whatever the case, I'll show you how to move
<path>/home</path> safely and efficiently.
</p>

<warn>
The following technique describes how to move a partition(s). Although this
technique is designed so that you can "back out" of a failed partition move, it
doesn't protect against user error. In other words, any time that you format
partitions or copy large numbers of files, there's a possibility that you will
type the wrong thing, causing lots of data to be destroyed. For this reason,
it's highly recommended that you <e>take appropriate steps to back up all
critical files before proceeding</e>.
</warn>

<p>
Now that you're prepared, we're ready to start moving <path>/home</path>. The
exact steps you will take depend on whether <path>/home</path> currently
resides on its own separate partition, or whether it is located on the root
partition. Keep this in mind as we go through the steps (I'll make notes where
necessary). Right now, if you are moving <path>/home</path> to a new hard
drive, it should be physically installed in your system.
</p>

<p>
If you are moving <path>/home</path> to an existing partition (it doesn't need
to be ext2, as long as the target primary or extended partition exists), you
can proceed to <uri link="#step2">step 2</uri>.
</p>

</body>
</section>
<section>
<title>Create a new partition, if necessary</title>
<body>

<p>
If the new partition doesn't exist yet, you'll need to create it using
<c>cfdisk</c> (preferred) or <c>fdisk</c>. If the partition doesn't reside on
your first drive, remember to specify the name of the device as the first
argument to <c>cfdisk</c> or <c>fdisk</c>. After creating the appropriate
primary or extended partition, you should reboot so that the partition table
can be reread correctly. This is the only time you will need to reboot the
system.
</p>

</body>
</section>
</chapter>

<chapter id="step2">
<title>Create a filesystem on the new partition</title>
<section>
<body>

<p>
To create a filesystem on the new partition, first make sure you know the exact
device name for the new partition (for example, <path>/dev/sda5</path>). If
you're not sure of the exact device name, stop now and double-check! Then type
the following, as root:
</p>

<pre caption="Creating the filesystem">
# <i>mkfs.ext2 /dev/???</i>
</pre>

<p>
In the above and following code samples, <path>???</path> should be replaced
with the target partition name. After executing this command, the target
partition will contain an empty ext2 filesystem.
</p>

</body>
</section>
</chapter>

<chapter>
<title>Mount the new filesystem in /mnt</title>
<section>
<body>

<p>
Create a directory called <path>/mnt/newpart</path>, and then mount the new
partition there:
</p>

<pre caption="Mounting the partition">
# <i>mount /dev/??? /mnt/newpart</i>
</pre>

</body>
</section>
</chapter>

<chapter>
<title>Drop to single-user mode</title>
<section>
<body>

<p>
I delayed this step as long as possible to maximize system availability, but we
now must drop into single-user mode, and copy files from <path>/home</path> to
<path>/mnt/newpart</path>. You shouldn't have any files open in
<path>/home</path>, and entering single-user mode eliminates this possibility:
</p>

<pre caption="Entering single user mode">
# <i>init 1</i>
</pre>

<p>
If prompted, enter the root password to perform system maintenance. You should
now have a root shell.
</p>

</body>
</section>
</chapter>

<chapter>
<title>Change directories to /home and copy files</title>
<section>
<body>

<p>
Type the following:
</p>

<pre caption="Copying files">
# <i>cd /home</i>
# <i>cp -ax * /mnt/newpart</i>
</pre>

<p>
The <c>cp -ax</c> command recursively copies the contents of <path>/home</path>
to <path>/mnt/newpart</path>, preserving all file attributes, and not crossing
any mount points. After this command finishes, <path>/mnt/newpart</path> will
contain an exact copy of all the files and directories currently in
<path>/home</path>. If the old <path>/home</path> was on its own separate
partition (listed on a separate line in <path>/etc/fstab</path>), go to <uri
link="#step6a">step 6a</uri>. Otherwise, proceed to <uri link="#step6b">step
6b</uri>.
</p>

</body>
</section>
</chapter>

<chapter>
<title>Use the new partition</title>
<section id="step6a">
<title>6a: /home on its own partition</title>
<body>



1.1                  xml/htdocs/doc/en/articles/partitioning-p2.xml

file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/partitioning-p2.xml?rev=1.1&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/partitioning-p2.xml?rev=1.1&content-type=text/plain&cvsroot=gentoo

Index: partitioning-p2.xml
===================================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/partitioning-p2.xml,v 1.1 2005/08/18 12:59:17 neysx Exp $ -->

<guide link="/doc/en/articles/partitioning-p2.xml" lang="en">
<title>Partitioning in action, Part 2</title>

<author title="Author">
  <mail link="drobbins@gentoo.org">Daniel Robbins</mail>
</author>
<author title="Editor">
  <mail link="jackdark@gmail.com">Joshua Saddler</mail>
</author>

<abstract>
In this second tip on changing partition layout on a running system, Daniel
Robbins shows you how to move /tmp and /var to their own shared partition. He
also covers several tricks of the trade to minimize downtime and avoid making
costly mistakes.
</abstract>

<!-- The original version of this article was first published on IBM
developerWorks, and is property of Westtech Information Services. This
document is an updated version of the original article, and contains
various improvements made by the Gentoo Linux Documentation team -->

<version>1.0</version>
<date>2005-08-15</date>

<chapter>
<title>Consolidating data</title>
<section>
<title>Introduction</title>
<body>

<note>
The original version of this article was first published on IBM developerWorks,
and is property of Westtech Information Services. This document is an updated
version of the original article, and contains various improvements made by the
Gentoo Linux Documentation team.
</note>

<p>
In my <uri link="/doc/en/articles/partitioning-p1.xml">last tip</uri>, we
successfully moved <path>/home</path> to a new partition. Now, it's time to
learn how to consolidate often-modified files onto a new partition. Why would
we want to do this? Here's an example. Often-modified files contribute heavily
to fragmentation. One of the best ways to contain fragmentation is to store
often-modified files on their own partition. That way, the other partitions are
unaffected by the fragmentation caused by the heavily modified files. In
concept, this is easy to understand, but how do you actually go about doing it?
</p>

<p>
First, you must create a new partition for the specific purpose of storing
frequently modified files. You might want to locate this partition on a
separate disk to enhance performance. Then, I'll walk you through the steps
required to move both <path>/tmp</path> and <path>/var</path> to this new
partition.
</p>

<warn>
The following technique describes how to move a partition(s). Although this
technique is designed so that you can "back out" of a failed partition move, it
doesn't protect against user error. In other words, any time that you format
partitions or copy large numbers of files, there's a possibility that you will
type the wrong thing, causing lots of data to be destroyed. For this reason,
it's highly recommended that you <e>take appropriate steps to back up all
critical files before proceeding</e>.
</warn>

</body>
</section>
<section>
<title>Create a filesystem on the new partition</title>
<body>

<p>
The first step of this process is to create a new partition that's big enough
to hold <path>/var</path> and <path>/tmp</path>, with a little extra space left
over. You'll need either an additional drive, or a spare (unused) partition
that will house the often-modified files. If you do need to use <c>fdisk</c> or
<c>cfdisk</c> to create the partition, you'll need to reboot once. Then, it's
time to format the new partition as follows (it's OK to be in multiuser mode
while you do this; I'll let you know when to switch to single-user):
</p>

<pre caption="Creating the filesystem">
# <i>mkfs.ext2 /dev/???</i>
</pre>

</body>
</section>
</chapter>

<chapter>
<title>Mount it to /mnt/rwstorage</title>
<section>
<body>

<p>
As in my previous tip, <path>???</path> should be replaced with the device name
for the new, empty partition that you are creating. Accidentally typing the
wrong name will destroy data on an existing partition, so be careful! After
typing this command, you'll have a brand-new ext2 filesystem on the new
partition. We're almost ready to mount it, but first, let's make a new mount
point.
</p>

<pre caption="Creating the mount point">
# <i>mkdir /mnt/rwstorage</i>
</pre>

<p>
I chose the name <path>rwstorage</path> to remind us that this particular
partition is going to be specifically used to house files that are read from
and written to frequently. To mount the partition, type:
</p>

<pre caption="Mounting the partition">
# <i>mount /dev/??? /mnt/rwstorage</i>
</pre>

</body>
</section>
</chapter>

<chapter>
<title>Creating a new /tmp</title>
<section>
<body>

<p>
The partition is now mounted and we're ready to create our new
<path>/tmp</path> directory:
</p>

<pre caption="Creating the new /tmp">
# <i>cd /mnt/rwstorage</i>
# <i>mkdir tmp</i>
# <i>chmod 1777 tmp</i>
</pre>

</body>
</section>
</chapter>

<chapter>
<title>Drop to single-user mode</title>
<section>
<body>

<p>
Our new directory at <path>/mnt/rwstorage/tmp</path> has the right permissions
for a temporary directory. Now, drop to single-user mode, since we must copy
over <path>/var</path>. As usual, we've delayed our drop to single-user mode to
the last possible moment. Right now, we don't want any programs reading or
writing files in <path>/var</path>, so we have to stop all daemons, disconnect
all users, and do some quick maintenance by typing:
</p>

<pre caption="Entering single-user mode">
# <i>init 1</i>
</pre>

<p>
If you're prompted to enter a password to perform system maintanance, do so.
You should now have a root shell, and all unnecessary daemons will be stopped.
Create a new location for our <path>/var</path> files by typing:
</p>

<pre caption="Creating the new directory">
# <i>cd /mnt/rwstorage</i>
# <i>mkdir var</i>
</pre>

</body>
</section>
</chapter>

<chapter>
<title>Copy /var</title>
<section>
<body>

<p>
Default permissions on our new <path>/mnt/newstorage/var</path> directory
should be correct, so now we're ready to copy all of our original
<path>/var</path> data over to the new partition:
</p>

<pre caption="Copying the data">
# <i>cd /var </i>
# <i>cp -ax * /mnt/rwstorage/var</i>
</pre>

</body>
</section>
</chapter>



-- 
gentoo-doc-cvs@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-doc-cvs] cvs commit: maximum-swappage.xml
@ 2005-08-18 20:01 Xavier Neys
  0 siblings, 0 replies; 3+ messages in thread
From: Xavier Neys @ 2005-08-18 20:01 UTC (permalink / raw
  To: gentoo-doc-cvs

neysx       05/08/18 20:01:56

  Modified:    xml/htdocs/doc/en/articles maximum-swappage.xml
                        partitioning-p1.xml partitioning-p2.xml
  Log:
  #102997 Fixed links and a <c>

Revision  Changes    Path
1.2       +9 -9      xml/htdocs/doc/en/articles/maximum-swappage.xml

file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/maximum-swappage.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/maximum-swappage.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo
diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/maximum-swappage.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo

Index: maximum-swappage.xml
===================================================================
RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/maximum-swappage.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- maximum-swappage.xml	18 Aug 2005 12:59:17 -0000	1.1
+++ maximum-swappage.xml	18 Aug 2005 20:01:55 -0000	1.2
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/maximum-swappage.xml,v 1.1 2005/08/18 12:59:17 neysx Exp $ -->
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/maximum-swappage.xml,v 1.2 2005/08/18 20:01:55 neysx Exp $ -->
 
 <guide link="/doc/en/articles/maximum-swappage.xml" lang="en">
 <title>Maximum swappage</title>
@@ -23,8 +23,8 @@
 document is an updated version of the original article, and contains
 various improvements made by the Gentoo Linux Documentation team -->
 
-<version>1.0</version>
-<date>2005-08-15</date>
+<version>1.1</version>
+<date>2005-08-18</date>
 
 <chapter>
 <title>Getting the most out of swap</title>
@@ -79,8 +79,8 @@
 </pre>
 
 <p>
-Everything looks good so far, but what happens if <c>jimgre</c>p gets
-accidentally replaced with a symbolic link to <c>bobgrep?</c> Well, in that
+Everything looks good so far, but what happens if <c>jimgrep</c> gets
+accidentally replaced with a symbolic link to <c>bobgrep</c>? Well, in that
 case, calling <c>bobgrep</c> or <c>jimgrep</c> will cause an infinite loop,
 causing hundreds of bash processes to be spawned in mere seconds. This actually
 happened to me once, and believe me, it hurt!
@@ -175,12 +175,12 @@
   </li>
   <li>
     In my second tip, <uri
-    link="/doc/en/articles/partition-planning-tips.xml">
-    "Partition planning tips"</uri>, I share several ways of effectively
-    organizing your partition layout.
+    link="/doc/en/articles/partition-planning-tips.xml">Partition planning
+    tips</uri>, I share several ways of effectively organizing your partition
+    layout.
   </li>
   <li>
-    The <uri link="http://www.redhat.com/mirrors/LDP/LDP/sag/index.html"> Linux
+    The <uri link="http://www.redhat.com/mirrors/LDP/LDP/sag/index.html">Linux
     system administrator's guide</uri> mirrored on Red Hat's home page.
   </li>
   <li>



1.2       +9 -10     xml/htdocs/doc/en/articles/partitioning-p1.xml

file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/partitioning-p1.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/partitioning-p1.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo
diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/partitioning-p1.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo

Index: partitioning-p1.xml
===================================================================
RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/partitioning-p1.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- partitioning-p1.xml	18 Aug 2005 12:59:17 -0000	1.1
+++ partitioning-p1.xml	18 Aug 2005 20:01:55 -0000	1.2
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/partitioning-p1.xml,v 1.1 2005/08/18 12:59:17 neysx Exp $ -->
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/partitioning-p1.xml,v 1.2 2005/08/18 20:01:55 neysx Exp $ -->
 
 <guide link="/doc/en/articles/partitioning-p1.xml" lang="en">
 <title>Partitioning in action, Part 1</title>
@@ -24,8 +24,8 @@
 document is an updated version of the original article, and contains
 various improvements made by the Gentoo Linux Documentation team -->
 
-<version>1.0</version>
-<date>2005-08-15</date>
+<version>1.1</version>
+<date>2005-08-18</date>
 
 <chapter>
 <title>Moving /home</title>
@@ -315,16 +315,15 @@
     <path>/tmp</path> to a new partition.
   </li>
   <li>
-    In my first tip, <uri
-    link="/doc/en/articles/maximum-swappage.xml">
-    "Maximum swappage"</uri>, I show how to dramatically increase swap
-    performance under Linux.
+    In my first tip, <uri link="/doc/en/articles/maximum-swappage.xml">Maximum
+    swappage</uri>, I show how to dramatically increase swap performance under
+    Linux.
   </li>
   <li>
     In my second tip, <uri
-    link="/doc/en/articles/partition-planning-tips.xml">
-    "Partition planning tips"</uri>, I share several ways of effectively
-    organizing your partition layout.
+    link="/doc/en/articles/partition-planning-tips.xml">Partition planning
+    tips</uri>, I share several ways of effectively organizing your partition
+    layout.
   </li>
   <li>
     I always recommend checking out the <uri



1.2       +7 -7      xml/htdocs/doc/en/articles/partitioning-p2.xml

file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/partitioning-p2.xml?rev=1.2&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/partitioning-p2.xml?rev=1.2&content-type=text/plain&cvsroot=gentoo
diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/partitioning-p2.xml.diff?r1=1.1&r2=1.2&cvsroot=gentoo

Index: partitioning-p2.xml
===================================================================
RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/partitioning-p2.xml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- partitioning-p2.xml	18 Aug 2005 12:59:17 -0000	1.1
+++ partitioning-p2.xml	18 Aug 2005 20:01:55 -0000	1.2
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/partitioning-p2.xml,v 1.1 2005/08/18 12:59:17 neysx Exp $ -->
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/partitioning-p2.xml,v 1.2 2005/08/18 20:01:55 neysx Exp $ -->
 
 <guide link="/doc/en/articles/partitioning-p2.xml" lang="en">
 <title>Partitioning in action, Part 2</title>
@@ -24,8 +24,8 @@
 document is an updated version of the original article, and contains
 various improvements made by the Gentoo Linux Documentation team -->
 
-<version>1.0</version>
-<date>2005-08-15</date>
+<version>1.1</version>
+<date>2005-08-18</date>
 
 <chapter>
 <title>Consolidating data</title>
@@ -305,13 +305,13 @@
     to a new partition.
   </li>
   <li>
-    In <uri link="/doc/en/articles/maximum-swappage.xml"> "Maximum
-    swappage"</uri>, I show how to dramatically increase swap performance under
+    In <uri link="/doc/en/articles/maximum-swappage.xml">Maximum
+    swappage</uri>, I show how to dramatically increase swap performance under
     Linux.
   </li>
   <li>
-    In <uri link="/doc/en/articles/partition-planning.xml"> "Partition planning
-    tips"</uri>, I share several ways of effectively organizing your partition
+    In <uri link="/doc/en/articles/partition-planning.xml">Partition planning
+    tips</uri>, I share several ways of effectively organizing your partition
     layout.
   </li>
   <li>



-- 
gentoo-doc-cvs@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [gentoo-doc-cvs] cvs commit: maximum-swappage.xml
@ 2005-09-25 15:14 Shyam Mani
  0 siblings, 0 replies; 3+ messages in thread
From: Shyam Mani @ 2005-09-25 15:14 UTC (permalink / raw
  To: gentoo-doc-cvs

fox2mike    05/09/25 15:14:45

  Modified:    xml/htdocs/doc/en/articles maximum-swappage.xml
  Log:
  Broken link, commented out for now. Thanks to Linuxblues on IRC for reporting.

Revision  Changes    Path
1.3       +4 -2      xml/htdocs/doc/en/articles/maximum-swappage.xml

file : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/maximum-swappage.xml?rev=1.3&content-type=text/x-cvsweb-markup&cvsroot=gentoo
plain: http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/maximum-swappage.xml?rev=1.3&content-type=text/plain&cvsroot=gentoo
diff : http://www.gentoo.org/cgi-bin/viewcvs.cgi/xml/htdocs/doc/en/articles/maximum-swappage.xml.diff?r1=1.2&r2=1.3&cvsroot=gentoo

Index: maximum-swappage.xml
===================================================================
RCS file: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/maximum-swappage.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- maximum-swappage.xml	18 Aug 2005 20:01:55 -0000	1.2
+++ maximum-swappage.xml	25 Sep 2005 15:14:45 -0000	1.3
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
-<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/maximum-swappage.xml,v 1.2 2005/08/18 20:01:55 neysx Exp $ -->
+<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/articles/maximum-swappage.xml,v 1.3 2005/09/25 15:14:45 fox2mike Exp $ -->
 
 <guide link="/doc/en/articles/maximum-swappage.xml" lang="en">
 <title>Maximum swappage</title>
@@ -23,7 +23,7 @@
 document is an updated version of the original article, and contains
 various improvements made by the Gentoo Linux Documentation team -->
 
-<version>1.1</version>
+<version>1.2</version>
 <date>2005-08-18</date>
 
 <chapter>
@@ -183,10 +183,12 @@
     The <uri link="http://www.redhat.com/mirrors/LDP/LDP/sag/index.html">Linux
     system administrator's guide</uri> mirrored on Red Hat's home page.
   </li>
+<!-- Link doesn't work anymore, commenting for the time being - fox2mike
   <li>
     A good high-level <uri link="http://www.gwdg.de/gs-2.0/chapter2_6.html">
     overview of Linux system administration</uri>.
   </li>
+-->
   <li>
     For more information on optimizing file system performance, take a look at
     Linas Vepstas' <uri link="http://www.tldp.org">Linux Software RAID



-- 
gentoo-doc-cvs@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-09-25 15:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-18 12:59 [gentoo-doc-cvs] cvs commit: maximum-swappage.xml Xavier Neys
  -- strict thread matches above, loose matches on Subject: below --
2005-08-18 20:01 Xavier Neys
2005-09-25 15:14 Shyam Mani

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox