Linux 使用Chef在特定路径中重新安装驱动器

Linux 使用Chef在特定路径中重新安装驱动器,linux,amazon-web-services,chef-infra,Linux,Amazon Web Services,Chef Infra,我正在尝试将驱动器从中的路径重新装入另一个路径。我正试着和厨师Opscode一起做这件事。此驱动器是m1.medium类型if实例附带的驱动器 运行chef客户端时,我收到此错误stacktrace: Chef::Log.info("About to re-mount dev/xvdb in /testpath ") # Mount additional volumes for data, configure them via LVM mount "/testpath" do dev

我正在尝试将驱动器从中的路径重新装入另一个路径。我正试着和厨师Opscode一起做这件事。此驱动器是m1.medium类型if实例附带的驱动器

运行chef客户端时,我收到此错误stacktrace:

  Chef::Log.info("About to re-mount dev/xvdb in /testpath ")
  # Mount additional volumes for data, configure them via LVM
mount "/testpath" do
  device  "/dev/xvdb"
  # I am using Chef 10 and following the documentation on the mount resource
  action  [ :remount, :enable ]  
end
我看到以下日志:

[2013-11-06T01:46:08+00:00] ERROR: Running exception handlers
[2013-11-06T01:46:09+00:00] FATAL: Saving node information to /var/chef/cache/failed-run-data.json
[2013-11-06T01:46:09+00:00] ERROR: Exception handlers complete
[2013-11-06T01:46:09+00:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
[2013-11-06T01:46:09+00:00] FATAL: Chef::Exceptions::UnsupportedAction: mount[/testpath] (my_cookbook::_my_recipe line 42) had an error: Chef::Exceptions::UnsupportedAction: #<Chef::Provider::Mount::Mount:0x000000046ad980> does not support :remount
[2013-11-06T01:46:08+00:00]错误:正在运行异常处理程序
[2013-11-06T01:46:09+00:00]致命:将节点信息保存到/var/chef/cache/failed-run-data.json
[2013-11-06T01:46:09+00:00]错误:异常处理程序已完成
[2013-11-06T01:46:09+00:00]致命:Stacktrace转储到/var/chef/cache/chef-Stacktrace.out
[2013-11-06T01:46:09+00:00]致命错误:厨师::异常::取消支持操作:装载[/testpath](我的食谱::_我的食谱行42)出现错误:厨师::异常::取消支持操作:#不支持:重新装载

因此:remount命令对我不起作用,但我尝试了:mount,结果成功了

另外,我必须确保名为“/testpath”的目录首先存在

所以现在我有了smth

Chef::Log.info("About to re-mount dev/xvdb in /testpath ")
  # Mount additional volumes for data, configure them via LVM
directory "/testpath" do
  owner "root"
  group "root"
  mode 00755
  action :create
end

mount "/testpath" do
  device  "/dev/xvdb"
  # I am using Chef 10 and following the documentation on the mount resource
map_point "/testpath"
  action  [ :remount, :enable ]  
end

因此,:remount命令对我不起作用,但我尝试了:mount,结果成功了

另外,我必须确保名为“/testpath”的目录首先存在

所以现在我有了smth

Chef::Log.info("About to re-mount dev/xvdb in /testpath ")
  # Mount additional volumes for data, configure them via LVM
directory "/testpath" do
  owner "root"
  group "root"
  mode 00755
  action :create
end

mount "/testpath" do
  device  "/dev/xvdb"
  # I am using Chef 10 and following the documentation on the mount resource
map_point "/testpath"
  action  [ :remount, :enable ]  
end

日志消息的相关部分

Chef::Exceptions::UnsupportedAction: #<Chef::Provider::Mount::Mount:0x000000046ad980> does not support :remount
Chef::Exceptions::UnsupportedAction:#不支持:重新装载

您的设备不支持重新安装操作。

日志消息的相关部分

Chef::Exceptions::UnsupportedAction: #<Chef::Provider::Mount::Mount:0x000000046ad980> does not support :remount
Chef::Exceptions::UnsupportedAction:#不支持:重新装载

您的设备不支持重新安装操作。

true。这是因为它希望先创建一条路径。。。请参阅下面我使用的目录资源。true。这是因为它希望先创建一条路径。。。请参阅下面我使用的目录资源。