aboutsummaryrefslogtreecommitdiff
path: root/en_US.ISO8859-1/articles/gjournal-desktop/article.sgml
blob: 4557dfb241b405dfd9e5920b425aff2604375ab0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
<?xml version="1.0" encoding="ISO8859-1" standalone="no"?>
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V4.2-Based Extension//EN"
	"../../../share/sgml/freebsd42.dtd" [
<!ENTITY % entities PUBLIC "-//FreeBSD//ENTITIES DocBook FreeBSD Entity Set//EN" "../../share/sgml/entities.ent">
%entities;
]>

<article lang="en">
  <articleinfo>
    <title>Implementing UFS Journaling on a Desktop PC</title>

    <author>
      <firstname>Manolis</firstname>
      <surname>Kiagias</surname>
      <affiliation>
	<address><email>manolis@FreeBSD.org</email></address>
      </affiliation>
    </author>

    <copyright>
      <year>2008</year>
      <holder role="mailto:manolis@FreeBSD.org">Manolis Kiagias</holder>
    </copyright>

    <pubdate>$FreeBSD$</pubdate>

    <releaseinfo>$FreeBSD$</releaseinfo>

    <legalnotice id="trademarks" role="trademarks">
      &tm-attrib.freebsd;
      &tm-attrib.general;
    </legalnotice>

    <abstract>
      <para>A journaling file system uses a log to record all transactions
	that take place in the file system, and preserves its integrity in the
	event of a system crash or power failure.  Although it is still
	possible to lose unsaved changes to files, journaling almost
	completely eliminates the possibility of file system corruption caused
	by an unclean shutdown.  It also shortens to a minimum the time
	required for after-failure file system checking.  Although the UFS
	file system employed by &os; does not implement journaling itself,
	the new journal class of the GEOM framework in &os;&nbsp;7.<replaceable>X</replaceable> can be
	used to provide file system independent journaling. This article
	explains how to implement UFS journaling on a typical desktop PC
	scenario.</para>
    </abstract>
  </articleinfo>

  <sect1 id="introduction">
    <title>Introduction</title>

    <para>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.</para>

    <para>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.</para>

    <para>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
      &os;.  The steps are simple enough and do not require overly complex
      interaction with the command line.</para>

    <para>After reading this article, you will know:</para>

    <itemizedlist>
      <listitem>
	<para>How to reserve space for journaling during a new installation of
	  &os;.</para>
      </listitem>

      <listitem>
	<para>How to load and enable the <literal>geom_journal</literal>
	  module (or build support for it in your custom kernel).</para>
      </listitem>

      <listitem>
	<para>How to convert your existing file systems to utilize journaling,
	  and what options to use in <filename>/etc/fstab</filename> to mount
	  them.</para>
      </listitem>

      <listitem>
	<para>How to implement journaling in new (empty) partitions.</para>
      </listitem>

      <listitem>
	<para>How to troubleshoot common problems associated with
	  journaling.</para>
      </listitem>
    </itemizedlist>

    <para>Before reading this article, you should be able to:</para>

    <itemizedlist>
      <listitem>
	<para>Understand basic &unix; and &os; concepts.</para>
      </listitem>

      <listitem>
	<para>Be familiar with the installation procedure of &os; and the
	<application>sysinstall</application> utility.</para>
      </listitem>
    </itemizedlist>

    <warning>
      <para>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.</para>
    </warning>
  </sect1>

  <sect1 id="understanding-journaling">
    <title>Understanding Journaling in &os;</title>

    <para>The journaling provided by GEOM in &os;&nbsp;7.<replaceable>X</replaceable> is not file system
      specific (unlike for example the ext3 file system in &linux;) but is
      functioning at the block level.  Though this means it can be applied
      to different file systems, for &os;&nbsp;7.0-RELEASE, it can only be used
      on UFS2.</para>

    <para>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.</para>

    <para>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:</para>

    <itemizedlist>
      <listitem>
	<para>You wish to journal your <filename>/usr</filename> file system,
	  stored in <filename class="devicefile">/dev/ad0s1f</filename> (which
	  already contains data).</para>
      </listitem>

      <listitem>
	<para>You reserved some free disk space in a partition in
	  <filename class="devicefile">/dev/ad0s1g</filename>.</para>
      </listitem>

      <listitem>
	<para>Using <command>gjournal</command>, a new <filename
	    class="devicefile">/dev/ad0s1f.journal</filename> device is created
	  where <filename class="devicefile">/dev/ad0s1f</filename> is the data
	  provider, and <filename class="devicefile">/dev/ad0s1g</filename> is
	  the journal provider.  This new device is then used for all
	  subsequent file operations.</para>
      </listitem>
    </itemizedlist>

    <para>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&nbsp;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.</para>

    <note>
      <para>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&nbsp;GB RAM, create an
	approximately 3.3&nbsp;GB journal provider. (Multiply your
	RAM size with 3.3 to obtain the size of the journal).</para>
    </note>

    <para>For more information about journaling, please read the manual
      page of &man.gjournal.8;.</para>
  </sect1>

  <sect1 id="reserve-space">
    <title>Steps During the Installation of &os;</title>

    <sect2>
      <title>Reserving Space for Journaling</title>

      <para>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.</para>

      <para>The default partitioning (the one obtained by pressing
	<keycap>A</keycap> at the &os; 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.</para>

      <para>In our example, an 80&nbsp;GB disk is used.  The following screenshot
	shows the default partitions created by <application>Disklabel</application> during
	installation:</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="disklabel1.png"/>
	</imageobject>
      </mediaobject>

      <para>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.</para>

      <para>Now, move the highlight to the disk name at the top of the screen
	and press <keycap>C</keycap> to create a new partition for
	<filename>/usr</filename>.  This new partition should be smaller by
	1&nbsp;GB (if you intend to journal <filename>/usr</filename> only), or
	2&nbsp;GB (if you intend to journal both <filename>/usr</filename> and
	<filename>/var</filename>).  From the pop-up that appears, opt to
	create a file system, and type <filename>/usr</filename> as the mount
	point.</para>

      <note>
	<para>Should you journal the <filename>/var</filename> partition?
	  Normally, journaling makes sense on quite large partitions.  You may
	  decide not to journal <filename>/var</filename>, although doing so
	  on a typical desktop will cause no harm.  If the file system is
	  lightly used (quite probable for a desktop) you may wish to
	  allocate less disk space for its journal.</para>

	<para>In our example, we journal both <filename>/usr</filename> and
	  <filename>/var</filename>.  You may of course adjust the procedure
	  to your own needs.</para>
      </note>

      <para>To keep things as easy going as possible, we are going to use
	<application>sysinstall</application> to create the partitions
	required for journaling.  However, during installation,
	<application>sysinstall</application> insists on asking a mount point
	for each partition you create.  At this point, you do not have any
	mount points for the partitions that will hold the journals, and in
	reality you <emphasis>do not even need them</emphasis>.  These are
	not partitions that we are ever going to mount somewhere.</para>

      <para>To avoid these problems with
	<application>sysinstall</application>, we are going to create the
	journal partitions as swap space.  Swap is never mounted, and
	<application>sysinstall</application> has no problem creating as many
	swap partitions as needed.  After the first reboot,
	<filename>/etc/fstab</filename> will have to be edited, and the extra
	swap space entries removed.</para>

      <para>To create the swap, again use the
	arrow keys to move the highlight to the top of
	<application>Disklabel</application> screen, so that the disk name itself is
	highlighted.  Then press <keycap>N</keycap>, enter the desired size
	(<replaceable>1024M</replaceable>), and select
	<quote>swap space</quote> from the pop-up menu that appears.  Repeat
	for every journal you wish to create.  In our example, we create two
	partitions to provide for the journals of <filename>/usr</filename> and
	<filename>/var</filename>.  The final result is shown in the following
	screenshot:</para>

      <mediaobject>
	<imageobject>
	  <imagedata fileref="disklabel2.png"/>
	</imageobject>
      </mediaobject>

      <para>When you have completed creating the partitions, we suggest you
	write down the partition names, and mount points, so you can easily
	refer to this information during the configuration phase.  This will
	help alleviate mistakes that may damage your installation.  The
	following table shows our notes for the sample configuration:</para>

      <table pgwide="1">
	<title>Partitions and Journals</title>
	<tgroup cols="3">
	<thead>
	  <row>
	    <entry>Partition</entry>
	    <entry>Mount Point</entry>
	    <entry>Journal</entry>
	  </row>
	</thead>

	  <tbody>
	    <row>
	      <entry>ad0s1d</entry>
	      <entry>/var</entry>
	      <entry>ad0s1h</entry>
	    </row>

	    <row>
	      <entry>ad0s1f</entry>
	      <entry>/usr</entry>
	      <entry>ad0s1g</entry>
	    </row>
	  </tbody>
	</tgroup>
      </table>

      <para>Continue the installation as you would normally do.  We would
	however suggest you postpone installation of third party software
	(packages) until you have completely setup journaling.</para>
    </sect2>

    <sect2 id="first-boot">
      <title>Booting for the first time</title>

      <para>Your system will come up normally, but you will need to edit
	<filename>/etc/fstab</filename> and remove the extra swap partitions
	you created for the journals.  Normally, the swap partition you will
	actually use is the one with the <quote>b</quote> suffix (i.e.
	ad0s1b in our example).  Remove all other swap space entries and
	reboot so that &os; will stop using them.</para>

      <para>When the system comes up again, we will be ready to configure
	journaling.</para>
    </sect2>
  </sect1>

  <sect1 id="configure-journal">
    <title>Setting Up Journaling</title>

    <sect2 id="running-gjournal">
      <title>Executing <command>gjournal</command></title>

      <para>Having prepared all the required partitions, it is quite easy
	to configure journaling.  We will need to switch to single user
	mode, so login as <username>root</username> and type:</para>

      <screen>&prompt.root; <userinput>shutdown now</userinput></screen>

      <para>Press <keycap>Enter</keycap> to get the default shell.  We will need to unmount
	the partitions that will be journaled, in our example
	<filename>/usr</filename> and <filename>/var</filename>:</para>

      <screen>&prompt.root; <userinput>umount /usr /var</userinput></screen>

      <para>Load the module required for journaling:</para>

      <screen>&prompt.root; <userinput>gjournal load</userinput></screen>

      <para>Now, use your notes to determine which partition will be used
	for each journal.  In our example,  <filename>/usr</filename> is
	<filename class="devicefile">ad0s1f</filename> and its journal will be
	<filename class="devicefile">ad0s1g</filename>, while
	<filename>/var</filename> is <filename
	  class="devicefile">ad0s1d</filename> and will
	be journaled to <filename class="devicefile">ad0s1h</filename>.
	The following commands are required:</para>

      <screen>&prompt.root; <userinput>gjournal label ad0s1f ad0s1g</userinput>

GEOM_JOURNAL: Journal 2948326772: ad0s1f contains data.
GEOM_JOURNAL: Journal 2948326772: ad0s1g contains journal.

&prompt.root; <userinput>gjournal label ad0s1d ad0s1h</userinput>

GEOM_JOURNAL: Journal 3193218002: ad0s1d contains data.
GEOM_JOURNAL: Journal 3193218002: ad0s1h contains journal.</screen>

      <note>
	<para>If the last sector of either partition is used,
	  <command>gjournal</command> will return an error.  You will have
	  to run the command using the <option>-f</option> flag to force an
	  overwrite, i.e.:</para>

	<screen>&prompt.root; <userinput>gjournal label -f ad0s1d ad0s1h</userinput></screen>

	<para>Since this is a new installation, it is highly unlikely that
	  anything will be actually overwritten.</para></note>

      <para>At this point, two new devices are created, namely
	<filename class="devicefile">ad0s1d.journal</filename> and
	<filename class="devicefile">ad0s1f.journal</filename>.  These represent
	the <filename>/var</filename> and <filename>/usr</filename>
	partitions we have to mount.  Before mounting, we must however set
	the journal flag on them and clear the Soft Updates flag:</para>

      <screen>&prompt.root; <userinput>tunefs -J enable -n disable ad0s1d.journal</userinput>

tunefs: gjournal set
tunefs: soft updates cleared

&prompt.root; <userinput>tunefs -J enable -n disable ad0s1f.journal</userinput>

tunefs: gjournal set
tunefs: soft updates cleared</screen>

      <para>Now, mount the new devices manually at their respective places
	(note that we can now use the <option>async</option> mount
	option):</para>

      <screen>&prompt.root; <userinput>mount -o async /dev/ad0s1d.journal /var</userinput>
&prompt.root; <userinput>mount -o async /dev/ad0s1f.journal /usr</userinput></screen>

      <para>Edit <filename>/etc/fstab</filename> and update the entries for
	<filename>/usr</filename> and <filename>/var</filename>:</para>

      <programlisting>/dev/ad0s1f.journal     /usr            ufs     rw,async      2       2
/dev/ad0s1d.journal     /var            ufs     rw,async      2       2</programlisting>

      <warning>
	<para>Make sure the above entries are correct, or you will have
	  trouble starting up normally after you reboot!</para>
      </warning>

      <para>Finally, edit <filename>/boot/loader.conf</filename> and add the
	following line so the &man.gjournal.8; module is loaded at every
	boot:</para>

      <programlisting>geom_journal_load="YES"</programlisting>

      <para>Congratulations! Your system is now set for journaling.  You can
	either type <userinput>exit</userinput> to return to multi-user mode, or
	reboot to test your configuration (recommended).  During the boot you
	will see messages like the following:</para>

      <screen>ad0: 76293MB XEC XE800JD-00HBC0 08.02D08 at ata0-master SATA150
GEOM_JOURNAL: Journal 2948326772: ad0s1g contains journal.
GEOM_JOURNAL: Journal 3193218002: ad0s1h contains journal.
GEOM_JOURNAL: Journal 3193218002: ad0s1d contains data.
GEOM_JOURNAL: Journal ad0s1d clean.
GEOM_JOURNAL: Journal 2948326772: ad0s1f contains data.
GEOM_JOURNAL: Journal ad0s1f clean.</screen>

      <para>After an unclean shutdown, the messages will vary slightly,
	i.e.:</para>

      <screen>GEOM_JOURNAL: Journal ad0s1d consistent.</screen>

      <para>This usually means that &man.gjournal.8; used the information in
	the journal provider to return the file system to a consistent
	state.</para>
    </sect2>

    <sect2 id="gjournal-new">
      <title>Journaling Newly Created Partitions</title>

      <para>While the above procedure is necessary for journaling partitions
	that already contain data, journaling an empty partition is somewhat
	easier, since both the data and the journal provider can be stored
	in the same partition.  For example, assume a new disk was installed,
	and a new partition <filename class="devicefile">/dev/ad1s1d</filename>
	was created.  Creating the journal would be as simple as:</para>

      <screen>&prompt.root; <userinput>gjournal label ad1s1d</userinput></screen>

      <para>The journal size will be 1&nbsp;GB by default. You may adjust it by
	using the <option>-s</option> option.  The value can be given in
	bytes, or appended by <literal>K</literal>, <literal>M</literal> or
	<literal>G</literal> to denote Kilobytes, Megabytes or Gigabytes
	respectively.  Note that <command>gjournal</command> will not allow
	you to create unsuitably small journal sizes.</para>

      <para>For example, to create a 2&nbsp;GB journal, you could use the following
	command:</para>

      <screen>&prompt.root; <userinput>gjournal label -s 2G ad1s1d</userinput></screen>

      <para>You can then create a file system on your new partition, and
	enable journaling using the <option>-J</option> option:</para>

      <screen>&prompt.root; <userinput>newfs -J /dev/ad1s1d.journal</userinput></screen>
    </sect2>

    <sect2 id="configure-kernel">
      <title>Building Journaling into Your Custom Kernel</title>

      <para>If you do not wish to load <literal>geom_journal</literal> as a
	module, you can build its functions right into your kernel.  Edit your
	custom kernel configuration file, and make sure it includes these two
	lines:</para>

      <programlisting>options UFS_GJOURNAL # Note: This is already in GENERIC

options GEOM_JOURNAL # You will have to add this one</programlisting>

      <para>Rebuild and reinstall your kernel following the relevant
	<ulink url="&url.books.handbook;/kernelconfig.html">instructions in
	the &os;&nbsp;Handbook.</ulink></para>

      <para>Do not forget to remove the relevant <quote>load</quote> entry
	from <filename>/boot/loader.conf</filename> if you have previously
	used it.</para>
    </sect2>
  </sect1>

  <sect1 id="troubleshooting-gjournal">
    <title>Troubleshooting Journaling</title>

    <para>The following section covers frequently asked questions regarding
      problems related to journaling.</para>

    <qandaset>
      <qandaentry>
	<question id="kernel-panic">
	  <para>I am getting kernel panics during periods of high disk
	    activity.  How is this related to journaling?</para>
	</question>

	<answer>
	  <para>The journal probably fills up before it has a chance to get
	    committed (flushed) to disk.  Keep in mind the size of the
	    journal depends on the usage load, and not the size of the data
	    provider.  If your disk activity is high, you need a larger
	    partition for the journal.  See the note in the <link
	      linkend="understanding-journaling">Understanding Journaling</link> section.</para>
	</answer>
      </qandaentry>

      <qandaentry>
	<question id="unable-boot">
	  <para>I made some mistake during configuration, and I cannot boot
	    normally now.  Can this be fixed some way?</para>
	</question>

	<answer>
	  <para>You either forgot (or misspelled) the entry in
	    <filename>/boot/loader.conf</filename>, or there are errors in
	    your <filename>/etc/fstab</filename> file.  These are usually easy
	    to fix.  Press <keycap>Enter</keycap> to get to the default single user shell.  Then
	    locate the root of the problem:</para>

	  <screen>&prompt.root; <userinput>cat /boot/loader.conf</userinput></screen>

	  <para>If the <literal>geom_journal_load</literal> entry is missing
	    or misspelled, the journaled devices are never created. Load the
	    module manually,  mount all partitions, and continue with
	    multi-user boot:</para>

	  <screen>&prompt.root; <userinput>gjournal load</userinput>

GEOM_JOURNAL: Journal 2948326772: ad0s1g contains journal.
GEOM_JOURNAL: Journal 3193218002: ad0s1h contains journal.
GEOM_JOURNAL: Journal 3193218002: ad0s1d contains data.
GEOM_JOURNAL: Journal ad0s1d clean.
GEOM_JOURNAL: Journal 2948326772: ad0s1f contains data.
GEOM_JOURNAL: Journal ad0s1f clean.

&prompt.root; <userinput>mount -a</userinput>
&prompt.root; <userinput>exit</userinput>
<emphasis>(boot continues)</emphasis></screen>

	  <para>If, on the other hand, this entry is correct, have a look at
	    <filename>/etc/fstab</filename>.  You will probably find a
	    misspelled or missing entry.  In this case, mount all remaining
	    partitions by hand and continue with the multi-user boot.</para>
	</answer>
      </qandaentry>

      <qandaentry>
	<question id="remove-journaling">
	  <para>Can I remove journaling and return to my standard file system
	      with Soft Updates?</para>
	</question>

	<answer>
	  <para>Sure. Use the following procedure, which reverses the
	    changes.  The partitions you created for the journal providers
	    can then be used for other purposes, if you so wish.</para>

	  <para>Login as <username>root</username> and switch to single user mode:</para>

	  <screen>&prompt.root; <userinput>shutdown now</userinput></screen>

	  <para>Unmount the journaled partitions:</para>

	  <screen>&prompt.root; <userinput>umount /usr /var</userinput></screen>

	  <para>Synchronize the journals:</para>

	  <screen>&prompt.root; <userinput>gjournal sync</userinput></screen>

	  <para>Stop the journaling providers:</para>

	  <screen>&prompt.root; <userinput>gjournal stop ad0s1d.journal</userinput>
&prompt.root; <userinput>gjournal stop ad0s1f.journal</userinput></screen>

	  <para>Clear journaling metadata from all the devices used:</para>

	  <screen>&prompt.root; <userinput>gjournal clear ad0s1d</userinput>
&prompt.root; <userinput>gjournal clear ad0s1f</userinput>
&prompt.root; <userinput>gjournal clear ad0s1g</userinput>
&prompt.root; <userinput>gjournal clear ad0s1h</userinput></screen>

	  <para>Clear the file system journaling flag, and restore the Soft
	    Updates flag:</para>

	  <screen>&prompt.root; <userinput>tunefs -J disable -n enable ad0s1d</userinput>

tunefs: gjournal cleared
tunefs: soft updates set

&prompt.root; <userinput>tunefs -J disable -n enable ad0s1f</userinput>

tunefs: gjournal cleared
tunefs: soft updates set</screen>

	  <para>Remount the old devices by hand:</para>

	  <screen>&prompt.root; <userinput>mount -o rw /dev/ad0s1d /var</userinput>
&prompt.root; <userinput>mount -o rw /dev/ad0s1f /usr</userinput></screen>

	  <para>Edit <filename>/etc/fstab</filename> and restore it to its
	    original state:</para>

	  <programlisting>/dev/ad0s1f     /usr            ufs     rw      2       2
/dev/ad0s1d     /var            ufs     rw      2       2</programlisting>

	  <para>Finally, edit <filename>/boot/loader.conf</filename>, remove
	    the entry that loads the <literal>geom_journal</literal> module
	    and reboot.</para>

	</answer>
      </qandaentry>
    </qandaset>
  </sect1>

  <sect1 id="further-reading">
    <title>Further Reading</title>

    <para>Journaling is a fairly new feature of &os;, and as such, it is
      not very well documented yet.  You may however find the following
      additional references useful:</para>

    <itemizedlist>
      <listitem>
	<para>A <ulink url="&url.books.handbook;/geom-gjournal.html">new section on journaling</ulink>
	  is now part of the &os;&nbsp;Handbook.</para>
      </listitem>

      <listitem>
	<para><ulink url="http://lists.freebsd.org/pipermail/freebsd-current/2006-June/064043.html">This post</ulink>
	  in &a.current.name; by &man.gjournal.8;'s developer, &a.pjd;.</para>
      </listitem>

      <listitem>
	<para><ulink url="http://lists.freebsd.org/pipermail/freebsd-questions/2008-April/173501.html">This post</ulink>
	  in &a.questions.name; by &a.ivoras;.</para>
      </listitem>

      <listitem>
	<para>The manual pages of &man.gjournal.8; and &man.geom.8;.</para>
      </listitem>
    </itemizedlist>
  </sect1>
</article>