Add an entry that describes why softupdates is dangerous to use on the

root filesystem.

PR:		docs/32319
Submitted by:	Michael Lucas <mwlucas@blackhelicopters.org>
This commit is contained in:
Giorgos Keramidas 2001-11-27 02:21:16 +00:00
parent 38193a56ec
commit ab52f82026
Notes: svn2git 2020-12-08 03:00:23 +00:00
svn path=/head/; revision=11301

View file

@ -6118,6 +6118,74 @@ C:\="DOS"</programlisting>
</answer>
</qandaentry>
<qandaentry>
<question id="safe-softupdates">
<para>Which partitions can safely use softupdates? I've
heard that softupdates on <filename>/</filename> can cause
problems.</para>
</question>
<answer>
<para>Short answer: you can usually use softupdates safely
on all partitions.</para>
<para>Long answer: There used to be some concern over using
softupdates on the root partition. Softupdates has two
characteristics that caused this. First, a softupdates
partition has a small chance of losing data during a
system crash. (The partition will not be corrupted; the
data will simply be lost.) Also, softupdates can cause
temporary space shortages.</para>
<para>When using softupdates, the kernel can take up to
thirty seconds to actually write changes to the physical
disk. If you delete a large file, the file still resides
on disk until the kernel actually performs the deletion.
This can cause a very simple race condition. Suppose you
delete one large file and immediately create another large
file. The first large file is not yet actually removed
from the physical disk, so the disk might not have enough
room for the second large file. You get an error that the
partition don't have enough space, although you know
perfectly well that you just released a large chunk of
space! When you try again mere seconds later, the file
creation works as you expect. This has left more than one
user scratching his head and doubting his sanity, the
FreeBSD filesystem, or both.</para>
<para>If a system should crash after the kernel accepts a
chunk of data for writing to disk, but before that data is
actually written out, data could be lost or corrupted.
This risk is extremely small, but generally manageable.
Use of IDE write caching greatly increases this risk; it
is strongly recommended that you disable IDE write caching
when using softupdates.</para>
<para>These issues affect all partitions using softupdates.
So, what does this mean for the root partition?</para>
<para>Vital information on the root partition changes very
rarely. Files such as <filename>/kernel</filename> and
the contents of <filename>/etc</filename> only change
during system maintenance, or when users change their
passwords. If the system crashed during the the
thirty-second window after such a change is made, it is
possible that data could be lost. This risk is negligible
for most applications, but you should be aware that it
exists. If your system cannot tolerate this much risk,
don't use softupdates on the root filesystem!</para>
<para><filename>/</filename> is traditionally one of the
smallest partitions. By default, FreeBSD puts the
<filename>/tmp</filename> directory on
<filename>/</filename>. If you have a busy
<filename>/tmp</filename>, you might see intermittent
space problems. Symlinking <filename>/tmp</filename> to
<filename>/var/tmp</filename> will solve this
problem.</para>
</answer>
</qandaentry>
<qandaentry>
<question id="add-swap-space">
<para>How can I add more swap space?</para>