Kanrisuru

FS Mount Options

The Kanrisuru::Util::FsMountOpts class is a lookup utility module that helps with validating if a device type is valid, as well as the various options for that device type. These options are primarly used with filesystem mounts with the mount command, as well as Kanrisuru::Remote::Fstab class.

Public Class Methods

get_device

Returns the full set of device options for a device.

Kanrisuru::Util::FsMountOpts.get_device('ext4')
{
  "acl": "boolean",
  "noacl": "boolean",
  "bsddf": "boolean",
  ... 
  "dioread_lock": "boolean",
  "dioread_nolock": "boolean",
  "i_version": "boolean"
}

get_device_opt

Checks for a given device, the option mapped to that device.

Kanrisuru::Util::FsMountOpts.get_device_opt('common', 'owner')
'boolean'

[]

Returns the full set of device options for a device.

Kanrisuru::Util::FsMountOpts['ext4']
{
  "acl": "boolean",
  "noacl": "boolean",
  "bsddf": "boolean",
  ... 
  "dioread_lock": "boolean",
  "dioread_nolock": "boolean",
  "i_version": "boolean"
}

Lookup Table

Table is structured as a hash of device type names, mapped to their options. Each option key is the name of the option used in linux, and maps to the argument type expected when constructing a command. boolean would be a flag, whereas value would be an option argument.

