System Administration Guide

How to Do Backups on Cartridge Tape

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.

  1. Become superuser.

  2. Shut down the system.


    # init 0
    
  3. Bring the system to run level S (single-user mode).


    ok boot -s
    
  4. [Optional] Check the file system for consistency with the fsck command.

    Running the fsck command using the -m option 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 31, Checking File System Integrity.


    # fsck -m /dev/rdsk/ device-name
    
  5. If you will be backing up file systems onto a remote tape drive:

    1. Add the following entry to the ./rhosts file of the system that is initiating the backup:


      host root
    2. Verify that the host name added to the /.rhosts file above is accessible via the local /etc/inet/hosts file or available from the NIS or NIS+ name server.

  6. Identify the device name of the tape drive.

    The default tape drive is /dev/rmt/0.

  7. Insert a tape that is not write protected into the tape drive.

  8. 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 36, 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/n files

    "Example--Full Backup, root (/), Cartridge Tape"

    Do an incremental backup 

    1-9 option  

    ufsdump 9ucf /dev/rmt/n files

    "Example--Incremental Backup, root (/) "

    Back up individual files 

    filename argument

    ufsdump 9ucf /dev/rmt/n /export/home/user1/mail

    "Example--Full Backup, Individual Home Directory"

    Record dumps to /etc/dumpdates file

    -u option (updates file)

    ufsdump 9ucf /dev/rmt/n files

    "Example--Incremental Backup, root (/) "

    Specify a cartridge tape 

    -c option

    ufsdump 9ucf /dev/rmt/n files

    "Example--Incremental Backup, root (/) "

    Specify the tape drive 

    -f dump-file

    ufsdump 9ucf /dev/rmt/1 files

    "Example--Incremental Backup, root (/) "

    Back up local file systems to a remote host's tape device 

    remote-host: argument

    ufsdump 0ucf mars:/dev/rmt/0 files

    "Example--Full Backup to Remote System (Solaris 2.x Data to Solaris 2.x System)"

  9. When prompted, remove the tape and replace with the next volume.

  10. Label each tape with the volume number, level, date, system name, and file system.

  11. Bring the system back to run level 3 by pressing Control-d.

  12. Verify the backup was successful by using the ufsrestore command to display the tape contents.

    This command is described in Chapter 35, Restoring Files and File Systems (Tasks).

Example--Full Backup, root (/), Cartridge Tape

In this example, a full backup of the root (/) file system is made on a 150-Mbyte cartridge tape (/dev/rmt/0).


# init 0
ok boot -s
# ufsdump 0ucf /dev/rmt/0 /
  DUMP: Writing 63 Kilobyte records
  DUMP: Date of this level 0 dump: Wed Nov 06 15:32:21 1996
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rdsk/c0t3d0s0 (mars:/) to /dev/rmt/0.
  DUMP: Mapping (Pass I) [regular files]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Estimated 41236 blocks (20.13MB).
  DUMP: Dumping (Pass III) [directories]
  DUMP: Dumping (Pass IV) [regular files]
  DUMP: Tape rewinding
  DUMP: 41200 blocks (20.12MB) on 1 volume at 95 KB/sec
  DUMP: DUMP IS DONE
  DUMP: Level 0 dump on Wed Nov 06 15:32:21 1996
# ufsrestore tf /dev/rmt/0 (Verification starts here)
         2	.
         3	./lost+found
      5696	./usr
     11392	./export
     17088	./opt
     22784	./var
     28480	./var/sadm
     34176	./var/sadm/install
     39872	./var/sadm/install/admin
     39879	./var/sadm/install/admin/default
                      .
                      .
                      .
    #
# (Press Control-D to bring system to run level 3)

Example--Full Backup, /export/home, 4-mm DAT Tape

In this example, a full backup of the /export/home file system is made on a 4-mm DAT tape.


# ufsdump 0ucf /dev/rmt/0 /export/home
  DUMP: Writing 63 Kilobyte records
  DUMP: Date of this level 0 dump: Wed Nov 06 16:18:08 1996
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rdsk/c0t3d0s7 (mars:/export/home) to /dev/rmt/0.
  DUMP: Mapping (Pass I) [regular files]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Estimated 13504 blocks (6.59MB).
  DUMP: Dumping (Pass III) [directories]
  DUMP: Dumping (Pass IV) [regular files]
  DUMP: Tape rewinding
  DUMP: 13480 blocks (6.58MB) on 1 volume at 92 KB/sec
  DUMP: DUMP IS DONE
  DUMP: Level 0 dump on Wed Nov 06 16:18:08 1996
# ufsrestore tf /dev/rmt/0
    113920	./x97_sysmgt
    159488	./kryten
    159489	./kryten/.login
    159490	./kryten/.cshrc
    170880	./kryten/directives
    170882	./kryten/directives/directive.2001
    170883	./kryten/directives/directive.450b
    170881	./kryten/directives/directive.115c
    159491	./kryten/tar_file
          .
          .
          .
#

Example--Incremental Backup, root (/)

In this example, an incremental backup of the root (/) file system is made on a 4-mm DAT tape device.


