O'Reilly logo

Salt Cookbook by Anirban Saha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required