DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 
Managing filesystem types

Step 1: copying the source filesystem

To make a copy, use either the cpio(1) or volcopy(1M) command. These two commands accomplish the work of moving filesystems in very different ways. cpio copies each file in one filesystem to another, whereas volcopy makes a literal copy of the filesystem as a whole.

The cpio and volcopy commands are not equivalent. You should be aware of the consequences of using either one and choose whichever makes more sense for your situation.

Once the destination filesystem is complete, you can remove the source. Follow the instructions under ``Steps 2 and 3: Removing the source filesystem and editing vfstab''.

Copying a filesystem with cpio

Using cpio presumes that a destination filesystem already exists, whether newly created or not. The files of the source filesystem are installed into this existing destination filesystem.

cpio does not move a filesystem as a single unit; it moves a filesystem by transferring its constituent files one at a time. Thus, you can use this command when transferring a filesystem between disks of different sizes. As long as the destination disk has enough free space to accommodate the files it's receiving, you can transfer that filesystem to it with cpio.

To move a filesystem with cpio, enter:

   find . -mount -print | cpio -pdm dest_directory

Copying a filesystem with volcopy

If you are moving a filesystem between two disks of the same size, we recommend running volcopy because it is the faster of the two commands. volcopy owes its speed, however, to the fact that it moves a filesystem as a single unit, overwriting the destination disk completely with the contents of the source disk. Any preexisting contents on the destination disk are destroyed when you move a filesystem to that disk with volcopy.

The volcopy options are not identical for the different types of filesystems that might be on your system. For details on the options, see the appropriate volcopy. (Separate versions exist for the vxfs, ufs, sfs, and s5 filesystem types.)

The following example shows how to run volcopy to move a vxfs-type filesystem (/home2):

  1. To copy a vxfs filesystem with volcopy, enter:
       volcopy fsname src_dev volname1 dest_dev volname2
    
    Because a filesystem type has not been specified on the command line, volcopy will get the filesystem type from /etc/vfstab. If the filesystem type is not defined in /etc/vfstab, it must be specified on the command line as an argument to the -F option.

    The arguments take the following values:


    fsname
    The mounted name of the filesystem being copied (such as /home2).

    src_dev
    The disk partition or tape (such as /dev/rdsk/c0b0t1d0s4 or /dev/rmt/c0s0) from which you are copying the filesystem. It must be a character special device.

    volname1
    The name (up to six characters long) of the physical volume from which you are copying the filesystem. (For example: home2, representing /home2, or -, representing the existing volume name.)

    dest_dev
    The disk partition or tape (such as /dev/rdsk/c0b0t2d0s3 or /dev/rmt/c0s0) to which you are copying the filesystem.

    volname2
    The name (up to six characters long) of the physical volume to which you are copying the filesystem. (For example: bhome2, representing ``backup of home2,'' or -, representing the existing source volume name.)

  2. For example, to make a backup copy of the /home2 filesystem, you might enter
       volcopy /home2 /dev/rdsk/c0b0t1d0s4 home2 /dev/rdsk/c0b0t2d0s3 bhome2
    

© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 22 April 2004