Sun Microsystems, Inc.
spacerspacer
spacer www.sun.com docs.sun.com |
spacer
black dot
 
 
45.  Backing Up and Restoring File Systems (Overview) Choosing the Type of Backup  Previous   Contents   Next 
   
 

Choosing a Tape Device

The following table shows typical tape devices that are used for storing file systems during the backup process. The capacity depends on the type of drive and the data being written to the tape. For more detailed information on tape devices, see Chapter 51, Managing Tape Drives (Tasks).

Table 45-5 Typical Media for Backing Up File Systems

Media

Capacity

1/2-inch reel tape

140 Mbytes (6250 bpi)

2.5-Gbyte 1/4 inch cartridge (QIC) tape

2.5 Gbytes

DDS3 4-mm cartridge tape (DAT)

12-24 Gbytes

14-Gbyte 8-mm cartridge tape

14 Gbytes

DLT 7000 1/2-inch cartridge tape

35-70 Gbytes

High-Level View of Backing Up and Restoring File Systems (Task Map)

Use this task map to identify all the tasks for the backing up and restoring of file systems. Each task points to a series of additional tasks such as determining the type of backup to perform.

Task

Description

For Instructions

1. Identify the file systems to back up

Identify which file systems need to be backed up on a daily, weekly, or monthly basis.

"Planning Which File Systems to Back Up"

2. Determine the type of backup

Determine the type of backup you need for the file systems at your site.

"Choosing the Type of Backup"

3. Create the backup

Use one of the following methods:

 

 

If you want to have full and incremental backups of your file systems, use the ufsdump command.

Chapter 46, Backing Up Files and File Systems (Tasks)

 

If you would like to create a snapshot of file system while it is active and mounted, consider using the fssnap command.

Chapter 47, Using UFS Snapshots (Tasks)

 

If you just want to have full backups of your personal home directory or smaller, less-important file systems, use the tar, cpio, or pax commands.

Chapter 50, Copying UFS Files and File Systems (Tasks)

3. Restore a file system

(Optional)

Select the restoration method based on the command used to back up the files or file system.

 

 

Restore a file system backup created with the ufsdump command.

Chapter 48, Restoring Files and File Systems (Tasks)

 

Restore a file system created with the tar, cpio, or pax command.

Chapter 50, Copying UFS Files and File Systems (Tasks)

4. Restore the root (/) or /usr file system

Optional

Restoring the root (/) or /usr file system is more complicated than restoring a non-critical file system because you need to boot from a local CD or from the network while these file systems are being restored.

"How to Restore the root (/) and /usr File Systems"

Guidelines for Scheduling Backups

A backup schedule is the schedule you establish to run the ufsdump command. This section discusses guidelines on the factors to weigh when you create a backup schedule, guidelines on how often to back up file systems, and sample backup schedules.

The backup schedule you create depends on the following:

  • Your need to minimize the number of tapes used for backups

  • Time available for doing backups

  • Time available for doing a full restore of a damaged file system

  • Time available for retrieving individual files that are accidentally deleted

How Often Should You Do Backups?

If you do not need to minimize time and the amount of media used for backups, you can do full backups every day. However, this is not realistic for most sites, so incremental backups are used most often. In this case, you should back up your site enough to restore files from the last four weeks. This schedule requires at least four sets of tapes--one for each week, which you would reuse each month. In addition, you should archive the monthly backups for at least a year, and then keep yearly backups for a number of years.

Using Dump Levels to Create Incremental Backups

The dump level you specify in the ufsdump command (0-9) determines which files are backed up. Dump level 0 creates a full backup. Levels 1-9 are used to schedule incremental backups, but have no defined meanings. Levels 1-9 are just a range of numbers that are used to schedule cumulative or discrete backups. The only meaning levels 1-9 have is in relationship to each other, as a higher or lower number.

The following examples show the flexibility of the incremental dump procedure using levels 1-9.

Dump Levels for Daily, Cumulative Backups

