Working with disks and mounts

Working with disks, configuring their mount points, and gathering useful data about them at times of emergency are some of the most critical tasks in system management. In this recipe, you will learn how Salt helps us perform all of these tasks efficiently.

How to do it...

We will use the same minion and logical volume configured in the previous recipe.

  1. Create a new state directory called disk.
  2. Create and edit /opt/salt-cookbook/staging/disk/format.sls to have the following entries:
    include:
      - lvm
    
    backup_volume:
      blockdev.formatted:
        - name: /dev/backup_vg/backup_lv
        - fs_type: ext4
        - require:
          - lvm: backup_lv
  3. Create and edit /opt/salt-cookbook/staging/disk/mount.sls to have the following entries:
    include: - disk.format backup_mount: ...

Get Salt Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.