# salt.states.mount

## Mounting of filesystems.

Mount any type of mountable filesystem with the mounted function:

    /mnt/sdb:
      mount.mounted:
        - device: /dev/sdb1
        - fstype: ext4
        - mkmnt: True
        - opts:
          - defaults

`salt.states.mount.` `mounted`(name, device, fstype, mkmnt=False, opts=None, dump=0, pass_num=0, config='/etc/fstab', persist=True)

  Verify that a device is mounted

  name
    The path to the location where the device is to be mounted
  device
    The device name, typically the device node, such as /dev/sdb1
  fstype
    The filesystem type, this will be xfs, ext2/3/4 in the case of classic filesystems, and fuse in the case of fuse mounts
  mkmnt
    If the mount point is not present then the state will fail, set mkmnt to True to create the mount point if it is otherwise not present
  opts
    A list object of options or a comma delimited list
  dump
    The dump value to be passed into the fstab, default to 0
  pass_num
    The pass value to be passed into the fstab, default to 0
  config
    Set an alternative location for the fstab, default to /etc/fstab
  remount
    Set if the file system can be remounted with the remount option, default to True
  persist
    Set if the mount should be saved in the fstab, default to True

`salt.states.mount.` `swap`(name, persist=True, config='/etc/fstab')

  Activates a swap device

      /root/swapfile:
        mount.swap

`salt.states.mount.` `unmounted`(name, config='/etc/fstab', persist=False)

  Note

  This state will be available in version 0.17.0.

  Verify that a device is not mounted

  name
    The path to the location where the device is to be unmounted from
  config
    Set an alternative location for the fstab, default to /etc/fstab
  persist
    Set if the mount should be purged from the fstab, default to False

Current Salt release: 0.17.1

### Table Of Contents

- salt.states.mount
  - Mounting of filesystems.

#### Previous topic

salt.states.mongodb_user

#### Next topic

salt.states.mysql_database

### Quick search

Enter search terms or a module, class or function name.

### Upcoming SaltStack Events

My conferences on Lanyrd