Adding or Removing Disks and Partitions

AFS makes it very easy to add storage space to your cell, just by adding disks to existing file server machines. This section explains how to install or remove a disk used to store AFS volumes. (Another way to add storage space is to install additional server machines, as instructed in the OpenAFS Quick Beginnings.)

Both adding and removing a disk cause at least a brief file system outage, because you must restart the fs process to have it recognize the new set of server partitions. Some operating systems require that you shut the machine off before adding or removing a disk, in which case you must shut down all of the AFS server processes first. Otherwise, the AFS-related aspects of adding or removing a disk are not complicated, so the duration of the outage depends mostly on how long it takes to install or remove the disk itself.

The following instructions for installing a new disk completely prepare it to house AFS volumes. You can then use the vos create command to create new volumes, or the vos move command to move existing ones from other partitions. For instructions, see Creating Read/write Volumes and Moving Volumes. The instructions for removing a disk are basically the reverse of the installation instructions, but include extra steps that protect against data loss.

A server machines can house 256 AFS server partitions, each one mounted at a directory with a name of the form /vicepindex, where index is one or two lowercase letters. By convention, the first partition on a machine is mounted at /vicepa, the second at /vicepb, and so on to the twenty-sixth at /vicepz. Additional partitions are mounted at /vicepaa through /vicepaz and so on up to /vicepiv. Using the letters consecutively is not required, but is simpler.

Mount each /vicep directory directly under the local file system's root directory ( / ), not as a subdirectory of any other directory; for example, /usr/vicepa is not an acceptable location. You must also map the directory to the partition's device name in the file server machine's file systems registry file (/etc/fstab or equivalent).

These instructions assume that the machine's AFS initialization file includes the following command to restart the BOS Server after each reboot. The BOS Server starts the other AFS server processes listed in the local /usr/afs/local/BosConfig file. For information on the bosserver command's optional arguments, see its reference page in the OpenAFS Administration Reference.

   /usr/afs/bin/bosserver

To add and mount a new disk to house AFS volumes

  1. Become the local superuser root on the machine, if you are not already, by issuing the su command.

       % su root
       Password: root_password
    
  2. Decide how many AFS partitions to divide the new disk into and the names of the directories at which to mount them (the introduction to this section describes the naming conventions). To display the names of the existing server partitions on the machine, issue the vos listpart command. Include the -localauth flag because you are logged in as the local superuser root but do not necessarily have administrative tokens.

       # vos listpart <machine name> -localauth
    

    where

    listp

    Is the shortest acceptable abbreviation of listpart.

    machine name

    Names the local file server machine.

    -localauth

    Constructs a server ticket using a key from the local /usr/afs/etc/KeyFile file. The bos command interpreter presents it to the BOS Server during mutual authentication.

  3. Create each directory at which to mount a partition.

       # mkdir /vicepx[x]
    
  4. Using a text editor, create an entry in the machine's file systems registry file (/etc/fstab or equivalent) for each new disk partition, mapping its device name to the directory you created in the previous step. Refer to existing entries in the file to learn the proper format, which varies for different operating systems.

  5. If the operating system requires that you shut off the machine to install a new disk, issue the bos shutdown command to shut down all AFS server processes other than the BOS Server (it terminates safely when you shut off the machine). Include the -localauth flag because you are logged in as the local superuser root but do not necessarily have administrative tokens. For a complete description of the command, see To stop processes temporarily.

       # bos shutdown <machine name> -localauth [-wait]
    
  6. If necessary, shut off the machine. Install and format the new disk according to the instructions provided by the disk and operating system vendors. If necessary, edit the disk's partition table to reflect the changes you made to the files system registry file in step 4; consult the operating system documentation for instructions.

  7. If you shut off the machine down in step 6, turn it on. Otherwise, issue the bos restart command to restart the fs process, forcing it to recognize the new set of server partitions. Include the -localauth flag because you are logged in as the local superuser root but do not necessarily have administrative tokens. For complete instructions for the bos restart command, see Stopping and Immediately Restarting Processes.

       # bos restart <machine name>  fs -localauth
    
  8. Issue the bos status command to verify that all server processes are running correctly. For more detailed instructions, see Displaying Process Status and Information from the BosConfig File.

       # bos status <machine name>
    

To unmount and remove a disk housing AFS volumes

  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. Issue the vos listvol command to list the volumes housed on each partition of each disk you are about to remove, in preparation for removing them or moving them to other partitions. For detailed instructions, see Displaying Volume Headers.

       % vos listvol <machine name> [<partition name>]
    
  3. Move any volume you wish to retain in the file system to another partition. You can move only read/write volumes. For more detailed instructions, and for instructions on moving read-only and backup volumes, see Moving Volumes.

       % vos move  <volume name or ID>  \
            <machine name on source> <partition name on source>  \
            <machine name on destination> <partition name on destination>
    
  4. (Optional) If there are any volumes you do not wish to retain, back them up using the vos dump command or the AFS Backup System. See Dumping and Restoring Volumes or Backing Up Data, respectively.

  5. Become the local superuser root on the machine, if you are not already, by issuing the su command.

       % su root
       Password: root_password
    
  6. Issue the umount command, repeating it for each partition on the disk to be removed.

       # cd /
       # umount /dev/<partition_block_device_name>
    
  7. Using a text editor, remove or comment out each partition's entry from the machine's file systems registry file (/etc/fstab or equivalent).

  8. Remove the /vicep directory associated with each partition.

       # rmdir /vicepxx
    
  9. If the operating system requires that you shut off the machine to remove a disk, issue the bos shutdown command to shut down all AFS server processes other than the BOS Server (it terminates safely when you shut off the machine). Include the -localauth flag because you are logged in as the local superuser root but do not necessarily have administrative tokens. For a complete description of the command, see To stop processes temporarily.

       # bos shutdown <machine name> -localauth [-wait]
    
  10. If necessary, shut off the machine. Remove the disk according to the instructions provided by the disk and operating system vendors. If necessary, edit the disk's partition table to reflect the changes you made to the files system registry file in step 7; consult the operating system documentation for instructions.

  11. If you shut off the machine down in step 10, turn it on. Otherwise, issue the bos restart command to restart the fs process, forcing it to recognize the new set of server partitions. Include the -localauth flag because you are logged in as the local superuser root but do not necessarily have administrative tokens. For complete instructions for the bos restart command, see Stopping and Immediately Restarting Processes.

       # bos restart <machine name>  fs -localauth
    
  12. Issue the bos status command to verify that all server processes are running correctly. For more detailed instructions, see Displaying Process Status and Information from the BosConfig File.

       # bos status <machine name>