This chapter describes the procedures for backing up file systems using the ufsdump command.
This is a list of the step-by-step instructions in this chapter.
For detailed information on syntax, options, and arguments for the ufsdump command, see Chapter 45, The ufsdump and ufsrestore Commands (Reference).
Preparing to back up file systems begins with planning, which is described in Chapter 42, Backing Up and Restoring File Systems (Overview) and includes choosing:
A tape drive
The file systems to back up
The type of backup (full or incremental)
A backup schedule
This section describes other tasks you might need to perform before backing up file systems, including:
Finding names of file systems to back up
Determining the number of tapes for a full backup
Display the contents of the /etc/vfstab file.
$ more /etc/vfstab |
Look in the mount point column for the name of the file system.
You use the mount point in the mount point column when you back up the file system.
$ more /etc/vfstab #device device mount FS fsck mount mount #to mount to fsck point type pass at boot options # #/dev/dsk/c1d0s2 /dev/rdsk/c1d0s2 /usr ufs 1 yes - fd - /dev/fd fd - no - /proc - /proc proc - no - /dev/dsk/c0t0d0s1 - - swap - no - /dev/dsk/c0t0d0s0 /dev/rdsk/c0t0d0s0 / ufs 1 no - /dev/dsk/c0t0d0s6 /dev/rdsk/c0t0d0s6 /usr ufs 1 no - /dev/dsk/c0t0d0s7 /dev/rdsk/c0t0d0s7 /export/home ufs 2 yes - mars:/share/kit - /kit nfs - yes - mars:/db/doc - /db/doc nfs - yes - |
Become superuser.
Estimate the size of the backup in bytes by using the usfdump S command.
# ufsdump S filesystem |
|
S |
Displays the estimated number of bytes needed to do the backup. |
Divide the estimated size by the capacity of the tape to see how many tapes you need.
See Table 42-2 for a list of tape capacities.
In this example, the file system of 489,472 bytes will easily fit on a 150-Mbyte tape.
# ufsdump S /export/home 489472 |
The following are general guidelines for performing backups:
Use single-user mode or unmount the file system.
Be aware that backing up file systems when there are directory-level operations (such as creating, removing, and renaming files) and file-level activity occurring means that some data will not be included in the backup.
You can run the ufsdump command from a single system and remotely back up groups of systems across the network through remote shell or remote login, and direct the output to the system on which the tape drive is located. (Typically, the tape drive is located on the system from which you run the ufsdump command, but it does not have to be.)
Another way to back up files to a remote drive is to pipe the output from the ufsdump command to the dd command. See Chapter 46, Copying UFS Files and File Systems (Tasks) for information about using the dd command.
If you are doing remote backups across the network, the system with the tape drive must have entries in its /.rhosts file for each client that will be using the drive. Also, the system initiating the backup must be included in the /.rhosts file on each system it will back up.
To specify a remote drive on a system, use the naming convention that matches the OS release of the system with the remote tape drive. For example, use /dev/rst0 for a remote drive on a system running the SunOS 4.1.1 release or compatible versions; use /dev/rmt/0 for a system running the Solaris 8 release or compatible versions.
Use the nisbackup command to back up a NIS+ master server running the Solaris 2.5 release or compatible versions. See Solaris Naming Administration Guide for information on using this command.
The following steps provide the general steps for backing up file systems using the ufsdump command. The examples show specific uses of options and arguments.
Become superuser.
Bring the system to run level S (single-user mode).
# shutdown -g30 -y |
[Optional] Check the file system for consistency with the fsck command.
Running the fsck -m command checks for consistency of file systems. For example, power failures can leave files in an inconsistent state. For more information on the fsck command, see Chapter 39, Checking File System Integrity.
# fsck -m /dev/rdsk/ device-name |
If you need to back up file systems to a remote tape drive:
On the system to which the tape drive is attached (the tape server), add the following entry to its /.rhosts file.
host root |
|
host |
Specifies the name of the system on which you will run ufsdump to perform the backup. |
On the tape server, verify that the host added to the /.rhosts file is accessible through the name service.
Identify the device name of the tape drive.
The default tape drive is /dev/rmt/0.
Insert a tape that is not write protected into the tape drive.
Back up file systems using the ufsdump command.
Use the following table to select the most common options and arguments for the ufsdump command. See Chapter 45, The ufsdump and ufsrestore Commands (Reference) for other options and arguments.
|
To ... |
Use This Option or Argument ... |
For Example ... |
See ... |
|---|---|---|---|
|
Do a full backup |
0 option |
ufsdump 0ucf /dev/rmt/0 / | |
|
Do an incremental backup |
1-9 option |
ufsdump 9ucf /dev/rmt/0 / | |
|
Back up individual files |
Specify a file or directory |
ufsdump ucf /dev/rmt/0 /export/home/kryten |
|
|
Record dumps to /etc/dumpdates file |
-u option |
ufsdump 9ucf /dev/rmt/0 /export/home | |
|
Specify a cartridge tape |
-c option |
ufsdump 9ucf /dev/rmt/0 /export/home | |
|
Specify the tape drive |
-f dump-file |
ufsdump 9ucf /dev/rmt/0 /export/home | |
|
Back up local file systems to a remote system's tape device |
remote-system:dump-file |
ufsdump 0ucf pluto:/dev/rmt/0 /export/home |
"Example--Full Backup to Remote System (Solaris 8 Data to Solaris 8 System)" |
If prompted, remove the tape and replace with the next volume.
Label each tape with the volume number, level, date, system name, disk slice, and file system.
Bring the system back to run level 3 by pressing Control-d.
Verify the backup was successful by using the ufsrestore command to display the tape contents.
This command is described in Chapter 44, Restoring Files and File Systems (Tasks).
The following example shows a full backup of the root (/) file system to a QIC-150 tape (/dev/rmt/0).
# shutdown -g30 -y
# ufsdump 0ucf /dev/rmt/0 /
DUMP: Writing 63 Kilobyte records
DUMP: Date of this level 0 dump: Tue Jul 13 10:46:09 1999
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rdsk/c0t0d0s0 (starbug:/) to /dev/rmt/0.
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Estimated 71058 blocks (34.70MB).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
DUMP: Tape rewinding
DUMP: 70936 blocks (34.64MB) on 1 volume at 64 KB/sec
DUMP: DUMP IS DONE
DUMP: Level 0 dump on Tue Jul 13 10:46:09 1999
# ufsrestore tf /dev/rmt/0
2 .
3 ./lost+found
5696 ./usr
11392 ./var
17088 ./export
22784 ./export/home
28480 ./opt
5697 ./etc
11393 ./etc/default
11394 ./etc/default/sys-suspend
11429 ./etc/default/cron
11430 ./etc/default/devfsadm
11431 ./etc/default/dhcpagent
11432 ./etc/default/fs
11433 ./etc/default/inetinit
11434 ./etc/default/kbd
11435 ./etc/default/nfslogd
11436 ./etc/default/passwd
.
.
.
# (Press Control-d to bring system to run level 3)
|
The following example shows an incremental backup of the root (/) file system to a 4-mm DAT tape (/dev/rmt/0).
# ufsdump 9ucf /dev/rmt/0 /
DUMP: Writing 63 Kilobyte records
DUMP: Date of this level 9 dump: Tue Jul 13 10:58:12 1999
DUMP: Date of last level 0 dump: Tue Jul 13 10:46:09 1999
DUMP: Dumping /dev/rdsk/c0t0d0s0 (starbug:/) to /dev/rmt/0.
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Mapping (Pass II) [directories]
DUMP: Mapping (Pass II) [directories]
DUMP: Mapping (Pass II) [directories]
DUMP: Estimated 200 blocks (100KB).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
DUMP: Tape rewinding
DUMP: 124 blocks (62KB) on 1 volume at 8 KB/sec
DUMP: DUMP IS DONE
DUMP: Level 9 dump on Tue Jul 13 10:58:12 1999
# ufsrestore tf /dev/rmt/0
2 .
3 ./lost+found
5696 ./usr
11392 ./var
17088 ./export
22784 ./export/home
28480 ./opt
5697 ./etc
11393 ./etc/default
11394 ./etc/default/sys-suspend
11429 ./etc/default/cron
11430 ./etc/default/devfsadm
11431 ./etc/default/dhcpagent
11432 ./etc/default/fs
11433 ./etc/default/inetinit
11434 ./etc/default/kbd
11435 ./etc/default/nfslogd
11436 ./etc/default/passwd
11437 ./etc/default/tar
.
.
.
|
The following example shows a full backup of the /export/home/kryten directory to a 4-mm DAT tape.
# ufsdump 0ucf /dev/rmt/0 /export/home/kryten
DUMP: Writing 63 Kilobyte records
DUMP: Date of this level 0 dump: Tue Jul 13 11:30:45 1999
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rdsk/c0t3d0s7 (pluto:/export/home) to /dev/rmt/0.
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Estimated 232 blocks (116KB).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
DUMP: Tape rewinding
DUMP: 124 blocks (62KB) on 1 volume at 8 KB/sec
DUMP: DUMP IS DONE
# ufsrestore tf /dev/rmt/0
2 .
2688 ./kryten
5409 ./kryten/letters
5410 ./kryten/letters/letter1
5411 ./kryten/letters/letter2
5412 ./kryten/letters/letter3
2689 ./kryten/.profile
8096 ./kryten/memos
30 ./kryten/reports
31 ./kryten/reports/reportA
32 ./kryten/reports/reportB
33 ./kryten/reports/reportC
#
|
The following example shows a full backup of a local /export/home file system on a Solaris 8 system to a tape device on a remote Solaris 8 system called starbug.
# ufsdump 0ucf starbug:/dev/rmt/0 /export/home
DUMP: Writing 63 Kilobyte records
DUMP: Date of this level 0 dump: Tue Jul 13 13:14:40 1999
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rdsk/c0t3d0s7 (mars:/export/home) to starbug:/dev/rmt/0
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Estimated 476 blocks (238KB).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
DUMP: Tape rewinding
DUMP: 376 blocks (188KB) on 1 volume at 21 KB/sec
DUMP: DUMP IS DONE
DUMP: Level 0 dump on Tue Jul 13 13:14:40 1999
# ufsrestore tf starbug:/dev/rmt/0
2 .
3 ./lost+found
3776 ./kryten
3777 ./kryten/.cshrc
3778 ./kryten/.login
3779 ./kryten/b
3780 ./kryten/memos
7552 ./kryten/letters
7553 ./kryten/letters/b
7554 ./kryten/letters/letter1
7555 ./kryten/letters/letter2
7556 ./kryten/letters/letter3
11328 ./kryten/reports
11329 ./kryten/reports/reportA
11330 ./kryten/reports/reportB
11331 ./kryten/reports/reportC
.
.
.
#
|
The following example shows a full backup of a local /export/home file system on a Solaris 8 system to a tape device on a remote SunOS 4.1.4 system (mars).
Notice the SunOS 4.x-style device name (/dev/rst0) used with the ufsdump command.
# ufsdump 0ucf mars:/dev/rst0 /export/home
DUMP: Writing 63 Kilobyte records
DUMP: Date of this level 0 dump: Thu Jul 15 09:13:01 1999
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rdsk/c0t0d0s7 (starbug:/export/home) to mars:/dev/rst0.
DUMP: Mapping (Pass I) [regular files]
DUMP: Mapping (Pass II) [directories]
DUMP: Estimated 5690 blocks (2.78MB).
DUMP: Dumping (Pass III) [directories]
DUMP: Dumping (Pass IV) [regular files]
DUMP: Tape rewinding
DUMP: 5542 blocks (2.71MB) on 1 volume at 77 KB/sec
DUMP: DUMP IS DONE
DUMP: Level 0 dump on Thu Jul 15 09:13:01 1999
# ufsrestore tf mars:/dev/rst0
2 .
3 ./lost+found
2688 ./kryten
5409 ./kryten/letters
5410 ./kryten/letters/letter1
5411 ./kryten/letters/letter2
5412 ./kryten/letters/letter3
2689 ./kryten/.profile
8096 ./kryten/memos
30 ./kryten/reports
31 ./kryten/reports/reportA
32 ./kryten/reports/reportB
33 ./kryten/reports/reportC
.
.
.
#
|
The following example shows a full backup of a local root (/) file system on a Sun 4.1.4 system (mars) to a remote tape device on a Solaris 8 system called starbug.
When you back up data on a system running SunOS 4.1.4 or a compatible version, you must use the dump command--not the ufsdump command.
# dump 0ucf starbug:/dev/rmt/0 /
DUMP: Date of this level 0 dump: Wed Jul 7 06:19:33 1999
DUMP: Date of last level 0 dump: the epoch
DUMP: Dumping /dev/rsd0a (/) to /dev/rmt/0 on host starbug
DUMP: mapping (Pass I) [regular files]
DUMP: mapping (Pass II) [directories]
DUMP: estimated 123706 blocks (60.40MB) on 1.41 tape(s).
DUMP: dumping (Pass III) [directories]
DUMP: dumping (Pass IV) [regular files]
DUMP: level 0 dump on Wed Jul 7 06:19:33 1999
DUMP: Tape rewinding
DUMP: 123680 blocks (60.39MB) on 2 volumes
DUMP: DUMP IS DONE
# restore tf starbug:/dev/rmt/0
2 .
3 ./lost+found
3776 ./export
7552 ./home
11328 ./usr
15104 ./pcfs
3777 ./tftpboot
3778 ./tftpboot/tftpboot
3794 ./tftpboot/boot.sun4c.sunos.4.1.4
7553 ./etc
7554 ./etc/sendmail.cf
7555 ./etc/aliases
7556 ./etc/aliases.dir
7557 ./etc/aliases.pag
7558 ./etc/holidays
7559 ./etc/dumpdates
.
.
.
#
|