# ufsdump 9ucf /dev/rmt/0 /
  DUMP: Writing 63 Kilobyte records
  DUMP: Date of this level 9 dump: Wed Nov 06 16:14:51 1996
  DUMP: Date of last level 0 dump: Wed Nov 06 15:32:21 1996
  DUMP: Dumping /dev/rdsk/c0t3d0s0 (mars:/) 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: Mapping (Pass II) [directories]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Estimated 3708 blocks (1.81MB).
  DUMP: Dumping (Pass III) [directories]
  DUMP: Dumping (Pass IV) [regular files]
  DUMP: Tape rewinding
  DUMP: 3652 blocks (1.78MB) on 1 volume at 75 KB/sec
  DUMP: DUMP IS DONE
  DUMP: Level 9 dump on Wed Nov 06 16:14:51 1996
 # ufsrestore tf /dev/rmt/0
         2	   .
     10752	   ./var
     13440	   ./var/sadm
      2689	   ./var/sadm/install
      2690	   ./var/sadm/install/.lockfile
      2766	   ./var/sadm/install/contents
     10753	   ./var/sadm/pkg
      2734	   ./var/adm
      2780	   ./var/adm/sa
      2951	   ./var/adm/sa/sa24
      2735	   ./var/cron
      2885	   ./var/cron/log
      8086	   ./var/spool
      8087	   ./var/spool/locks
      8088	   ./var/tmp
#

Example--Full Backup, Individual Home Directory

In this example, a full backup of the /export/home/kryten directory is made on 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: Wed Nov 06 16:12:41 1996
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rdsk/c0t3d0s7 (mars:/export/home) to 
/dev/rmt/0.
  DUMP: Mapping (Pass I) [regular files]
  DUMP: Mapping (Pass II) [directories]
  DUMP: Estimated 280 blocks (140KB).
  DUMP: Dumping (Pass III) [directories]
  DUMP: Dumping (Pass IV) [regular files]
  DUMP: Tape rewinding
  DUMP: 250 blocks (125KB) on 1 volume at 15 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
#

Example--Full Backup to Remote System (Solaris 2.x Data to Solaris 2.x System)

In this example, the local /export/home file system on a Solaris 2.x system is backed up to a tape device on a remote Solaris 2.x system called pluto.


# ufsdump 0ucf pluto:/dev/rmt/0 /export/home
  DUMP: Writing 63 Kilobyte records
  DUMP: Date of this level 0 dump: Fri Oct 25 10:30:53 1996
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rdsk/c0t3d0s7 (/export/home) to (pluto:
/dev/rmt/0).
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 19574 blocks (9.56MB)
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
  DUMP: level 0 dump on Fri Oct 25 10:30:53 1996
  DUMP: Tape rewinding
  DUMP: 19574 blocks (9.56MB) on 1 volume at 92 KB/sec
  DUMP: DUMP IS DONE
# ufsrestore tf pluto:/dev/rmt/0
         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
              .
              .
              .
#

Example--Full Backup to Remote System (Solaris 2.x Data to Sun 4.1.x System)

In this example, the local /export/home file system on a Solaris 2.x system is backed up to a tape device on a remote SunOS 4.1.x system (mars). Notice the SunOS 4.x-style device name (/dev/rst0) used with the ufsdump command. To run the ufsdump command, you would log in as superuser on the Solaris 2.x system.


# ufsdump 0ucf mars:/dev/rst0 /export/home
  DUMP: Writing 63 Kilobyte records
  DUMP: Date of this level 0 dump: Fri Oct 25 15:06:47 1996
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rdsk/c0t3d0s7 (/export/home) to (mars:
/dev/rst0).
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 19574 blocks (9.56MB)
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
  DUMP: level 0 dump on Fri Oct 25 15:06:47 1996
  DUMP: Tape rewinding
  DUMP: 19574 blocks (9.56MB) on 1 volume
  DUMP: DUMP IS DONE
#
 
 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
                .
                .
                .
#

Example--Full Backup to Remote System (SunOS 4.1.x Data to Solaris 2.x)

In this example, the local root (/) file system on a Sun 4.1.x system (mars) is backed up to a remote tape device on a Solaris 2.x system called pluto.


Note -

Notice that when you back up data to a SunOS 4.1.x system, you must use the dump command--not the ufsdump command.



mars# dump 0ucf pluto:/dev/rmt/0 /
  DUMP: Date of this level 0 dump: Tue Oct 25 16:05:19 1996   
  DUMP: Date of last level 0 dump: the epoch
  DUMP: Dumping /dev/rsd2a (/) to /dev/rmt/0 on host pluto
  DUMP: mapping (Pass I) [regular files]
  DUMP: mapping (Pass II) [directories]
  DUMP: estimated 8686 blocks (4.24MB) on 0.10 tape(s).
  DUMP: dumping (Pass III) [directories]
  DUMP: dumping (Pass IV) [regular files]
  DUMP: level 0 dump on Tue Oct 25 16:05:19 1996
  DUMP: Tape rewinding
  DUMP: 8690 blocks (4.24MB) on 1 volume
  DUMP: DUMP IS DONE
mars# restore tf pluto:/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.3
      7553      ./etc
      7554      ./etc/sendmail.cf
      7555      ./etc/aliases
      7556      ./etc/aliases.dir
      7557      ./etc/aliases.pag
      7558      ./etc/holidays
      7559      ./etc/dumpdates
                      .
                .
                .
mars#