【问题标题】:lxc-clone: unrecognized option '--dir'lxc-clone:无法识别的选项“--dir”
【发布时间】:2014-12-13 12:59:09
【问题描述】:

我尝试在克隆时更改 rootfs 目录:

lxc-clone -o foo -n bar --dir /lxc/bar

但我收到了这个错误:

lxc-clone: unrecognized option '--dir'

然后我尝试使用“-B”选项和“lvm”值在 LV 中设置 rootfs:

lxc-clone -o foo -n bar -B lvm --vgname lxc-vg

我得到这个错误:

Error: vgname not supported
Usage: lxc-clone [-s] [-B backingstore] [-L size[unit]] [-K] [-M] [-H]
          [-p lxcpath] [-P newlxcpath] orig new

  -s: snapshot rather than copy
  -B: use specified new backingstore.  Default is the same as
      the original.  Options include aufs, btrfs, lvm, overlayfs, 
      dir and loop
  -L: for blockdev-backed backingstore, use specified size * specified
      unit. Default size is the size of the source blockdev, default
      unit is MB
  -K: Keep name - do not change the container name
  -M: Keep macaddr - do not choose a random new mac address
  -p: use container orig from custom lxcpath
  -P: create container new in custom lxcpath

为什么我不能将“--vgname”或“--dir”与“lxc-clone”一起使用?
我究竟做错了什么? 克隆容器时是否可以更改 rootfs 目录?

PS:我使用的是 Ubuntu 14.04 和 lxc 1.0.5

【问题讨论】:

    标签: ubuntu lxc


    【解决方案1】:

    很久以前,我认为这是“启动板”中报告的错误。他们现在回答我,我发现我犯了一个大错误。

    这里是来自启动板的答案:

    嗨,

    "dir" 只是 -b/--backingstore 的一个选项,而不是选项本身。

    所以它必须是:

    sudo lxc-clone -o u1 -n u1-clone2 -B dir
    

    或:

    sudo lxc-clone -o u1 -n u1-clone4 --backingstore dir
    

    这里是页面的链接:

    https://bugs.launchpad.net/lxc/+bug/1383245

    希望有用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-08-21
      • 2020-07-02
      • 2018-02-06
      • 2021-11-08
      • 2017-02-14
      • 2022-06-17
      • 2022-10-12
      相关资源
      最近更新 更多