我想确定/
分区具有哪种文件系统类型。
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 等(
哈希访问应该是什么样子的?
要访问哈希中的值,请使用 $hash_name['key name']
,因此请使用 $facts
,依次访问mountpoints
键、/
键和filesystem
键:
$root_filesystem = $facts['mountpoints']['/']['filesystem']
详细信息:木偶语言:哈希:访问值。