Partition the Disk - AFS

Install AFS on a Single Server

Product
AFS
AFS_Version
7.9
Platform
RHEL
Category
Technical Notes

The /usr/local/afs7 directory must be set in a dedicated partition with "noatime" option enabled on each server hosting AFS environments.

The “noatime” option prevents the atime (access time) from being updated on file and directory accesses. This avoids any performance loss due to recording information on files or directories which often change.

We strongly recommend using an ext4 partition.

This partition hosts all disk space used by AFS.

In our example, we create an ext4 partition named afs7 with noatime, using the LVM Linux tool, on an already created physical volume.

For more information on physical volumes, see the LVM documentation.

  1. Check the physical volumes (pv) by running the following command:

    As root user

    pvs

    It returns the following information:

    PV VG Fmt Attr PSize PFree
    /dev/xvda3 vg_system lvm2 a-- 7.00g 1.50g
    /dev/xvda5 vg_data lvm2 a-- 37.75g 36.75g

  2. Check the volume groups (vg) by running the following command:

    As root user

    vgs

    It returns the following information:

    VG #PV #LV #SN Attr VSize VFree
    vg_data 1 1 0 wz--n- 37.75g 36.75g
    vg_system 1 3 0 wz--n- 7.00g 1.50g

  3. Create a logical volume (lv):

    As root user

    lvcreate -L 30G --name afs7 vg_data

    The above command creates the "afs7" logical volume.

    You can check the logical volumes by running the following command:

    As root user

    lvs

    It returns the following information:

    LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
    afs7 vg_data -wi-a----- 30.00g
    lv_home vg_data -wi-ao---- 1.00g
    lv_swap vg_system -wi-ao---- 512.00m
    lv_tmp vg_system -wi-ao---- 1.00g
    lv_var vg_system -wi-ao---- 4.00g

  4. Format the partition in ext4:

    As root user

    mkfs -t ext4 /dev/mapper/vg_data-afs7

    It returns the following information:

    mke2fs 1.42.12 (29-Aug-2014)
    Creating filesystem with 7864320 4k blocks and 1966080 inodes
    Filesystem UUID: 0c95d00d-2dfe-4f1d-8187-13906f86dac0
    Superblock backups stored on blocks:
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
    4096000

    Allocating group tables: done
    Writing inode tables: done
    Creating journal (32768 blocks): done
    Writing superblocks and filesystem accounting information: done

  5. Create the afs7 directory by running the following command:

    As root user

    mkdir /usr/local/afs7

  6. Edit the following file:

    As root user

    /etc/fstab

  7. Add the following line:

    /dev/xvdb /usr/local/afs7 ext4 noatime,nodiratime,rw 1 2

  8. Run the following command:

    As root user

    mount /usr/local/afs7/

  9. Run the following command:

    df -h

    Ensure the following result is displayed as shown in the example below:

    Filesystem Size Used Avail Use% Mounted on
    /dev/xvda1 9,8G 1,7G 7,6G 19% /
    tmpfs 1,9G 0 1,9G 0% /dev/shm
    /dev/mapper/vg_data-afs7 30G 44M 28G 1% /usr/local/afs7

If no logical volume is created, nor is the /usr/local/afs7.

Even though no dedicated partition is used, create the afs7 directory by running the following command:

As root user

mkdir /usr/local/afs7