Removing Volumes and their Mount Points

To remove a volume from its site and its record from the VLDB, use the vos remove command. Use it to remove any of the three types of volumes; the effect depends on the type.

Other Removal Commands

The vos remove command is almost always the appropriate way to remove a volume, because it automatically removes a volume's VLDB entry and both the volume header and all data from the partition. If either the VLDB entry or volume header does not exist, it is sometimes necessary to use other commands that remove only the remaining element. Do not use these commands in the normal case when both the VLDB entry and the volume header exist, because by definition they create discrepancies between them. For details on the commands' syntax, see their reference pages in the OpenAFS Administration Reference.

The vos zap command removes a volume from its site by removing the volume header and volume data for which a VLDB entry no longer exists. You can tell a VLDB entry is missing if the vos listvol command displays the volume header but the vos examine or vos listvldb command cannot locate the VLDB entry. You must run this command to correct the discrepancy, because the vos syncvldb and vos syncserv commands never remove volume headers.

The vos remsite command removes a read-only site definition from the VLDB without affecting the volume on the file server machine. Use this command when you have mistakenly issued the vos addsite command to define a read-only site, but have not yet issued the vos release command to release the volume to the site. If you have actually released a volume to the site, use the vos remove command instead.

The vos delentry command removes the entire VLDB entry that mentions the volume you specify. If versions of the volume actually exist on file server machines, they are not affected. This command is useful if you know for certain that a volume removal was not recorded in the VLDB (perhaps you used the vos zap command during an emergency), and do not want to take the time to resynchronize the entire VLDB with the vos syncvldb and vos syncserv commands.

To remove a volume and unmount it

  1. Verify that you are listed in the /usr/afs/etc/UserList file. If necessary, issue the bos listusers command, which is fully described in To display the users in the UserList file.

       % bos listusers <machine name>
    
  2. If removing the volume's mount point, verify that you have the d( delete) permission on its parent directory's ACL. If necessary, issue the fs listacl command, which is fully described in Displaying ACLs.

       % fs listacl [<dir/file path>]
    

    Members of the system:administrators group always implicitly have the a( administer) and by default also the l( lookup) permission on every ACL and can use the fs setacl command to grant other rights as necessary.

  3. (Optional) Dump the volume to a file or to tape, in case you want to restore it later. To copy the volume's contents to a file, use the vos dump command as instructed in Dumping and Restoring Volumes. You can then copy the file to tape using a third-party backup utility or an archiving utility such as the UNIX tar command.

    Alternatively, use the AFS Backup System to create a tape copy. In this case, it can be convenient to create a temporary volume set that includes only the volume of interest. Temporary volume sets are not recorded in the Backup Database, and so do not clutter database with records for volume sets that you use only once. For instructions, see To create a dump.

  4. Issue the vos remove command to remove the volume. If removing a read-only volume from multiple sites, repeat the command for each one.

       % vos remove [-server machine name>] [-partition <partition name>] \
                   -id <volume name or ID>
    

    where

    remo

    Is the shortest acceptable abbreviation of remove.

    -server

    Specifies the file server machine on which the volume resides. It is necessary only when the -id argument names a read-only volume that exists at multiple sites.

    -partition

    Specifies the partition on machine name where the volume resides. It is necessary only when the -id argument names a read-only volume that exists at multiple sites. Provide the -server argument along with this one.

    -id

    Identifies the volume to remove, either by its complete name or volume ID number. If identifying a read-only or backup volume by name, include the appropriate extension ( .readonly or .backup).

  5. If you are removing the last existing version of the volume, issue the fs rmmount command remove the corresponding mount point. Complete instructions appear in To remove a volume and unmount it.

    If you are removing a backup volume that is mounted in the conventional way (at a subdirectory of its read/write volume's root directory), then removing the source volume's mount point in this step is sufficient to remove the backup volume's mount point. If you mounted the backup at a completely separate directory, you need to repeat this step for the backup volume's mount point.

       % fs rmmount <directory>
    
  6. (Optional) If you created a dump file in Step 3, transfer it to tape. The preferred method is to use the AFS Backup System, which is described in Configuring the AFS Backup Systemand Backing Up and Restoring AFS Data.