我想确定/
分区的文件系统类型。
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等)
哈希访问应该是什么样的?
答案 0 :(得分:2)
要访问哈希值,请使用$hash_name['key name']
,因此请使用$facts
,访问mountpoints
密钥,然后访问/
密钥,再访问filesystem
按键顺序:
$root_filesystem = $facts['mountpoints']['/']['filesystem']