22.16.117. salt.modules.mount

Salt module to manage unix mounts and the fstab file

salt.modules.mount.active(extended=False)

List the active mounts.

CLI Example:

salt '*' mount.active
salt.modules.mount.fstab(config='/etc/fstab')

List the contents of the fstab

CLI Example:

salt '*' mount.fstab
salt.modules.mount.is_fuse_exec(cmd)

Returns true if the command passed is a fuse mountable application.

CLI Example:

salt '*' mount.is_fuse_exec sshfs
salt.modules.mount.is_mounted(name)

New in version 2014.7.0.

Provide information if the path is mounted

CLI Example:

salt '*' mount.is_mounted /mnt/share
salt.modules.mount.mount(name, device, mkmnt=False, fstype='', opts='defaults')

Mount a device

CLI Example:

salt '*' mount.mount /mnt/foo /dev/sdz1 True
salt.modules.mount.remount(name, device, mkmnt=False, fstype='', opts='defaults')

Attempt to remount a device, if the device is not already mounted, mount is called

CLI Example:

salt '*' mount.remount /mnt/foo /dev/sdz1 True
salt.modules.mount.rm_fstab(name, config='/etc/fstab')

Remove the mount point from the fstab

CLI Example:

salt '*' mount.rm_fstab /mnt/foo
salt.modules.mount.set_fstab(name, device, fstype, opts='defaults', dump=0, pass_num=0, config='/etc/fstab', test=False, **kwargs)

Verify that this mount is represented in the fstab, change the mount to match the data passed, or add the mount if it is not present.

CLI Example:

salt '*' mount.set_fstab /mnt/foo /dev/sdz1 ext4
salt.modules.mount.swapoff(name)

Deactivate a named swap mount

CLI Example:

salt '*' mount.swapoff /root/swapfile
salt.modules.mount.swapon(name, priority=None)

Activate a swap disk

CLI Example:

salt '*' mount.swapon /root/swapfile
salt.modules.mount.swaps()

Return a dict containing information on active swap

CLI Example:

salt '*' mount.swaps
salt.modules.mount.umount(name)

Attempt to unmount a device by specifying the directory it is mounted on

CLI Example:

salt '*' mount.umount /mnt/foo

Docs for previous releases are available on salt.rtfd.org.

Latest Salt release: 2014.1.13

Try the shiny new release candidate of Salt, v2014.7.0rc6! More info here.

Previous topic

22.16.116. salt.modules.moosefs

Next topic

22.16.118. salt.modules.munin

SaltStack News

Upcoming SaltStack events, webinars and local meet ups and user groups.