Doing daily, cumulative incremental backups is the most commonly used backup scheme and is recommended for most situations. The following example shows a schedule that uses a level 9 dump each day, and a level 5 dump on Friday to restart the process.

Figure 45-1 Incremental Backup: Daily Cumulative

In the preceding example, you could have used other numbers in the 1-9 range to produce the same results. The key is having the same number each day, with any lower number on Friday. For example, you could have specified levels 4, 4, 4, 4, 2 or 7, 7, 7, 7, 5.

Dump Levels for Daily, Discrete Backups

The following example shows a schedule where you capture only a day's work on different tapes. In this case, sequential dump level numbers are used during the week (3,4,5,6) with a lower number (2) on Friday.

Figure 45-2 Incremental Backup: Daily Discrete

In the preceding example, you could have used the sequence 6, 7, 8, 9 followed by 2, or 5, 6, 7, 8 followed by 3. Remember, the numbers themselves have no defined meaning. You attribute meaning by ordering them in a high/low sequence.

Sample Backup Schedules

This section provides sample backup schedules. All schedules assume that you begin with a full backup (dump level 0), and that you use the -u option to record each backup.

Example--Daily Cumulative, Weekly Cumulative Backups

The following table shows the most commonly used incremental backup schedule. This schedule is recommended for most situations. With this schedule:

  • All files that have changed since the lower-level backup at the end of the previous week are saved each day.

  • For each weekday level 9 backup, the previous level 0 or level 5 is the closest backup at a lower level. Therefore, each weekday tape contains all the files that changed since the end of the previous week (or the initial level 0 for the first week).

  • For each Friday level 5 backup, the nearest lower-level backup is the level 0 done at the beginning of the month. Therefore, each Friday's tape contains all the files changed during the month to that point.

Table 45-6 Daily Cumulative/Weekly Cumulative Backup Schedule

 

Floating

Mon

Tues

Wed

Thurs

Fri

1st of Month

0

 

Week 1

 

9

9

9

9

5

Week 2

 

9

9

9

9

5

Week 3

 

9

9

9

9

5

Week 4

 

9

9

9

9

5

The following table shows how the contents of the tapes can change across two weeks with the daily cumulative, weekly cumulative schedule. Each letter represents a different file.

Table 45-7 Contents of Tapes for Daily Cumulative/Weekly Cumulative Schedule

 

Mon

Tues

Wed

Thurs

Fri

Week 1

a b

a b c

a b c d

a b c d e

a b c d e f

Week 2

g

g h

g h i

g h i j

a b c d e f g h i j k

Tape Requirements for the Daily Cumulative, Weekly Cumulative Schedule

With this schedule, you need six tapes (if you want to reuse daily tapes), or nine tapes (if you want to use four different daily tapes): one tape for the level 0, four tapes for Fridays, and one or four daily tapes.

If you need to restore a complete file system, you need the following tapes: the level 0, the most recent Friday tape, and the most recent daily tape since the last Friday tape (if any).

Example--Daily Cumulative, Weekly Incremental Backups

The following table shows a schedule where each weekday tape accumulates all files that changed since the beginning of the week (or the initial level 0 for the first week), and each Friday's tape contains all the files that changed that week.

Table 45-8 Daily Cumulative/Weekly Incremental Backup Schedule

 

Floating

Mon

Tues

Wed

Thurs

Fri

1st of Month

0

 

Week 1

 

9

9

9

9

3

Week 2

 

9

9

9

9

4

Week 3

 

9

9

9

9

5

Week 4

 

9

9

9

9

6

The following table shows how the contents of the tapes can change across two weeks with the daily cumulative, weekly incremental backup schedule. Each letter represents a different file.

Table 45-9 Contents of Tapes for Daily Cumulative/Weekly Incremental Backup Schedule

 

Mon

Tues

Wed

Thurs

Fri

Week 1

a b

a b c

a b c d

a b c d e

a b c d e f

Week 2

g

g h

g h i

g h i j

g h i j k

 
 
 
  Previous   Contents   Next