git: b703716729 - main - Handbook/Storage: Various improvements

From: Joseph Mingrone <jrm_at_FreeBSD.org>
Date: Fri, 15 Mar 2024 19:54:07 UTC
The branch main has been updated by jrm:

URL: https://cgit.FreeBSD.org/doc/commit/?id=b70371672911f868db03219b549ec70ad0b65099

commit b70371672911f868db03219b549ec70ad0b65099
Author:     Chris Moerz <freebsd@ny-central.org>
AuthorDate: 2024-03-15 19:28:25 +0000
Commit:     Joseph Mingrone <jrm@FreeBSD.org>
CommitDate: 2024-03-15 19:53:00 +0000

    Handbook/Storage: Various improvements
    
    - Minor grammar updates
    - Add tip about replicating using ZFS snapshots
    - List popular backup utilities
    - When backing up, keep a list prime packages
    - Update sample CARP configuration
    - Add tip about sharing highly available storage across the network
    
    Reviewed by:    emaste, jrm, Pau Amma <pauamma@gundo.com>
    Differential Revision:  https://reviews.freebsd.org/D43948
---
 .../content/en/books/handbook/disks/_index.adoc    | 51 +++++++++++++---------
 1 file changed, 31 insertions(+), 20 deletions(-)

diff --git a/documentation/content/en/books/handbook/disks/_index.adoc b/documentation/content/en/books/handbook/disks/_index.adoc
index 862d5c5f46..11567f7ffb 100644
--- a/documentation/content/en/books/handbook/disks/_index.adoc
+++ b/documentation/content/en/books/handbook/disks/_index.adoc
@@ -1245,21 +1245,21 @@ Instead of writing files and directories, `dump` writes the raw data blocks that
 
 [NOTE]
 ====
-If `dump` is used on the root directory, it will not back up [.filename]#/home#, [.filename]#/usr# or many other directories since these are typically mount points for other file systems or symbolic links into those file systems.
+If `dump` is used on the root directory, it will not back up [.filename]#/home#, [.filename]#/usr#, or many other directories since these are typically mount points for other file systems or symbolic links into those file systems.
 ====
 
 When used to restore data, `restore` stores temporary files in [.filename]#/tmp/# by default.
-When using a recovery disk with a small [.filename]#/tmp#, set `TMPDIR` to a directory with more free space in order for the restore to succeed.
+When using a recovery disk with a small [.filename]#/tmp#, set `TMPDIR` to a directory with more free space for the restore to succeed.
 
 When using `dump`, be aware that some quirks remain from its early days in Version 6 of AT&T UNIX(R),circa 1975.
 The default parameters assume a backup to a 9-track tape, rather than to another type of media or to the high-density tapes available today.
 These defaults must be overridden on the command line.
 
-It is possible to backup a file system across the network to a another system or to a tape drive attached to another computer.
+It is possible to backup a file system across the network to another system or a tape drive attached to another computer.
 While the man:rdump[8] and man:rrestore[8] utilities can be used for this purpose, they are not considered to be secure.
 
-Instead, one can use `dump` and `restore` in a more secure fashion over an SSH connection.
-This example creates a full, compressed backup of [.filename]#/usr# and sends the backup file to the specified host over a SSH connection.
+Instead, one can use `dump` and `restore` more securely over an SSH connection.
+This example creates a full, compressed backup of [.filename]#/usr# and sends the backup file to the specified host over an SSH connection.
 
 .Using `dump` over ssh
 [example]
@@ -1271,7 +1271,7 @@ This example creates a full, compressed backup of [.filename]#/usr# and sends th
 ....
 ====
 
-This example sets `RSH` in order to write the backup to a tape drive on a remote system over a SSH connection:
+This example sets `RSH` in order to write the backup to a tape drive on a remote system over an SSH connection:
 
 .Using `dump` over ssh with `RSH` Set
 [example]
@@ -1282,6 +1282,11 @@ This example sets `RSH` in order to write the backup to a tape drive on a remote
 ....
 ====
 
+[TIP]
+====
+Systems using the crossref:zfs[,Z file system (ZFS)] can make use of man:zfs[8] for creating snapshots, as well as crossref:zfs[zfs-zfs-send,sending and receiving] them to/from remote systems.
+====
+
 === Directory Backups
 
 Several built-in utilities are available for backing up and restoring specified files and directories as needed.