Kanrisuru::Util::FsMountOpts.instance_variable_get(:@options_dict)
{
  "auto": {
  },
  "common": {
    "async": "boolean",
    "atime": "boolean",
    "noatime": "boolean",
    "auto": "boolean",
    "noauto": "boolean",
    "context": "value",
    "fscontext": "value",
    "defcontext": "value",
    "rootcontext": "value",
    "defaults": "boolean",
    "dev": "boolean",
    "nodev": "boolean",
    "diratime": "boolean",
    "nodiratime": "boolean",
    "dirsync": "boolean",
    "exec": "boolean",
    "noexec": "boolean",
    "group": "boolean",
    "iversion": "boolean",
    "noiversion": "boolean",
    "mand": "boolean",
    "nomand": "boolean",
    "_netdev": "boolean",
    "nofail": "boolean",
    "relatime": "boolean",
    "norelatime": "boolean",
    "strictatime": "boolean",
    "nostrictatime": "boolean",
    "suid": "boolean",
    "nosuid": "boolean",
    "owner": "boolean",
    "remount": "boolean",
    "ro": "boolean",
    "_rnetdev": "boolean",
    "rw": "boolean",
    "sync": "boolean",
    "user": "boolean",
    "nouser": "boolean",
    "users": "boolean"
  },
  "adfs": {
    "uid": "value",
    "gid": "value",
    "ownmask": "boolean",
    "othmask": "boolean"
  },
  "affs": {
    "uid": "value",
    "gid": "value",
    "setuid": "value",
    "setgid": "value",
    "mode": "value",
    "protect": "boolean",
    "usemp": "boolean",
    "verbose": "boolean",
    "prefix": "value",
    "volume": "value",
    "reserved": "value",
    "root": "value",
    "bs": "value",
    "grpquota": "boolean",
    "noquota": "boolean",
    "quota": "boolean",
    "usrquota": "boolean"
  },
  "cifs": {
    "user": "value",
    "password": "value",
    "credentials": "value",
    "uid": "value",
    "forceuid": "boolean",
    "cruid": "value",
    "gid": "value",
    "forcegid": "boolean",
    "port": "value",
    "servernetbiosname": "value",
    "servern": "value",
    "netbiosname": "value",
    "file_mode": "value",
    "dir_mode": "value",
    "ip": "value",
    "domain": "value",
    "guest": "boolean",
    "iocharset": "boolean",
    "ro": "boolean",
    "rw": "boolean",
    "setuids": "boolean",
    "nosetuids": "boolean",
    "perm": "boolean",
    "noperm": "boolean",
    "dynperm": "boolean",
    "cache": "value",
    "directio": "boolean",
    "strictcache": "boolean",
    "rwpidforward": "boolean",
    "mapchars": "boolean",
    "nomapchars": "boolean",
    "intr": "boolean",
    "nointr": "boolean",
    "hard": "boolean",
    "soft": "boolean",
    "noacl": "boolean",
    "cifsacl": "boolean",
    "backupuid": "value",
    "backupgid": "value",
    "nocase": "boolean",
    "ignorecase": "boolean",
    "sec": "value",
    "nobrl": "boolean",
    "sfu": "boolean",
    "serverino": "boolean",
    "noserverino": "boolean",
    "nounix": "boolean",
    "nouser_xattr": "boolean",
    "rsize": "value",
    "wsize": "value",
    "fsc": "boolean",
    "multiuser": "boolean",
    "actimeo": "value",
    "noposixpaths": "boolean",
    "posixpaths": "boolean",
    "prefixpath": "value"
  },
  "coherent": {
  },
  "debugfs": {
  },
  "devpts": {
    "uid": "value",
    "gid": "value",
    "mode": "value",
    "newinstance": "boolean",
    "ptmxmode": "value"
  },
  "ext2": {
    "acl": "boolean",
    "noacl": "boolean",
    "bsddf": "boolean",
    "minixdf": "boolean",
    "check": "value",
    "debug": "boolean",
    "errors": "value",
    "grpid": "boolean",
    "bsdgroups": "boolean",
    "nogrpid": "boolean",
    "sysvgroups": "boolean",
    "grpquota": "boolean",
    "noquota": "boolean",
    "quota": "boolean",
    "usrquota": "boolean",
    "nobh": "boolean",
    "nouid32": "boolean",
    "oldalloc": "boolean",
    "orlov": "boolean",
    "resgid": "value",
    "resuid": "value",
    "sb": "value",
    "user_xattr": "boolean",
    "nouser_xattr": "boolean"
  },
  "ext3": {
    "acl": "boolean",
    "noacl": "boolean",
    "bsddf": "boolean",
    "minixdf": "boolean",
    "check": "value",
    "debug": "boolean",
    "errors": "value",
    "grpid": "boolean",
    "bsdgroups": "boolean",
    "nogrpid": "boolean",
    "sysvgroups": "boolean",
    "grpquota": "boolean",
    "noquota": "boolean",
    "quota": "boolean",
    "usrquota": "boolean",
    "nobh": "boolean",
    "nouid32": "boolean",
    "oldalloc": "boolean",
    "orlov": "boolean",
    "resgid": "value",
    "resuid": "value",
    "sb": "value",
    "user_xattr": "boolean",
    "nouser_xattr": "boolean",
    "journal": "value",
    "journal_dev": "value",
    "norecovery": "boolean",
    "noload": "boolean",
    "data": "value",
    "barrier": "value",
    "commit": "value"
  },
  "ext4": {
    "acl": "boolean",
    "noacl": "boolean",
    "bsddf": "boolean",
    "minixdf": "boolean",
    "check": "value",
    "debug": "boolean",
    "errors": "value",
    "grpid": "boolean",
    "bsdgroups": "boolean",
    "nogrpid": "boolean",
    "sysvgroups": "boolean",
    "grpquota": "boolean",
    "noquota": "boolean",
    "quota": "boolean",
    "usrquota": "boolean",
    "nobh": "boolean",
    "nouid32": "boolean",
    "oldalloc": "boolean",
    "orlov": "boolean",
    "resgid": "value",
    "resuid": "value",
    "sb": "value",
    "user_xattr": "boolean",
    "nouser_xattr": "boolean",
    "journal": "value",
    "journa_dev": "value",
    "norecovery": "boolean",
    "noload": "boolean",
    "data": "value",
    "barrier": "value",
    "nobarrier": "boolean",
    "commit": "value",
    "journal_checksum": "boolean",
    "journal_async_commit": "boolean",
    "inode_readahead_blks": "value",
    "stripe": "value",
    "delalloc": "boolean",
    "nodelalloc": "boolean",
    "max_batch_time": "value",
    "min_batch_time": "value",
    "journal_ioprio": "value",
    "abort": "boolean",
    "auto_da_alloc": "boolean",
    "noauto_da_alloc": "boolean",
    "discard": "boolean",
    "nodiscard": "boolean",
    "resize": "boolean",
    "block_validity": "boolean",
    "noblock_validity": "boolean",
    "dioread_lock": "boolean",
    "dioread_nolock": "boolean",
    "i_version": "boolean"
  },
  "fat": {
    "blocksize": "value",
    "uid": "value",
    "gid": "value",
    "umask": "value",
    "dmask": "value",
    "fmask": "value",
    "allow_utime": "value",
    "check": "value",
    "codepage": "value",
    "conv": "value",
    "cvf_format": "value",
    "cvf_option": "value",
    "debug": "boolean",
    "fat": "value",
    "iocharset": "value",
    "tz": "value",
    "quiet": "boolean",
    "showexec": "boolean",
    "sys_immutable": "boolean",
    "flush": "boolean",
    "usefree": "boolean",
    "dots": "boolean",
    "nodots": "boolean",
    "dotsOK": "value"
  },
  "hfs": {
    "creator": "value",
    "type": "value",
    "uid": "value",
    "gid": "value",
    "dir_umask": "value",
    "file_umask": "value",
    "umask": "value",
    "session": "value",
    "part": "value",
    "quiet": "boolean"
  },
  "hpfs": {
    "uid": "value",
    "gid": "value",
    "umask": "value",
    "case": "value",
    "conv": "value",
    "nocheck": "boolean"
  },
  "iso9660": {
    "norock": "boolean",
    "nojoliet": "boolean",
    "check": "value",
    "uid": "value",
    "gid": "value",
    "map": "value",
    "mode": "value",
    "unhide": "boolean",
    "block": "value",
    "conv": "value",
    "cruft": "boolean",
    "session": "value",
    "sbsector": "value",
    "iocharset": "value",
    "utf8": "boolean"
  },
  "jfs": {
    "iocharset": "value",
    "resize": "value",
    "nointegrity": "boolean",
    "integrity": "boolean",
    "errors": "value",
    "grpquota": "boolean",
    "noquota": "boolean",
    "quota": "boolean",
    "usrquota": "boolean"
  },
  "minix": {
  },
  "msdos": {
    "blocksize": "value",
    "uid": "value",
    "gid": "value",
    "umask": "value",
    "dmask": "value",
    "fmask": "value",
    "allow_utime": "value",
    "check": "value",
    "codepage": "value",
    "conv": "value",
    "cvf_format": "value",
    "cvf_option": "value",
    "debug": "boolean",
    "fat": "value",
    "iocharset": "value",
    "tz": "value",
    "quiet": "boolean",
    "showexec": "boolean",
    "sys_immutable": "boolean",
    "flush": "boolean",
    "usefree": "boolean",
    "dots": "boolean",
    "nodots": "boolean",
    "dotsOK": "value"
  },
  "ncpfs": {
  },
  "nfs": {
    "soft": "boolean",
    "hard": "boolean",
    "timeo": "value",
    "retrans": "value",
    "rsize": "value",
    "wsize": "value",
    "ac": "boolean",
    "noac": "boolean",
    "acregmin": "value",
    "acregmax": "value",
    "acdirmin": "value",
    "acdirmax": "value",
    "actimeo": "value",
    "bg": "boolean",
    "fg": "boolean",
    "retry": "value",
    "sec": "value",
    "sharecache": "boolean",
    "nosharecache": "boolean",
    "resvport": "boolean",
    "noresvport": "boolean",
    "lookupcache": "value",
    "proto": "value",
    "udp": "boolean",
    "tcp": "boolean",
    "rdma": "boolean",
    "port": "value",
    "mountport": "value",
    "mountproto": "value",
    "mounthost": "value",
    "mountvers": "value",
    "namlen": "value",
    "nfsvers": "value",
    "vers": "value",
    "lock": "boolean",
    "nolock": "boolean",
    "intr": "boolean",
    "nointr": "boolean",
    "cto": "boolean",
    "nocto": "boolean",
    "acl": "boolean",
    "noacl": "boolean",
    "rdirplus": "boolean",
    "nordirplus": "boolean",
    "local_lock": "value"
  },
  "nfs4": {
    "soft": "boolean",
    "hard": "boolean",
    "timeo": "value",
    "retrans": "value",
    "rsize": "value",
    "wsize": "value",
    "ac": "boolean",
    "noac": "boolean",
    "acregmin": "value",
    "acregmax": "value",
    "acdirmin": "value",
    "acdirmax": "value",
    "actimeo": "value",
    "bg": "boolean",
    "fg": "boolean",
    "retry": "value",
    "sec": "value",
    "sharecache": "boolean",
    "nosharecache": "boolean",
    "resvport": "boolean",
    "noresvport": "boolean",
    "lookupcache": "value",
    "minorversion": "value",
    "proto": "value",
    "port": "value",
    "intr": "boolean",
    "nointr": "boolean",
    "cto": "boolean",
    "nocto": "boolean",
    "clientaddr": "value"
  },
  "ntfs": {
    "iocharset": "value",
    "nls": "value",
    "utf8": "boolean",
    "uni_xlate": "value",
    "posix": "value",
    "uid": "value",
    "gid": "value",
    "umask": "value"
  },
  "proc": {
    "uid": "value",
    "gid": "value"
  },
  "ramfs": {
  },
  "reiserfs": {
    "conv": "boolean",
    "hash": "value",
    "hashed_relocation": "boolean",
    "no_unhashed_relocation": "boolean",
    "noborder": "boolean",
    "nolog": "boolean",
    "notail": "boolean",
    "replayonly": "boolean",
    "resize": "value",
    "user_xattr": "boolean",
    "acl": "boolean",
    "barrier": "value"
  },
  "romfs": {
  },
  "squashfs": {
  },
  "smbfs": {
    "username": "value",
    "password": "value",
    "credentials": "value",
    "krb": "boolean",
    "uid": "value",
    "gid": "value",
    "port": "value",
    "dmask": "value",
    "fmask": "value",
    "debug": "value",
    "ip": "value",
    "workgroup": "value",
    "sockopt": "value",
    "scope": "value",
    "guest": "boolean",
    "ro": "boolean",
    "rw": "boolean",
    "iocharset": "value",
    "codepage": "value",
    "ttl": "value"
  },
  "sysv": {
  },
  "tmpfs": {
    "size": "value",
    "nr_blocks": "value",
    "nr_inodes": "value",
    "mode": "value",
    "uid": "value",
    "gid": "value",
    "mpol": "value"
  },
  "ubifs": {
    "bulk_read": "boolean",
    "no_bulk_read": "boolean",
    "chk_data_crc": "boolean",
    "no_chk_data_crc": "boolean",
    "compr": "value"
  },
  "udf": {
    "uid": "value",
    "gid": "value",
    "umask": "value",
    "unhide": "boolean",
    "undelete": "boolean",
    "nostrict": "boolean",
    "iocharset": "boolean",
    "bs": "value",
    "novrs": "boolean",
    "session": "value",
    "anchor": "value",
    "volume": "value",
    "partition": "value",
    "lastblock": "value",
    "fileset": "value",
    "rootdir": "value"
  },
  "ufs": {
    "ufstype": "value",
    "onerror": "value"
  },
  "umsdos": {
    "blocksize": "value",
    "uid": "value",
    "gid": "value",
    "umask": "value",
    "dmask": "value",
    "fmask": "value",
    "allow_utime": "value",
    "check": "value",
    "codepage": "value",
    "conv": "value",
    "cvf_format": "value",
    "cvf_option": "value",
    "debug": "boolean",
    "fat": "value",
    "iocharset": "value",
    "tz": "value",
    "quiet": "boolean",
    "showexec": "boolean",
    "sys_immutable": "boolean",
    "flush": "boolean",
    "usefree": "boolean",
    "dots": "boolean",
    "nodots": "boolean"
  },
  "vfat": {
    "blocksize": "value",
    "uid": "value",
    "gid": "value",
    "umask": "value",
    "dmask": "value",
    "fmask": "value",
    "allow_utime": "value",
    "check": "value",
    "codepage": "value",
    "conv": "value",
    "cvf_format": "value",
    "cvf_option": "value",
    "debug": "boolean",
    "fat": "value",
    "iocharset": "value",
    "tz": "value",
    "quiet": "boolean",
    "showexec": "boolean",
    "sys_immutable": "boolean",
    "flush": "boolean",
    "usefree": "boolean",
    "dots": "boolean",
    "nodots": "boolean",
    "uni_xlate": "boolean",
    "posix": "boolean",
    "nonumtail": "boolean",
    "utf8": "boolean",
    "shortname": "value"
  },
  "usbfs": {
    "devuid": "value",
    "devgid": "value",
    "devmode": "value",
    "busuid": "value",
    "busgid": "value",
    "busmode": "value",
    "listuid": "value",
    "listgid": "value",
    "listmode": "value"
  },
  "xenix": {
  },
  "xfs": {
    "allocsize": "value",
    "attr2": "boolean",
    "noattr2": "boolean",
    "barrier": "boolean",
    "dmapi": "boolean",
    "grpid": "boolean",
    "bsdgroups": "boolean",
    "nogrpid": "boolean",
    "sysvgroups": "boolean",
    "ihashsize": "value",
    "ikeep": "boolean",
    "noikeep": "boolean",
    "inode64": "boolean",
    "largeio": "boolean",
    "nolargeio": "boolean",
    "logbufs": "value",
    "logbsize": "value",
    "logdev": "value",
    "rtdev": "value",
    "mtpt": "value",
    "noalign": "boolean",
    "noatime": "boolean",
    "norecovery": "boolean",
    "nouuid": "boolean",
    "osyncisosync": "boolean",
    "uquota": "boolean",
    "usrquota": "boolean",
    "uqnoenforce": "boolean",
    "quota": "boolean",
    "gquota": "boolean",
    "grpquota": "boolean",
    "gqnoenforce": "boolean",
    "pquota": "boolean",
    "prjquota": "boolean",
    "pqnoenforce": "boolean",
    "sunit": "value",
    "swidth": "value",
    "swalloc": "boolean"
  },
  "loop": {
    "loop": "value",
    "offset": "value",
    "sizelimit": "value",
    "encryption": "value"
  }
}