Source string Read only

(itstool) path: sect1/para
350/3500
Context English State
Introduction
While professional servers are usually well protected from unforeseen shutdowns, the typical desktop is at the mercy of power failures, accidental resets, and other user related incidents that can lead to unclean shutdowns. Soft Updates usually protect the file system efficiently in such cases, although most of the times a lengthy background check is required. On rare occasions, file system corruption reaches a point where user intervention is required and data may be lost.
The new journaling capability provided by GEOM can greatly assist in such scenarios, by virtually eliminating the time required for file system checking, and ensuring that the file system is quickly restored to a consistent state.
This article describes a procedure for implementing UFS journaling on a typical desktop PC scenario (one hard disk used for both operating system and data). It should be followed during a fresh installation of FreeBSD. The steps are simple enough and do not require overly complex interaction with the command line.
After reading this article, you will know:
How to reserve space for journaling during a new installation of FreeBSD.
How to load and enable the <literal>geom_journal</literal> module (or build support for it in your custom kernel).
How to convert your existing file systems to utilize journaling, and what options to use in <filename>/etc/fstab</filename> to mount them.
How to implement journaling in new (empty) partitions.
How to troubleshoot common problems associated with journaling.
Before reading this article, you should be able to:
Understand basic <trademark class="registered">UNIX</trademark> and FreeBSD concepts.
Be familiar with the installation procedure of FreeBSD and the <application>sysinstall</application> utility.
The procedure described here is intended for preparing a new installation where no actual user data is stored on the disk yet. While it is possible to modify and extend this procedure for systems already in production, you should <emphasis>backup</emphasis> all important data before doing so. Messing around with disks and partitions at a low level can lead to fatal mistakes and data loss.
Understanding Journaling in FreeBSD
The journaling provided by GEOM in FreeBSD 7.<replaceable>X</replaceable> is not file system specific (unlike for example the ext3 file system in <trademark class="registered">Linux</trademark>) but is functioning at the block level. Though this means it can be applied to different file systems, for FreeBSD 7.0-RELEASE, it can only be used on UFS2.
This functionality is provided by loading the <filename>geom_journal.ko</filename> module into the kernel (or building it into a custom kernel) and using the <command>gjournal</command> command to configure the file systems. In general, you would like to journal large file systems, like <filename>/usr</filename>. You will need however (see the following section) to reserve some free disk space.
When a file system is journaled, some disk space is needed to keep the journal itself. The disk space that holds the actual data is referred to as the <emphasis>data provider</emphasis>, while the one that holds the journal is referred to as the <emphasis>journal provider</emphasis>. The data and journal providers need to be on different partitions when journaling an existing (non-empty) partition. When journaling a new partition, you have the option to use a single provider for both data and journal. In any case, the <command>gjournal</command> command combines both providers to create the final journaled file system. For example:
You wish to journal your <filename>/usr</filename> file system, stored in <filename>/dev/ad0s1f</filename> (which already contains data).
You reserved some free disk space in a partition in <filename>/dev/ad0s1g</filename>.
Using <command>gjournal</command>, a new <filename>/dev/ad0s1f.journal</filename> device is created where <filename>/dev/ad0s1f</filename> is the data provider, and <filename>/dev/ad0s1g</filename> is the journal provider. This new device is then used for all subsequent file operations.
The amount of disk space you need to reserve for the journal provider depends on the usage load of the file system and not on the size of the data provider. For example on a typical office desktop, a 1 GB journal provider for the <filename>/usr</filename> file system will suffice, while a machine that deals with heavy disk I/O (i.e. video editing) may need more. A kernel panic will occur if the journal space is exhausted before it has a chance to be committed.
The journal sizes suggested here, are highly unlikely to cause problems in typical desktop use (such as web browsing, word processing and playback of media files). If your workload includes intense disk activity, use the following rule for maximum reliability: Your RAM size should fit in 30% of the journal provider's space. For example, if your system has 1 GB RAM, create an approximately 3.3 GB journal provider. (Multiply your RAM size with 3.3 to obtain the size of the journal).
For more information about journaling, please read the manual page of <citerefentry><refentrytitle>gjournal</refentrytitle><manvolnum>8</manvolnum></citerefentry>.
Steps During the Installation of FreeBSD
Reserving Space for Journaling
A typical desktop machine usually has one hard disk that stores both the OS and user data. Arguably, the default partitioning scheme selected by <application>sysinstall</application> is more or less suitable: A desktop machine does not need a large <filename>/var</filename> partition, while <filename>/usr</filename> is allocated the bulk of the disk space, since user data and a lot of packages are installed into its subdirectories.
The default partitioning (the one obtained by pressing <keycap>A</keycap> at the FreeBSD partition editor, called <application>Disklabel</application>) does not leave any unallocated space. Each partition that will be journaled, requires another partition for the journal. Since the <filename>/usr</filename> partition is the largest, it makes sense to shrink this partition slightly, to obtain the space required for journaling.
In our example, an 80 GB disk is used. The following screenshot shows the default partitions created by <application>Disklabel</application> during installation:
_ external ref='disklabel1' md5='__failed__'
If this is more or less what you need, it is very easy to adjust for journaling. Simply use the arrow keys to move the highlight to the <filename>/usr</filename> partition and press <keycap>D</keycap> to delete it.

Loading…

User avatar None

New source string

FreeBSD Doc / articles_gjournal-desktopEnglish

New source string 6 months ago
Browse all component changes

Glossary

English English
No related strings found in the glossary.

Source information

Source string comment
(itstool) path: sect1/para
Flags
read-only
Source string location
article.translate.xml:126
String age
6 months ago
Source string age
6 months ago
Translation file
articles/gjournal-desktop.pot, string 25