1

我想确定/分区具有哪种文件系统类型。

facter mountpoints显示:

/home => {
  available => "1.81 GiB",
  available_bytes => 1946107904,
  capacity => "2.01%",
  device => "/dev/sda/home",
  filesystem => "xfs",
  options => [
    "rw",
    "relatime",
    "attr2",
    "inode64",
    "noquota"
  ],
  size => "1.85 GiB",
  size_bytes => 1986002944,
  used => "38.05 MiB",
  used_bytes => 39895040
},

我只想要文件系统类型(如 xfs、ext2 等)

哈希访问应该是什么样的?

4

1 回答 1

2

要访问散列中的值,请使用$hash_name['key name'],因此请使用$facts,依次访问mountpoints键、/键、filesystem键:

$root_filesystem = $facts['mountpoints']['/']['filesystem']

更多信息:木偶语言:哈希:访问值

于 2017-05-24T09:01:53.423 回答