@@ -1404,7 +1409,14 @@ To interactively restore files from a `dump` file on tape into the current direc
 The FreeBSD Ports Collection provides many third-party utilities which can be used to schedule the creation of backups, simplify tape backup, and make backups easier and more convenient.
 Many of these applications are client/server based and can be used to automate the backups of a single system or all of the computers in a network.
 
-Popular utilities include Amanda, Bacula, rsync, and duplicity.
+Popular utilities include:
+
+ * Amanda (package:misc/amanda-server[] and package:misc/amanda-client[]),
+ * Bacula (package:sysutils/bacula13-server[] and package:sysutils/bacula13-client[]),
+ * Bareos (package:sysutils/bareos-server[] and package:sysutils/bareos-client[]),
+ * package:net/rsync[],
+ * package:sysutils/duply[], and
+ * package:sysutils/duplicity[].
 
 === Emergency Recovery
 
@@ -1414,6 +1426,7 @@ Create a print copy of the output of the following commands:
 
 * `gpart show`
 * `more /etc/fstab`
+* `pkg prime-list`
 * `dmesg`
 
 Store this printout and a copy of the installation media in a secure location.
@@ -1550,7 +1563,8 @@ For more details about `mdmfs`, refer to man:mdmfs[8].
 
 FreeBSD offers a feature in conjunction with crossref:config[soft-updates,Soft Updates]: file system snapshots.
 
-UFS snapshots allow a user to create images of specified file systems, and treat them as a file.
+UFS snapshots allow a user to create images of specified file systems, and treat them as a file. If you are using the crossref:zfs[,Z file system (ZFS)], refer to crossref:zfs[zfs-zfs-snapshot,"Managing Snapshots"] on how to use snapshots.
+
 Snapshot files must be created in the file system that the action is performed on, and a user may create no more than 20 snapshots per file system.
 Active snapshots are recorded in the superblock so they are persistent across unmount and remount operations along with system reboots.
 When a snapshot is no longer required, it can be removed using man:rm[1].
@@ -2380,30 +2394,25 @@ In the event of CARP interfaces going up or down, the FreeBSD operating system g
 A state change on the CARP interface is an indication that one of the nodes failed or came back online.
 These state change events make it possible to run a script which will automatically handle the HAST failover.
 
-To catch state changes on the CARP interfaces, add this configuration to [.filename]#/etc/devd.conf# on each node:
+To catch state changes on the CARP interfaces, add this configuration to [.filename]#/etc/devd.conf# on each node, while replacing `<vhid>` with the virtual host id and `<ifname>` with the associated interface name:
 
 [.programlisting]
 ....
 notify 30 {
-	match "system" "IFNET";
-	match "subsystem" "carp0";
-	match "type" "LINK_UP";
+	match "system" "CARP";
+	match "subsystem" "<vhid>@<ifname>";
+	match "type" "MASTER";
 	action "/usr/local/sbin/carp-hast-switch primary";
 };
 
 notify 30 {
-	match "system" "IFNET";
-	match "subsystem" "carp0";
-	match "type" "LINK_DOWN";
+	match "system" "CARP";
+	match "subsystem" "<vhid>@<ifname>";
+	match "type" "BACKUP";
 	action "/usr/local/sbin/carp-hast-switch secondary";
 };
 ....
 
-[NOTE]
-====
-If the systems are running FreeBSD 10 or higher, replace [.filename]#carp0# with the name of the CARP-configured interface.
-====
-
 Restart man:devd[8] on both nodes to put the new configuration into effect:
 
 [source,shell]
@@ -2525,6 +2534,8 @@ For this example, a standard UFS file system was used.
 To reduce the time needed for recovery, a journal-enabled UFS or ZFS file system can be used instead.
 ====
 
+Instead of using the highly available storage locally, it can also be shared to other computers on a network via crossref:network-servers[network-nfs,NFS], crossref:network-servers[network-iscsi,iSCSI], man:sshfs[1], or programs in ports (i.e. package:net/samba419[]).
+
 More detailed information with additional examples can be found at http://wiki.FreeBSD.org/HAST[http://wiki.FreeBSD.org/HAST].
 
 === Troubleshooting